From d6670aaaf09ea0933d559926683c3da16b14f76d Mon Sep 17 00:00:00 2001 From: Kasdejong Date: Wed, 11 Dec 2024 11:34:08 +0100 Subject: [PATCH 1/8] first draft (not very good) --- .../Hl7.Fhir.R4.Tests.csproj | 1 + src/Hl7.Fhir.R4/Hl7.Fhir.R4.csproj | 1 + src/Hl7.Fhir.R4/Model/Generated/Patient.cs | 2139 +++++++++-------- 3 files changed, 1165 insertions(+), 976 deletions(-) diff --git a/src/Hl7.Fhir.R4.Tests/Hl7.Fhir.R4.Tests.csproj b/src/Hl7.Fhir.R4.Tests/Hl7.Fhir.R4.Tests.csproj index 67680013c8..0a58d76b0c 100644 --- a/src/Hl7.Fhir.R4.Tests/Hl7.Fhir.R4.Tests.csproj +++ b/src/Hl7.Fhir.R4.Tests/Hl7.Fhir.R4.Tests.csproj @@ -6,6 +6,7 @@ Hl7.Fhir.R4.Tests + true diff --git a/src/Hl7.Fhir.R4/Hl7.Fhir.R4.csproj b/src/Hl7.Fhir.R4/Hl7.Fhir.R4.csproj index 75f2de645c..2a4c479b0d 100644 --- a/src/Hl7.Fhir.R4/Hl7.Fhir.R4.csproj +++ b/src/Hl7.Fhir.R4/Hl7.Fhir.R4.csproj @@ -11,6 +11,7 @@ Firely's SDK for working with HL7 FHIR R4 (4.0.1) Firely's SDK for working with HL7 FHIR R4. This is the root package for the SDK includes core functionality to working with RESTful FHIR servers, POCO classes for FHIR, parsing/serialization of FHIR data and working with conformance data and terminologies. HL7;FHIR;Firely;SDK;POCO;Fhir client;Terminology;StructureDefinition;parsing;serialization;FHIR server + true diff --git a/src/Hl7.Fhir.R4/Model/Generated/Patient.cs b/src/Hl7.Fhir.R4/Model/Generated/Patient.cs index 157adf75e7..317ca9ec0f 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Patient.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Patient.cs @@ -10,6 +10,7 @@ using Hl7.Fhir.Specification; using Hl7.Fhir.Utility; using Hl7.Fhir.Validation; +using System.Runtime.CompilerServices; using SystemPrimitive = Hl7.Fhir.ElementModel.Types; /* @@ -43,1066 +44,1252 @@ POSSIBILITY OF SUCH DAMAGE. namespace Hl7.Fhir.Model { - /// - /// Information about an individual or animal receiving health care services - /// - /// - /// Demographics and other administrative information about an individual or animal receiving care or other health-related services. - /// - [Serializable] - [DataContract] - [FhirType("Patient","http://hl7.org/fhir/StructureDefinition/Patient")] - public partial class Patient : Hl7.Fhir.Model.DomainResource, Hl7.Fhir.Model.IPatient, IIdentifiable> - { /// - /// FHIR Type Name - /// - public override string TypeName { get { return "Patient"; } } - - /// - /// The type of link between this patient resource and another patient resource. - /// (url: http://hl7.org/fhir/ValueSet/link-type) - /// (system: http://hl7.org/fhir/link-type) - /// - [FhirEnumeration("LinkType", "http://hl7.org/fhir/ValueSet/link-type", "http://hl7.org/fhir/link-type")] - public enum LinkType - { - /// - /// The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains this link. - /// (system: http://hl7.org/fhir/link-type) - /// - [EnumLiteral("replaced-by"), Description("Replaced-by")] - ReplacedBy, - /// - /// The patient resource containing this link is the current active patient record. The link points back to an inactive patient resource that has been merged into this resource, and should be consulted to retrieve additional referenced information. - /// (system: http://hl7.org/fhir/link-type) - /// - [EnumLiteral("replaces"), Description("Replaces")] - Replaces, - /// - /// The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information. - /// (system: http://hl7.org/fhir/link-type) - /// - [EnumLiteral("refer"), Description("Refer")] - Refer, - /// - /// The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid. - /// (system: http://hl7.org/fhir/link-type) - /// - [EnumLiteral("seealso"), Description("See also")] - Seealso, - } - - /// - /// A contact party (e.g. guardian, partner, friend) for the patient + /// Information about an individual or animal receiving health care services /// /// - /// Contact covers all kinds of contact parties: family members, business contacts, guardians, caregivers. Not applicable to register pedigree and family ties beyond use of having contact. + /// Demographics and other administrative information about an individual or animal receiving care or other health-related services. /// [Serializable] [DataContract] - [FhirType("Patient.contact", IsBackboneType=true)] - public partial class ContactComponent : Hl7.Fhir.Model.BackboneElement + [FhirType("Patient", "http://hl7.org/fhir/StructureDefinition/Patient")] + public partial class Patient : Hl7.Fhir.Model.DomainResource, Hl7.Fhir.Model.IPatient, IIdentifiable> { - /// - /// FHIR Type Name - /// - public override string TypeName { get { return "Patient.contact"; } } - - /// - /// The kind of relationship. - /// - [FhirElement("relationship", Order=40)] - [Binding("ContactRelationship")] - [Cardinality(Min=0,Max=-1)] - [DataMember] - public List Relationship - { - get { if(_Relationship==null) _Relationship = new List(); return _Relationship; } - set { _Relationship = value; OnPropertyChanged("Relationship"); } - } - - private List _Relationship; - - /// - /// A name associated with the contact person. - /// - [FhirElement("name", Order=50)] - [DataMember] - public Hl7.Fhir.Model.HumanName Name - { - get { return _Name; } - set { _Name = value; OnPropertyChanged("Name"); } - } - - private Hl7.Fhir.Model.HumanName _Name; - - /// - /// A contact detail for the person. - /// - [FhirElement("telecom", Order=60)] - [Cardinality(Min=0,Max=-1)] - [DataMember] - public List Telecom - { - get { if(_Telecom==null) _Telecom = new List(); return _Telecom; } - set { _Telecom = value; OnPropertyChanged("Telecom"); } - } - - private List _Telecom; - - /// - /// Address for the contact person. - /// - [FhirElement("address", Order=70)] - [DataMember] - public Hl7.Fhir.Model.Address Address - { - get { return _Address; } - set { _Address = value; OnPropertyChanged("Address"); } - } - - private Hl7.Fhir.Model.Address _Address; - - /// - /// male | female | other | unknown. - /// - [FhirElement("gender", Order=80)] - [DeclaredType(Type = typeof(Code))] - [Binding("AdministrativeGender")] - [DataMember] - public Code GenderElement - { - get { return _GenderElement; } - set { _GenderElement = value; OnPropertyChanged("GenderElement"); } - } - - private Code _GenderElement; - - /// - /// male | female | other | unknown - /// - /// This uses the native .NET datatype, rather than the FHIR equivalent - [IgnoreDataMember] - public Hl7.Fhir.Model.AdministrativeGender? Gender - { - get { return GenderElement != null ? GenderElement.Value : null; } - set - { - if (value == null) - GenderElement = null; - else - GenderElement = new Code(value); - OnPropertyChanged("Gender"); - } - } - - /// - /// Organization that is associated with the contact. - /// - [FhirElement("organization", Order=90)] - [CLSCompliant(false)] - [References("Organization")] - [DataMember] - public Hl7.Fhir.Model.ResourceReference Organization - { - get { return _Organization; } - set { _Organization = value; OnPropertyChanged("Organization"); } - } - - private Hl7.Fhir.Model.ResourceReference _Organization; - - /// - /// The period during which this contact person or organization is valid to be contacted relating to this patient. - /// - [FhirElement("period", Order=100)] - [DataMember] - public Hl7.Fhir.Model.Period Period - { - get { return _Period; } - set { _Period = value; OnPropertyChanged("Period"); } - } - - private Hl7.Fhir.Model.Period _Period; - - public override IDeepCopyable CopyTo(IDeepCopyable other) - { - var dest = other as ContactComponent; - - if (dest == null) + /// + /// FHIR Type Name + /// + public override string TypeName { get { return "Patient"; } } + + /// + /// The type of link between this patient resource and another patient resource. + /// (url: http://hl7.org/fhir/ValueSet/link-type) + /// (system: http://hl7.org/fhir/link-type) + /// + [FhirEnumeration("LinkType", "http://hl7.org/fhir/ValueSet/link-type", "http://hl7.org/fhir/link-type")] + public enum LinkType { - throw new ArgumentException("Can only copy to an object of the same type", "other"); + /// + /// The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains this link. + /// (system: http://hl7.org/fhir/link-type) + /// + [EnumLiteral("replaced-by"), Description("Replaced-by")] + ReplacedBy, + + /// + /// The patient resource containing this link is the current active patient record. The link points back to an inactive patient resource that has been merged into this resource, and should be consulted to retrieve additional referenced information. + /// (system: http://hl7.org/fhir/link-type) + /// + [EnumLiteral("replaces"), Description("Replaces")] + Replaces, + + /// + /// The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information. + /// (system: http://hl7.org/fhir/link-type) + /// + [EnumLiteral("refer"), Description("Refer")] + Refer, + + /// + /// The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid. + /// (system: http://hl7.org/fhir/link-type) + /// + [EnumLiteral("seealso"), Description("See also")] + Seealso, } - base.CopyTo(dest); - if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopy()); - if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ContactComponent()); - } - - public override bool CompareChildren(Base other, IEqualityComparer comparer) - { - var otherT = other as ContactComponent; - if(otherT == null) return false; - - if(!base.CompareChildren(otherT, comparer)) return false; - if(!comparer.ListEquals(Relationship, otherT.Relationship)) return false; - if(!comparer.Equals(Name, otherT.Name)) return false; - if(!comparer.ListEquals(Telecom, otherT.Telecom)) return false; - if(!comparer.Equals(Address, otherT.Address)) return false; - if(!comparer.Equals(GenderElement, otherT.GenderElement)) return false; - if(!comparer.Equals(Organization, otherT.Organization)) return false; - if(!comparer.Equals(Period, otherT.Period)) return false; - - return true; - } - - public override bool TryGetValue(string key, out object value) - { - switch (key) + /// + /// A contact party (e.g. guardian, partner, friend) for the patient + /// + /// + /// Contact covers all kinds of contact parties: family members, business contacts, guardians, caregivers. Not applicable to register pedigree and family ties beyond use of having contact. + /// + [Serializable] + [DataContract] + [FhirType("Patient.contact", IsBackboneType = true)] + public partial class ContactComponent : Hl7.Fhir.Model.BackboneElement { - case "relationship": - value = Relationship; - return Relationship?.Any() == true; - case "name": - value = Name; - return Name is not null; - case "telecom": - value = Telecom; - return Telecom?.Any() == true; - case "address": - value = Address; - return Address is not null; - case "gender": - value = GenderElement; - return GenderElement is not null; - case "organization": - value = Organization; - return Organization is not null; - case "period": - value = Period; - return Period is not null; - default: - return base.TryGetValue(key, out value); - } + /// + /// FHIR Type Name + /// + public override string TypeName { get { return "Patient.contact"; } } + + /// + /// The kind of relationship. + /// + [FhirElement("relationship", Order = 40)] + [Binding("ContactRelationship")] + [Cardinality(Min = 0, Max = -1)] + [DataMember] + public List Relationship + { + get + { + if (_Relationship == null) _Relationship = new List(); + return _Relationship; + } + set + { + _Relationship = value; + OnPropertyChanged("Relationship"); + } + } + + private List _Relationship; + + /// + /// A name associated with the contact person. + /// + [FhirElement("name", Order = 50)] + [DataMember] + public Hl7.Fhir.Model.HumanName Name + { + get { return _Name; } + set + { + _Name = value; + OnPropertyChanged("Name"); + } + } + + private Hl7.Fhir.Model.HumanName _Name; + + /// + /// A contact detail for the person. + /// + [FhirElement("telecom", Order = 60)] + [Cardinality(Min = 0, Max = -1)] + [DataMember] + public List Telecom + { + get + { + if (_Telecom == null) _Telecom = new List(); + return _Telecom; + } + set + { + _Telecom = value; + OnPropertyChanged("Telecom"); + } + } + + private List _Telecom; + + /// + /// Address for the contact person. + /// + [FhirElement("address", Order = 70)] + [DataMember] + public Hl7.Fhir.Model.Address Address + { + get { return _Address; } + set + { + _Address = value; + OnPropertyChanged("Address"); + } + } + + private Hl7.Fhir.Model.Address _Address; + + /// + /// male | female | other | unknown. + /// + [FhirElement("gender", Order = 80)] + [DeclaredType(Type = typeof(Code))] + [Binding("AdministrativeGender")] + [DataMember] + public Code GenderElement + { + get { return _GenderElement; } + set + { + _GenderElement = value; + OnPropertyChanged("GenderElement"); + } + } + + private Code _GenderElement; + + /// + /// male | female | other | unknown + /// + /// This uses the native .NET datatype, rather than the FHIR equivalent + [IgnoreDataMember] + public Hl7.Fhir.Model.AdministrativeGender? Gender + { + get { return GenderElement != null ? GenderElement.Value : null; } + set + { + if (value == null) + GenderElement = null; + else + GenderElement = new Code(value); + OnPropertyChanged("Gender"); + } + } + + /// + /// Organization that is associated with the contact. + /// + [FhirElement("organization", Order = 90)] + [CLSCompliant(false)] + [References("Organization")] + [DataMember] + public Hl7.Fhir.Model.ResourceReference Organization + { + get { return _Organization; } + set + { + _Organization = value; + OnPropertyChanged("Organization"); + } + } + + private Hl7.Fhir.Model.ResourceReference _Organization; + + /// + /// The period during which this contact person or organization is valid to be contacted relating to this patient. + /// + [FhirElement("period", Order = 100)] + [DataMember] + public Hl7.Fhir.Model.Period Period + { + get { return _Period; } + set + { + _Period = value; + OnPropertyChanged("Period"); + } + } + + private Hl7.Fhir.Model.Period _Period; + + public override IDeepCopyable CopyTo(IDeepCopyable other) + { + var dest = other as ContactComponent; + + if (dest == null) + { + throw new ArgumentException("Can only copy to an object of the same type", "other"); + } + + base.CopyTo(dest); + if (Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopy()); + if (Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy(); + if (Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); + if (Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); + if (GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); + if (Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); + if (Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); + return dest; + } + + public override IDeepCopyable DeepCopy() + { + return CopyTo(new ContactComponent()); + } + + public override bool CompareChildren(Base other, IEqualityComparer comparer) + { + var otherT = other as ContactComponent; + if (otherT == null) return false; + + if (!base.CompareChildren(otherT, comparer)) return false; + if (!comparer.ListEquals(Relationship, otherT.Relationship)) return false; + if (!comparer.Equals(Name, otherT.Name)) return false; + if (!comparer.ListEquals(Telecom, otherT.Telecom)) return false; + if (!comparer.Equals(Address, otherT.Address)) return false; + if (!comparer.Equals(GenderElement, otherT.GenderElement)) return false; + if (!comparer.Equals(Organization, otherT.Organization)) return false; + if (!comparer.Equals(Period, otherT.Period)) return false; + + return true; + } + + public override bool TryGetValue(string key, out object value) + { + switch (key) + { + case "relationship": + value = Relationship; + return Relationship?.Any() == true; + case "name": + value = Name; + return Name is not null; + case "telecom": + value = Telecom; + return Telecom?.Any() == true; + case "address": + value = Address; + return Address is not null; + case "gender": + value = GenderElement; + return GenderElement is not null; + case "organization": + value = Organization; + return Organization is not null; + case "period": + value = Period; + return Period is not null; + default: + return base.TryGetValue(key, out value); + } + + } + + public override Base SetValue(string key, object value) + { + switch (key) + { + case "relationship": + Relationship = (List)value; + return this; + case "name": + Name = (Hl7.Fhir.Model.HumanName)value; + return this; + case "telecom": + Telecom = (List)value; + return this; + case "address": + Address = (Hl7.Fhir.Model.Address)value; + return this; + case "gender": + GenderElement = (Code)value; + return this; + case "organization": + Organization = (Hl7.Fhir.Model.ResourceReference)value; + return this; + case "period": + Period = (Hl7.Fhir.Model.Period)value; + return this; + default: + return base.SetValue(key, value); + } + + } + + public override IEnumerable> EnumerateElements() + { + foreach (var kvp in base.EnumerateElements()) yield return kvp; + if (Relationship?.Any() == true) yield return new KeyValuePair("relationship", Relationship); + if (Name is not null) yield return new KeyValuePair("name", Name); + if (Telecom?.Any() == true) yield return new KeyValuePair("telecom", Telecom); + if (Address is not null) yield return new KeyValuePair("address", Address); + if (GenderElement is not null) yield return new KeyValuePair("gender", GenderElement); + if (Organization is not null) yield return new KeyValuePair("organization", Organization); + if (Period is not null) yield return new KeyValuePair("period", Period); + } - } + } - public override Base SetValue(string key, object value) - { - switch (key) + /// + /// A language which may be used to communicate with the patient about his or her health + /// + /// + /// If no language is specified, this *implies* that the default local language is spoken. If you need to convey proficiency for multiple modes, then you need multiple Patient.Communication associations. For animals, language is not a relevant field, and should be absent from the instance. If the Patient does not speak the default local language, then the Interpreter Required Standard can be used to explicitly declare that an interpreter is required. + /// + [Serializable] + [DataContract] + [FhirType("Patient.communication", IsBackboneType = true)] + public partial class CommunicationComponent : Hl7.Fhir.Model.BackboneElement { - case "relationship": - Relationship = (List)value; - return this; - case "name": - Name = (Hl7.Fhir.Model.HumanName)value; - return this; - case "telecom": - Telecom = (List)value; - return this; - case "address": - Address = (Hl7.Fhir.Model.Address)value; - return this; - case "gender": - GenderElement = (Code)value; - return this; - case "organization": - Organization = (Hl7.Fhir.Model.ResourceReference)value; - return this; - case "period": - Period = (Hl7.Fhir.Model.Period)value; - return this; - default: - return base.SetValue(key, value); - } + /// + /// FHIR Type Name + /// + public override string TypeName { get { return "Patient.communication"; } } + + /// + /// The language which can be used to communicate with the patient about his or her health. + /// + [FhirElement("language", Order = 40)] + [Binding("Language")] + [Cardinality(Min = 1, Max = 1)] + [DataMember] + public Hl7.Fhir.Model.CodeableConcept Language + { + get { return _Language; } + set + { + _Language = value; + OnPropertyChanged("Language"); + } + } + + private Hl7.Fhir.Model.CodeableConcept _Language; + + /// + /// Language preference indicator. + /// + [FhirElement("preferred", Order = 50)] + [DataMember] + public Hl7.Fhir.Model.FhirBoolean PreferredElement + { + get { return _PreferredElement; } + set + { + _PreferredElement = value; + OnPropertyChanged("PreferredElement"); + } + } + + private Hl7.Fhir.Model.FhirBoolean _PreferredElement; + + /// + /// Language preference indicator + /// + /// This uses the native .NET datatype, rather than the FHIR equivalent + [IgnoreDataMember] + public bool? Preferred + { + get { return PreferredElement != null ? PreferredElement.Value : null; } + set + { + if (value == null) + PreferredElement = null; + else + PreferredElement = new Hl7.Fhir.Model.FhirBoolean(value); + OnPropertyChanged("Preferred"); + } + } + + public override IDeepCopyable CopyTo(IDeepCopyable other) + { + var dest = other as CommunicationComponent; + + if (dest == null) + { + throw new ArgumentException("Can only copy to an object of the same type", "other"); + } + + base.CopyTo(dest); + if (Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); + if (PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); + return dest; + } + + public override IDeepCopyable DeepCopy() + { + return CopyTo(new CommunicationComponent()); + } + + public override bool CompareChildren(Base other, IEqualityComparer comparer) + { + var otherT = other as CommunicationComponent; + if (otherT == null) return false; + + if (!base.CompareChildren(otherT, comparer)) return false; + if (!comparer.Equals(Language, otherT.Language)) return false; + if (!comparer.Equals(PreferredElement, otherT.PreferredElement)) return false; + + return true; + } + + public override bool TryGetValue(string key, out object value) + { + switch (key) + { + case "language": + value = Language; + return Language is not null; + case "preferred": + value = PreferredElement; + return PreferredElement is not null; + default: + return base.TryGetValue(key, out value); + } + + } + + public override Base SetValue(string key, object value) + { + switch (key) + { + case "language": + Language = (Hl7.Fhir.Model.CodeableConcept)value; + return this; + case "preferred": + PreferredElement = (Hl7.Fhir.Model.FhirBoolean)value; + return this; + default: + return base.SetValue(key, value); + } + + } + + public override IEnumerable> EnumerateElements() + { + foreach (var kvp in base.EnumerateElements()) yield return kvp; + if (Language is not null) yield return new KeyValuePair("language", Language); + if (PreferredElement is not null) yield return new KeyValuePair("preferred", PreferredElement); + } - } + } - public override IEnumerable> EnumerateElements() - { - foreach (var kvp in base.EnumerateElements()) yield return kvp; - if (Relationship?.Any() == true) yield return new KeyValuePair("relationship",Relationship); - if (Name is not null) yield return new KeyValuePair("name",Name); - if (Telecom?.Any() == true) yield return new KeyValuePair("telecom",Telecom); - if (Address is not null) yield return new KeyValuePair("address",Address); - if (GenderElement is not null) yield return new KeyValuePair("gender",GenderElement); - if (Organization is not null) yield return new KeyValuePair("organization",Organization); - if (Period is not null) yield return new KeyValuePair("period",Period); - } + /// + /// Link to another patient resource that concerns the same actual person + /// + /// + /// Link to another patient resource that concerns the same actual patient. + /// There is no assumption that linked patient records have mutual links. + /// + [Serializable] + [DataContract] + [FhirType("Patient.link", IsBackboneType = true)] + public partial class LinkComponent : Hl7.Fhir.Model.BackboneElement + { + /// + /// FHIR Type Name + /// + public override string TypeName { get { return "Patient.link"; } } + + /// + /// The other patient or related person resource that the link refers to. + /// + [FhirElement("other", InSummary = true, Order = 40)] + [CLSCompliant(false)] + [References("Patient", "RelatedPerson")] + [Cardinality(Min = 1, Max = 1)] + [DataMember] + public Hl7.Fhir.Model.ResourceReference Other + { + get { return _Other; } + set + { + _Other = value; + OnPropertyChanged("Other"); + } + } + + private Hl7.Fhir.Model.ResourceReference _Other; + + /// + /// replaced-by | replaces | refer | seealso. + /// + [FhirElement("type", InSummary = true, Order = 50)] + [DeclaredType(Type = typeof(Code))] + [Binding("LinkType")] + [Cardinality(Min = 1, Max = 1)] + [DataMember] + public Code TypeElement + { + get { return _TypeElement; } + set + { + _TypeElement = value; + OnPropertyChanged("TypeElement"); + } + } + + private Code _TypeElement; + + /// + /// replaced-by | replaces | refer | seealso + /// + /// This uses the native .NET datatype, rather than the FHIR equivalent + [IgnoreDataMember] + public Hl7.Fhir.Model.Patient.LinkType? Type + { + get { return TypeElement != null ? TypeElement.Value : null; } + set + { + if (value == null) + TypeElement = null; + else + TypeElement = new Code(value); + OnPropertyChanged("Type"); + } + } + + public override IDeepCopyable CopyTo(IDeepCopyable other) + { + var dest = other as LinkComponent; + + if (dest == null) + { + throw new ArgumentException("Can only copy to an object of the same type", "other"); + } + + base.CopyTo(dest); + if (Other != null) dest.Other = (Hl7.Fhir.Model.ResourceReference)Other.DeepCopy(); + if (TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); + return dest; + } + + public override IDeepCopyable DeepCopy() + { + return CopyTo(new LinkComponent()); + } + + public override bool CompareChildren(Base other, IEqualityComparer comparer) + { + var otherT = other as LinkComponent; + if (otherT == null) return false; + + if (!base.CompareChildren(otherT, comparer)) return false; + if (!comparer.Equals(Other, otherT.Other)) return false; + if (!comparer.Equals(TypeElement, otherT.TypeElement)) return false; + + return true; + } + + public override bool TryGetValue(string key, out object value) + { + switch (key) + { + case "other": + value = Other; + return Other is not null; + case "type": + value = TypeElement; + return TypeElement is not null; + default: + return base.TryGetValue(key, out value); + } + + } + + public override Base SetValue(string key, object value) + { + switch (key) + { + case "other": + Other = (Hl7.Fhir.Model.ResourceReference)value; + return this; + case "type": + TypeElement = (Code)value; + return this; + default: + return base.SetValue(key, value); + } + + } + + public override IEnumerable> EnumerateElements() + { + foreach (var kvp in base.EnumerateElements()) yield return kvp; + if (Other is not null) yield return new KeyValuePair("other", Other); + if (TypeElement is not null) yield return new KeyValuePair("type", TypeElement); + } - } + } - /// - /// A language which may be used to communicate with the patient about his or her health - /// - /// - /// If no language is specified, this *implies* that the default local language is spoken. If you need to convey proficiency for multiple modes, then you need multiple Patient.Communication associations. For animals, language is not a relevant field, and should be absent from the instance. If the Patient does not speak the default local language, then the Interpreter Required Standard can be used to explicitly declare that an interpreter is required. - /// - [Serializable] - [DataContract] - [FhirType("Patient.communication", IsBackboneType=true)] - public partial class CommunicationComponent : Hl7.Fhir.Model.BackboneElement - { - /// - /// FHIR Type Name - /// - public override string TypeName { get { return "Patient.communication"; } } - - /// - /// The language which can be used to communicate with the patient about his or her health. - /// - [FhirElement("language", Order=40)] - [Binding("Language")] - [Cardinality(Min=1,Max=1)] - [DataMember] - public Hl7.Fhir.Model.CodeableConcept Language - { - get { return _Language; } - set { _Language = value; OnPropertyChanged("Language"); } - } - - private Hl7.Fhir.Model.CodeableConcept _Language; - - /// - /// Language preference indicator. - /// - [FhirElement("preferred", Order=50)] - [DataMember] - public Hl7.Fhir.Model.FhirBoolean PreferredElement - { - get { return _PreferredElement; } - set { _PreferredElement = value; OnPropertyChanged("PreferredElement"); } - } - - private Hl7.Fhir.Model.FhirBoolean _PreferredElement; - - /// - /// Language preference indicator - /// - /// This uses the native .NET datatype, rather than the FHIR equivalent - [IgnoreDataMember] - public bool? Preferred - { - get { return PreferredElement != null ? PreferredElement.Value : null; } - set + /// + /// An identifier for this patient. + /// + [FhirElement("identifier", InSummary = true, Order = 90, FiveWs = "FiveWs.identifier")] + [Cardinality(Min = 0, Max = -1)] + [DataMember] + public List Identifier { - if (value == null) - PreferredElement = null; - else - PreferredElement = new Hl7.Fhir.Model.FhirBoolean(value); - OnPropertyChanged("Preferred"); + get + { + if (_Identifier == null) _Identifier = new List(); + return _Identifier; + } + set + { + _Identifier = value; + OnPropertyChanged("Identifier"); + } } - } - public override IDeepCopyable CopyTo(IDeepCopyable other) - { - var dest = other as CommunicationComponent; + private List _Identifier; - if (dest == null) + /// + /// Whether this patient's record is in active use. + /// + [FhirElement("active", InSummary = true, IsModifier = true, Order = 100, FiveWs = "FiveWs.status")] + [DataMember] + public Hl7.Fhir.Model.FhirBoolean ActiveElement { - throw new ArgumentException("Can only copy to an object of the same type", "other"); + get { return _ActiveElement; } + set + { + _ActiveElement = value; + OnPropertyChanged("ActiveElement"); + } } - base.CopyTo(dest); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - return dest; - } + private Hl7.Fhir.Model.FhirBoolean _ActiveElement; - public override IDeepCopyable DeepCopy() - { - return CopyTo(new CommunicationComponent()); - } - - public override bool CompareChildren(Base other, IEqualityComparer comparer) - { - var otherT = other as CommunicationComponent; - if(otherT == null) return false; - - if(!base.CompareChildren(otherT, comparer)) return false; - if(!comparer.Equals(Language, otherT.Language)) return false; - if(!comparer.Equals(PreferredElement, otherT.PreferredElement)) return false; - - return true; - } - - public override bool TryGetValue(string key, out object value) - { - switch (key) + /// + /// Whether this patient's record is in active use + /// + /// This uses the native .NET datatype, rather than the FHIR equivalent + [IgnoreDataMember] + public bool? Active { - case "language": - value = Language; - return Language is not null; - case "preferred": - value = PreferredElement; - return PreferredElement is not null; - default: - return base.TryGetValue(key, out value); + get { return ActiveElement != null ? ActiveElement.Value : null; } + set + { + if (value == null) + ActiveElement = null; + else + ActiveElement = new Hl7.Fhir.Model.FhirBoolean(value); + OnPropertyChanged("Active"); + } } - } - - public override Base SetValue(string key, object value) - { - switch (key) + /// + /// A name associated with the patient. + /// + [FhirElement("name", InSummary = true, Order = 110)] + [Cardinality(Min = 0, Max = -1)] + [DataMember] + public List Name { - case "language": - Language = (Hl7.Fhir.Model.CodeableConcept)value; - return this; - case "preferred": - PreferredElement = (Hl7.Fhir.Model.FhirBoolean)value; - return this; - default: - return base.SetValue(key, value); + get + { + if (_Name == null) _Name = new List(); + return _Name; + } + set + { + _Name = value; + OnPropertyChanged("Name"); + } } - } - - public override IEnumerable> EnumerateElements() - { - foreach (var kvp in base.EnumerateElements()) yield return kvp; - if (Language is not null) yield return new KeyValuePair("language",Language); - if (PreferredElement is not null) yield return new KeyValuePair("preferred",PreferredElement); - } + private List _Name; - } - - /// - /// Link to another patient resource that concerns the same actual person - /// - /// - /// Link to another patient resource that concerns the same actual patient. - /// There is no assumption that linked patient records have mutual links. - /// - [Serializable] - [DataContract] - [FhirType("Patient.link", IsBackboneType=true)] - public partial class LinkComponent : Hl7.Fhir.Model.BackboneElement - { - /// - /// FHIR Type Name - /// - public override string TypeName { get { return "Patient.link"; } } - - /// - /// The other patient or related person resource that the link refers to. - /// - [FhirElement("other", InSummary=true, Order=40)] - [CLSCompliant(false)] - [References("Patient","RelatedPerson")] - [Cardinality(Min=1,Max=1)] - [DataMember] - public Hl7.Fhir.Model.ResourceReference Other - { - get { return _Other; } - set { _Other = value; OnPropertyChanged("Other"); } - } - - private Hl7.Fhir.Model.ResourceReference _Other; - - /// - /// replaced-by | replaces | refer | seealso. - /// - [FhirElement("type", InSummary=true, Order=50)] - [DeclaredType(Type = typeof(Code))] - [Binding("LinkType")] - [Cardinality(Min=1,Max=1)] - [DataMember] - public Code TypeElement - { - get { return _TypeElement; } - set { _TypeElement = value; OnPropertyChanged("TypeElement"); } - } - - private Code _TypeElement; - - /// - /// replaced-by | replaces | refer | seealso - /// - /// This uses the native .NET datatype, rather than the FHIR equivalent - [IgnoreDataMember] - public Hl7.Fhir.Model.Patient.LinkType? Type - { - get { return TypeElement != null ? TypeElement.Value : null; } - set + /// + /// A contact detail for the individual. + /// + [FhirElement("telecom", InSummary = true, Order = 120)] + [Cardinality(Min = 0, Max = -1)] + [DataMember] + public List Telecom { - if (value == null) - TypeElement = null; - else - TypeElement = new Code(value); - OnPropertyChanged("Type"); + get + { + if (_Telecom == null) _Telecom = new List(); + return _Telecom; + } + set + { + _Telecom = value; + OnPropertyChanged("Telecom"); + } } - } - public override IDeepCopyable CopyTo(IDeepCopyable other) - { - var dest = other as LinkComponent; + private List _Telecom; - if (dest == null) + /// + /// male | female | other | unknown. + /// + [FhirElement("gender", InSummary = true, Order = 130)] + [DeclaredType(Type = typeof(Code))] + [Binding("AdministrativeGender")] + [DataMember] + public Code GenderElement { - throw new ArgumentException("Can only copy to an object of the same type", "other"); + get { return _GenderElement; } + set + { + _GenderElement = value; + OnPropertyChanged("GenderElement"); + } } - base.CopyTo(dest); - if(Other != null) dest.Other = (Hl7.Fhir.Model.ResourceReference)Other.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new LinkComponent()); - } - - public override bool CompareChildren(Base other, IEqualityComparer comparer) - { - var otherT = other as LinkComponent; - if(otherT == null) return false; - - if(!base.CompareChildren(otherT, comparer)) return false; - if(!comparer.Equals(Other, otherT.Other)) return false; - if(!comparer.Equals(TypeElement, otherT.TypeElement)) return false; + private Code _GenderElement; - return true; - } - - public override bool TryGetValue(string key, out object value) - { - switch (key) + /// + /// male | female | other | unknown + /// + /// This uses the native .NET datatype, rather than the FHIR equivalent + [IgnoreDataMember] + public Hl7.Fhir.Model.AdministrativeGender? Gender { - case "other": - value = Other; - return Other is not null; - case "type": - value = TypeElement; - return TypeElement is not null; - default: - return base.TryGetValue(key, out value); + get { return GenderElement != null ? GenderElement.Value : null; } + set + { + if (value == null) + GenderElement = null; + else + GenderElement = new Code(value); + OnPropertyChanged("Gender"); + } } - } - - public override Base SetValue(string key, object value) - { - switch (key) + /// + /// The date of birth for the individual. + /// + [FhirElement("birthDate", InSummary = true, Order = 140)] + [DataMember] + public Hl7.Fhir.Model.Date BirthDateElement { - case "other": - Other = (Hl7.Fhir.Model.ResourceReference)value; - return this; - case "type": - TypeElement = (Code)value; - return this; - default: - return base.SetValue(key, value); + get { return _BirthDateElement; } + set + { + _BirthDateElement = value; + OnPropertyChanged("BirthDateElement"); + } } - } - - public override IEnumerable> EnumerateElements() - { - foreach (var kvp in base.EnumerateElements()) yield return kvp; - if (Other is not null) yield return new KeyValuePair("other",Other); - if (TypeElement is not null) yield return new KeyValuePair("type",TypeElement); - } - - } - - /// - /// An identifier for this patient. - /// - [FhirElement("identifier", InSummary=true, Order=90, FiveWs="FiveWs.identifier")] - [Cardinality(Min=0,Max=-1)] - [DataMember] - public List Identifier - { - get { if(_Identifier==null) _Identifier = new List(); return _Identifier; } - set { _Identifier = value; OnPropertyChanged("Identifier"); } - } - - private List _Identifier; - - /// - /// Whether this patient's record is in active use. - /// - [FhirElement("active", InSummary=true, IsModifier=true, Order=100, FiveWs="FiveWs.status")] - [DataMember] - public Hl7.Fhir.Model.FhirBoolean ActiveElement - { - get { return _ActiveElement; } - set { _ActiveElement = value; OnPropertyChanged("ActiveElement"); } - } - - private Hl7.Fhir.Model.FhirBoolean _ActiveElement; + private Hl7.Fhir.Model.Date _BirthDateElement; - /// - /// Whether this patient's record is in active use - /// - /// This uses the native .NET datatype, rather than the FHIR equivalent - [IgnoreDataMember] - public bool? Active - { - get { return ActiveElement != null ? ActiveElement.Value : null; } - set - { - if (value == null) - ActiveElement = null; - else - ActiveElement = new Hl7.Fhir.Model.FhirBoolean(value); - OnPropertyChanged("Active"); - } - } - - /// - /// A name associated with the patient. - /// - [FhirElement("name", InSummary=true, Order=110)] - [Cardinality(Min=0,Max=-1)] - [DataMember] - public List Name - { - get { if(_Name==null) _Name = new List(); return _Name; } - set { _Name = value; OnPropertyChanged("Name"); } - } - - private List _Name; - - /// - /// A contact detail for the individual. - /// - [FhirElement("telecom", InSummary=true, Order=120)] - [Cardinality(Min=0,Max=-1)] - [DataMember] - public List Telecom - { - get { if(_Telecom==null) _Telecom = new List(); return _Telecom; } - set { _Telecom = value; OnPropertyChanged("Telecom"); } - } - - private List _Telecom; - - /// - /// male | female | other | unknown. - /// - [FhirElement("gender", InSummary=true, Order=130)] - [DeclaredType(Type = typeof(Code))] - [Binding("AdministrativeGender")] - [DataMember] - public Code GenderElement - { - get { return _GenderElement; } - set { _GenderElement = value; OnPropertyChanged("GenderElement"); } - } - - private Code _GenderElement; - - /// - /// male | female | other | unknown - /// - /// This uses the native .NET datatype, rather than the FHIR equivalent - [IgnoreDataMember] - public Hl7.Fhir.Model.AdministrativeGender? Gender - { - get { return GenderElement != null ? GenderElement.Value : null; } - set - { - if (value == null) - GenderElement = null; - else - GenderElement = new Code(value); - OnPropertyChanged("Gender"); - } - } + /// + /// The date of birth for the individual + /// + /// This uses the native .NET datatype, rather than the FHIR equivalent + [IgnoreDataMember] + public string BirthDate + { + get { return BirthDateElement != null ? BirthDateElement.Value : null; } + set + { + if (value == null) + BirthDateElement = null; + else + BirthDateElement = new Hl7.Fhir.Model.Date(value); + OnPropertyChanged("BirthDate"); + } + } - /// - /// The date of birth for the individual. - /// - [FhirElement("birthDate", InSummary=true, Order=140)] - [DataMember] - public Hl7.Fhir.Model.Date BirthDateElement - { - get { return _BirthDateElement; } - set { _BirthDateElement = value; OnPropertyChanged("BirthDateElement"); } - } + /// + /// Indicates if the individual is deceased or not. + /// + [FhirElement("deceased", InSummary = true, IsModifier = true, Order = 150, Choice = ChoiceType.DatatypeChoice)] + [CLSCompliant(false)] + [AllowedTypes(typeof(Hl7.Fhir.Model.FhirBoolean), typeof(Hl7.Fhir.Model.FhirDateTime))] + [DataMember] + public Hl7.Fhir.Model.DataType Deceased + { + get { return _Deceased; } + set + { + _Deceased = value; + OnPropertyChanged("Deceased"); + } + } - private Hl7.Fhir.Model.Date _BirthDateElement; + private Hl7.Fhir.Model.DataType _Deceased; - /// - /// The date of birth for the individual - /// - /// This uses the native .NET datatype, rather than the FHIR equivalent - [IgnoreDataMember] - public string BirthDate - { - get { return BirthDateElement != null ? BirthDateElement.Value : null; } - set - { - if (value == null) - BirthDateElement = null; - else - BirthDateElement = new Hl7.Fhir.Model.Date(value); - OnPropertyChanged("BirthDate"); - } - } + /// + /// An address for the individual. + /// + [FhirElement("address", InSummary = true, Order = 160)] + [Cardinality(Min = 0, Max = -1)] + [DataMember] + public List Address + { + get + { + if (_Address == null) _Address = new List(); + return _Address; + } + set + { + _Address = value; + OnPropertyChanged("Address"); + } + } - /// - /// Indicates if the individual is deceased or not. - /// - [FhirElement("deceased", InSummary=true, IsModifier=true, Order=150, Choice=ChoiceType.DatatypeChoice)] - [CLSCompliant(false)] - [AllowedTypes(typeof(Hl7.Fhir.Model.FhirBoolean),typeof(Hl7.Fhir.Model.FhirDateTime))] - [DataMember] - public Hl7.Fhir.Model.DataType Deceased - { - get { return _Deceased; } - set { _Deceased = value; OnPropertyChanged("Deceased"); } - } + private List _Address; - private Hl7.Fhir.Model.DataType _Deceased; + /// + /// Marital (civil) status of a patient. + /// + [FhirElement("maritalStatus", Order = 170)] + [Binding("MaritalStatus")] + [DataMember] + public Hl7.Fhir.Model.CodeableConcept MaritalStatus + { + get { return _MaritalStatus; } + set + { + _MaritalStatus = value; + OnPropertyChanged("MaritalStatus"); + } + } - /// - /// An address for the individual. - /// - [FhirElement("address", InSummary=true, Order=160)] - [Cardinality(Min=0,Max=-1)] - [DataMember] - public List Address - { - get { if(_Address==null) _Address = new List(); return _Address; } - set { _Address = value; OnPropertyChanged("Address"); } - } + private Hl7.Fhir.Model.CodeableConcept _MaritalStatus; - private List _Address; + /// + /// Whether patient is part of a multiple birth. + /// + [FhirElement("multipleBirth", Order = 180, Choice = ChoiceType.DatatypeChoice)] + [CLSCompliant(false)] + [AllowedTypes(typeof(Hl7.Fhir.Model.FhirBoolean), typeof(Hl7.Fhir.Model.Integer))] + [DataMember] + public Hl7.Fhir.Model.DataType MultipleBirth + { + get { return _MultipleBirth; } + set + { + _MultipleBirth = value; + OnPropertyChanged("MultipleBirth"); + } + } - /// - /// Marital (civil) status of a patient. - /// - [FhirElement("maritalStatus", Order=170)] - [Binding("MaritalStatus")] - [DataMember] - public Hl7.Fhir.Model.CodeableConcept MaritalStatus - { - get { return _MaritalStatus; } - set { _MaritalStatus = value; OnPropertyChanged("MaritalStatus"); } - } + private Hl7.Fhir.Model.DataType _MultipleBirth; - private Hl7.Fhir.Model.CodeableConcept _MaritalStatus; + /// + /// Image of the patient. + /// + [FhirElement("photo", Order = 190)] + [Cardinality(Min = 0, Max = -1)] + [DataMember] + public List Photo + { + get + { + if (_Photo == null) _Photo = new List(); + return _Photo; + } + set + { + _Photo = value; + OnPropertyChanged("Photo"); + } + } - /// - /// Whether patient is part of a multiple birth. - /// - [FhirElement("multipleBirth", Order=180, Choice=ChoiceType.DatatypeChoice)] - [CLSCompliant(false)] - [AllowedTypes(typeof(Hl7.Fhir.Model.FhirBoolean),typeof(Hl7.Fhir.Model.Integer))] - [DataMember] - public Hl7.Fhir.Model.DataType MultipleBirth - { - get { return _MultipleBirth; } - set { _MultipleBirth = value; OnPropertyChanged("MultipleBirth"); } - } + private List _Photo; - private Hl7.Fhir.Model.DataType _MultipleBirth; + /// + /// A contact party (e.g. guardian, partner, friend) for the patient. + /// + [FhirElement("contact", Order = 200)] + [Cardinality(Min = 0, Max = -1)] + [DataMember] + public List Contact + { + get + { + if (_Contact == null) _Contact = new List(); + return _Contact; + } + set + { + _Contact = value; + OnPropertyChanged("Contact"); + } + } - /// - /// Image of the patient. - /// - [FhirElement("photo", Order=190)] - [Cardinality(Min=0,Max=-1)] - [DataMember] - public List Photo - { - get { if(_Photo==null) _Photo = new List(); return _Photo; } - set { _Photo = value; OnPropertyChanged("Photo"); } - } + private List _Contact; - private List _Photo; + /// + /// A language which may be used to communicate with the patient about his or her health. + /// + [FhirElement("communication", Order = 210)] + [Cardinality(Min = 0, Max = -1)] + [DataMember] + public List Communication + { + get + { + if (_Communication == null) _Communication = new List(); + return _Communication; + } + set + { + _Communication = value; + OnPropertyChanged("Communication"); + } + } - /// - /// A contact party (e.g. guardian, partner, friend) for the patient. - /// - [FhirElement("contact", Order=200)] - [Cardinality(Min=0,Max=-1)] - [DataMember] - public List Contact - { - get { if(_Contact==null) _Contact = new List(); return _Contact; } - set { _Contact = value; OnPropertyChanged("Contact"); } - } + private List _Communication; + + /// + /// Patient's nominated primary care provider. + /// + [FhirElement("generalPractitioner", Order = 220)] + [CLSCompliant(false)] + [References("Organization", "Practitioner", "PractitionerRole")] + [Cardinality(Min = 0, Max = -1)] + [DataMember] + public List GeneralPractitioner + { + get + { + if (_GeneralPractitioner == null) _GeneralPractitioner = new List(); + return _GeneralPractitioner; + } + set + { + _GeneralPractitioner = value; + OnPropertyChanged("GeneralPractitioner"); + } + } - private List _Contact; + private List _GeneralPractitioner; - /// - /// A language which may be used to communicate with the patient about his or her health. - /// - [FhirElement("communication", Order=210)] - [Cardinality(Min=0,Max=-1)] - [DataMember] - public List Communication - { - get { if(_Communication==null) _Communication = new List(); return _Communication; } - set { _Communication = value; OnPropertyChanged("Communication"); } - } + /// + /// Organization that is the custodian of the patient record. + /// + [FhirElement("managingOrganization", InSummary = true, Order = 230)] + [CLSCompliant(false)] + [References("Organization")] + [DataMember] + public Hl7.Fhir.Model.ResourceReference ManagingOrganization + { + get { return _ManagingOrganization; } + set + { + _ManagingOrganization = value; + OnPropertyChanged("ManagingOrganization"); + } + } - private List _Communication; + private Hl7.Fhir.Model.ResourceReference _ManagingOrganization; - /// - /// Patient's nominated primary care provider. - /// - [FhirElement("generalPractitioner", Order=220)] - [CLSCompliant(false)] - [References("Organization","Practitioner","PractitionerRole")] - [Cardinality(Min=0,Max=-1)] - [DataMember] - public List GeneralPractitioner - { - get { if(_GeneralPractitioner==null) _GeneralPractitioner = new List(); return _GeneralPractitioner; } - set { _GeneralPractitioner = value; OnPropertyChanged("GeneralPractitioner"); } - } + /// + /// Link to another patient resource that concerns the same actual person. + /// + [FhirElement("link", InSummary = true, IsModifier = true, Order = 240)] + [Cardinality(Min = 0, Max = -1)] + [DataMember] + public List Link + { + get + { + if (_Link == null) _Link = new List(); + return _Link; + } + set + { + _Link = value; + OnPropertyChanged("Link"); + } + } - private List _GeneralPractitioner; + private List _Link; - /// - /// Organization that is the custodian of the patient record. - /// - [FhirElement("managingOrganization", InSummary=true, Order=230)] - [CLSCompliant(false)] - [References("Organization")] - [DataMember] - public Hl7.Fhir.Model.ResourceReference ManagingOrganization - { - get { return _ManagingOrganization; } - set { _ManagingOrganization = value; OnPropertyChanged("ManagingOrganization"); } - } + List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - private Hl7.Fhir.Model.ResourceReference _ManagingOrganization; + Hl7.Fhir.Model.Date Hl7.Fhir.Model.IPatient.BirthDate => BirthDateElement; - /// - /// Link to another patient resource that concerns the same actual person. - /// - [FhirElement("link", InSummary=true, IsModifier=true, Order=240)] - [Cardinality(Min=0,Max=-1)] - [DataMember] - public List Link - { - get { if(_Link==null) _Link = new List(); return _Link; } - set { _Link = value; OnPropertyChanged("Link"); } - } + public override IDeepCopyable CopyTo(IDeepCopyable other) + { + var dest = other as Patient; + + if (dest == null) + { + throw new ArgumentException("Can only copy to an object of the same type", "other"); + } + + base.CopyTo(dest); + if (Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); + if (ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); + if (Name.Any()) dest.Name = new List(Name.DeepCopy()); + if (Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); + if (GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); + if (BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); + if (Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy(); + if (Address.Any()) dest.Address = new List(Address.DeepCopy()); + if (MaritalStatus != null) dest.MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)MaritalStatus.DeepCopy(); + if (MultipleBirth != null) dest.MultipleBirth = (Hl7.Fhir.Model.DataType)MultipleBirth.DeepCopy(); + if (Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); + if (Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); + if (Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); + if (GeneralPractitioner.Any()) dest.GeneralPractitioner = new List(GeneralPractitioner.DeepCopy()); + if (ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); + if (Link.Any()) dest.Link = new List(Link.DeepCopy()); + return dest; + } - private List _Link; + public override IDeepCopyable DeepCopy() + { + return CopyTo(new Patient()); + } - List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } + public override bool CompareChildren(Base other, IEqualityComparer comparer) + { + var otherT = other as Patient; + if (otherT == null) return false; + + if (!base.CompareChildren(otherT, comparer)) return false; + if (!comparer.ListEquals(Identifier, otherT.Identifier)) return false; + if (!comparer.Equals(ActiveElement, otherT.ActiveElement)) return false; + if (!comparer.ListEquals(Name, otherT.Name)) return false; + if (!comparer.ListEquals(Telecom, otherT.Telecom)) return false; + if (!comparer.Equals(GenderElement, otherT.GenderElement)) return false; + if (!comparer.Equals(BirthDateElement, otherT.BirthDateElement)) return false; + if (!comparer.Equals(Deceased, otherT.Deceased)) return false; + if (!comparer.ListEquals(Address, otherT.Address)) return false; + if (!comparer.Equals(MaritalStatus, otherT.MaritalStatus)) return false; + if (!comparer.Equals(MultipleBirth, otherT.MultipleBirth)) return false; + if (!comparer.ListEquals(Photo, otherT.Photo)) return false; + if (!comparer.ListEquals(Contact, otherT.Contact)) return false; + if (!comparer.ListEquals(Communication, otherT.Communication)) return false; + if (!comparer.ListEquals(GeneralPractitioner, otherT.GeneralPractitioner)) return false; + if (!comparer.Equals(ManagingOrganization, otherT.ManagingOrganization)) return false; + if (!comparer.ListEquals(Link, otherT.Link)) return false; + + return true; + } - Hl7.Fhir.Model.Date Hl7.Fhir.Model.IPatient.BirthDate => BirthDateElement; + public override bool TryGetValue(string key, out object value) + { + switch (key) + { + case "identifier": + value = Identifier; + return Identifier?.Any() == true; + case "active": + value = ActiveElement; + return ActiveElement is not null; + case "name": + value = Name; + return Name?.Any() == true; + case "telecom": + value = Telecom; + return Telecom?.Any() == true; + case "gender": + value = GenderElement; + return GenderElement is not null; + case "birthDate": + value = BirthDateElement; + return BirthDateElement is not null; + case "deceased": + value = Deceased; + return Deceased is not null; + case "address": + value = Address; + return Address?.Any() == true; + case "maritalStatus": + value = MaritalStatus; + return MaritalStatus is not null; + case "multipleBirth": + value = MultipleBirth; + return MultipleBirth is not null; + case "photo": + value = Photo; + return Photo?.Any() == true; + case "contact": + value = Contact; + return Contact?.Any() == true; + case "communication": + value = Communication; + return Communication?.Any() == true; + case "generalPractitioner": + value = GeneralPractitioner; + return GeneralPractitioner?.Any() == true; + case "managingOrganization": + value = ManagingOrganization; + return ManagingOrganization is not null; + case "link": + value = Link; + return Link?.Any() == true; + default: + return base.TryGetValue(key, out value); + } - public override IDeepCopyable CopyTo(IDeepCopyable other) - { - var dest = other as Patient; - - if (dest == null) - { - throw new ArgumentException("Can only copy to an object of the same type", "other"); - } - - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy(); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(MaritalStatus != null) dest.MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)MaritalStatus.DeepCopy(); - if(MultipleBirth != null) dest.MultipleBirth = (Hl7.Fhir.Model.DataType)MultipleBirth.DeepCopy(); - if(Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - if(GeneralPractitioner.Any()) dest.GeneralPractitioner = new List(GeneralPractitioner.DeepCopy()); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; - } + } - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Patient()); - } + public override Base SetValue(string key, object value) + { + switch (key) + { + case "identifier": + Identifier = (List)value; + return this; + case "active": + ActiveElement = (Hl7.Fhir.Model.FhirBoolean)value; + return this; + case "name": + Name = (List)value; + return this; + case "telecom": + Telecom = (List)value; + return this; + case "gender": + GenderElement = (Code)value; + return this; + case "birthDate": + BirthDateElement = (Hl7.Fhir.Model.Date)value; + return this; + case "deceased": + Deceased = (Hl7.Fhir.Model.DataType)value; + return this; + case "address": + Address = (List)value; + return this; + case "maritalStatus": + MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)value; + return this; + case "multipleBirth": + MultipleBirth = (Hl7.Fhir.Model.DataType)value; + return this; + case "photo": + Photo = (List)value; + return this; + case "contact": + Contact = (List)value; + return this; + case "communication": + Communication = (List)value; + return this; + case "generalPractitioner": + GeneralPractitioner = (List)value; + return this; + case "managingOrganization": + ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)value; + return this; + case "link": + Link = (List)value; + return this; + default: + return base.SetValue(key, value); + } - public override bool CompareChildren(Base other, IEqualityComparer comparer) - { - var otherT = other as Patient; - if(otherT == null) return false; - - if(!base.CompareChildren(otherT, comparer)) return false; - if(!comparer.ListEquals(Identifier, otherT.Identifier)) return false; - if(!comparer.Equals(ActiveElement, otherT.ActiveElement)) return false; - if(!comparer.ListEquals(Name, otherT.Name)) return false; - if(!comparer.ListEquals(Telecom, otherT.Telecom)) return false; - if(!comparer.Equals(GenderElement, otherT.GenderElement)) return false; - if(!comparer.Equals(BirthDateElement, otherT.BirthDateElement)) return false; - if(!comparer.Equals(Deceased, otherT.Deceased)) return false; - if(!comparer.ListEquals(Address, otherT.Address)) return false; - if(!comparer.Equals(MaritalStatus, otherT.MaritalStatus)) return false; - if(!comparer.Equals(MultipleBirth, otherT.MultipleBirth)) return false; - if(!comparer.ListEquals(Photo, otherT.Photo)) return false; - if(!comparer.ListEquals(Contact, otherT.Contact)) return false; - if(!comparer.ListEquals(Communication, otherT.Communication)) return false; - if(!comparer.ListEquals(GeneralPractitioner, otherT.GeneralPractitioner)) return false; - if(!comparer.Equals(ManagingOrganization, otherT.ManagingOrganization)) return false; - if(!comparer.ListEquals(Link, otherT.Link)) return false; - - return true; - } + } - public override bool TryGetValue(string key, out object value) - { - switch (key) - { - case "identifier": - value = Identifier; - return Identifier?.Any() == true; - case "active": - value = ActiveElement; - return ActiveElement is not null; - case "name": - value = Name; - return Name?.Any() == true; - case "telecom": - value = Telecom; - return Telecom?.Any() == true; - case "gender": - value = GenderElement; - return GenderElement is not null; - case "birthDate": - value = BirthDateElement; - return BirthDateElement is not null; - case "deceased": - value = Deceased; - return Deceased is not null; - case "address": - value = Address; - return Address?.Any() == true; - case "maritalStatus": - value = MaritalStatus; - return MaritalStatus is not null; - case "multipleBirth": - value = MultipleBirth; - return MultipleBirth is not null; - case "photo": - value = Photo; - return Photo?.Any() == true; - case "contact": - value = Contact; - return Contact?.Any() == true; - case "communication": - value = Communication; - return Communication?.Any() == true; - case "generalPractitioner": - value = GeneralPractitioner; - return GeneralPractitioner?.Any() == true; - case "managingOrganization": - value = ManagingOrganization; - return ManagingOrganization is not null; - case "link": - value = Link; - return Link?.Any() == true; - default: - return base.TryGetValue(key, out value); - } + public override IEnumerable> EnumerateElements() + { + foreach (var kvp in base.EnumerateElements()) yield return kvp; + if (Identifier?.Any() == true) yield return new KeyValuePair("identifier", Identifier); + if (ActiveElement is not null) yield return new KeyValuePair("active", ActiveElement); + if (Name?.Any() == true) yield return new KeyValuePair("name", Name); + if (Telecom?.Any() == true) yield return new KeyValuePair("telecom", Telecom); + if (GenderElement is not null) yield return new KeyValuePair("gender", GenderElement); + if (BirthDateElement is not null) yield return new KeyValuePair("birthDate", BirthDateElement); + if (Deceased is not null) yield return new KeyValuePair("deceased", Deceased); + if (Address?.Any() == true) yield return new KeyValuePair("address", Address); + if (MaritalStatus is not null) yield return new KeyValuePair("maritalStatus", MaritalStatus); + if (MultipleBirth is not null) yield return new KeyValuePair("multipleBirth", MultipleBirth); + if (Photo?.Any() == true) yield return new KeyValuePair("photo", Photo); + if (Contact?.Any() == true) yield return new KeyValuePair("contact", Contact); + if (Communication?.Any() == true) yield return new KeyValuePair("communication", Communication); + if (GeneralPractitioner?.Any() == true) yield return new KeyValuePair("generalPractitioner", GeneralPractitioner); + if (ManagingOrganization is not null) yield return new KeyValuePair("managingOrganization", ManagingOrganization); + if (Link?.Any() == true) yield return new KeyValuePair("link", Link); + } - } + public Span ToSpan() + { + unsafe + { + fixed (Patient* ptr = this) + { + fixed (List* linkPtr = &this._Link) + return new Span(ptr, (int)((long)linkPtr - (long)ptr) / sizeof(object)); + } + } + } - public override Base SetValue(string key, object value) - { - switch (key) - { - case "identifier": - Identifier = (List)value; - return this; - case "active": - ActiveElement = (Hl7.Fhir.Model.FhirBoolean)value; - return this; - case "name": - Name = (List)value; - return this; - case "telecom": - Telecom = (List)value; - return this; - case "gender": - GenderElement = (Code)value; - return this; - case "birthDate": - BirthDateElement = (Hl7.Fhir.Model.Date)value; - return this; - case "deceased": - Deceased = (Hl7.Fhir.Model.DataType)value; - return this; - case "address": - Address = (List)value; - return this; - case "maritalStatus": - MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)value; - return this; - case "multipleBirth": - MultipleBirth = (Hl7.Fhir.Model.DataType)value; - return this; - case "photo": - Photo = (List)value; - return this; - case "contact": - Contact = (List)value; - return this; - case "communication": - Communication = (List)value; - return this; - case "generalPractitioner": - GeneralPractitioner = (List)value; - return this; - case "managingOrganization": - ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)value; - return this; - case "link": - Link = (List)value; - return this; - default: - return base.SetValue(key, value); - } + public unsafe ref Patient GetPinnableReference() + { + var copy = this; + return ref *(Patient*)*(void**)Unsafe.AsPointer(ref copy); + } + public unsafe ref List GetLinkPinnableReference() + { + var copy = this._Link; + return ref *(List*)*(void**)Unsafe.AsPointer(ref copy); + } } - public override IEnumerable> EnumerateElements() + public static class ListExtensions { - foreach (var kvp in base.EnumerateElements()) yield return kvp; - if (Identifier?.Any() == true) yield return new KeyValuePair("identifier",Identifier); - if (ActiveElement is not null) yield return new KeyValuePair("active",ActiveElement); - if (Name?.Any() == true) yield return new KeyValuePair("name",Name); - if (Telecom?.Any() == true) yield return new KeyValuePair("telecom",Telecom); - if (GenderElement is not null) yield return new KeyValuePair("gender",GenderElement); - if (BirthDateElement is not null) yield return new KeyValuePair("birthDate",BirthDateElement); - if (Deceased is not null) yield return new KeyValuePair("deceased",Deceased); - if (Address?.Any() == true) yield return new KeyValuePair("address",Address); - if (MaritalStatus is not null) yield return new KeyValuePair("maritalStatus",MaritalStatus); - if (MultipleBirth is not null) yield return new KeyValuePair("multipleBirth",MultipleBirth); - if (Photo?.Any() == true) yield return new KeyValuePair("photo",Photo); - if (Contact?.Any() == true) yield return new KeyValuePair("contact",Contact); - if (Communication?.Any() == true) yield return new KeyValuePair("communication",Communication); - if (GeneralPractitioner?.Any() == true) yield return new KeyValuePair("generalPractitioner",GeneralPractitioner); - if (ManagingOrganization is not null) yield return new KeyValuePair("managingOrganization",ManagingOrganization); - if (Link?.Any() == true) yield return new KeyValuePair("link",Link); + public static unsafe ref List GetPinnableReference(this List list) + { + var copy = list; + return ref *(List*)*(void**)Unsafe.AsPointer(ref copy); + } } - - } - } // end of file From b8ccaa4e077e7aa7974af193d32c7048ddfdecc3 Mon Sep 17 00:00:00 2001 From: Kasdejong Date: Wed, 11 Dec 2024 15:12:00 +0100 Subject: [PATCH 2/8] this works??? --- src/Hl7.Fhir.R4/Model/Generated/Patient.cs | 39 ++++++++-------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Patient.cs b/src/Hl7.Fhir.R4/Model/Generated/Patient.cs index 317ca9ec0f..9dce8bd8eb 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Patient.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Patient.cs @@ -11,6 +11,7 @@ using Hl7.Fhir.Utility; using Hl7.Fhir.Validation; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; using SystemPrimitive = Hl7.Fhir.ElementModel.Types; /* @@ -1257,38 +1258,24 @@ public override IEnumerable> EnumerateElements() if (Link?.Any() == true) yield return new KeyValuePair("link", Link); } - public Span ToSpan() + public unsafe Span ToSpan() { - unsafe - { - fixed (Patient* ptr = this) - { - fixed (List* linkPtr = &this._Link) - return new Span(ptr, (int)((long)linkPtr - (long)ptr) / sizeof(object)); - } - } - } + var span = MemoryMarshal.CreateSpan(ref this._Identifier, 16); + var elements = MemoryMarshal.CreateSpan(ref Unsafe.AsRef((void*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(span))), 16); - public unsafe ref Patient GetPinnableReference() - { - var copy = this; - return ref *(Patient*)*(void**)Unsafe.AsPointer(ref copy); - } - - public unsafe ref List GetLinkPinnableReference() - { - var copy = this._Link; - return ref *(List*)*(void**)Unsafe.AsPointer(ref copy); + return elements; } } - public static class ListExtensions + public static class ObjectExtensions { - public static unsafe ref List GetPinnableReference(this List list) - { - var copy = list; - return ref *(List*)*(void**)Unsafe.AsPointer(ref copy); - } + // public static unsafe Span ToSpan(this Base @base) + // { + // var span = MemoryMarshal.CreateSpan(ref this._Identifier, 16); + // var elements =MemoryMarshal.CreateSpan(ref Unsafe.AsRef((void*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(span[1..]))), 16); + // + // return elements; + // } } } From dcd076adae879bd03abfb11d3e75097eb825a648 Mon Sep 17 00:00:00 2001 From: Kasdejong Date: Thu, 12 Dec 2024 12:10:04 +0100 Subject: [PATCH 3/8] wip --- src/Hl7.Fhir.Base/Model/Base.Extensions.cs | 2 +- src/Hl7.Fhir.Base/Model/BaseAggregator.cs | 59 ++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/Hl7.Fhir.Base/Model/BaseAggregator.cs diff --git a/src/Hl7.Fhir.Base/Model/Base.Extensions.cs b/src/Hl7.Fhir.Base/Model/Base.Extensions.cs index 513e2365d4..171b291274 100644 --- a/src/Hl7.Fhir.Base/Model/Base.Extensions.cs +++ b/src/Hl7.Fhir.Base/Model/Base.Extensions.cs @@ -5,7 +5,7 @@ namespace Hl7.Fhir.Model; -public static class BaseExtensions +public static partial class BaseExtensions { [Obsolete("Use GetElementPairs() instead. Note that with GetElementPairs(), the elements are not guaranteed to " + "be the same type, as they reflect the type in the actual POCO definition.")] diff --git a/src/Hl7.Fhir.Base/Model/BaseAggregator.cs b/src/Hl7.Fhir.Base/Model/BaseAggregator.cs new file mode 100644 index 0000000000..894774f882 --- /dev/null +++ b/src/Hl7.Fhir.Base/Model/BaseAggregator.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +#nullable enable + +namespace Hl7.Fhir.Model; + +internal abstract record PocoMapper(Func BaseMapper, Func PrimitiveMapper) +{ + internal abstract TResult MapSingle(object instance); +}; + +internal record TreeMapper( + Func BaseMapper, + Func PrimitiveMapper, + Func, TResult> BaseListMapper, + Func, TResult> PrimitiveListMapper +) : PocoMapper(BaseMapper, PrimitiveMapper) +{ + internal override TResult MapSingle(object instance) + { + return instance switch + { + Base baseInstance => baseInstance.MapSingle(mapper), + IEnumerable baseList => mapper.BaseListMapper(baseList), + IEnumerable primitiveList => mapper.PrimitiveListMapper(primitiveList), + object primitive => mapper.PrimitiveMapper(primitive), + _ => throw new InvalidOperationException("Unexpected instance type") + }; + } +} + +internal record FlatMapper(Func BaseMapper, Func PrimitiveMapper) : PocoMapper(BaseMapper, PrimitiveMapper) +{ + internal override TResult MapSingle(object instance) + { + return instance switch + { + Base baseInstance => baseInstance.MapSingle(mapper), + object primitive => mapper.PrimitiveMapper(primitive), + _ => throw new InvalidOperationException("Unexpected instance type") + }; + } +} + +public static partial class BaseExtensions +{ + internal static TResult MapSingle(this Base instance, PocoMapper mapper) + { + return mapper.BaseMapper(instance); + } + + internal static IEnumerable MapChildren(this Base instance, PocoMapper mapper) + { + return instance.EnumerateElements().Select(child => child.Value.MapSingle(mapper)); + } +} \ No newline at end of file From 3c50bdb5320298e4a820fd4c42f101f0b5a93717 Mon Sep 17 00:00:00 2001 From: Kasdejong Date: Tue, 17 Dec 2024 13:02:18 +0100 Subject: [PATCH 4/8] removed this idea --- src/Hl7.Fhir.Base/Model/BaseAggregator.cs | 59 ----------------------- src/Hl7.Fhir.Base/Model/IDeepCopyable.cs | 50 ------------------- 2 files changed, 109 deletions(-) delete mode 100644 src/Hl7.Fhir.Base/Model/BaseAggregator.cs delete mode 100644 src/Hl7.Fhir.Base/Model/IDeepCopyable.cs diff --git a/src/Hl7.Fhir.Base/Model/BaseAggregator.cs b/src/Hl7.Fhir.Base/Model/BaseAggregator.cs deleted file mode 100644 index 894774f882..0000000000 --- a/src/Hl7.Fhir.Base/Model/BaseAggregator.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -#nullable enable - -namespace Hl7.Fhir.Model; - -internal abstract record PocoMapper(Func BaseMapper, Func PrimitiveMapper) -{ - internal abstract TResult MapSingle(object instance); -}; - -internal record TreeMapper( - Func BaseMapper, - Func PrimitiveMapper, - Func, TResult> BaseListMapper, - Func, TResult> PrimitiveListMapper -) : PocoMapper(BaseMapper, PrimitiveMapper) -{ - internal override TResult MapSingle(object instance) - { - return instance switch - { - Base baseInstance => baseInstance.MapSingle(mapper), - IEnumerable baseList => mapper.BaseListMapper(baseList), - IEnumerable primitiveList => mapper.PrimitiveListMapper(primitiveList), - object primitive => mapper.PrimitiveMapper(primitive), - _ => throw new InvalidOperationException("Unexpected instance type") - }; - } -} - -internal record FlatMapper(Func BaseMapper, Func PrimitiveMapper) : PocoMapper(BaseMapper, PrimitiveMapper) -{ - internal override TResult MapSingle(object instance) - { - return instance switch - { - Base baseInstance => baseInstance.MapSingle(mapper), - object primitive => mapper.PrimitiveMapper(primitive), - _ => throw new InvalidOperationException("Unexpected instance type") - }; - } -} - -public static partial class BaseExtensions -{ - internal static TResult MapSingle(this Base instance, PocoMapper mapper) - { - return mapper.BaseMapper(instance); - } - - internal static IEnumerable MapChildren(this Base instance, PocoMapper mapper) - { - return instance.EnumerateElements().Select(child => child.Value.MapSingle(mapper)); - } -} \ No newline at end of file diff --git a/src/Hl7.Fhir.Base/Model/IDeepCopyable.cs b/src/Hl7.Fhir.Base/Model/IDeepCopyable.cs deleted file mode 100644 index d26c0e0af4..0000000000 --- a/src/Hl7.Fhir.Base/Model/IDeepCopyable.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (c) 2011-2012, HL7, Inc - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Hl7.Fhir.Model -{ - public interface IDeepCopyable - { - IDeepCopyable DeepCopy(); - IDeepCopyable CopyTo(IDeepCopyable other); - } - - public static class ListCopyExtensions - { - public static IEnumerable DeepCopy(this IEnumerable source) where T : IDeepCopyable - { - return source.Select(item => item != null ? (T)item.DeepCopy() : default(T)).ToList(); - } - } -} From 902ff6537efd012865fab995cb84e4a05c821a9e Mon Sep 17 00:00:00 2001 From: Kasdejong Date: Tue, 17 Dec 2024 15:51:35 +0100 Subject: [PATCH 5/8] Removed IDeepCopyable --- src/Hl7.Fhir.Base/Model/Base.Extensions.cs | 27 +- src/Hl7.Fhir.Base/Model/Base.cs | 16 +- src/Hl7.Fhir.Base/Model/CodeOfT.cs | 7 + src/Hl7.Fhir.Base/Model/DynamicDataType.cs | 21 + .../Model/Generated/Attachment.cs | 45 +- .../Model/Generated/BackboneElement.cs | 7 +- .../Model/Generated/BackboneType.cs | 7 +- src/Hl7.Fhir.Base/Model/Generated/Base.cs | 8 +- .../Model/Generated/Base64Binary.cs | 7 + src/Hl7.Fhir.Base/Model/Generated/Binary.cs | 19 +- src/Hl7.Fhir.Base/Model/Generated/Bundle.cs | 124 +- .../Model/Generated/Canonical.cs | 7 + src/Hl7.Fhir.Base/Model/Generated/Code.cs | 7 + .../Model/Generated/CodeableConcept.cs | 15 +- .../Model/Generated/CodeableReference.cs | 15 +- src/Hl7.Fhir.Base/Model/Generated/Coding.cs | 21 +- .../Model/Generated/ContactDetail.cs | 15 +- .../Model/Generated/ContactPoint.cs | 21 +- src/Hl7.Fhir.Base/Model/Generated/DataType.cs | 5 +- src/Hl7.Fhir.Base/Model/Generated/Date.cs | 7 + .../Model/Generated/DomainResource.cs | 13 +- src/Hl7.Fhir.Base/Model/Generated/Element.cs | 9 +- .../Model/Generated/Extension.cs | 15 +- .../Model/Generated/FhirBoolean.cs | 7 + .../Model/Generated/FhirDateTime.cs | 7 + .../Model/Generated/FhirDecimal.cs | 7 + .../Model/Generated/FhirString.cs | 7 + src/Hl7.Fhir.Base/Model/Generated/FhirUri.cs | 7 + src/Hl7.Fhir.Base/Model/Generated/FhirUrl.cs | 7 + src/Hl7.Fhir.Base/Model/Generated/Id.cs | 7 + .../Model/Generated/Identifier.cs | 23 +- src/Hl7.Fhir.Base/Model/Generated/Instant.cs | 7 + src/Hl7.Fhir.Base/Model/Generated/Integer.cs | 7 + .../Model/Generated/Integer64.cs | 7 + src/Hl7.Fhir.Base/Model/Generated/Markdown.cs | 7 + src/Hl7.Fhir.Base/Model/Generated/Meta.cs | 23 +- .../Model/Generated/Narrative.cs | 15 +- src/Hl7.Fhir.Base/Model/Generated/Oid.cs | 7 + .../Model/Generated/OperationOutcome.cs | 36 +- .../Model/Generated/Parameters.cs | 32 +- src/Hl7.Fhir.Base/Model/Generated/Period.cs | 15 +- .../Model/Generated/PositiveInt.cs | 7 + .../Model/Generated/PrimitiveType.cs | 5 +- src/Hl7.Fhir.Base/Model/Generated/Quantity.cs | 21 +- src/Hl7.Fhir.Base/Model/Generated/Range.cs | 15 +- src/Hl7.Fhir.Base/Model/Generated/Resource.cs | 13 +- .../Model/Generated/ResourceReference.cs | 19 +- .../Model/Generated/Signature.cs | 29 +- src/Hl7.Fhir.Base/Model/Generated/Time.cs | 7 + .../Model/Generated/UnsignedInt.cs | 7 + .../Model/Generated/UsageContext.cs | 15 +- src/Hl7.Fhir.Base/Model/Generated/Uuid.cs | 7 + src/Hl7.Fhir.Base/Model/Generated/XHtml.cs | 7 + .../Model/Generated/CapabilityStatement.cs | 334 +-- .../Model/Generated/CodeSystem.cs | 186 +- .../Model/Generated/ElementDefinition.cs | 264 +- .../Model/Generated/RelatedArtifact.cs | 33 +- .../Model/Generated/StructureDefinition.cs | 129 +- .../Model/Generated/ValueSet.cs | 303 +-- .../Snapshot/ElementDefnMerger.cs | 18 +- src/Hl7.Fhir.R4/Model/Generated/Account.cs | 65 +- .../Model/Generated/ActivityDefinition.cs | 139 +- src/Hl7.Fhir.R4/Model/Generated/Address.cs | 31 +- .../Model/Generated/AdverseEvent.cs | 85 +- src/Hl7.Fhir.R4/Model/Generated/Age.cs | 6 +- .../Model/Generated/AllergyIntolerance.cs | 68 +- src/Hl7.Fhir.R4/Model/Generated/Annotation.cs | 17 +- .../Model/Generated/Appointment.cs | 76 +- .../Model/Generated/AppointmentResponse.cs | 27 +- src/Hl7.Fhir.R4/Model/Generated/AuditEvent.cs | 142 +- src/Hl7.Fhir.R4/Model/Generated/Basic.cs | 21 +- .../Generated/BiologicallyDerivedProduct.cs | 103 +- .../Model/Generated/BodyStructure.cs | 27 +- src/Hl7.Fhir.R4/Model/Generated/CarePlan.cs | 123 +- src/Hl7.Fhir.R4/Model/Generated/CareTeam.cs | 56 +- .../Model/Generated/CatalogEntry.cs | 52 +- src/Hl7.Fhir.R4/Model/Generated/ChargeItem.cs | 84 +- .../Model/Generated/ChargeItemDefinition.cs | 108 +- src/Hl7.Fhir.R4/Model/Generated/Claim.cs | 352 +-- .../Model/Generated/ClaimResponse.cs | 345 +-- .../Model/Generated/ClinicalImpression.cs | 89 +- .../Model/Generated/Communication.cs | 76 +- .../Model/Generated/CommunicationRequest.cs | 74 +- .../Model/Generated/CompartmentDefinition.cs | 62 +- .../Model/Generated/Composition.cs | 121 +- src/Hl7.Fhir.R4/Model/Generated/ConceptMap.cs | 148 +- src/Hl7.Fhir.R4/Model/Generated/Condition.cs | 77 +- src/Hl7.Fhir.R4/Model/Generated/Consent.cs | 132 +- src/Hl7.Fhir.R4/Model/Generated/Contract.cs | 440 ++-- .../Model/Generated/Contributor.cs | 17 +- src/Hl7.Fhir.R4/Model/Generated/Count.cs | 6 +- src/Hl7.Fhir.R4/Model/Generated/Coverage.cs | 94 +- .../Generated/CoverageEligibilityRequest.cs | 117 +- .../Generated/CoverageEligibilityResponse.cs | 129 +- .../Model/Generated/DataRequirement.cs | 78 +- .../Model/Generated/DetectedIssue.cs | 67 +- src/Hl7.Fhir.R4/Model/Generated/Device.cs | 150 +- .../Model/Generated/DeviceDefinition.cs | 151 +- .../Model/Generated/DeviceMetric.cs | 48 +- .../Model/Generated/DeviceRequest.cs | 80 +- .../Model/Generated/DeviceUseStatement.cs | 37 +- .../Model/Generated/DiagnosticReport.cs | 62 +- src/Hl7.Fhir.R4/Model/Generated/Distance.cs | 6 +- .../Model/Generated/DocumentManifest.cs | 50 +- .../Model/Generated/DocumentReference.cs | 98 +- src/Hl7.Fhir.R4/Model/Generated/Dosage.cs | 54 +- src/Hl7.Fhir.R4/Model/Generated/Duration.cs | 6 +- .../Generated/EffectEvidenceSynthesis.cs | 189 +- src/Hl7.Fhir.R4/Model/Generated/Encounter.cs | 169 +- src/Hl7.Fhir.R4/Model/Generated/Endpoint.cs | 33 +- .../Model/Generated/EnrollmentRequest.cs | 25 +- .../Model/Generated/EnrollmentResponse.cs | 27 +- .../Model/Generated/EpisodeOfCare.cs | 67 +- .../Model/Generated/EventDefinition.cs | 67 +- src/Hl7.Fhir.R4/Model/Generated/Evidence.cs | 73 +- .../Model/Generated/EvidenceVariable.cs | 90 +- .../Model/Generated/ExampleScenario.cs | 205 +- .../Model/Generated/ExplanationOfBenefit.cs | 617 ++--- src/Hl7.Fhir.R4/Model/Generated/Expression.cs | 21 +- .../Model/Generated/FamilyMemberHistory.cs | 74 +- src/Hl7.Fhir.R4/Model/Generated/Flag.cs | 27 +- src/Hl7.Fhir.R4/Model/Generated/Goal.cs | 60 +- .../Model/Generated/GraphDefinition.cs | 106 +- src/Hl7.Fhir.R4/Model/Generated/Group.cs | 67 +- .../Model/Generated/GuidanceResponse.cs | 41 +- .../Model/Generated/HealthcareService.cs | 108 +- src/Hl7.Fhir.R4/Model/Generated/HumanName.cs | 25 +- .../Model/Generated/ImagingStudy.cs | 120 +- .../Model/Generated/Immunization.cs | 139 +- .../Model/Generated/ImmunizationEvaluation.cs | 37 +- .../Generated/ImmunizationRecommendation.cs | 71 +- .../Model/Generated/ImplementationGuide.cs | 248 +- .../Model/Generated/InsurancePlan.cs | 198 +- src/Hl7.Fhir.R4/Model/Generated/Invoice.cs | 94 +- src/Hl7.Fhir.R4/Model/Generated/Library.cs | 73 +- src/Hl7.Fhir.R4/Model/Generated/Linkage.cs | 32 +- src/Hl7.Fhir.R4/Model/Generated/List.cs | 56 +- src/Hl7.Fhir.R4/Model/Generated/Location.cs | 81 +- .../Model/Generated/MarketingStatus.cs | 21 +- src/Hl7.Fhir.R4/Model/Generated/Measure.cs | 190 +- .../Model/Generated/MeasureReport.cs | 135 +- src/Hl7.Fhir.R4/Model/Generated/Media.cs | 61 +- src/Hl7.Fhir.R4/Model/Generated/Medication.cs | 59 +- .../Generated/MedicationAdministration.cs | 87 +- .../Model/Generated/MedicationDispense.cs | 93 +- .../Model/Generated/MedicationKnowledge.cs | 305 +-- .../Model/Generated/MedicationRequest.cs | 130 +- .../Model/Generated/MedicationStatement.cs | 45 +- .../Model/Generated/MedicinalProduct.cs | 148 +- .../MedicinalProductAuthorization.cs | 83 +- .../MedicinalProductContraindication.cs | 40 +- .../Generated/MedicinalProductIndication.cs | 44 +- .../Generated/MedicinalProductIngredient.cs | 103 +- .../Generated/MedicinalProductInteraction.cs | 38 +- .../Generated/MedicinalProductManufactured.cs | 25 +- .../Generated/MedicinalProductPackaged.cs | 79 +- .../MedicinalProductPharmaceutical.cs | 97 +- .../MedicinalProductUndesirableEffect.cs | 21 +- .../Model/Generated/MessageDefinition.cs | 93 +- .../Model/Generated/MessageHeader.cs | 90 +- .../Model/Generated/MolecularSequence.cs | 235 +- src/Hl7.Fhir.R4/Model/Generated/Money.cs | 15 +- .../Model/Generated/NamingSystem.cs | 58 +- .../Model/Generated/NutritionOrder.cs | 165 +- .../Model/Generated/Observation.cs | 103 +- .../Model/Generated/ObservationDefinition.cs | 83 +- .../Model/Generated/OperationDefinition.cs | 141 +- .../Model/Generated/Organization.cs | 50 +- .../Generated/OrganizationAffiliation.cs | 35 +- .../Model/Generated/ParameterDefinition.cs | 25 +- src/Hl7.Fhir.R4/Model/Generated/Patient.cs | 2132 ++++++++--------- .../Model/Generated/PaymentNotice.cs | 35 +- .../Model/Generated/PaymentReconciliation.cs | 87 +- src/Hl7.Fhir.R4/Model/Generated/Person.cs | 46 +- .../Model/Generated/PlanDefinition.cs | 248 +- src/Hl7.Fhir.R4/Model/Generated/Population.cs | 19 +- .../Model/Generated/Practitioner.cs | 50 +- .../Model/Generated/PractitionerRole.cs | 73 +- src/Hl7.Fhir.R4/Model/Generated/Procedure.cs | 99 +- .../Model/Generated/ProdCharacteristic.cs | 33 +- .../Model/Generated/ProductShelfLife.cs | 19 +- src/Hl7.Fhir.R4/Model/Generated/Provenance.cs | 67 +- .../Model/Generated/Questionnaire.cs | 143 +- .../Model/Generated/QuestionnaireResponse.cs | 69 +- src/Hl7.Fhir.R4/Model/Generated/Ratio.cs | 15 +- .../Model/Generated/RelatedPerson.cs | 50 +- .../Model/Generated/RequestGroup.cs | 134 +- .../Model/Generated/ResearchDefinition.cs | 79 +- .../Generated/ResearchElementDefinition.cs | 112 +- .../Model/Generated/ResearchStudy.cs | 91 +- .../Model/Generated/ResearchSubject.cs | 27 +- .../Model/Generated/RiskAssessment.cs | 68 +- .../Model/Generated/RiskEvidenceSynthesis.cs | 168 +- .../Model/Generated/SampledData.cs | 25 +- src/Hl7.Fhir.R4/Model/Generated/Schedule.cs | 27 +- .../Model/Generated/SearchParameter.cs | 78 +- .../Model/Generated/ServiceRequest.cs | 77 +- src/Hl7.Fhir.R4/Model/Generated/Slot.cs | 33 +- src/Hl7.Fhir.R4/Model/Generated/Specimen.cs | 104 +- .../Model/Generated/SpecimenDefinition.cs | 109 +- .../Model/Generated/StructureMap.cs | 219 +- .../Model/Generated/Subscription.cs | 44 +- src/Hl7.Fhir.R4/Model/Generated/Substance.cs | 57 +- .../Model/Generated/SubstanceAmount.cs | 34 +- .../Model/Generated/SubstanceNucleicAcid.cs | 84 +- .../Model/Generated/SubstancePolymer.cs | 129 +- .../Model/Generated/SubstanceProtein.cs | 46 +- .../SubstanceReferenceInformation.cs | 101 +- .../Generated/SubstanceSourceMaterial.cs | 149 +- .../Model/Generated/SubstanceSpecification.cs | 273 ++- .../Model/Generated/SupplyDelivery.cs | 48 +- .../Model/Generated/SupplyRequest.cs | 56 +- src/Hl7.Fhir.R4/Model/Generated/Task.cs | 120 +- .../Generated/TerminologyCapabilities.cs | 219 +- src/Hl7.Fhir.R4/Model/Generated/TestReport.cs | 172 +- src/Hl7.Fhir.R4/Model/Generated/TestScript.cs | 401 ++-- src/Hl7.Fhir.R4/Model/Generated/Timing.cs | 58 +- .../Model/Generated/TriggerDefinition.cs | 21 +- .../Model/Generated/VerificationResult.cs | 108 +- .../Model/Generated/VisionPrescription.cs | 81 +- src/Hl7.Fhir.R4B/Model/Generated/Account.cs | 65 +- .../Model/Generated/ActivityDefinition.cs | 139 +- src/Hl7.Fhir.R4B/Model/Generated/Address.cs | 31 +- .../AdministrableProductDefinition.cs | 105 +- .../Model/Generated/AdverseEvent.cs | 85 +- src/Hl7.Fhir.R4B/Model/Generated/Age.cs | 6 +- .../Model/Generated/AllergyIntolerance.cs | 68 +- .../Model/Generated/Annotation.cs | 17 +- .../Model/Generated/Appointment.cs | 76 +- .../Model/Generated/AppointmentResponse.cs | 27 +- .../Model/Generated/AuditEvent.cs | 142 +- src/Hl7.Fhir.R4B/Model/Generated/Basic.cs | 21 +- .../Generated/BiologicallyDerivedProduct.cs | 103 +- .../Model/Generated/BodyStructure.cs | 27 +- src/Hl7.Fhir.R4B/Model/Generated/CarePlan.cs | 123 +- src/Hl7.Fhir.R4B/Model/Generated/CareTeam.cs | 56 +- .../Model/Generated/CatalogEntry.cs | 52 +- .../Model/Generated/ChargeItem.cs | 84 +- .../Model/Generated/ChargeItemDefinition.cs | 108 +- src/Hl7.Fhir.R4B/Model/Generated/Citation.cs | 528 ++-- src/Hl7.Fhir.R4B/Model/Generated/Claim.cs | 352 +-- .../Model/Generated/ClaimResponse.cs | 345 +-- .../Model/Generated/ClinicalImpression.cs | 89 +- .../Model/Generated/ClinicalUseDefinition.cs | 160 +- .../Model/Generated/Communication.cs | 76 +- .../Model/Generated/CommunicationRequest.cs | 74 +- .../Model/Generated/CompartmentDefinition.cs | 62 +- .../Model/Generated/Composition.cs | 121 +- .../Model/Generated/ConceptMap.cs | 148 +- src/Hl7.Fhir.R4B/Model/Generated/Condition.cs | 77 +- src/Hl7.Fhir.R4B/Model/Generated/Consent.cs | 132 +- src/Hl7.Fhir.R4B/Model/Generated/Contract.cs | 440 ++-- .../Model/Generated/Contributor.cs | 17 +- src/Hl7.Fhir.R4B/Model/Generated/Count.cs | 6 +- src/Hl7.Fhir.R4B/Model/Generated/Coverage.cs | 94 +- .../Generated/CoverageEligibilityRequest.cs | 117 +- .../Generated/CoverageEligibilityResponse.cs | 129 +- .../Model/Generated/DataRequirement.cs | 78 +- .../Model/Generated/DetectedIssue.cs | 67 +- src/Hl7.Fhir.R4B/Model/Generated/Device.cs | 150 +- .../Model/Generated/DeviceDefinition.cs | 151 +- .../Model/Generated/DeviceMetric.cs | 48 +- .../Model/Generated/DeviceRequest.cs | 80 +- .../Model/Generated/DeviceUseStatement.cs | 37 +- .../Model/Generated/DiagnosticReport.cs | 62 +- src/Hl7.Fhir.R4B/Model/Generated/Distance.cs | 6 +- .../Model/Generated/DocumentManifest.cs | 50 +- .../Model/Generated/DocumentReference.cs | 98 +- src/Hl7.Fhir.R4B/Model/Generated/Dosage.cs | 54 +- src/Hl7.Fhir.R4B/Model/Generated/Duration.cs | 6 +- src/Hl7.Fhir.R4B/Model/Generated/Encounter.cs | 169 +- src/Hl7.Fhir.R4B/Model/Generated/Endpoint.cs | 33 +- .../Model/Generated/EnrollmentRequest.cs | 25 +- .../Model/Generated/EnrollmentResponse.cs | 27 +- .../Model/Generated/EpisodeOfCare.cs | 67 +- .../Model/Generated/EventDefinition.cs | 67 +- src/Hl7.Fhir.R4B/Model/Generated/Evidence.cs | 224 +- .../Model/Generated/EvidenceReport.cs | 131 +- .../Model/Generated/EvidenceVariable.cs | 118 +- .../Model/Generated/ExampleScenario.cs | 205 +- .../Model/Generated/ExplanationOfBenefit.cs | 617 ++--- .../Model/Generated/Expression.cs | 21 +- .../Model/Generated/FamilyMemberHistory.cs | 74 +- src/Hl7.Fhir.R4B/Model/Generated/Flag.cs | 27 +- src/Hl7.Fhir.R4B/Model/Generated/Goal.cs | 60 +- .../Model/Generated/GraphDefinition.cs | 106 +- src/Hl7.Fhir.R4B/Model/Generated/Group.cs | 67 +- .../Model/Generated/GuidanceResponse.cs | 41 +- .../Model/Generated/HealthcareService.cs | 108 +- src/Hl7.Fhir.R4B/Model/Generated/HumanName.cs | 25 +- .../Model/Generated/ImagingStudy.cs | 120 +- .../Model/Generated/Immunization.cs | 139 +- .../Model/Generated/ImmunizationEvaluation.cs | 37 +- .../Generated/ImmunizationRecommendation.cs | 71 +- .../Model/Generated/ImplementationGuide.cs | 248 +- .../Model/Generated/Ingredient.cs | 101 +- .../Model/Generated/InsurancePlan.cs | 198 +- src/Hl7.Fhir.R4B/Model/Generated/Invoice.cs | 94 +- src/Hl7.Fhir.R4B/Model/Generated/Library.cs | 73 +- src/Hl7.Fhir.R4B/Model/Generated/Linkage.cs | 32 +- src/Hl7.Fhir.R4B/Model/Generated/List.cs | 56 +- src/Hl7.Fhir.R4B/Model/Generated/Location.cs | 81 +- .../Generated/ManufacturedItemDefinition.cs | 40 +- .../Model/Generated/MarketingStatus.cs | 21 +- src/Hl7.Fhir.R4B/Model/Generated/Measure.cs | 190 +- .../Model/Generated/MeasureReport.cs | 135 +- src/Hl7.Fhir.R4B/Model/Generated/Media.cs | 61 +- .../Model/Generated/Medication.cs | 59 +- .../Generated/MedicationAdministration.cs | 87 +- .../Model/Generated/MedicationDispense.cs | 93 +- .../Model/Generated/MedicationKnowledge.cs | 305 +-- .../Model/Generated/MedicationRequest.cs | 130 +- .../Model/Generated/MedicationStatement.cs | 45 +- .../Generated/MedicinalProductDefinition.cs | 182 +- .../Model/Generated/MessageDefinition.cs | 93 +- .../Model/Generated/MessageHeader.cs | 90 +- .../Model/Generated/MolecularSequence.cs | 235 +- src/Hl7.Fhir.R4B/Model/Generated/Money.cs | 15 +- .../Model/Generated/NamingSystem.cs | 58 +- .../Model/Generated/NutritionOrder.cs | 165 +- .../Model/Generated/NutritionProduct.cs | 97 +- .../Model/Generated/Observation.cs | 103 +- .../Model/Generated/ObservationDefinition.cs | 83 +- .../Model/Generated/OperationDefinition.cs | 141 +- .../Model/Generated/Organization.cs | 50 +- .../Generated/OrganizationAffiliation.cs | 35 +- .../Generated/PackagedProductDefinition.cs | 132 +- .../Model/Generated/ParameterDefinition.cs | 25 +- src/Hl7.Fhir.R4B/Model/Generated/Patient.cs | 98 +- .../Model/Generated/PaymentNotice.cs | 35 +- .../Model/Generated/PaymentReconciliation.cs | 87 +- src/Hl7.Fhir.R4B/Model/Generated/Person.cs | 46 +- .../Model/Generated/PlanDefinition.cs | 248 +- .../Model/Generated/Population.cs | 19 +- .../Model/Generated/Practitioner.cs | 50 +- .../Model/Generated/PractitionerRole.cs | 73 +- src/Hl7.Fhir.R4B/Model/Generated/Procedure.cs | 99 +- .../Model/Generated/ProdCharacteristic.cs | 33 +- .../Model/Generated/ProductShelfLife.cs | 19 +- .../Model/Generated/Provenance.cs | 67 +- .../Model/Generated/Questionnaire.cs | 143 +- .../Model/Generated/QuestionnaireResponse.cs | 69 +- src/Hl7.Fhir.R4B/Model/Generated/Ratio.cs | 15 +- .../Model/Generated/RatioRange.cs | 17 +- .../Model/Generated/RegulatedAuthorization.cs | 60 +- .../Model/Generated/RelatedPerson.cs | 50 +- .../Model/Generated/RequestGroup.cs | 134 +- .../Model/Generated/ResearchDefinition.cs | 79 +- .../Generated/ResearchElementDefinition.cs | 112 +- .../Model/Generated/ResearchStudy.cs | 91 +- .../Model/Generated/ResearchSubject.cs | 27 +- .../Model/Generated/RiskAssessment.cs | 68 +- .../Model/Generated/SampledData.cs | 25 +- src/Hl7.Fhir.R4B/Model/Generated/Schedule.cs | 27 +- .../Model/Generated/SearchParameter.cs | 78 +- .../Model/Generated/ServiceRequest.cs | 77 +- src/Hl7.Fhir.R4B/Model/Generated/Slot.cs | 33 +- src/Hl7.Fhir.R4B/Model/Generated/Specimen.cs | 104 +- .../Model/Generated/SpecimenDefinition.cs | 109 +- .../Model/Generated/StructureMap.cs | 219 +- .../Model/Generated/Subscription.cs | 44 +- .../Model/Generated/SubscriptionStatus.cs | 44 +- .../Model/Generated/SubscriptionTopic.cs | 152 +- src/Hl7.Fhir.R4B/Model/Generated/Substance.cs | 57 +- .../Model/Generated/SubstanceDefinition.cs | 271 ++- .../Model/Generated/SupplyDelivery.cs | 48 +- .../Model/Generated/SupplyRequest.cs | 56 +- src/Hl7.Fhir.R4B/Model/Generated/Task.cs | 120 +- .../Generated/TerminologyCapabilities.cs | 219 +- .../Model/Generated/TestReport.cs | 172 +- .../Model/Generated/TestScript.cs | 401 ++-- src/Hl7.Fhir.R4B/Model/Generated/Timing.cs | 58 +- .../Model/Generated/TriggerDefinition.cs | 21 +- .../Model/Generated/VerificationResult.cs | 108 +- .../Model/Generated/VisionPrescription.cs | 81 +- src/Hl7.Fhir.R5/Model/Generated/Account.cs | 157 +- .../Model/Generated/ActivityDefinition.cs | 151 +- .../Model/Generated/ActorDefinition.cs | 61 +- src/Hl7.Fhir.R5/Model/Generated/Address.cs | 31 +- .../AdministrableProductDefinition.cs | 107 +- .../Model/Generated/AdverseEvent.cs | 158 +- src/Hl7.Fhir.R5/Model/Generated/Age.cs | 6 +- .../Model/Generated/AllergyIntolerance.cs | 81 +- src/Hl7.Fhir.R5/Model/Generated/Annotation.cs | 17 +- .../Model/Generated/Appointment.cs | 186 +- .../Model/Generated/AppointmentResponse.cs | 35 +- .../Model/Generated/ArtifactAssessment.cs | 64 +- src/Hl7.Fhir.R5/Model/Generated/AuditEvent.cs | 136 +- .../Model/Generated/Availability.cs | 49 +- src/Hl7.Fhir.R5/Model/Generated/Basic.cs | 21 +- .../Generated/BiologicallyDerivedProduct.cs | 69 +- .../BiologicallyDerivedProductDispense.cs | 58 +- .../Model/Generated/BodyStructure.cs | 82 +- src/Hl7.Fhir.R5/Model/Generated/CarePlan.cs | 80 +- src/Hl7.Fhir.R5/Model/Generated/CareTeam.cs | 52 +- src/Hl7.Fhir.R5/Model/Generated/ChargeItem.cs | 84 +- .../Model/Generated/ChargeItemDefinition.cs | 95 +- src/Hl7.Fhir.R5/Model/Generated/Citation.cs | 445 ++-- src/Hl7.Fhir.R5/Model/Generated/Claim.cs | 414 ++-- .../Model/Generated/ClaimResponse.cs | 448 ++-- .../Model/Generated/ClinicalImpression.cs | 64 +- .../Model/Generated/ClinicalUseDefinition.cs | 166 +- .../Model/Generated/Communication.cs | 74 +- .../Model/Generated/CommunicationRequest.cs | 74 +- .../Model/Generated/CompartmentDefinition.cs | 70 +- .../Model/Generated/Composition.cs | 110 +- src/Hl7.Fhir.R5/Model/Generated/ConceptMap.cs | 235 +- src/Hl7.Fhir.R5/Model/Generated/Condition.cs | 75 +- .../Model/Generated/ConditionDefinition.cs | 146 +- src/Hl7.Fhir.R5/Model/Generated/Consent.cs | 148 +- src/Hl7.Fhir.R5/Model/Generated/Contract.cs | 436 ++-- .../Model/Generated/Contributor.cs | 17 +- src/Hl7.Fhir.R5/Model/Generated/Count.cs | 6 +- src/Hl7.Fhir.R5/Model/Generated/Coverage.cs | 123 +- .../Generated/CoverageEligibilityRequest.cs | 134 +- .../Generated/CoverageEligibilityResponse.cs | 148 +- .../Model/Generated/DataRequirement.cs | 99 +- .../Model/Generated/DetectedIssue.cs | 73 +- src/Hl7.Fhir.R5/Model/Generated/Device.cs | 166 +- .../Model/Generated/DeviceAssociation.cs | 46 +- .../Model/Generated/DeviceDefinition.cs | 343 +-- .../Model/Generated/DeviceDispense.cs | 74 +- .../Model/Generated/DeviceMetric.cs | 46 +- .../Model/Generated/DeviceRequest.cs | 84 +- .../Model/Generated/DeviceUsage.cs | 60 +- .../Model/Generated/DiagnosticReport.cs | 89 +- src/Hl7.Fhir.R5/Model/Generated/Distance.cs | 6 +- .../Model/Generated/DocumentReference.cs | 117 +- src/Hl7.Fhir.R5/Model/Generated/Dosage.cs | 56 +- src/Hl7.Fhir.R5/Model/Generated/Duration.cs | 6 +- src/Hl7.Fhir.R5/Model/Generated/Encounter.cs | 156 +- .../Model/Generated/EncounterHistory.cs | 52 +- src/Hl7.Fhir.R5/Model/Generated/Endpoint.cs | 50 +- .../Model/Generated/EnrollmentRequest.cs | 25 +- .../Model/Generated/EnrollmentResponse.cs | 27 +- .../Model/Generated/EpisodeOfCare.cs | 82 +- .../Model/Generated/EventDefinition.cs | 71 +- src/Hl7.Fhir.R5/Model/Generated/Evidence.cs | 236 +- .../Model/Generated/EvidenceReport.cs | 150 +- .../Model/Generated/EvidenceVariable.cs | 184 +- .../Model/Generated/ExampleScenario.cs | 223 +- .../Model/Generated/ExplanationOfBenefit.cs | 769 +++--- src/Hl7.Fhir.R5/Model/Generated/Expression.cs | 21 +- .../Model/Generated/ExtendedContactDetail.cs | 23 +- .../Model/Generated/FamilyMemberHistory.cs | 106 +- src/Hl7.Fhir.R5/Model/Generated/Flag.cs | 27 +- .../Model/Generated/FormularyItem.cs | 17 +- .../Model/Generated/GenomicStudy.cs | 156 +- src/Hl7.Fhir.R5/Model/Generated/Goal.cs | 60 +- .../Model/Generated/GraphDefinition.cs | 120 +- src/Hl7.Fhir.R5/Model/Generated/Group.cs | 69 +- .../Model/Generated/GuidanceResponse.cs | 39 +- .../Model/Generated/HealthcareService.cs | 78 +- src/Hl7.Fhir.R5/Model/Generated/HumanName.cs | 25 +- .../Model/Generated/ImagingSelection.cs | 113 +- .../Model/Generated/ImagingStudy.cs | 116 +- .../Model/Generated/Immunization.cs | 135 +- .../Model/Generated/ImmunizationEvaluation.cs | 37 +- .../Generated/ImmunizationRecommendation.cs | 71 +- .../Model/Generated/ImplementationGuide.cs | 264 +- src/Hl7.Fhir.R5/Model/Generated/Ingredient.cs | 107 +- .../Model/Generated/InsurancePlan.cs | 179 +- .../Model/Generated/InventoryItem.cs | 139 +- .../Model/Generated/InventoryReport.cs | 67 +- src/Hl7.Fhir.R5/Model/Generated/Invoice.cs | 87 +- src/Hl7.Fhir.R5/Model/Generated/Library.cs | 77 +- src/Hl7.Fhir.R5/Model/Generated/Linkage.cs | 32 +- src/Hl7.Fhir.R5/Model/Generated/List.cs | 56 +- src/Hl7.Fhir.R5/Model/Generated/Location.cs | 70 +- .../Generated/ManufacturedItemDefinition.cs | 88 +- .../Model/Generated/MarketingStatus.cs | 21 +- src/Hl7.Fhir.R5/Model/Generated/Measure.cs | 249 +- .../Model/Generated/MeasureReport.cs | 167 +- src/Hl7.Fhir.R5/Model/Generated/Medication.cs | 61 +- .../Generated/MedicationAdministration.cs | 91 +- .../Model/Generated/MedicationDispense.cs | 99 +- .../Model/Generated/MedicationKnowledge.cs | 347 +-- .../Model/Generated/MedicationRequest.cs | 136 +- .../Model/Generated/MedicationStatement.cs | 60 +- .../Generated/MedicinalProductDefinition.cs | 184 +- .../Model/Generated/MessageDefinition.cs | 97 +- .../Model/Generated/MessageHeader.cs | 88 +- .../Model/Generated/MolecularSequence.cs | 96 +- .../Model/Generated/MonetaryComponent.cs | 19 +- src/Hl7.Fhir.R5/Model/Generated/Money.cs | 15 +- .../Model/Generated/NamingSystem.cs | 96 +- .../Model/Generated/NutritionIntake.cs | 106 +- .../Model/Generated/NutritionOrder.cs | 245 +- .../Model/Generated/NutritionProduct.cs | 101 +- .../Model/Generated/Observation.cs | 128 +- .../Model/Generated/ObservationDefinition.cs | 145 +- .../Model/Generated/OperationDefinition.cs | 159 +- .../Model/Generated/Organization.cs | 50 +- .../Generated/OrganizationAffiliation.cs | 35 +- .../Generated/PackagedProductDefinition.cs | 119 +- .../Model/Generated/ParameterDefinition.cs | 25 +- src/Hl7.Fhir.R5/Model/Generated/Patient.cs | 98 +- .../Model/Generated/PaymentNotice.cs | 35 +- .../Model/Generated/PaymentReconciliation.cs | 121 +- src/Hl7.Fhir.R5/Model/Generated/Permission.cs | 110 +- src/Hl7.Fhir.R5/Model/Generated/Person.cs | 67 +- .../Model/Generated/PlanDefinition.cs | 346 +-- .../Model/Generated/Practitioner.cs | 67 +- .../Model/Generated/PractitionerRole.cs | 39 +- src/Hl7.Fhir.R5/Model/Generated/Procedure.cs | 101 +- .../Model/Generated/ProductShelfLife.cs | 17 +- src/Hl7.Fhir.R5/Model/Generated/Provenance.cs | 73 +- .../Model/Generated/Questionnaire.cs | 157 +- .../Model/Generated/QuestionnaireResponse.cs | 69 +- src/Hl7.Fhir.R5/Model/Generated/Ratio.cs | 15 +- src/Hl7.Fhir.R5/Model/Generated/RatioRange.cs | 17 +- .../Model/Generated/RegulatedAuthorization.cs | 62 +- .../Model/Generated/RelatedPerson.cs | 50 +- .../Model/Generated/RequestOrchestration.cs | 224 +- .../Model/Generated/Requirements.cs | 84 +- .../Model/Generated/ResearchStudy.cs | 206 +- .../Model/Generated/ResearchSubject.cs | 52 +- .../Model/Generated/RiskAssessment.cs | 66 +- .../Model/Generated/SampledData.cs | 31 +- src/Hl7.Fhir.R5/Model/Generated/Schedule.cs | 29 +- .../Model/Generated/SearchParameter.cs | 94 +- .../Model/Generated/ServiceRequest.cs | 120 +- src/Hl7.Fhir.R5/Model/Generated/Slot.cs | 33 +- src/Hl7.Fhir.R5/Model/Generated/Specimen.cs | 123 +- .../Model/Generated/SpecimenDefinition.cs | 157 +- .../Model/Generated/StructureMap.cs | 238 +- .../Model/Generated/Subscription.cs | 81 +- .../Model/Generated/SubscriptionStatus.cs | 44 +- .../Model/Generated/SubscriptionTopic.cs | 160 +- src/Hl7.Fhir.R5/Model/Generated/Substance.cs | 44 +- .../Model/Generated/SubstanceDefinition.cs | 300 +-- .../Model/Generated/SubstanceNucleicAcid.cs | 84 +- .../Model/Generated/SubstancePolymer.cs | 135 +- .../Model/Generated/SubstanceProtein.cs | 46 +- .../SubstanceReferenceInformation.cs | 80 +- .../Generated/SubstanceSourceMaterial.cs | 149 +- .../Model/Generated/SupplyDelivery.cs | 48 +- .../Model/Generated/SupplyRequest.cs | 58 +- src/Hl7.Fhir.R5/Model/Generated/Task.cs | 139 +- .../Generated/TerminologyCapabilities.cs | 227 +- src/Hl7.Fhir.R5/Model/Generated/TestPlan.cs | 174 +- src/Hl7.Fhir.R5/Model/Generated/TestReport.cs | 187 +- src/Hl7.Fhir.R5/Model/Generated/TestScript.cs | 447 ++-- src/Hl7.Fhir.R5/Model/Generated/Timing.cs | 58 +- src/Hl7.Fhir.R5/Model/Generated/Transport.cs | 122 +- .../Model/Generated/TriggerDefinition.cs | 25 +- .../Model/Generated/VerificationResult.cs | 108 +- .../Model/Generated/VirtualServiceDetail.cs | 21 +- .../Model/Generated/VisionPrescription.cs | 81 +- src/Hl7.Fhir.STU3.Tests/Model/DeepCopyTest.cs | 2 +- src/Hl7.Fhir.STU3/Model/Generated/Account.cs | 67 +- .../Model/Generated/ActivityDefinition.cs | 113 +- src/Hl7.Fhir.STU3/Model/Generated/Address.cs | 31 +- .../Model/Generated/AdverseEvent.cs | 68 +- src/Hl7.Fhir.STU3/Model/Generated/Age.cs | 6 +- .../Model/Generated/AllergyIntolerance.cs | 66 +- .../Model/Generated/Annotation.cs | 17 +- .../Model/Generated/Appointment.cs | 76 +- .../Model/Generated/AppointmentResponse.cs | 27 +- .../Model/Generated/AuditEvent.cs | 142 +- src/Hl7.Fhir.STU3/Model/Generated/Basic.cs | 21 +- src/Hl7.Fhir.STU3/Model/Generated/BodySite.cs | 25 +- .../Model/Generated/CapabilityStatement.cs | 356 +-- src/Hl7.Fhir.STU3/Model/Generated/CarePlan.cs | 115 +- src/Hl7.Fhir.STU3/Model/Generated/CareTeam.cs | 54 +- .../Model/Generated/ChargeItem.cs | 78 +- src/Hl7.Fhir.STU3/Model/Generated/Claim.cs | 352 +-- .../Model/Generated/ClaimResponse.cs | 269 ++- .../Model/Generated/ClinicalImpression.cs | 85 +- .../Model/Generated/CodeSystem.cs | 154 +- .../Model/Generated/Communication.cs | 64 +- .../Model/Generated/CommunicationRequest.cs | 79 +- .../Model/Generated/CompartmentDefinition.cs | 64 +- .../Model/Generated/Composition.cs | 117 +- .../Model/Generated/ConceptMap.cs | 148 +- .../Model/Generated/Condition.cs | 73 +- src/Hl7.Fhir.STU3/Model/Generated/Consent.cs | 153 +- src/Hl7.Fhir.STU3/Model/Generated/Contract.cs | 234 +- .../Model/Generated/Contributor.cs | 17 +- src/Hl7.Fhir.STU3/Model/Generated/Count.cs | 6 +- src/Hl7.Fhir.STU3/Model/Generated/Coverage.cs | 78 +- .../Model/Generated/DataElement.cs | 68 +- .../Model/Generated/DataRequirement.cs | 57 +- .../Model/Generated/DetectedIssue.cs | 50 +- src/Hl7.Fhir.STU3/Model/Generated/Device.cs | 70 +- .../Model/Generated/DeviceComponent.cs | 48 +- .../Model/Generated/DeviceMetric.cs | 48 +- .../Model/Generated/DeviceRequest.cs | 68 +- .../Model/Generated/DeviceUseStatement.cs | 33 +- .../Model/Generated/DiagnosticReport.cs | 75 +- src/Hl7.Fhir.STU3/Model/Generated/Distance.cs | 6 +- .../Model/Generated/DocumentManifest.cs | 63 +- .../Model/Generated/DocumentReference.cs | 115 +- src/Hl7.Fhir.STU3/Model/Generated/Dosage.cs | 39 +- src/Hl7.Fhir.STU3/Model/Generated/Duration.cs | 6 +- .../Model/Generated/ElementDefinition.cs | 229 +- .../Model/Generated/EligibilityRequest.cs | 41 +- .../Model/Generated/EligibilityResponse.cs | 113 +- .../Model/Generated/Encounter.cs | 163 +- src/Hl7.Fhir.STU3/Model/Generated/Endpoint.cs | 33 +- .../Model/Generated/EnrollmentRequest.cs | 27 +- .../Model/Generated/EnrollmentResponse.cs | 29 +- .../Model/Generated/EpisodeOfCare.cs | 67 +- .../Model/Generated/ExpansionProfile.cs | 160 +- .../Model/Generated/ExplanationOfBenefit.cs | 539 +++-- .../Model/Generated/FamilyMemberHistory.cs | 72 +- src/Hl7.Fhir.STU3/Model/Generated/Flag.cs | 27 +- src/Hl7.Fhir.STU3/Model/Generated/Goal.cs | 58 +- .../Model/Generated/GraphDefinition.cs | 102 +- src/Hl7.Fhir.STU3/Model/Generated/Group.cs | 65 +- .../Model/Generated/GuidanceResponse.cs | 39 +- .../Model/Generated/HealthcareService.cs | 93 +- .../Model/Generated/HumanName.cs | 25 +- .../Model/Generated/ImagingManifest.cs | 74 +- .../Model/Generated/ImagingStudy.cs | 103 +- .../Model/Generated/Immunization.cs | 127 +- .../Generated/ImmunizationRecommendation.cs | 80 +- .../Model/Generated/ImplementationGuide.cs | 142 +- src/Hl7.Fhir.STU3/Model/Generated/Library.cs | 69 +- src/Hl7.Fhir.STU3/Model/Generated/Linkage.cs | 32 +- src/Hl7.Fhir.STU3/Model/Generated/List.cs | 56 +- src/Hl7.Fhir.STU3/Model/Generated/Location.cs | 58 +- src/Hl7.Fhir.STU3/Model/Generated/Measure.cs | 169 +- .../Model/Generated/MeasureReport.cs | 120 +- src/Hl7.Fhir.STU3/Model/Generated/Media.cs | 47 +- .../Model/Generated/Medication.cs | 93 +- .../Generated/MedicationAdministration.cs | 89 +- .../Model/Generated/MedicationDispense.cs | 93 +- .../Model/Generated/MedicationRequest.cs | 110 +- .../Model/Generated/MedicationStatement.cs | 47 +- .../Model/Generated/MessageDefinition.cs | 91 +- .../Model/Generated/MessageHeader.cs | 90 +- src/Hl7.Fhir.STU3/Model/Generated/Money.cs | 6 +- .../Model/Generated/NamingSystem.cs | 60 +- .../Model/Generated/NutritionOrder.cs | 155 +- .../Model/Generated/Observation.cs | 112 +- .../Model/Generated/OperationDefinition.cs | 118 +- .../Model/Generated/Organization.cs | 50 +- .../Model/Generated/ParameterDefinition.cs | 25 +- src/Hl7.Fhir.STU3/Model/Generated/Patient.cs | 117 +- .../Model/Generated/PaymentNotice.cs | 31 +- .../Model/Generated/PaymentReconciliation.cs | 79 +- src/Hl7.Fhir.STU3/Model/Generated/Person.cs | 46 +- .../Model/Generated/PlanDefinition.cs | 242 +- .../Model/Generated/Practitioner.cs | 50 +- .../Model/Generated/PractitionerRole.cs | 73 +- .../Model/Generated/Procedure.cs | 95 +- .../Model/Generated/ProcedureRequest.cs | 84 +- .../Model/Generated/ProcessRequest.cs | 54 +- .../Model/Generated/ProcessResponse.cs | 52 +- .../Model/Generated/Provenance.cs | 67 +- .../Model/Generated/Questionnaire.cs | 124 +- .../Model/Generated/QuestionnaireResponse.cs | 71 +- src/Hl7.Fhir.STU3/Model/Generated/Ratio.cs | 15 +- .../Model/Generated/ReferralRequest.cs | 78 +- .../Model/Generated/RelatedArtifact.cs | 23 +- .../Model/Generated/RelatedPerson.cs | 33 +- .../Model/Generated/RequestGroup.cs | 130 +- .../Model/Generated/ResearchStudy.cs | 68 +- .../Model/Generated/ResearchSubject.cs | 27 +- .../Model/Generated/RiskAssessment.cs | 66 +- .../Model/Generated/SampledData.cs | 25 +- src/Hl7.Fhir.STU3/Model/Generated/Schedule.cs | 27 +- .../Model/Generated/SearchParameter.cs | 74 +- src/Hl7.Fhir.STU3/Model/Generated/Sequence.cs | 153 +- .../Model/Generated/ServiceDefinition.cs | 67 +- src/Hl7.Fhir.STU3/Model/Generated/Slot.cs | 33 +- src/Hl7.Fhir.STU3/Model/Generated/Specimen.cs | 98 +- .../Model/Generated/StructureDefinition.cs | 112 +- .../Model/Generated/StructureMap.cs | 217 +- .../Model/Generated/Subscription.cs | 46 +- .../Model/Generated/Substance.cs | 57 +- .../Model/Generated/SupplyDelivery.cs | 48 +- .../Model/Generated/SupplyRequest.cs | 65 +- src/Hl7.Fhir.STU3/Model/Generated/Task.cs | 127 +- .../Model/Generated/TestReport.cs | 172 +- .../Model/Generated/TestScript.cs | 551 +++-- src/Hl7.Fhir.STU3/Model/Generated/Timing.cs | 58 +- .../Model/Generated/TriggerDefinition.cs | 19 +- src/Hl7.Fhir.STU3/Model/Generated/ValueSet.cs | 205 +- .../Model/Generated/VisionPrescription.cs | 68 +- .../Snapshot/ElementDefnMerger.cs | 26 +- .../Model/DeepCopyTest.cs | 2 +- .../Model/StructureDefinition.cs | 2 +- .../Model/ModelTests.cs | 2 +- .../Introspection/ClassMappingTest.cs | 6 +- .../Specification/AsyncSources.cs | 4 +- 687 files changed, 34393 insertions(+), 31876 deletions(-) diff --git a/src/Hl7.Fhir.Base/Model/Base.Extensions.cs b/src/Hl7.Fhir.Base/Model/Base.Extensions.cs index 171b291274..2fd62f9abc 100644 --- a/src/Hl7.Fhir.Base/Model/Base.Extensions.cs +++ b/src/Hl7.Fhir.Base/Model/Base.Extensions.cs @@ -2,10 +2,11 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; namespace Hl7.Fhir.Model; -public static partial class BaseExtensions +public static class BaseExtensions { [Obsolete("Use GetElementPairs() instead. Note that with GetElementPairs(), the elements are not guaranteed to " + "be the same type, as they reflect the type in the actual POCO definition.")] @@ -25,7 +26,7 @@ public static IEnumerable Children(this Base instance) foreach (var item in list) yield return item; break; - case("value", _) when instance is PrimitiveType: + case ("value", _) when instance is PrimitiveType: yield break; default: yield return (Base)element.Value; @@ -33,4 +34,26 @@ public static IEnumerable Children(this Base instance) } } } + + public static T DeepCopy(this T source) where T : Base => (T)source.DeepCopyInternal(); + + public static void CopyTo(this T source, T target) where T : Base => source.CopyToInternal(target); + + internal static IEnumerable DeepCopyInternal(this IEnumerable source) where T : Base + { + return source.Select(item => item.DeepCopy()); + } + + internal static void CopyToInternal(this Dictionary source, Dictionary target) + { + foreach ((string key, object value) in source) + { + target[key] = value switch + { + Base baseValue => baseValue.DeepCopy(), + IEnumerable baseList => baseList.DeepCopyInternal(), + _ => throw new InvalidOperationException($"Unexpected type in overflow: key {key} is of type {value.GetType()}, but either Base or IEnumerable was expected.") + }; + } + } } \ No newline at end of file diff --git a/src/Hl7.Fhir.Base/Model/Base.cs b/src/Hl7.Fhir.Base/Model/Base.cs index 78ab33deae..2a9932b8e2 100644 --- a/src/Hl7.Fhir.Base/Model/Base.cs +++ b/src/Hl7.Fhir.Base/Model/Base.cs @@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace Hl7.Fhir.Model; -public abstract partial class Base : IDeepCopyable, IAnnotatable, +public abstract partial class Base : IAnnotatable, IValidatableObject, INotifyPropertyChanged { /// @@ -64,13 +64,13 @@ public abstract partial class Base : IDeepCopyable, IAnnotatable, private AnnotationList annotations => LazyInitializer.EnsureInitialized(ref _annotations, () => [])!; - public IEnumerable Annotations(Type type) - { - if (type == typeof(IFhirValueProvider)) - return [this]; - else - return annotations.OfType(type); - } + public IEnumerable Annotations(Type type) + { + if (type == typeof(IFhirValueProvider)) + return [this]; + else + return annotations.OfType(type); + } public void AddAnnotation(object annotation) => annotations.AddAnnotation(annotation); diff --git a/src/Hl7.Fhir.Base/Model/CodeOfT.cs b/src/Hl7.Fhir.Base/Model/CodeOfT.cs index 5dd8b2d3dc..44b4eaca7f 100644 --- a/src/Hl7.Fhir.Base/Model/CodeOfT.cs +++ b/src/Hl7.Fhir.Base/Model/CodeOfT.cs @@ -54,6 +54,13 @@ static Code() throw new ArgumentException("T must be an enumerated type"); } + protected internal override Base DeepCopyInternal() + { + var instance = new Code(); + CopyToInternal(instance); + return instance; + } + public override string TypeName => "code"; public Code() : this(null) { } diff --git a/src/Hl7.Fhir.Base/Model/DynamicDataType.cs b/src/Hl7.Fhir.Base/Model/DynamicDataType.cs index 4c8bbbf7d8..b52d3d817e 100644 --- a/src/Hl7.Fhir.Base/Model/DynamicDataType.cs +++ b/src/Hl7.Fhir.Base/Model/DynamicDataType.cs @@ -24,6 +24,13 @@ public class DynamicDataType : DataType, IDynamicType public string? DynamicTypeName { get; set; } public override string TypeName => DynamicTypeName ?? base.TypeName; + + protected internal override Base DeepCopyInternal() + { + var instance = new DynamicDataType(); + CopyToInternal(instance); + return instance; + } } @@ -39,6 +46,13 @@ public class DynamicResource : Resource, IDynamicType public string? DynamicTypeName { get; set; } public override string TypeName => DynamicTypeName ?? base.TypeName; + + protected internal override Base DeepCopyInternal() + { + var instance = new DynamicResource(); + CopyToInternal(instance); + return instance; + } } @@ -53,4 +67,11 @@ public class DynamicPrimitive : PrimitiveType, IDynamicType public string? DynamicTypeName { get; set; } public override string TypeName => DynamicTypeName ?? base.TypeName; + + protected internal override Base DeepCopyInternal() + { + var instance = new DynamicPrimitive(); + CopyToInternal(instance); + return instance; + } } \ No newline at end of file diff --git a/src/Hl7.Fhir.Base/Model/Generated/Attachment.cs b/src/Hl7.Fhir.Base/Model/Generated/Attachment.cs index 41c6164ddb..868c078d66 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Attachment.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Attachment.cs @@ -209,7 +209,7 @@ public string Url if (value == null) UrlElement = null; else - UrlElement = new Hl7.Fhir.Model.FhirUri(value); + UrlElement = new Hl7.Fhir.Model.FhirUrl(value); OnPropertyChanged("Url"); } } @@ -536,7 +536,7 @@ public int? Pages } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Attachment; @@ -545,26 +545,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy(); - if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.Base64Binary)DataElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.PrimitiveType)UrlElement.DeepCopy(); - if(SizeElement != null) dest.SizeElement = (Hl7.Fhir.Model.PrimitiveType)SizeElement.DeepCopy(); - if(HashElement != null) dest.HashElement = (Hl7.Fhir.Model.Base64Binary)HashElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(CreationElement != null) dest.CreationElement = (Hl7.Fhir.Model.FhirDateTime)CreationElement.DeepCopy(); - if(HeightElement != null) dest.HeightElement = (Hl7.Fhir.Model.PositiveInt)HeightElement.DeepCopy(); - if(WidthElement != null) dest.WidthElement = (Hl7.Fhir.Model.PositiveInt)WidthElement.DeepCopy(); - if(FramesElement != null) dest.FramesElement = (Hl7.Fhir.Model.PositiveInt)FramesElement.DeepCopy(); - if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopy(); - if(PagesElement != null) dest.PagesElement = (Hl7.Fhir.Model.PositiveInt)PagesElement.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Attachment()); + base.CopyToInternal(dest); + if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopyInternal(); + if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.Base64Binary)DataElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.PrimitiveType)UrlElement.DeepCopyInternal(); + if(SizeElement != null) dest.SizeElement = (Hl7.Fhir.Model.PrimitiveType)SizeElement.DeepCopyInternal(); + if(HashElement != null) dest.HashElement = (Hl7.Fhir.Model.Base64Binary)HashElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(CreationElement != null) dest.CreationElement = (Hl7.Fhir.Model.FhirDateTime)CreationElement.DeepCopyInternal(); + if(HeightElement != null) dest.HeightElement = (Hl7.Fhir.Model.PositiveInt)HeightElement.DeepCopyInternal(); + if(WidthElement != null) dest.WidthElement = (Hl7.Fhir.Model.PositiveInt)WidthElement.DeepCopyInternal(); + if(FramesElement != null) dest.FramesElement = (Hl7.Fhir.Model.PositiveInt)FramesElement.DeepCopyInternal(); + if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopyInternal(); + if(PagesElement != null) dest.PagesElement = (Hl7.Fhir.Model.PositiveInt)PagesElement.DeepCopyInternal(); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Attachment(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/BackboneElement.cs b/src/Hl7.Fhir.Base/Model/Generated/BackboneElement.cs index fe68997deb..15ec37a82c 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/BackboneElement.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/BackboneElement.cs @@ -68,7 +68,7 @@ public List ModifierExtension private List _ModifierExtension; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BackboneElement; @@ -77,9 +77,8 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModifierExtension.Any()) dest.ModifierExtension = new List(ModifierExtension.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ModifierExtension.Any()) dest.ModifierExtension = new List(ModifierExtension.DeepCopyInternal()); } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/BackboneType.cs b/src/Hl7.Fhir.Base/Model/Generated/BackboneType.cs index 1db25fedeb..fea1afd059 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/BackboneType.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/BackboneType.cs @@ -68,7 +68,7 @@ public List ModifierExtension private List _ModifierExtension; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BackboneType; @@ -77,9 +77,8 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModifierExtension.Any()) dest.ModifierExtension = new List(ModifierExtension.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ModifierExtension.Any()) dest.ModifierExtension = new List(ModifierExtension.DeepCopyInternal()); } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Base.cs b/src/Hl7.Fhir.Base/Model/Generated/Base.cs index 7f8dbee2eb..6ebbce7f19 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Base.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Base.cs @@ -54,7 +54,7 @@ namespace Hl7.Fhir.Model [FhirType("Base","http://hl7.org/fhir/StructureDefinition/Base")] public abstract partial class Base { - public virtual IDeepCopyable CopyTo(IDeepCopyable other) + protected internal virtual void CopyToInternal(Base other) { var dest = other as Base; @@ -66,11 +66,11 @@ public virtual IDeepCopyable CopyTo(IDeepCopyable other) if (_annotations is not null) dest.annotations.AddRange(annotations); - return dest; + if (Overflow.Any()) + Overflow.CopyToInternal(dest.Overflow); } - public virtual IDeepCopyable DeepCopy() => - CopyTo((IDeepCopyable)Activator.CreateInstance(GetType())!); + protected internal abstract Base DeepCopyInternal(); } diff --git a/src/Hl7.Fhir.Base/Model/Generated/Base64Binary.cs b/src/Hl7.Fhir.Base/Model/Generated/Base64Binary.cs index c063064049..4b347a4856 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Base64Binary.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Base64Binary.cs @@ -80,6 +80,13 @@ public byte[] Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new Base64Binary(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/Binary.cs b/src/Hl7.Fhir.Base/Model/Generated/Binary.cs index 8a30a85755..74db8051e9 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Binary.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Binary.cs @@ -180,7 +180,7 @@ public byte[] Data } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Binary; @@ -189,17 +189,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopy(); - if(SecurityContext != null) dest.SecurityContext = (Hl7.Fhir.Model.ResourceReference)SecurityContext.DeepCopy(); - if(ContentElement != null) dest.ContentElement = (Hl7.Fhir.Model.Base64Binary)ContentElement.DeepCopy(); - if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.Base64Binary)DataElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopyInternal(); + if(SecurityContext != null) dest.SecurityContext = (Hl7.Fhir.Model.ResourceReference)SecurityContext.DeepCopyInternal(); + if(ContentElement != null) dest.ContentElement = (Hl7.Fhir.Model.Base64Binary)ContentElement.DeepCopyInternal(); + if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.Base64Binary)DataElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Binary()); + var instance = new Binary(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Bundle.cs b/src/Hl7.Fhir.Base/Model/Generated/Bundle.cs index 4de9a4ffc7..d2d5e91288 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Bundle.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Bundle.cs @@ -1045,7 +1045,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -1054,15 +1054,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RelationElement != null) dest.RelationElement = (Hl7.Fhir.Model.PrimitiveType)RelationElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RelationElement != null) dest.RelationElement = (Hl7.Fhir.Model.PrimitiveType)RelationElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1233,7 +1234,7 @@ public Hl7.Fhir.Model.Bundle.ResponseComponent Response private Hl7.Fhir.Model.Bundle.ResponseComponent _Response; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EntryComponent; @@ -1242,19 +1243,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - if(FullUrlElement != null) dest.FullUrlElement = (Hl7.Fhir.Model.FhirUri)FullUrlElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.Resource)Resource.DeepCopy(); - if(Search != null) dest.Search = (Hl7.Fhir.Model.Bundle.SearchComponent)Search.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.Bundle.RequestComponent)Request.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.Bundle.ResponseComponent)Response.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); + if(FullUrlElement != null) dest.FullUrlElement = (Hl7.Fhir.Model.FhirUri)FullUrlElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.Resource)Resource.DeepCopyInternal(); + if(Search != null) dest.Search = (Hl7.Fhir.Model.Bundle.SearchComponent)Search.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.Bundle.RequestComponent)Request.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.Bundle.ResponseComponent)Response.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EntryComponent()); + var instance = new EntryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1422,7 +1424,7 @@ public decimal? Score } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SearchComponent; @@ -1431,15 +1433,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(ScoreElement != null) dest.ScoreElement = (Hl7.Fhir.Model.FhirDecimal)ScoreElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(ScoreElement != null) dest.ScoreElement = (Hl7.Fhir.Model.FhirDecimal)ScoreElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SearchComponent()); + var instance = new SearchComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1701,7 +1704,7 @@ public string IfNoneExist } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequestComponent; @@ -1710,19 +1713,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MethodElement != null) dest.MethodElement = (Code)MethodElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(IfNoneMatchElement != null) dest.IfNoneMatchElement = (Hl7.Fhir.Model.FhirString)IfNoneMatchElement.DeepCopy(); - if(IfModifiedSinceElement != null) dest.IfModifiedSinceElement = (Hl7.Fhir.Model.Instant)IfModifiedSinceElement.DeepCopy(); - if(IfMatchElement != null) dest.IfMatchElement = (Hl7.Fhir.Model.FhirString)IfMatchElement.DeepCopy(); - if(IfNoneExistElement != null) dest.IfNoneExistElement = (Hl7.Fhir.Model.FhirString)IfNoneExistElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MethodElement != null) dest.MethodElement = (Code)MethodElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(IfNoneMatchElement != null) dest.IfNoneMatchElement = (Hl7.Fhir.Model.FhirString)IfNoneMatchElement.DeepCopyInternal(); + if(IfModifiedSinceElement != null) dest.IfModifiedSinceElement = (Hl7.Fhir.Model.Instant)IfModifiedSinceElement.DeepCopyInternal(); + if(IfMatchElement != null) dest.IfMatchElement = (Hl7.Fhir.Model.FhirString)IfMatchElement.DeepCopyInternal(); + if(IfNoneExistElement != null) dest.IfNoneExistElement = (Hl7.Fhir.Model.FhirString)IfNoneExistElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequestComponent()); + var instance = new RequestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1966,7 +1970,7 @@ public Hl7.Fhir.Model.Resource Outcome private Hl7.Fhir.Model.Resource _Outcome; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResponseComponent; @@ -1975,18 +1979,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Hl7.Fhir.Model.FhirString)StatusElement.DeepCopy(); - if(LocationElement != null) dest.LocationElement = (Hl7.Fhir.Model.FhirUri)LocationElement.DeepCopy(); - if(EtagElement != null) dest.EtagElement = (Hl7.Fhir.Model.FhirString)EtagElement.DeepCopy(); - if(LastModifiedElement != null) dest.LastModifiedElement = (Hl7.Fhir.Model.Instant)LastModifiedElement.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.Resource)Outcome.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Hl7.Fhir.Model.FhirString)StatusElement.DeepCopyInternal(); + if(LocationElement != null) dest.LocationElement = (Hl7.Fhir.Model.FhirUri)LocationElement.DeepCopyInternal(); + if(EtagElement != null) dest.EtagElement = (Hl7.Fhir.Model.FhirString)EtagElement.DeepCopyInternal(); + if(LastModifiedElement != null) dest.LastModifiedElement = (Hl7.Fhir.Model.Instant)LastModifiedElement.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.Resource)Outcome.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResponseComponent()); + var instance = new ResponseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2239,7 +2244,7 @@ public Hl7.Fhir.Model.Resource Issues Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Bundle; @@ -2248,21 +2253,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TimestampElement != null) dest.TimestampElement = (Hl7.Fhir.Model.Instant)TimestampElement.DeepCopy(); - if(TotalElement != null) dest.TotalElement = (Hl7.Fhir.Model.UnsignedInt)TotalElement.DeepCopy(); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - if(Entry.Any()) dest.Entry = new List(Entry.DeepCopy()); - if(Signature != null) dest.Signature = (Hl7.Fhir.Model.Signature)Signature.DeepCopy(); - if(Issues != null) dest.Issues = (Hl7.Fhir.Model.Resource)Issues.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TimestampElement != null) dest.TimestampElement = (Hl7.Fhir.Model.Instant)TimestampElement.DeepCopyInternal(); + if(TotalElement != null) dest.TotalElement = (Hl7.Fhir.Model.UnsignedInt)TotalElement.DeepCopyInternal(); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); + if(Entry.Any()) dest.Entry = new List(Entry.DeepCopyInternal()); + if(Signature != null) dest.Signature = (Hl7.Fhir.Model.Signature)Signature.DeepCopyInternal(); + if(Issues != null) dest.Issues = (Hl7.Fhir.Model.Resource)Issues.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Bundle()); + var instance = new Bundle(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Canonical.cs b/src/Hl7.Fhir.Base/Model/Generated/Canonical.cs index 87930bf419..4138a22616 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Canonical.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Canonical.cs @@ -80,6 +80,13 @@ public string Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new Canonical(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/Code.cs b/src/Hl7.Fhir.Base/Model/Generated/Code.cs index dcf7dc898e..77110d05f5 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Code.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Code.cs @@ -78,6 +78,13 @@ public string Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new Code(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/CodeableConcept.cs b/src/Hl7.Fhir.Base/Model/Generated/CodeableConcept.cs index d92c3d87c0..dab9d114e7 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/CodeableConcept.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/CodeableConcept.cs @@ -105,7 +105,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeableConcept; @@ -114,15 +114,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Coding.Any()) dest.Coding = new List(Coding.DeepCopy()); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Coding.Any()) dest.Coding = new List(Coding.DeepCopyInternal()); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CodeableConcept()); + var instance = new CodeableConcept(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/CodeableReference.cs b/src/Hl7.Fhir.Base/Model/Generated/CodeableReference.cs index 4a88977de5..05dd1da8ac 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/CodeableReference.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/CodeableReference.cs @@ -85,7 +85,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeableReference; @@ -94,15 +94,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Concept != null) dest.Concept = (Hl7.Fhir.Model.CodeableConcept)Concept.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Concept != null) dest.Concept = (Hl7.Fhir.Model.CodeableConcept)Concept.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CodeableReference()); + var instance = new CodeableReference(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Coding.cs b/src/Hl7.Fhir.Base/Model/Generated/Coding.cs index 82f5a4ca56..7466b0f9e4 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Coding.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Coding.cs @@ -214,7 +214,7 @@ public bool? UserSelected } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Coding; @@ -223,18 +223,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(UserSelectedElement != null) dest.UserSelectedElement = (Hl7.Fhir.Model.FhirBoolean)UserSelectedElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(UserSelectedElement != null) dest.UserSelectedElement = (Hl7.Fhir.Model.FhirBoolean)UserSelectedElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Coding()); + var instance = new Coding(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/ContactDetail.cs b/src/Hl7.Fhir.Base/Model/Generated/ContactDetail.cs index 27974d58bf..5bccaba8b9 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/ContactDetail.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/ContactDetail.cs @@ -104,7 +104,7 @@ public List Telecom private List _Telecom; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContactDetail; @@ -113,15 +113,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContactDetail()); + var instance = new ContactDetail(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/ContactPoint.cs b/src/Hl7.Fhir.Base/Model/Generated/ContactPoint.cs index fa66301f6d..0e145ac89e 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/ContactPoint.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/ContactPoint.cs @@ -292,7 +292,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContactPoint; @@ -301,18 +301,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SystemElement != null) dest.SystemElement = (Code)SystemElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SystemElement != null) dest.SystemElement = (Code)SystemElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContactPoint()); + var instance = new ContactPoint(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/DataType.cs b/src/Hl7.Fhir.Base/Model/Generated/DataType.cs index a4d370faeb..26b0a62e07 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/DataType.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/DataType.cs @@ -54,7 +54,7 @@ namespace Hl7.Fhir.Model [FhirType("DataType","http://hl7.org/fhir/StructureDefinition/DataType")] public abstract partial class DataType : Hl7.Fhir.Model.Element { - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DataType; @@ -63,8 +63,7 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - return dest; + base.CopyToInternal(dest); } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Date.cs b/src/Hl7.Fhir.Base/Model/Generated/Date.cs index 08a8fecb73..89b1e6a367 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Date.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Date.cs @@ -78,6 +78,13 @@ public string Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new Date(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/DomainResource.cs b/src/Hl7.Fhir.Base/Model/Generated/DomainResource.cs index 052eb0fabe..b50e9962a8 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/DomainResource.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/DomainResource.cs @@ -111,7 +111,7 @@ public List ModifierExtension private List _ModifierExtension; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DomainResource; @@ -120,12 +120,11 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopy(); - if(Contained.Any()) dest.Contained = new List(Contained.DeepCopy()); - if(Extension.Any()) dest.Extension = new List(Extension.DeepCopy()); - if(ModifierExtension.Any()) dest.ModifierExtension = new List(ModifierExtension.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopyInternal(); + if(Contained.Any()) dest.Contained = new List(Contained.DeepCopyInternal()); + if(Extension.Any()) dest.Extension = new List(Extension.DeepCopyInternal()); + if(ModifierExtension.Any()) dest.ModifierExtension = new List(ModifierExtension.DeepCopyInternal()); } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Element.cs b/src/Hl7.Fhir.Base/Model/Generated/Element.cs index e5c800ca72..b786796903 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Element.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Element.cs @@ -99,7 +99,7 @@ public List Extension private List _Extension; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Element; @@ -108,10 +108,9 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ElementIdElement != null) dest.ElementIdElement = (Hl7.Fhir.Model.FhirString)ElementIdElement.DeepCopy(); - if(Extension.Any()) dest.Extension = new List(Extension.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ElementIdElement != null) dest.ElementIdElement = (Hl7.Fhir.Model.FhirString)ElementIdElement.DeepCopyInternal(); + if(Extension.Any()) dest.Extension = new List(Extension.DeepCopyInternal()); } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Extension.cs b/src/Hl7.Fhir.Base/Model/Generated/Extension.cs index c120a6d2b0..c0deb98418 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Extension.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Extension.cs @@ -104,7 +104,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Extension; @@ -113,15 +113,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Extension()); + var instance = new Extension(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/FhirBoolean.cs b/src/Hl7.Fhir.Base/Model/Generated/FhirBoolean.cs index ff9819cb71..a240bcca1d 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/FhirBoolean.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/FhirBoolean.cs @@ -77,6 +77,13 @@ public bool? Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new FhirBoolean(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/FhirDateTime.cs b/src/Hl7.Fhir.Base/Model/Generated/FhirDateTime.cs index 1ba1041d5a..9b00de76dc 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/FhirDateTime.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/FhirDateTime.cs @@ -81,6 +81,13 @@ public string Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new FhirDateTime(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/FhirDecimal.cs b/src/Hl7.Fhir.Base/Model/Generated/FhirDecimal.cs index 26a030c60f..fc5dc9574b 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/FhirDecimal.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/FhirDecimal.cs @@ -80,6 +80,13 @@ public decimal? Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new FhirDecimal(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/FhirString.cs b/src/Hl7.Fhir.Base/Model/Generated/FhirString.cs index 97314770a4..3355a04713 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/FhirString.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/FhirString.cs @@ -81,6 +81,13 @@ public string Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new FhirString(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/FhirUri.cs b/src/Hl7.Fhir.Base/Model/Generated/FhirUri.cs index 5582ada55a..1c724187e9 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/FhirUri.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/FhirUri.cs @@ -81,6 +81,13 @@ public string Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new FhirUri(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/FhirUrl.cs b/src/Hl7.Fhir.Base/Model/Generated/FhirUrl.cs index 7f898322ae..1463daae04 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/FhirUrl.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/FhirUrl.cs @@ -77,6 +77,13 @@ public string Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new FhirUrl(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/Id.cs b/src/Hl7.Fhir.Base/Model/Generated/Id.cs index 23ef65aaed..ead6728688 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Id.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Id.cs @@ -81,6 +81,13 @@ public string Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new Id(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/Identifier.cs b/src/Hl7.Fhir.Base/Model/Generated/Identifier.cs index 9f5cc00f97..33d6a0bf29 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Identifier.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Identifier.cs @@ -237,7 +237,7 @@ public Hl7.Fhir.Model.ResourceReference Assigner private Hl7.Fhir.Model.ResourceReference _Assigner; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Identifier; @@ -246,19 +246,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Assigner != null) dest.Assigner = (Hl7.Fhir.Model.ResourceReference)Assigner.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Assigner != null) dest.Assigner = (Hl7.Fhir.Model.ResourceReference)Assigner.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Identifier()); + var instance = new Identifier(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Instant.cs b/src/Hl7.Fhir.Base/Model/Generated/Instant.cs index 503acf7736..7a814bd780 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Instant.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Instant.cs @@ -80,6 +80,13 @@ public DateTimeOffset? Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new Instant(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/Integer.cs b/src/Hl7.Fhir.Base/Model/Generated/Integer.cs index e734e5a402..d2ddc68f32 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Integer.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Integer.cs @@ -80,6 +80,13 @@ public int? Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new Integer(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/Integer64.cs b/src/Hl7.Fhir.Base/Model/Generated/Integer64.cs index 6770b88deb..8f637d900a 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Integer64.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Integer64.cs @@ -88,6 +88,13 @@ public long? Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new Integer64(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/Markdown.cs b/src/Hl7.Fhir.Base/Model/Generated/Markdown.cs index 5fc6061a64..257bfba625 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Markdown.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Markdown.cs @@ -81,6 +81,13 @@ public string Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new Markdown(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/Meta.cs b/src/Hl7.Fhir.Base/Model/Generated/Meta.cs index 1f6a94bc5e..e3e628bd03 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Meta.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Meta.cs @@ -245,7 +245,7 @@ public List Tag private List _Tag; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Meta; @@ -254,19 +254,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(VersionIdElement != null) dest.VersionIdElement = (Hl7.Fhir.Model.Id)VersionIdElement.DeepCopy(); - if(LastUpdatedElement != null) dest.LastUpdatedElement = (Hl7.Fhir.Model.Instant)LastUpdatedElement.DeepCopy(); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopy(); - if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopy()); - if(Security.Any()) dest.Security = new List(Security.DeepCopy()); - if(Tag.Any()) dest.Tag = new List(Tag.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(VersionIdElement != null) dest.VersionIdElement = (Hl7.Fhir.Model.Id)VersionIdElement.DeepCopyInternal(); + if(LastUpdatedElement != null) dest.LastUpdatedElement = (Hl7.Fhir.Model.Instant)LastUpdatedElement.DeepCopyInternal(); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopyInternal(); + if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopyInternal()); + if(Security.Any()) dest.Security = new List(Security.DeepCopyInternal()); + if(Tag.Any()) dest.Tag = new List(Tag.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Meta()); + var instance = new Meta(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Narrative.cs b/src/Hl7.Fhir.Base/Model/Generated/Narrative.cs index 12eeb53163..71e0fbc1bc 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Narrative.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Narrative.cs @@ -159,7 +159,7 @@ public string Div } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Narrative; @@ -168,15 +168,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DivElement != null) dest.DivElement = (Hl7.Fhir.Model.XHtml)DivElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DivElement != null) dest.DivElement = (Hl7.Fhir.Model.XHtml)DivElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Narrative()); + var instance = new Narrative(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Oid.cs b/src/Hl7.Fhir.Base/Model/Generated/Oid.cs index 89833cd9ba..48fe22bdd4 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Oid.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Oid.cs @@ -81,6 +81,13 @@ public string Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new Oid(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/OperationOutcome.cs b/src/Hl7.Fhir.Base/Model/Generated/OperationOutcome.cs index bbf2b00805..41e8a59a5a 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/OperationOutcome.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/OperationOutcome.cs @@ -502,7 +502,7 @@ public IEnumerable Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IssueComponent; @@ -511,19 +511,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Details != null) dest.Details = (Hl7.Fhir.Model.CodeableConcept)Details.DeepCopy(); - if(DiagnosticsElement != null) dest.DiagnosticsElement = (Hl7.Fhir.Model.FhirString)DiagnosticsElement.DeepCopy(); - if(LocationElement.Any()) dest.LocationElement = new List(LocationElement.DeepCopy()); - if(ExpressionElement.Any()) dest.ExpressionElement = new List(ExpressionElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Details != null) dest.Details = (Hl7.Fhir.Model.CodeableConcept)Details.DeepCopyInternal(); + if(DiagnosticsElement != null) dest.DiagnosticsElement = (Hl7.Fhir.Model.FhirString)DiagnosticsElement.DeepCopyInternal(); + if(LocationElement.Any()) dest.LocationElement = new List(LocationElement.DeepCopyInternal()); + if(ExpressionElement.Any()) dest.ExpressionElement = new List(ExpressionElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IssueComponent()); + var instance = new IssueComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -625,7 +626,7 @@ public List Issue private List _Issue; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationOutcome; @@ -634,14 +635,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Issue.Any()) dest.Issue = new List(Issue.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Issue.Any()) dest.Issue = new List(Issue.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationOutcome()); + var instance = new OperationOutcome(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Parameters.cs b/src/Hl7.Fhir.Base/Model/Generated/Parameters.cs index 1b05f84cb6..414d6b4a36 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Parameters.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Parameters.cs @@ -150,7 +150,7 @@ public List Part private List _Part; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -159,17 +159,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.Resource)Resource.DeepCopy(); - if(Part.Any()) dest.Part = new List(Part.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.Resource)Resource.DeepCopyInternal(); + if(Part.Any()) dest.Part = new List(Part.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -255,7 +256,7 @@ public List Parameter private List _Parameter; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Parameters; @@ -264,14 +265,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Parameters()); + var instance = new Parameters(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Period.cs b/src/Hl7.Fhir.Base/Model/Generated/Period.cs index a90bb53cc6..78663099fa 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Period.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Period.cs @@ -123,7 +123,7 @@ public string End } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Period; @@ -132,15 +132,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.FhirDateTime)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.FhirDateTime)EndElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.FhirDateTime)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.FhirDateTime)EndElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Period()); + var instance = new Period(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/PositiveInt.cs b/src/Hl7.Fhir.Base/Model/Generated/PositiveInt.cs index 2a8cb76e31..18eacf29a8 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/PositiveInt.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/PositiveInt.cs @@ -77,6 +77,13 @@ public int? Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new PositiveInt(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/PrimitiveType.cs b/src/Hl7.Fhir.Base/Model/Generated/PrimitiveType.cs index 837568f786..85ea439959 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/PrimitiveType.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/PrimitiveType.cs @@ -54,7 +54,7 @@ namespace Hl7.Fhir.Model [FhirType("PrimitiveType","http://hl7.org/fhir/StructureDefinition/PrimitiveType")] public abstract partial class PrimitiveType : Hl7.Fhir.Model.DataType { - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PrimitiveType; @@ -63,9 +63,8 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); + base.CopyToInternal(dest); if (ObjectValue != null) dest.ObjectValue = ObjectValue; - return dest; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Quantity.cs b/src/Hl7.Fhir.Base/Model/Generated/Quantity.cs index 9ca92263ce..32a139214f 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Quantity.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Quantity.cs @@ -257,7 +257,7 @@ public string Code } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Quantity; @@ -266,18 +266,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy(); - if(ComparatorElement != null) dest.ComparatorElement = (Code)ComparatorElement.DeepCopy(); - if(UnitElement != null) dest.UnitElement = (Hl7.Fhir.Model.FhirString)UnitElement.DeepCopy(); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopyInternal(); + if(ComparatorElement != null) dest.ComparatorElement = (Code)ComparatorElement.DeepCopyInternal(); + if(UnitElement != null) dest.UnitElement = (Hl7.Fhir.Model.FhirString)UnitElement.DeepCopyInternal(); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Quantity()); + var instance = new Quantity(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Range.cs b/src/Hl7.Fhir.Base/Model/Generated/Range.cs index f9812130e0..4fa7f408f7 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Range.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Range.cs @@ -86,7 +86,7 @@ public Hl7.Fhir.Model.Quantity High private Hl7.Fhir.Model.Quantity _High; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Range; @@ -95,15 +95,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Low != null) dest.Low = (Hl7.Fhir.Model.Quantity)Low.DeepCopy(); - if(High != null) dest.High = (Hl7.Fhir.Model.Quantity)High.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Low != null) dest.Low = (Hl7.Fhir.Model.Quantity)Low.DeepCopyInternal(); + if(High != null) dest.High = (Hl7.Fhir.Model.Quantity)High.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Range()); + var instance = new Range(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Resource.cs b/src/Hl7.Fhir.Base/Model/Generated/Resource.cs index 0916f94a4c..f2bb8c35f4 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Resource.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Resource.cs @@ -161,7 +161,7 @@ public string Language } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Resource; @@ -170,12 +170,11 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IdElement != null) dest.IdElement = (Hl7.Fhir.Model.Id)IdElement.DeepCopy(); - if(Meta != null) dest.Meta = (Hl7.Fhir.Model.Meta)Meta.DeepCopy(); - if(ImplicitRulesElement != null) dest.ImplicitRulesElement = (Hl7.Fhir.Model.FhirUri)ImplicitRulesElement.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IdElement != null) dest.IdElement = (Hl7.Fhir.Model.Id)IdElement.DeepCopyInternal(); + if(Meta != null) dest.Meta = (Hl7.Fhir.Model.Meta)Meta.DeepCopyInternal(); + if(ImplicitRulesElement != null) dest.ImplicitRulesElement = (Hl7.Fhir.Model.FhirUri)ImplicitRulesElement.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopyInternal(); } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/ResourceReference.cs b/src/Hl7.Fhir.Base/Model/Generated/ResourceReference.cs index 192f412a68..d6b157a029 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/ResourceReference.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/ResourceReference.cs @@ -169,7 +169,7 @@ public string Display } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceReference; @@ -178,17 +178,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirString)ReferenceElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirUri)TypeElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirString)ReferenceElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirUri)TypeElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceReference()); + var instance = new ResourceReference(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Signature.cs b/src/Hl7.Fhir.Base/Model/Generated/Signature.cs index 54a5fb751b..e14001a326 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Signature.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Signature.cs @@ -332,7 +332,7 @@ public byte[] Data } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Signature; @@ -341,22 +341,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(WhenElement != null) dest.WhenElement = (Hl7.Fhir.Model.Instant)WhenElement.DeepCopy(); - if(Who != null) dest.Who = (Hl7.Fhir.Model.DataType)Who.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.DataType)OnBehalfOf.DeepCopy(); - if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopy(); - if(TargetFormatElement != null) dest.TargetFormatElement = (Hl7.Fhir.Model.Code)TargetFormatElement.DeepCopy(); - if(SigFormatElement != null) dest.SigFormatElement = (Hl7.Fhir.Model.Code)SigFormatElement.DeepCopy(); - if(BlobElement != null) dest.BlobElement = (Hl7.Fhir.Model.Base64Binary)BlobElement.DeepCopy(); - if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.Base64Binary)DataElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(WhenElement != null) dest.WhenElement = (Hl7.Fhir.Model.Instant)WhenElement.DeepCopyInternal(); + if(Who != null) dest.Who = (Hl7.Fhir.Model.DataType)Who.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.DataType)OnBehalfOf.DeepCopyInternal(); + if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopyInternal(); + if(TargetFormatElement != null) dest.TargetFormatElement = (Hl7.Fhir.Model.Code)TargetFormatElement.DeepCopyInternal(); + if(SigFormatElement != null) dest.SigFormatElement = (Hl7.Fhir.Model.Code)SigFormatElement.DeepCopyInternal(); + if(BlobElement != null) dest.BlobElement = (Hl7.Fhir.Model.Base64Binary)BlobElement.DeepCopyInternal(); + if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.Base64Binary)DataElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Signature()); + var instance = new Signature(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Time.cs b/src/Hl7.Fhir.Base/Model/Generated/Time.cs index 789f2bb764..fa9e930ca8 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Time.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Time.cs @@ -78,6 +78,13 @@ public string Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new Time(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/UnsignedInt.cs b/src/Hl7.Fhir.Base/Model/Generated/UnsignedInt.cs index d9f30914ac..f351637ec7 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/UnsignedInt.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/UnsignedInt.cs @@ -77,6 +77,13 @@ public int? Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new UnsignedInt(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/UsageContext.cs b/src/Hl7.Fhir.Base/Model/Generated/UsageContext.cs index f61a70aacb..8d621423a0 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/UsageContext.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/UsageContext.cs @@ -92,7 +92,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UsageContext; @@ -101,15 +101,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.Coding)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.Coding)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UsageContext()); + var instance = new UsageContext(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Base/Model/Generated/Uuid.cs b/src/Hl7.Fhir.Base/Model/Generated/Uuid.cs index 7bfb3e9c65..d9e34d00ca 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/Uuid.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/Uuid.cs @@ -81,6 +81,13 @@ public string Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new Uuid(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Base/Model/Generated/XHtml.cs b/src/Hl7.Fhir.Base/Model/Generated/XHtml.cs index 869229ed93..e7d4933c45 100644 --- a/src/Hl7.Fhir.Base/Model/Generated/XHtml.cs +++ b/src/Hl7.Fhir.Base/Model/Generated/XHtml.cs @@ -75,6 +75,13 @@ public string Value set { ObjectValue = value; OnPropertyChanged("Value"); } } + protected internal override Base DeepCopyInternal() + { + var instance = new XHtml(); + CopyToInternal(instance); + return instance; + } + } } diff --git a/src/Hl7.Fhir.Conformance/Model/Generated/CapabilityStatement.cs b/src/Hl7.Fhir.Conformance/Model/Generated/CapabilityStatement.cs index be808b6114..29f1d42721 100644 --- a/src/Hl7.Fhir.Conformance/Model/Generated/CapabilityStatement.cs +++ b/src/Hl7.Fhir.Conformance/Model/Generated/CapabilityStatement.cs @@ -464,7 +464,7 @@ public string ReleaseDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SoftwareComponent; @@ -473,16 +473,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(ReleaseDateElement != null) dest.ReleaseDateElement = (Hl7.Fhir.Model.FhirDateTime)ReleaseDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(ReleaseDateElement != null) dest.ReleaseDateElement = (Hl7.Fhir.Model.FhirDateTime)ReleaseDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SoftwareComponent()); + var instance = new SoftwareComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -668,7 +669,7 @@ public Hl7.Fhir.Model.ResourceReference Custodian private Hl7.Fhir.Model.ResourceReference _Custodian; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImplementationComponent; @@ -677,16 +678,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.PrimitiveType)DescriptionElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopy(); - if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.PrimitiveType)DescriptionElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopyInternal(); + if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImplementationComponent()); + var instance = new ImplementationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -933,7 +935,7 @@ public IEnumerable Compartment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RestComponent; @@ -942,21 +944,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopy(); - if(Security != null) dest.Security = (Hl7.Fhir.Model.CapabilityStatement.SecurityComponent)Security.DeepCopy(); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - if(Interaction.Any()) dest.Interaction = new List(Interaction.DeepCopy()); - if(SearchParam.Any()) dest.SearchParam = new List(SearchParam.DeepCopy()); - if(Operation.Any()) dest.Operation = new List(Operation.DeepCopy()); - if(CompartmentElement.Any()) dest.CompartmentElement = new List(CompartmentElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopyInternal(); + if(Security != null) dest.Security = (Hl7.Fhir.Model.CapabilityStatement.SecurityComponent)Security.DeepCopyInternal(); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); + if(Interaction.Any()) dest.Interaction = new List(Interaction.DeepCopyInternal()); + if(SearchParam.Any()) dest.SearchParam = new List(SearchParam.DeepCopyInternal()); + if(Operation.Any()) dest.Operation = new List(Operation.DeepCopyInternal()); + if(CompartmentElement.Any()) dest.CompartmentElement = new List(CompartmentElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RestComponent()); + var instance = new RestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1153,7 +1156,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SecurityComponent; @@ -1162,16 +1165,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CorsElement != null) dest.CorsElement = (Hl7.Fhir.Model.FhirBoolean)CorsElement.DeepCopy(); - if(Service.Any()) dest.Service = new List(Service.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CorsElement != null) dest.CorsElement = (Hl7.Fhir.Model.FhirBoolean)CorsElement.DeepCopyInternal(); + if(Service.Any()) dest.Service = new List(Service.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SecurityComponent()); + var instance = new SecurityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1776,7 +1780,7 @@ public List Operation private List _Operation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceComponent; @@ -1785,31 +1789,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.Code)TypeElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - if(SupportedProfileElement.Any()) dest.SupportedProfileElement = new List(SupportedProfileElement.DeepCopy()); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopy(); - if(Interaction.Any()) dest.Interaction = new List(Interaction.DeepCopy()); - if(VersioningElement != null) dest.VersioningElement = (Code)VersioningElement.DeepCopy(); - if(ReadHistoryElement != null) dest.ReadHistoryElement = (Hl7.Fhir.Model.FhirBoolean)ReadHistoryElement.DeepCopy(); - if(UpdateCreateElement != null) dest.UpdateCreateElement = (Hl7.Fhir.Model.FhirBoolean)UpdateCreateElement.DeepCopy(); - if(ConditionalCreateElement != null) dest.ConditionalCreateElement = (Hl7.Fhir.Model.FhirBoolean)ConditionalCreateElement.DeepCopy(); - if(ConditionalReadElement != null) dest.ConditionalReadElement = (Code)ConditionalReadElement.DeepCopy(); - if(ConditionalUpdateElement != null) dest.ConditionalUpdateElement = (Hl7.Fhir.Model.FhirBoolean)ConditionalUpdateElement.DeepCopy(); - if(ConditionalPatchElement != null) dest.ConditionalPatchElement = (Hl7.Fhir.Model.FhirBoolean)ConditionalPatchElement.DeepCopy(); - if(ConditionalDeleteElement != null) dest.ConditionalDeleteElement = (Code)ConditionalDeleteElement.DeepCopy(); - if(ReferencePolicyElement.Any()) dest.ReferencePolicyElement = new List>(ReferencePolicyElement.DeepCopy()); - if(SearchIncludeElement.Any()) dest.SearchIncludeElement = new List(SearchIncludeElement.DeepCopy()); - if(SearchRevIncludeElement.Any()) dest.SearchRevIncludeElement = new List(SearchRevIncludeElement.DeepCopy()); - if(SearchParam.Any()) dest.SearchParam = new List(SearchParam.DeepCopy()); - if(Operation.Any()) dest.Operation = new List(Operation.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ResourceComponent()); + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.Code)TypeElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); + if(SupportedProfileElement.Any()) dest.SupportedProfileElement = new List(SupportedProfileElement.DeepCopyInternal()); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopyInternal(); + if(Interaction.Any()) dest.Interaction = new List(Interaction.DeepCopyInternal()); + if(VersioningElement != null) dest.VersioningElement = (Code)VersioningElement.DeepCopyInternal(); + if(ReadHistoryElement != null) dest.ReadHistoryElement = (Hl7.Fhir.Model.FhirBoolean)ReadHistoryElement.DeepCopyInternal(); + if(UpdateCreateElement != null) dest.UpdateCreateElement = (Hl7.Fhir.Model.FhirBoolean)UpdateCreateElement.DeepCopyInternal(); + if(ConditionalCreateElement != null) dest.ConditionalCreateElement = (Hl7.Fhir.Model.FhirBoolean)ConditionalCreateElement.DeepCopyInternal(); + if(ConditionalReadElement != null) dest.ConditionalReadElement = (Code)ConditionalReadElement.DeepCopyInternal(); + if(ConditionalUpdateElement != null) dest.ConditionalUpdateElement = (Hl7.Fhir.Model.FhirBoolean)ConditionalUpdateElement.DeepCopyInternal(); + if(ConditionalPatchElement != null) dest.ConditionalPatchElement = (Hl7.Fhir.Model.FhirBoolean)ConditionalPatchElement.DeepCopyInternal(); + if(ConditionalDeleteElement != null) dest.ConditionalDeleteElement = (Code)ConditionalDeleteElement.DeepCopyInternal(); + if(ReferencePolicyElement.Any()) dest.ReferencePolicyElement = new List>(ReferencePolicyElement.DeepCopyInternal()); + if(SearchIncludeElement.Any()) dest.SearchIncludeElement = new List(SearchIncludeElement.DeepCopyInternal()); + if(SearchRevIncludeElement.Any()) dest.SearchRevIncludeElement = new List(SearchRevIncludeElement.DeepCopyInternal()); + if(SearchParam.Any()) dest.SearchParam = new List(SearchParam.DeepCopyInternal()); + if(Operation.Any()) dest.Operation = new List(Operation.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2075,7 +2080,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceInteractionComponent; @@ -2084,15 +2089,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceInteractionComponent()); + var instance = new ResourceInteractionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2293,7 +2299,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SearchParamComponent; @@ -2302,17 +2308,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SearchParamComponent()); + var instance = new SearchParamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2497,7 +2504,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -2506,16 +2513,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationComponent()); + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2660,7 +2668,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SystemInteractionComponent; @@ -2669,15 +2677,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SystemInteractionComponent()); + var instance = new SystemInteractionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2840,7 +2849,7 @@ public List Suppor private List _SupportedMessage; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessagingComponent; @@ -2849,17 +2858,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(ReliableCacheElement != null) dest.ReliableCacheElement = (Hl7.Fhir.Model.UnsignedInt)ReliableCacheElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopy(); - if(SupportedMessage.Any()) dest.SupportedMessage = new List(SupportedMessage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(ReliableCacheElement != null) dest.ReliableCacheElement = (Hl7.Fhir.Model.UnsignedInt)ReliableCacheElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopyInternal(); + if(SupportedMessage.Any()) dest.SupportedMessage = new List(SupportedMessage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessagingComponent()); + var instance = new MessagingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2994,7 +3004,7 @@ public string Address } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EndpointComponent; @@ -3003,15 +3013,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Protocol != null) dest.Protocol = (Hl7.Fhir.Model.Coding)Protocol.DeepCopy(); - if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirUrl)AddressElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Protocol != null) dest.Protocol = (Hl7.Fhir.Model.Coding)Protocol.DeepCopyInternal(); + if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirUrl)AddressElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EndpointComponent()); + var instance = new EndpointComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3150,7 +3161,7 @@ public string Definition } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportedMessageComponent; @@ -3159,15 +3170,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportedMessageComponent()); + var instance = new SupportedMessageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3336,7 +3348,7 @@ public string Profile } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DocumentComponent; @@ -3345,16 +3357,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DocumentComponent()); + var instance = new DocumentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4211,7 +4224,7 @@ public List Document List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CapabilityStatement; @@ -4220,43 +4233,44 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopy()); - if(ImportsElement.Any()) dest.ImportsElement = new List(ImportsElement.DeepCopy()); - if(Software != null) dest.Software = (Hl7.Fhir.Model.CapabilityStatement.SoftwareComponent)Software.DeepCopy(); - if(Implementation != null) dest.Implementation = (Hl7.Fhir.Model.CapabilityStatement.ImplementationComponent)Implementation.DeepCopy(); - if(FhirVersionElement != null) dest.FhirVersionElement = (Code)FhirVersionElement.DeepCopy(); - if(FormatElement.Any()) dest.FormatElement = new List(FormatElement.DeepCopy()); - if(PatchFormatElement.Any()) dest.PatchFormatElement = new List(PatchFormatElement.DeepCopy()); - if(AcceptLanguageElement.Any()) dest.AcceptLanguageElement = new List(AcceptLanguageElement.DeepCopy()); - if(ImplementationGuideElement.Any()) dest.ImplementationGuideElement = new List(ImplementationGuideElement.DeepCopy()); - if(Rest.Any()) dest.Rest = new List(Rest.DeepCopy()); - if(Messaging.Any()) dest.Messaging = new List(Messaging.DeepCopy()); - if(Document.Any()) dest.Document = new List(Document.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopyInternal()); + if(ImportsElement.Any()) dest.ImportsElement = new List(ImportsElement.DeepCopyInternal()); + if(Software != null) dest.Software = (Hl7.Fhir.Model.CapabilityStatement.SoftwareComponent)Software.DeepCopyInternal(); + if(Implementation != null) dest.Implementation = (Hl7.Fhir.Model.CapabilityStatement.ImplementationComponent)Implementation.DeepCopyInternal(); + if(FhirVersionElement != null) dest.FhirVersionElement = (Code)FhirVersionElement.DeepCopyInternal(); + if(FormatElement.Any()) dest.FormatElement = new List(FormatElement.DeepCopyInternal()); + if(PatchFormatElement.Any()) dest.PatchFormatElement = new List(PatchFormatElement.DeepCopyInternal()); + if(AcceptLanguageElement.Any()) dest.AcceptLanguageElement = new List(AcceptLanguageElement.DeepCopyInternal()); + if(ImplementationGuideElement.Any()) dest.ImplementationGuideElement = new List(ImplementationGuideElement.DeepCopyInternal()); + if(Rest.Any()) dest.Rest = new List(Rest.DeepCopyInternal()); + if(Messaging.Any()) dest.Messaging = new List(Messaging.DeepCopyInternal()); + if(Document.Any()) dest.Document = new List(Document.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CapabilityStatement()); + var instance = new CapabilityStatement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Conformance/Model/Generated/CodeSystem.cs b/src/Hl7.Fhir.Conformance/Model/Generated/CodeSystem.cs index 22efbe2222..51830d7277 100644 --- a/src/Hl7.Fhir.Conformance/Model/Generated/CodeSystem.cs +++ b/src/Hl7.Fhir.Conformance/Model/Generated/CodeSystem.cs @@ -291,7 +291,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FilterComponent; @@ -300,17 +300,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(OperatorElement.Any()) dest.OperatorElement = new List>(OperatorElement.DeepCopy()); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(OperatorElement.Any()) dest.OperatorElement = new List>(OperatorElement.DeepCopyInternal()); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FilterComponent()); + var instance = new FilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -527,7 +528,7 @@ public Hl7.Fhir.Model.CodeSystem.PropertyType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -536,17 +537,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -771,7 +773,7 @@ public List Concept private List _Concept; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptDefinitionComponent; @@ -780,19 +782,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirString)DefinitionElement.DeepCopy(); - if(Designation.Any()) dest.Designation = new List(Designation.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Concept.Any()) dest.Concept = new List(Concept.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirString)DefinitionElement.DeepCopyInternal(); + if(Designation.Any()) dest.Designation = new List(Designation.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Concept.Any()) dest.Concept = new List(Concept.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptDefinitionComponent()); + var instance = new ConceptDefinitionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -993,7 +996,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DesignationComponent; @@ -1002,17 +1005,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy(); - if(Use != null) dest.Use = (Hl7.Fhir.Model.Coding)Use.DeepCopy(); - if(AdditionalUse.Any()) dest.AdditionalUse = new List(AdditionalUse.DeepCopy()); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopyInternal(); + if(Use != null) dest.Use = (Hl7.Fhir.Model.Coding)Use.DeepCopyInternal(); + if(AdditionalUse.Any()) dest.AdditionalUse = new List(AdditionalUse.DeepCopyInternal()); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DesignationComponent()); + var instance = new DesignationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1148,7 +1152,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptPropertyComponent; @@ -1157,15 +1161,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptPropertyComponent()); + var instance = new ConceptPropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2158,7 +2163,7 @@ public List Concept List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeSystem; @@ -2167,50 +2172,51 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(CaseSensitiveElement != null) dest.CaseSensitiveElement = (Hl7.Fhir.Model.FhirBoolean)CaseSensitiveElement.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopy(); - if(HierarchyMeaningElement != null) dest.HierarchyMeaningElement = (Code)HierarchyMeaningElement.DeepCopy(); - if(CompositionalElement != null) dest.CompositionalElement = (Hl7.Fhir.Model.FhirBoolean)CompositionalElement.DeepCopy(); - if(VersionNeededElement != null) dest.VersionNeededElement = (Hl7.Fhir.Model.FhirBoolean)VersionNeededElement.DeepCopy(); - if(ContentElement != null) dest.ContentElement = (Code)ContentElement.DeepCopy(); - if(SupplementsElement != null) dest.SupplementsElement = (Hl7.Fhir.Model.Canonical)SupplementsElement.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.UnsignedInt)CountElement.DeepCopy(); - if(Filter.Any()) dest.Filter = new List(Filter.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Concept.Any()) dest.Concept = new List(Concept.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new CodeSystem()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(CaseSensitiveElement != null) dest.CaseSensitiveElement = (Hl7.Fhir.Model.FhirBoolean)CaseSensitiveElement.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopyInternal(); + if(HierarchyMeaningElement != null) dest.HierarchyMeaningElement = (Code)HierarchyMeaningElement.DeepCopyInternal(); + if(CompositionalElement != null) dest.CompositionalElement = (Hl7.Fhir.Model.FhirBoolean)CompositionalElement.DeepCopyInternal(); + if(VersionNeededElement != null) dest.VersionNeededElement = (Hl7.Fhir.Model.FhirBoolean)VersionNeededElement.DeepCopyInternal(); + if(ContentElement != null) dest.ContentElement = (Code)ContentElement.DeepCopyInternal(); + if(SupplementsElement != null) dest.SupplementsElement = (Hl7.Fhir.Model.Canonical)SupplementsElement.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.UnsignedInt)CountElement.DeepCopyInternal(); + if(Filter.Any()) dest.Filter = new List(Filter.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Concept.Any()) dest.Concept = new List(Concept.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new CodeSystem(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Conformance/Model/Generated/ElementDefinition.cs b/src/Hl7.Fhir.Conformance/Model/Generated/ElementDefinition.cs index 2b299ac4a3..49407264ab 100644 --- a/src/Hl7.Fhir.Conformance/Model/Generated/ElementDefinition.cs +++ b/src/Hl7.Fhir.Conformance/Model/Generated/ElementDefinition.cs @@ -427,7 +427,7 @@ public Hl7.Fhir.Model.ElementDefinition.SlicingRules? Rules } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SlicingComponent; @@ -436,17 +436,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Discriminator.Any()) dest.Discriminator = new List(Discriminator.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(OrderedElement != null) dest.OrderedElement = (Hl7.Fhir.Model.FhirBoolean)OrderedElement.DeepCopy(); - if(RulesElement != null) dest.RulesElement = (Code)RulesElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Discriminator.Any()) dest.Discriminator = new List(Discriminator.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(OrderedElement != null) dest.OrderedElement = (Hl7.Fhir.Model.FhirBoolean)OrderedElement.DeepCopyInternal(); + if(RulesElement != null) dest.RulesElement = (Code)RulesElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SlicingComponent()); + var instance = new SlicingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -601,7 +602,7 @@ public string Path } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiscriminatorComponent; @@ -610,15 +611,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiscriminatorComponent()); + var instance = new DiscriminatorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -787,7 +789,7 @@ public string Max } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BaseComponent; @@ -796,16 +798,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BaseComponent()); + var instance = new BaseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1050,7 +1053,7 @@ public Hl7.Fhir.Model.ElementDefinition.ReferenceVersionRules? Versioning } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TypeRefComponent; @@ -1059,18 +1062,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.FhirUri)CodeElement.DeepCopy(); - if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopy()); - if(TargetProfileElement.Any()) dest.TargetProfileElement = new List(TargetProfileElement.DeepCopy()); - if(AggregationElement.Any()) dest.AggregationElement = new List>(AggregationElement.DeepCopy()); - if(VersioningElement != null) dest.VersioningElement = (Code)VersioningElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.FhirUri)CodeElement.DeepCopyInternal(); + if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopyInternal()); + if(TargetProfileElement.Any()) dest.TargetProfileElement = new List(TargetProfileElement.DeepCopyInternal()); + if(AggregationElement.Any()) dest.AggregationElement = new List>(AggregationElement.DeepCopyInternal()); + if(VersioningElement != null) dest.VersioningElement = (Code)VersioningElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TypeRefComponent()); + var instance = new TypeRefComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1213,7 +1217,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExampleComponent; @@ -1222,15 +1226,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExampleComponent()); + var instance = new ExampleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1591,7 +1596,7 @@ public string Source } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConstraintComponent; @@ -1600,21 +1605,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KeyElement != null) dest.KeyElement = (Hl7.Fhir.Model.Id)KeyElement.DeepCopy(); - if(RequirementsElement != null) dest.RequirementsElement = (Hl7.Fhir.Model.PrimitiveType)RequirementsElement.DeepCopy(); - if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopy(); - if(SuppressElement != null) dest.SuppressElement = (Hl7.Fhir.Model.FhirBoolean)SuppressElement.DeepCopy(); - if(HumanElement != null) dest.HumanElement = (Hl7.Fhir.Model.FhirString)HumanElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(XpathElement != null) dest.XpathElement = (Hl7.Fhir.Model.FhirString)XpathElement.DeepCopy(); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.Canonical)SourceElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KeyElement != null) dest.KeyElement = (Hl7.Fhir.Model.Id)KeyElement.DeepCopyInternal(); + if(RequirementsElement != null) dest.RequirementsElement = (Hl7.Fhir.Model.PrimitiveType)RequirementsElement.DeepCopyInternal(); + if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopyInternal(); + if(SuppressElement != null) dest.SuppressElement = (Hl7.Fhir.Model.FhirBoolean)SuppressElement.DeepCopyInternal(); + if(HumanElement != null) dest.HumanElement = (Hl7.Fhir.Model.FhirString)HumanElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(XpathElement != null) dest.XpathElement = (Hl7.Fhir.Model.FhirString)XpathElement.DeepCopyInternal(); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.Canonical)SourceElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConstraintComponent()); + var instance = new ConstraintComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1876,7 +1882,7 @@ public List Additional private List _Additional; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ElementDefinitionBindingComponent; @@ -1885,17 +1891,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StrengthElement != null) dest.StrengthElement = (Code)StrengthElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.PrimitiveType)DescriptionElement.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopy(); - if(Additional.Any()) dest.Additional = new List(Additional.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(StrengthElement != null) dest.StrengthElement = (Code)StrengthElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.PrimitiveType)DescriptionElement.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopyInternal(); + if(Additional.Any()) dest.Additional = new List(Additional.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ElementDefinitionBindingComponent()); + var instance = new ElementDefinitionBindingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2174,7 +2181,7 @@ public bool? Any } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdditionalComponent; @@ -2183,19 +2190,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PurposeElement != null) dest.PurposeElement = (Code)PurposeElement.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopy(); - if(ShortDocoElement != null) dest.ShortDocoElement = (Hl7.Fhir.Model.FhirString)ShortDocoElement.DeepCopy(); - if(Usage.Any()) dest.Usage = new List(Usage.DeepCopy()); - if(AnyElement != null) dest.AnyElement = (Hl7.Fhir.Model.FhirBoolean)AnyElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PurposeElement != null) dest.PurposeElement = (Code)PurposeElement.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopyInternal(); + if(ShortDocoElement != null) dest.ShortDocoElement = (Hl7.Fhir.Model.FhirString)ShortDocoElement.DeepCopyInternal(); + if(Usage.Any()) dest.Usage = new List(Usage.DeepCopyInternal()); + if(AnyElement != null) dest.AnyElement = (Hl7.Fhir.Model.FhirBoolean)AnyElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdditionalComponent()); + var instance = new AdditionalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2455,7 +2463,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MappingComponent; @@ -2464,17 +2472,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IdentityElement != null) dest.IdentityElement = (Hl7.Fhir.Model.Id)IdentityElement.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy(); - if(MapElement != null) dest.MapElement = (Hl7.Fhir.Model.FhirString)MapElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.PrimitiveType)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IdentityElement != null) dest.IdentityElement = (Hl7.Fhir.Model.Id)IdentityElement.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopyInternal(); + if(MapElement != null) dest.MapElement = (Hl7.Fhir.Model.FhirString)MapElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.PrimitiveType)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MappingComponent()); + var instance = new MappingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3451,7 +3460,7 @@ public List Mapping private List _Mapping; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ElementDefinition; @@ -3460,49 +3469,50 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(RepresentationElement.Any()) dest.RepresentationElement = new List>(RepresentationElement.DeepCopy()); - if(SliceNameElement != null) dest.SliceNameElement = (Hl7.Fhir.Model.FhirString)SliceNameElement.DeepCopy(); - if(SliceIsConstrainingElement != null) dest.SliceIsConstrainingElement = (Hl7.Fhir.Model.FhirBoolean)SliceIsConstrainingElement.DeepCopy(); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Slicing != null) dest.Slicing = (Hl7.Fhir.Model.ElementDefinition.SlicingComponent)Slicing.DeepCopy(); - if(ShortElement != null) dest.ShortElement = (Hl7.Fhir.Model.FhirString)ShortElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Markdown)DefinitionElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopy(); - if(RequirementsElement != null) dest.RequirementsElement = (Hl7.Fhir.Model.Markdown)RequirementsElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(Base != null) dest.Base = (Hl7.Fhir.Model.ElementDefinition.BaseComponent)Base.DeepCopy(); - if(ContentReferenceElement != null) dest.ContentReferenceElement = (Hl7.Fhir.Model.FhirUri)ContentReferenceElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(DefaultValue != null) dest.DefaultValue = (Hl7.Fhir.Model.DataType)DefaultValue.DeepCopy(); - if(MeaningWhenMissingElement != null) dest.MeaningWhenMissingElement = (Hl7.Fhir.Model.Markdown)MeaningWhenMissingElement.DeepCopy(); - if(OrderMeaningElement != null) dest.OrderMeaningElement = (Hl7.Fhir.Model.FhirString)OrderMeaningElement.DeepCopy(); - if(Fixed != null) dest.Fixed = (Hl7.Fhir.Model.DataType)Fixed.DeepCopy(); - if(Pattern != null) dest.Pattern = (Hl7.Fhir.Model.DataType)Pattern.DeepCopy(); - if(Example.Any()) dest.Example = new List(Example.DeepCopy()); - if(MinValue != null) dest.MinValue = (Hl7.Fhir.Model.DataType)MinValue.DeepCopy(); - if(MaxValue != null) dest.MaxValue = (Hl7.Fhir.Model.DataType)MaxValue.DeepCopy(); - if(MaxLengthElement != null) dest.MaxLengthElement = (Hl7.Fhir.Model.Integer)MaxLengthElement.DeepCopy(); - if(ConditionElement.Any()) dest.ConditionElement = new List(ConditionElement.DeepCopy()); - if(Constraint.Any()) dest.Constraint = new List(Constraint.DeepCopy()); - if(MustHaveValueElement != null) dest.MustHaveValueElement = (Hl7.Fhir.Model.FhirBoolean)MustHaveValueElement.DeepCopy(); - if(ValueAlternativesElement.Any()) dest.ValueAlternativesElement = new List(ValueAlternativesElement.DeepCopy()); - if(MustSupportElement != null) dest.MustSupportElement = (Hl7.Fhir.Model.FhirBoolean)MustSupportElement.DeepCopy(); - if(IsModifierElement != null) dest.IsModifierElement = (Hl7.Fhir.Model.FhirBoolean)IsModifierElement.DeepCopy(); - if(IsModifierReasonElement != null) dest.IsModifierReasonElement = (Hl7.Fhir.Model.FhirString)IsModifierReasonElement.DeepCopy(); - if(IsSummaryElement != null) dest.IsSummaryElement = (Hl7.Fhir.Model.FhirBoolean)IsSummaryElement.DeepCopy(); - if(Binding != null) dest.Binding = (Hl7.Fhir.Model.ElementDefinition.ElementDefinitionBindingComponent)Binding.DeepCopy(); - if(Mapping.Any()) dest.Mapping = new List(Mapping.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ElementDefinition()); + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(RepresentationElement.Any()) dest.RepresentationElement = new List>(RepresentationElement.DeepCopyInternal()); + if(SliceNameElement != null) dest.SliceNameElement = (Hl7.Fhir.Model.FhirString)SliceNameElement.DeepCopyInternal(); + if(SliceIsConstrainingElement != null) dest.SliceIsConstrainingElement = (Hl7.Fhir.Model.FhirBoolean)SliceIsConstrainingElement.DeepCopyInternal(); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Slicing != null) dest.Slicing = (Hl7.Fhir.Model.ElementDefinition.SlicingComponent)Slicing.DeepCopyInternal(); + if(ShortElement != null) dest.ShortElement = (Hl7.Fhir.Model.FhirString)ShortElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Markdown)DefinitionElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopyInternal(); + if(RequirementsElement != null) dest.RequirementsElement = (Hl7.Fhir.Model.Markdown)RequirementsElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(Base != null) dest.Base = (Hl7.Fhir.Model.ElementDefinition.BaseComponent)Base.DeepCopyInternal(); + if(ContentReferenceElement != null) dest.ContentReferenceElement = (Hl7.Fhir.Model.FhirUri)ContentReferenceElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(DefaultValue != null) dest.DefaultValue = (Hl7.Fhir.Model.DataType)DefaultValue.DeepCopyInternal(); + if(MeaningWhenMissingElement != null) dest.MeaningWhenMissingElement = (Hl7.Fhir.Model.Markdown)MeaningWhenMissingElement.DeepCopyInternal(); + if(OrderMeaningElement != null) dest.OrderMeaningElement = (Hl7.Fhir.Model.FhirString)OrderMeaningElement.DeepCopyInternal(); + if(Fixed != null) dest.Fixed = (Hl7.Fhir.Model.DataType)Fixed.DeepCopyInternal(); + if(Pattern != null) dest.Pattern = (Hl7.Fhir.Model.DataType)Pattern.DeepCopyInternal(); + if(Example.Any()) dest.Example = new List(Example.DeepCopyInternal()); + if(MinValue != null) dest.MinValue = (Hl7.Fhir.Model.DataType)MinValue.DeepCopyInternal(); + if(MaxValue != null) dest.MaxValue = (Hl7.Fhir.Model.DataType)MaxValue.DeepCopyInternal(); + if(MaxLengthElement != null) dest.MaxLengthElement = (Hl7.Fhir.Model.Integer)MaxLengthElement.DeepCopyInternal(); + if(ConditionElement.Any()) dest.ConditionElement = new List(ConditionElement.DeepCopyInternal()); + if(Constraint.Any()) dest.Constraint = new List(Constraint.DeepCopyInternal()); + if(MustHaveValueElement != null) dest.MustHaveValueElement = (Hl7.Fhir.Model.FhirBoolean)MustHaveValueElement.DeepCopyInternal(); + if(ValueAlternativesElement.Any()) dest.ValueAlternativesElement = new List(ValueAlternativesElement.DeepCopyInternal()); + if(MustSupportElement != null) dest.MustSupportElement = (Hl7.Fhir.Model.FhirBoolean)MustSupportElement.DeepCopyInternal(); + if(IsModifierElement != null) dest.IsModifierElement = (Hl7.Fhir.Model.FhirBoolean)IsModifierElement.DeepCopyInternal(); + if(IsModifierReasonElement != null) dest.IsModifierReasonElement = (Hl7.Fhir.Model.FhirString)IsModifierReasonElement.DeepCopyInternal(); + if(IsSummaryElement != null) dest.IsSummaryElement = (Hl7.Fhir.Model.FhirBoolean)IsSummaryElement.DeepCopyInternal(); + if(Binding != null) dest.Binding = (Hl7.Fhir.Model.ElementDefinition.ElementDefinitionBindingComponent)Binding.DeepCopyInternal(); + if(Mapping.Any()) dest.Mapping = new List(Mapping.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ElementDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Conformance/Model/Generated/RelatedArtifact.cs b/src/Hl7.Fhir.Conformance/Model/Generated/RelatedArtifact.cs index e956ba59e6..679f73c32e 100644 --- a/src/Hl7.Fhir.Conformance/Model/Generated/RelatedArtifact.cs +++ b/src/Hl7.Fhir.Conformance/Model/Generated/RelatedArtifact.cs @@ -598,7 +598,7 @@ public string PublicationDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedArtifact; @@ -607,24 +607,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopy()); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(CitationElement != null) dest.CitationElement = (Hl7.Fhir.Model.Markdown)CitationElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopy(); - if(Document != null) dest.Document = (Hl7.Fhir.Model.Attachment)Document.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.Canonical)ResourceElement.DeepCopy(); - if(ResourceReference != null) dest.ResourceReference = (Hl7.Fhir.Model.ResourceReference)ResourceReference.DeepCopy(); - if(PublicationStatusElement != null) dest.PublicationStatusElement = (Code)PublicationStatusElement.DeepCopy(); - if(PublicationDateElement != null) dest.PublicationDateElement = (Hl7.Fhir.Model.Date)PublicationDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopyInternal()); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(CitationElement != null) dest.CitationElement = (Hl7.Fhir.Model.Markdown)CitationElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopyInternal(); + if(Document != null) dest.Document = (Hl7.Fhir.Model.Attachment)Document.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.Canonical)ResourceElement.DeepCopyInternal(); + if(ResourceReference != null) dest.ResourceReference = (Hl7.Fhir.Model.ResourceReference)ResourceReference.DeepCopyInternal(); + if(PublicationStatusElement != null) dest.PublicationStatusElement = (Code)PublicationStatusElement.DeepCopyInternal(); + if(PublicationDateElement != null) dest.PublicationDateElement = (Hl7.Fhir.Model.Date)PublicationDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedArtifact()); + var instance = new RelatedArtifact(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Conformance/Model/Generated/StructureDefinition.cs b/src/Hl7.Fhir.Conformance/Model/Generated/StructureDefinition.cs index 7b984b6046..395b781787 100644 --- a/src/Hl7.Fhir.Conformance/Model/Generated/StructureDefinition.cs +++ b/src/Hl7.Fhir.Conformance/Model/Generated/StructureDefinition.cs @@ -284,7 +284,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MappingComponent; @@ -293,17 +293,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IdentityElement != null) dest.IdentityElement = (Hl7.Fhir.Model.Id)IdentityElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IdentityElement != null) dest.IdentityElement = (Hl7.Fhir.Model.Id)IdentityElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MappingComponent()); + var instance = new MappingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -457,7 +458,7 @@ public string Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContextComponent; @@ -466,15 +467,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContextComponent()); + var instance = new ContextComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -560,7 +562,7 @@ public List Element private List _Element; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SnapshotComponent; @@ -569,14 +571,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Element.Any()) dest.Element = new List(Element.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Element.Any()) dest.Element = new List(Element.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SnapshotComponent()); + var instance = new SnapshotComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -654,7 +657,7 @@ public List Element private List _Element; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DifferentialComponent; @@ -663,14 +666,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Element.Any()) dest.Element = new List(Element.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Element.Any()) dest.Element = new List(Element.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DifferentialComponent()); + var instance = new DifferentialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1472,7 +1476,7 @@ public Hl7.Fhir.Model.StructureDefinition.DifferentialComponent Differential List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureDefinition; @@ -1481,42 +1485,43 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(Keyword.Any()) dest.Keyword = new List(Keyword.DeepCopy()); - if(FhirVersionElement != null) dest.FhirVersionElement = (Code)FhirVersionElement.DeepCopy(); - if(Mapping.Any()) dest.Mapping = new List(Mapping.DeepCopy()); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(AbstractElement != null) dest.AbstractElement = (Hl7.Fhir.Model.FhirBoolean)AbstractElement.DeepCopy(); - if(Context.Any()) dest.Context = new List(Context.DeepCopy()); - if(ContextInvariantElement.Any()) dest.ContextInvariantElement = new List(ContextInvariantElement.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirUri)TypeElement.DeepCopy(); - if(BaseDefinitionElement != null) dest.BaseDefinitionElement = (Hl7.Fhir.Model.Canonical)BaseDefinitionElement.DeepCopy(); - if(DerivationElement != null) dest.DerivationElement = (Code)DerivationElement.DeepCopy(); - if(Snapshot != null) dest.Snapshot = (Hl7.Fhir.Model.StructureDefinition.SnapshotComponent)Snapshot.DeepCopy(); - if(Differential != null) dest.Differential = (Hl7.Fhir.Model.StructureDefinition.DifferentialComponent)Differential.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(Keyword.Any()) dest.Keyword = new List(Keyword.DeepCopyInternal()); + if(FhirVersionElement != null) dest.FhirVersionElement = (Code)FhirVersionElement.DeepCopyInternal(); + if(Mapping.Any()) dest.Mapping = new List(Mapping.DeepCopyInternal()); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(AbstractElement != null) dest.AbstractElement = (Hl7.Fhir.Model.FhirBoolean)AbstractElement.DeepCopyInternal(); + if(Context.Any()) dest.Context = new List(Context.DeepCopyInternal()); + if(ContextInvariantElement.Any()) dest.ContextInvariantElement = new List(ContextInvariantElement.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirUri)TypeElement.DeepCopyInternal(); + if(BaseDefinitionElement != null) dest.BaseDefinitionElement = (Hl7.Fhir.Model.Canonical)BaseDefinitionElement.DeepCopyInternal(); + if(DerivationElement != null) dest.DerivationElement = (Code)DerivationElement.DeepCopyInternal(); + if(Snapshot != null) dest.Snapshot = (Hl7.Fhir.Model.StructureDefinition.SnapshotComponent)Snapshot.DeepCopyInternal(); + if(Differential != null) dest.Differential = (Hl7.Fhir.Model.StructureDefinition.DifferentialComponent)Differential.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureDefinition()); + var instance = new StructureDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Conformance/Model/Generated/ValueSet.cs b/src/Hl7.Fhir.Conformance/Model/Generated/ValueSet.cs index 012890a8ed..7ef9170ab2 100644 --- a/src/Hl7.Fhir.Conformance/Model/Generated/ValueSet.cs +++ b/src/Hl7.Fhir.Conformance/Model/Generated/ValueSet.cs @@ -200,7 +200,7 @@ public IEnumerable Property } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComposeComponent; @@ -209,18 +209,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LockedDateElement != null) dest.LockedDateElement = (Hl7.Fhir.Model.Date)LockedDateElement.DeepCopy(); - if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopy(); - if(Include.Any()) dest.Include = new List(Include.DeepCopy()); - if(Exclude.Any()) dest.Exclude = new List(Exclude.DeepCopy()); - if(PropertyElement.Any()) dest.PropertyElement = new List(PropertyElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LockedDateElement != null) dest.LockedDateElement = (Hl7.Fhir.Model.Date)LockedDateElement.DeepCopyInternal(); + if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopyInternal(); + if(Include.Any()) dest.Include = new List(Include.DeepCopyInternal()); + if(Exclude.Any()) dest.Exclude = new List(Exclude.DeepCopyInternal()); + if(PropertyElement.Any()) dest.PropertyElement = new List(PropertyElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComposeComponent()); + var instance = new ComposeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -472,7 +473,7 @@ public string Copyright } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptSetComponent; @@ -481,19 +482,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(Concept.Any()) dest.Concept = new List(Concept.DeepCopy()); - if(Filter.Any()) dest.Filter = new List(Filter.DeepCopy()); - if(ValueSetElement.Any()) dest.ValueSetElement = new List(ValueSetElement.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.FhirString)CopyrightElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(Concept.Any()) dest.Concept = new List(Concept.DeepCopyInternal()); + if(Filter.Any()) dest.Filter = new List(Filter.DeepCopyInternal()); + if(ValueSetElement.Any()) dest.ValueSetElement = new List(ValueSetElement.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.FhirString)CopyrightElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptSetComponent()); + var instance = new ConceptSetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -675,7 +677,7 @@ public List Designation private List _Designation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptReferenceComponent; @@ -684,16 +686,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(Designation.Any()) dest.Designation = new List(Designation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(Designation.Any()) dest.Designation = new List(Designation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptReferenceComponent()); + var instance = new ConceptReferenceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -870,7 +873,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DesignationComponent; @@ -879,17 +882,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy(); - if(Use != null) dest.Use = (Hl7.Fhir.Model.Coding)Use.DeepCopy(); - if(AdditionalUse.Any()) dest.AdditionalUse = new List(AdditionalUse.DeepCopy()); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopyInternal(); + if(Use != null) dest.Use = (Hl7.Fhir.Model.Coding)Use.DeepCopyInternal(); + if(AdditionalUse.Any()) dest.AdditionalUse = new List(AdditionalUse.DeepCopyInternal()); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DesignationComponent()); + var instance = new DesignationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1076,7 +1080,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FilterComponent; @@ -1085,16 +1089,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PropertyElement != null) dest.PropertyElement = (Hl7.Fhir.Model.Code)PropertyElement.DeepCopy(); - if(OpElement != null) dest.OpElement = (Code)OpElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PropertyElement != null) dest.PropertyElement = (Hl7.Fhir.Model.Code)PropertyElement.DeepCopyInternal(); + if(OpElement != null) dest.OpElement = (Code)OpElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FilterComponent()); + var instance = new FilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1380,7 +1385,7 @@ public List Contains private List _Contains; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExpansionComponent; @@ -1389,21 +1394,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IdentifierElement != null) dest.IdentifierElement = (Hl7.Fhir.Model.FhirUri)IdentifierElement.DeepCopy(); - if(NextElement != null) dest.NextElement = (Hl7.Fhir.Model.FhirUri)NextElement.DeepCopy(); - if(TimestampElement != null) dest.TimestampElement = (Hl7.Fhir.Model.FhirDateTime)TimestampElement.DeepCopy(); - if(TotalElement != null) dest.TotalElement = (Hl7.Fhir.Model.Integer)TotalElement.DeepCopy(); - if(OffsetElement != null) dest.OffsetElement = (Hl7.Fhir.Model.Integer)OffsetElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Contains.Any()) dest.Contains = new List(Contains.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(IdentifierElement != null) dest.IdentifierElement = (Hl7.Fhir.Model.FhirUri)IdentifierElement.DeepCopyInternal(); + if(NextElement != null) dest.NextElement = (Hl7.Fhir.Model.FhirUri)NextElement.DeepCopyInternal(); + if(TimestampElement != null) dest.TimestampElement = (Hl7.Fhir.Model.FhirDateTime)TimestampElement.DeepCopyInternal(); + if(TotalElement != null) dest.TotalElement = (Hl7.Fhir.Model.Integer)TotalElement.DeepCopyInternal(); + if(OffsetElement != null) dest.OffsetElement = (Hl7.Fhir.Model.Integer)OffsetElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Contains.Any()) dest.Contains = new List(Contains.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExpansionComponent()); + var instance = new ExpansionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1571,7 +1577,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -1580,15 +1586,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1723,7 +1730,7 @@ public string Uri } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -1732,15 +1739,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2043,7 +2051,7 @@ public List Contains private List _Contains; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainsComponent; @@ -2052,22 +2060,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy(); - if(AbstractElement != null) dest.AbstractElement = (Hl7.Fhir.Model.FhirBoolean)AbstractElement.DeepCopy(); - if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(Designation.Any()) dest.Designation = new List(Designation.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Contains.Any()) dest.Contains = new List(Contains.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopyInternal(); + if(AbstractElement != null) dest.AbstractElement = (Hl7.Fhir.Model.FhirBoolean)AbstractElement.DeepCopyInternal(); + if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(Designation.Any()) dest.Designation = new List(Designation.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Contains.Any()) dest.Contains = new List(Contains.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainsComponent()); + var instance = new ContainsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2260,7 +2269,7 @@ public List SubProperty private List _SubProperty; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptPropertyComponent; @@ -2269,16 +2278,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(SubProperty.Any()) dest.SubProperty = new List(SubProperty.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(SubProperty.Any()) dest.SubProperty = new List(SubProperty.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptPropertyComponent()); + var instance = new ConceptPropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2412,7 +2422,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptSubPropertyComponent; @@ -2421,15 +2431,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptSubPropertyComponent()); + var instance = new ConceptSubPropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2595,7 +2606,7 @@ public string ExclusionCriteria } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ScopeComponent; @@ -2604,16 +2615,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(InclusionCriteriaElement != null) dest.InclusionCriteriaElement = (Hl7.Fhir.Model.FhirString)InclusionCriteriaElement.DeepCopy(); - if(FocusElement != null) dest.FocusElement = (Hl7.Fhir.Model.FhirString)FocusElement.DeepCopy(); - if(ExclusionCriteriaElement != null) dest.ExclusionCriteriaElement = (Hl7.Fhir.Model.FhirString)ExclusionCriteriaElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(InclusionCriteriaElement != null) dest.InclusionCriteriaElement = (Hl7.Fhir.Model.FhirString)InclusionCriteriaElement.DeepCopyInternal(); + if(FocusElement != null) dest.FocusElement = (Hl7.Fhir.Model.FhirString)FocusElement.DeepCopyInternal(); + if(ExclusionCriteriaElement != null) dest.ExclusionCriteriaElement = (Hl7.Fhir.Model.FhirString)ExclusionCriteriaElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ScopeComponent()); + var instance = new ScopeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3392,7 +3404,7 @@ public Hl7.Fhir.Model.ValueSet.ScopeComponent Scope List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ValueSet; @@ -3401,43 +3413,44 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(ImmutableElement != null) dest.ImmutableElement = (Hl7.Fhir.Model.FhirBoolean)ImmutableElement.DeepCopy(); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Compose != null) dest.Compose = (Hl7.Fhir.Model.ValueSet.ComposeComponent)Compose.DeepCopy(); - if(Expansion != null) dest.Expansion = (Hl7.Fhir.Model.ValueSet.ExpansionComponent)Expansion.DeepCopy(); - if(Scope != null) dest.Scope = (Hl7.Fhir.Model.ValueSet.ScopeComponent)Scope.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(ImmutableElement != null) dest.ImmutableElement = (Hl7.Fhir.Model.FhirBoolean)ImmutableElement.DeepCopyInternal(); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Compose != null) dest.Compose = (Hl7.Fhir.Model.ValueSet.ComposeComponent)Compose.DeepCopyInternal(); + if(Expansion != null) dest.Expansion = (Hl7.Fhir.Model.ValueSet.ExpansionComponent)Expansion.DeepCopyInternal(); + if(Scope != null) dest.Scope = (Hl7.Fhir.Model.ValueSet.ScopeComponent)Scope.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ValueSet()); + var instance = new ValueSet(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.Conformance/Specification/Snapshot/ElementDefnMerger.cs b/src/Hl7.Fhir.Conformance/Specification/Snapshot/ElementDefnMerger.cs index e8c47664bf..cf4aa2137b 100644 --- a/src/Hl7.Fhir.Conformance/Specification/Snapshot/ElementDefnMerger.cs +++ b/src/Hl7.Fhir.Conformance/Specification/Snapshot/ElementDefnMerger.cs @@ -226,7 +226,7 @@ void onConstraint(List snap) where T : Element { if (snap.IsNullOrEmpty()) { - result = (List)diff.DeepCopy(); + result = (List)diff.DeepCopyInternal(); onConstraint(result); } else if (!diff.IsExactly(snap)) @@ -294,11 +294,11 @@ ElementDefinition.TypeRefComponent mergeElementType(ElementDefinition.TypeRefCom //result.AggregationElement = mergePrimitiveCollection(snap.AggregationElement, diff.AggregationElement, matchAggregationModes); if (!(diff.AggregationElement is null)) { - result.AggregationElement = new List>(diff.AggregationElement.DeepCopy()); + result.AggregationElement = new List>(diff.AggregationElement.DeepCopyInternal()); } else if (!(snap.AggregationElement is null)) { - result.AggregationElement = (List>)snap.AggregationElement.DeepCopy(); + result.AggregationElement = (List>)snap.AggregationElement.DeepCopyInternal(); } result.VersioningElement = mergePrimitiveElement(snap.VersioningElement, diff.VersioningElement); @@ -317,13 +317,13 @@ List mergePrimitiveCollection(List snap, List diff, Func { if (snap.IsNullOrEmpty()) { - result = (List)diff.DeepCopy(); + result = (List)diff.DeepCopyInternal(); onConstraint(result); } else if (!diff.IsExactly(snap)) { // Paranoia... List elements are never null - result = new List(snap.DeepCopy()); + result = new List(snap.DeepCopyInternal()); foreach (var diffItem in diff) { @@ -401,12 +401,12 @@ List mergeExtensions(List snap, List diff) { if (snap.IsNullOrEmpty()) { - result = (List)diff.DeepCopy(); + result = (List)diff.DeepCopyInternal(); onConstraint(result); } else if (!diff.IsExactly(snap)) { - result = new List(snap.DeepCopy()); + result = new List(snap.DeepCopyInternal()); // Properly merge matching collection items foreach (var diffItem in diff) { @@ -461,12 +461,12 @@ List mergeCollection(List snap, List diff, Func matchIte { if (snap.IsNullOrEmpty()) { - result = (List)diff.DeepCopy(); + result = (List)diff.DeepCopyInternal(); onConstraint(result); } else if (!diff.IsExactly(snap)) { - result = new List(snap.DeepCopy()); + result = new List(snap.DeepCopyInternal()); // Properly merge matching collection items foreach (var diffItem in diff) { diff --git a/src/Hl7.Fhir.R4/Model/Generated/Account.cs b/src/Hl7.Fhir.R4/Model/Generated/Account.cs index 3fc79c9f8f..07276b34e7 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Account.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Account.cs @@ -164,7 +164,7 @@ public int? Priority } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageComponent; @@ -173,15 +173,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.PositiveInt)PriorityElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.PositiveInt)PriorityElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageComponent()); + var instance = new CoverageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -313,7 +314,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GuarantorComponent; @@ -322,16 +323,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - if(OnHoldElement != null) dest.OnHoldElement = (Hl7.Fhir.Model.FhirBoolean)OnHoldElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); + if(OnHoldElement != null) dest.OnHoldElement = (Hl7.Fhir.Model.FhirBoolean)OnHoldElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GuarantorComponent()); + var instance = new GuarantorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -611,7 +613,7 @@ public Hl7.Fhir.Model.ResourceReference PartOf Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Type; set => Type = value; } IEnumerable ICoded.ToCodings() => Type.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Account; @@ -620,24 +622,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(ServicePeriod != null) dest.ServicePeriod = (Hl7.Fhir.Model.Period)ServicePeriod.DeepCopy(); - if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopy()); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Guarantor.Any()) dest.Guarantor = new List(Guarantor.DeepCopy()); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(ServicePeriod != null) dest.ServicePeriod = (Hl7.Fhir.Model.Period)ServicePeriod.DeepCopyInternal(); + if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopyInternal()); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Guarantor.Any()) dest.Guarantor = new List(Guarantor.DeepCopyInternal()); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Account()); + var instance = new Account(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ActivityDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/ActivityDefinition.cs index a81a570a25..5c1940ba11 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ActivityDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ActivityDefinition.cs @@ -223,7 +223,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -232,15 +232,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -359,7 +360,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DynamicValueComponent; @@ -368,15 +369,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DynamicValueComponent()); + var instance = new DynamicValueComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1480,7 +1482,7 @@ public List DynamicValu List ICoded>.Code { get => Topic; set => Topic = value; } IEnumerable ICoded.ToCodings() => Topic.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActivityDefinition; @@ -1489,59 +1491,60 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(SpecimenRequirement.Any()) dest.SpecimenRequirement = new List(SpecimenRequirement.DeepCopy()); - if(ObservationRequirement.Any()) dest.ObservationRequirement = new List(ObservationRequirement.DeepCopy()); - if(ObservationResultRequirement.Any()) dest.ObservationResultRequirement = new List(ObservationResultRequirement.DeepCopy()); - if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopy(); - if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActivityDefinition()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(SpecimenRequirement.Any()) dest.SpecimenRequirement = new List(SpecimenRequirement.DeepCopyInternal()); + if(ObservationRequirement.Any()) dest.ObservationRequirement = new List(ObservationRequirement.DeepCopyInternal()); + if(ObservationResultRequirement.Any()) dest.ObservationResultRequirement = new List(ObservationResultRequirement.DeepCopyInternal()); + if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopyInternal(); + if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActivityDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Address.cs b/src/Hl7.Fhir.R4/Model/Generated/Address.cs index 85553dd3a3..100f9f7019 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Address.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Address.cs @@ -425,7 +425,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Address; @@ -434,23 +434,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(LineElement.Any()) dest.LineElement = new List(LineElement.DeepCopy()); - if(CityElement != null) dest.CityElement = (Hl7.Fhir.Model.FhirString)CityElement.DeepCopy(); - if(DistrictElement != null) dest.DistrictElement = (Hl7.Fhir.Model.FhirString)DistrictElement.DeepCopy(); - if(StateElement != null) dest.StateElement = (Hl7.Fhir.Model.FhirString)StateElement.DeepCopy(); - if(PostalCodeElement != null) dest.PostalCodeElement = (Hl7.Fhir.Model.FhirString)PostalCodeElement.DeepCopy(); - if(CountryElement != null) dest.CountryElement = (Hl7.Fhir.Model.FhirString)CountryElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(LineElement.Any()) dest.LineElement = new List(LineElement.DeepCopyInternal()); + if(CityElement != null) dest.CityElement = (Hl7.Fhir.Model.FhirString)CityElement.DeepCopyInternal(); + if(DistrictElement != null) dest.DistrictElement = (Hl7.Fhir.Model.FhirString)DistrictElement.DeepCopyInternal(); + if(StateElement != null) dest.StateElement = (Hl7.Fhir.Model.FhirString)StateElement.DeepCopyInternal(); + if(PostalCodeElement != null) dest.PostalCodeElement = (Hl7.Fhir.Model.FhirString)PostalCodeElement.DeepCopyInternal(); + if(CountryElement != null) dest.CountryElement = (Hl7.Fhir.Model.FhirString)CountryElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Address()); + var instance = new Address(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/AdverseEvent.cs b/src/Hl7.Fhir.R4/Model/Generated/AdverseEvent.cs index 3a98dc956b..8620acd8ab 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/AdverseEvent.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/AdverseEvent.cs @@ -201,7 +201,7 @@ public List Causality private List _Causality; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SuspectEntityComponent; @@ -210,15 +210,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Instance != null) dest.Instance = (Hl7.Fhir.Model.ResourceReference)Instance.DeepCopy(); - if(Causality.Any()) dest.Causality = new List(Causality.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Instance != null) dest.Instance = (Hl7.Fhir.Model.ResourceReference)Instance.DeepCopyInternal(); + if(Causality.Any()) dest.Causality = new List(Causality.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SuspectEntityComponent()); + var instance = new SuspectEntityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -361,7 +362,7 @@ public Hl7.Fhir.Model.CodeableConcept Method private Hl7.Fhir.Model.CodeableConcept _Method; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CausalityComponent; @@ -370,17 +371,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Assessment != null) dest.Assessment = (Hl7.Fhir.Model.CodeableConcept)Assessment.DeepCopy(); - if(ProductRelatednessElement != null) dest.ProductRelatednessElement = (Hl7.Fhir.Model.FhirString)ProductRelatednessElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Assessment != null) dest.Assessment = (Hl7.Fhir.Model.CodeableConcept)Assessment.DeepCopyInternal(); + if(ProductRelatednessElement != null) dest.ProductRelatednessElement = (Hl7.Fhir.Model.FhirString)ProductRelatednessElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CausalityComponent()); + var instance = new CausalityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -823,7 +825,7 @@ public List Study Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Event; set => Event = value; } IEnumerable ICoded.ToCodings() => Event.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdverseEvent; @@ -832,33 +834,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(ActualityElement != null) dest.ActualityElement = (Code)ActualityElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Event != null) dest.Event = (Hl7.Fhir.Model.CodeableConcept)Event.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(DetectedElement != null) dest.DetectedElement = (Hl7.Fhir.Model.FhirDateTime)DetectedElement.DeepCopy(); - if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopy(); - if(ResultingCondition.Any()) dest.ResultingCondition = new List(ResultingCondition.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Seriousness != null) dest.Seriousness = (Hl7.Fhir.Model.CodeableConcept)Seriousness.DeepCopy(); - if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopy()); - if(SuspectEntity.Any()) dest.SuspectEntity = new List(SuspectEntity.DeepCopy()); - if(SubjectMedicalHistory.Any()) dest.SubjectMedicalHistory = new List(SubjectMedicalHistory.DeepCopy()); - if(ReferenceDocument.Any()) dest.ReferenceDocument = new List(ReferenceDocument.DeepCopy()); - if(Study.Any()) dest.Study = new List(Study.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(ActualityElement != null) dest.ActualityElement = (Code)ActualityElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Event != null) dest.Event = (Hl7.Fhir.Model.CodeableConcept)Event.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(DetectedElement != null) dest.DetectedElement = (Hl7.Fhir.Model.FhirDateTime)DetectedElement.DeepCopyInternal(); + if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopyInternal(); + if(ResultingCondition.Any()) dest.ResultingCondition = new List(ResultingCondition.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Seriousness != null) dest.Seriousness = (Hl7.Fhir.Model.CodeableConcept)Seriousness.DeepCopyInternal(); + if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopyInternal()); + if(SuspectEntity.Any()) dest.SuspectEntity = new List(SuspectEntity.DeepCopyInternal()); + if(SubjectMedicalHistory.Any()) dest.SubjectMedicalHistory = new List(SubjectMedicalHistory.DeepCopyInternal()); + if(ReferenceDocument.Any()) dest.ReferenceDocument = new List(ReferenceDocument.DeepCopyInternal()); + if(Study.Any()) dest.Study = new List(Study.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdverseEvent()); + var instance = new AdverseEvent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Age.cs b/src/Hl7.Fhir.R4/Model/Generated/Age.cs index 9266eb35e3..1b91087ab9 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Age.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Age.cs @@ -59,9 +59,11 @@ public partial class Age : Quantity /// public override string TypeName { get { return "Age"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Age()); + var instance = new Age(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.R4/Model/Generated/AllergyIntolerance.cs b/src/Hl7.Fhir.R4/Model/Generated/AllergyIntolerance.cs index ba38e8b399..a532fb8f67 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/AllergyIntolerance.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/AllergyIntolerance.cs @@ -402,7 +402,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReactionComponent; @@ -411,20 +411,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopy(); - if(Manifestation.Any()) dest.Manifestation = new List(Manifestation.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(OnsetElement != null) dest.OnsetElement = (Hl7.Fhir.Model.FhirDateTime)OnsetElement.DeepCopy(); - if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopy(); - if(ExposureRoute != null) dest.ExposureRoute = (Hl7.Fhir.Model.CodeableConcept)ExposureRoute.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopyInternal(); + if(Manifestation.Any()) dest.Manifestation = new List(Manifestation.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(OnsetElement != null) dest.OnsetElement = (Hl7.Fhir.Model.FhirDateTime)OnsetElement.DeepCopyInternal(); + if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopyInternal(); + if(ExposureRoute != null) dest.ExposureRoute = (Hl7.Fhir.Model.CodeableConcept)ExposureRoute.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReactionComponent()); + var instance = new ReactionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -847,7 +848,7 @@ public List Reaction Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AllergyIntolerance; @@ -856,29 +857,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ClinicalStatus != null) dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopy(); - if(VerificationStatus != null) dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(CategoryElement.Any()) dest.CategoryElement = new List>(CategoryElement.DeepCopy()); - if(CriticalityElement != null) dest.CriticalityElement = (Code)CriticalityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy(); - if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy(); - if(LastOccurrenceElement != null) dest.LastOccurrenceElement = (Hl7.Fhir.Model.FhirDateTime)LastOccurrenceElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ClinicalStatus != null) dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopyInternal(); + if(VerificationStatus != null) dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(CategoryElement.Any()) dest.CategoryElement = new List>(CategoryElement.DeepCopyInternal()); + if(CriticalityElement != null) dest.CriticalityElement = (Code)CriticalityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopyInternal(); + if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopyInternal(); + if(LastOccurrenceElement != null) dest.LastOccurrenceElement = (Hl7.Fhir.Model.FhirDateTime)LastOccurrenceElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AllergyIntolerance()); + var instance = new AllergyIntolerance(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Annotation.cs b/src/Hl7.Fhir.R4/Model/Generated/Annotation.cs index ba2ffd730f..abd63c9181 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Annotation.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Annotation.cs @@ -139,7 +139,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Annotation; @@ -148,16 +148,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Author != null) dest.Author = (Hl7.Fhir.Model.DataType)Author.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Author != null) dest.Author = (Hl7.Fhir.Model.DataType)Author.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Annotation()); + var instance = new Annotation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Appointment.cs b/src/Hl7.Fhir.R4/Model/Generated/Appointment.cs index 44912ee492..0d04da7d2e 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Appointment.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Appointment.cs @@ -280,7 +280,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -289,18 +289,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(RequiredElement != null) dest.RequiredElement = (Code)RequiredElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(RequiredElement != null) dest.RequiredElement = (Code)RequiredElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -861,7 +862,7 @@ public List RequestedPeriod List ICoded>.Code { get => ServiceType; set => ServiceType = value; } IEnumerable ICoded.ToCodings() => ServiceType.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Appointment; @@ -870,35 +871,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CancelationReason != null) dest.CancelationReason = (Hl7.Fhir.Model.CodeableConcept)CancelationReason.DeepCopy(); - if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopy()); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.UnsignedInt)PriorityElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(MinutesDurationElement != null) dest.MinutesDurationElement = (Hl7.Fhir.Model.PositiveInt)MinutesDurationElement.DeepCopy(); - if(Slot.Any()) dest.Slot = new List(Slot.DeepCopy()); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(RequestedPeriod.Any()) dest.RequestedPeriod = new List(RequestedPeriod.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CancelationReason != null) dest.CancelationReason = (Hl7.Fhir.Model.CodeableConcept)CancelationReason.DeepCopyInternal(); + if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopyInternal()); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.UnsignedInt)PriorityElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(MinutesDurationElement != null) dest.MinutesDurationElement = (Hl7.Fhir.Model.PositiveInt)MinutesDurationElement.DeepCopyInternal(); + if(Slot.Any()) dest.Slot = new List(Slot.DeepCopyInternal()); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(RequestedPeriod.Any()) dest.RequestedPeriod = new List(RequestedPeriod.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Appointment()); + var instance = new Appointment(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/AppointmentResponse.cs b/src/Hl7.Fhir.R4/Model/Generated/AppointmentResponse.cs index e8f5c4fefc..656c0b192d 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/AppointmentResponse.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/AppointmentResponse.cs @@ -245,7 +245,7 @@ public string Comment List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AppointmentResponse; @@ -254,21 +254,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Appointment != null) dest.Appointment = (Hl7.Fhir.Model.ResourceReference)Appointment.DeepCopy(); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(ParticipantType.Any()) dest.ParticipantType = new List(ParticipantType.DeepCopy()); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(ParticipantStatusElement != null) dest.ParticipantStatusElement = (Code)ParticipantStatusElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Appointment != null) dest.Appointment = (Hl7.Fhir.Model.ResourceReference)Appointment.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(ParticipantType.Any()) dest.ParticipantType = new List(ParticipantType.DeepCopyInternal()); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(ParticipantStatusElement != null) dest.ParticipantStatusElement = (Code)ParticipantStatusElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AppointmentResponse()); + var instance = new AppointmentResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/AuditEvent.cs b/src/Hl7.Fhir.R4/Model/Generated/AuditEvent.cs index 961db2936e..87b45eac33 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/AuditEvent.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/AuditEvent.cs @@ -419,7 +419,7 @@ public List PurposeOfUse private List _PurposeOfUse; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AgentComponent; @@ -428,24 +428,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Role.Any()) dest.Role = new List(Role.DeepCopy()); - if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopy(); - if(AltIdElement != null) dest.AltIdElement = (Hl7.Fhir.Model.FhirString)AltIdElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(RequestorElement != null) dest.RequestorElement = (Hl7.Fhir.Model.FhirBoolean)RequestorElement.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopy()); - if(Media != null) dest.Media = (Hl7.Fhir.Model.Coding)Media.DeepCopy(); - if(Network != null) dest.Network = (Hl7.Fhir.Model.AuditEvent.NetworkComponent)Network.DeepCopy(); - if(PurposeOfUse.Any()) dest.PurposeOfUse = new List(PurposeOfUse.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Role.Any()) dest.Role = new List(Role.DeepCopyInternal()); + if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopyInternal(); + if(AltIdElement != null) dest.AltIdElement = (Hl7.Fhir.Model.FhirString)AltIdElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(RequestorElement != null) dest.RequestorElement = (Hl7.Fhir.Model.FhirBoolean)RequestorElement.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopyInternal()); + if(Media != null) dest.Media = (Hl7.Fhir.Model.Coding)Media.DeepCopyInternal(); + if(Network != null) dest.Network = (Hl7.Fhir.Model.AuditEvent.NetworkComponent)Network.DeepCopyInternal(); + if(PurposeOfUse.Any()) dest.PurposeOfUse = new List(PurposeOfUse.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AgentComponent()); + var instance = new AgentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -653,7 +654,7 @@ public Hl7.Fhir.Model.AuditEvent.AuditEventAgentNetworkType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NetworkComponent; @@ -662,15 +663,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirString)AddressElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirString)AddressElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NetworkComponent()); + var instance = new NetworkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -805,7 +807,7 @@ public List Type private List _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceComponent; @@ -814,16 +816,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SiteElement != null) dest.SiteElement = (Hl7.Fhir.Model.FhirString)SiteElement.DeepCopy(); - if(Observer != null) dest.Observer = (Hl7.Fhir.Model.ResourceReference)Observer.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SiteElement != null) dest.SiteElement = (Hl7.Fhir.Model.FhirString)SiteElement.DeepCopyInternal(); + if(Observer != null) dest.Observer = (Hl7.Fhir.Model.ResourceReference)Observer.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceComponent()); + var instance = new SourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1083,7 +1086,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EntityComponent; @@ -1092,22 +1095,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(What != null) dest.What = (Hl7.Fhir.Model.ResourceReference)What.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.Coding)Role.DeepCopy(); - if(Lifecycle != null) dest.Lifecycle = (Hl7.Fhir.Model.Coding)Lifecycle.DeepCopy(); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(QueryElement != null) dest.QueryElement = (Hl7.Fhir.Model.Base64Binary)QueryElement.DeepCopy(); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(What != null) dest.What = (Hl7.Fhir.Model.ResourceReference)What.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.Coding)Role.DeepCopyInternal(); + if(Lifecycle != null) dest.Lifecycle = (Hl7.Fhir.Model.Coding)Lifecycle.DeepCopyInternal(); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(QueryElement != null) dest.QueryElement = (Hl7.Fhir.Model.Base64Binary)QueryElement.DeepCopyInternal(); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EntityComponent()); + var instance = new EntityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1283,7 +1287,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -1292,15 +1296,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1585,7 +1590,7 @@ public List Entity private List _Entity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AuditEvent; @@ -1594,24 +1599,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopy()); - if(ActionElement != null) dest.ActionElement = (Code)ActionElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(OutcomeDescElement != null) dest.OutcomeDescElement = (Hl7.Fhir.Model.FhirString)OutcomeDescElement.DeepCopy(); - if(PurposeOfEvent.Any()) dest.PurposeOfEvent = new List(PurposeOfEvent.DeepCopy()); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - if(Source != null) dest.Source = (Hl7.Fhir.Model.AuditEvent.SourceComponent)Source.DeepCopy(); - if(Entity.Any()) dest.Entity = new List(Entity.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopyInternal()); + if(ActionElement != null) dest.ActionElement = (Code)ActionElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(OutcomeDescElement != null) dest.OutcomeDescElement = (Hl7.Fhir.Model.FhirString)OutcomeDescElement.DeepCopyInternal(); + if(PurposeOfEvent.Any()) dest.PurposeOfEvent = new List(PurposeOfEvent.DeepCopyInternal()); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); + if(Source != null) dest.Source = (Hl7.Fhir.Model.AuditEvent.SourceComponent)Source.DeepCopyInternal(); + if(Entity.Any()) dest.Entity = new List(Entity.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AuditEvent()); + var instance = new AuditEvent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Basic.cs b/src/Hl7.Fhir.R4/Model/Generated/Basic.cs index 3a51465e2c..67caca27c1 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Basic.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Basic.cs @@ -154,7 +154,7 @@ public Hl7.Fhir.Model.ResourceReference Author Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Basic; @@ -163,18 +163,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.Date)CreatedElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.Date)CreatedElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Basic()); + var instance = new Basic(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/BiologicallyDerivedProduct.cs b/src/Hl7.Fhir.R4/Model/Generated/BiologicallyDerivedProduct.cs index b0ba266c18..4097bf7771 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/BiologicallyDerivedProduct.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/BiologicallyDerivedProduct.cs @@ -209,7 +209,7 @@ public Hl7.Fhir.Model.DataType Collected private Hl7.Fhir.Model.DataType _Collected; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CollectionComponent; @@ -218,16 +218,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CollectionComponent()); + var instance = new CollectionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -382,7 +383,7 @@ public Hl7.Fhir.Model.DataType Time private Hl7.Fhir.Model.DataType _Time; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcessingComponent; @@ -391,17 +392,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.CodeableConcept)Procedure.DeepCopy(); - if(Additive != null) dest.Additive = (Hl7.Fhir.Model.ResourceReference)Additive.DeepCopy(); - if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.CodeableConcept)Procedure.DeepCopyInternal(); + if(Additive != null) dest.Additive = (Hl7.Fhir.Model.ResourceReference)Additive.DeepCopyInternal(); + if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcessingComponent()); + var instance = new ProcessingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -535,7 +537,7 @@ public Hl7.Fhir.Model.DataType Time private Hl7.Fhir.Model.DataType _Time; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManipulationComponent; @@ -544,15 +546,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManipulationComponent()); + var instance = new ManipulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -729,7 +732,7 @@ public Hl7.Fhir.Model.Period Duration private Hl7.Fhir.Model.Period _Duration; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StorageComponent; @@ -738,17 +741,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(TemperatureElement != null) dest.TemperatureElement = (Hl7.Fhir.Model.FhirDecimal)TemperatureElement.DeepCopy(); - if(ScaleElement != null) dest.ScaleElement = (Code)ScaleElement.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Period)Duration.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(TemperatureElement != null) dest.TemperatureElement = (Hl7.Fhir.Model.FhirDecimal)TemperatureElement.DeepCopyInternal(); + if(ScaleElement != null) dest.ScaleElement = (Code)ScaleElement.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Period)Duration.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StorageComponent()); + var instance = new StorageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1033,7 +1037,7 @@ public List Storage List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BiologicallyDerivedProduct; @@ -1042,24 +1046,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ProductCategoryElement != null) dest.ProductCategoryElement = (Code)ProductCategoryElement.DeepCopy(); - if(ProductCode != null) dest.ProductCode = (Hl7.Fhir.Model.CodeableConcept)ProductCode.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Request.Any()) dest.Request = new List(Request.DeepCopy()); - if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.Integer)QuantityElement.DeepCopy(); - if(Parent.Any()) dest.Parent = new List(Parent.DeepCopy()); - if(Collection != null) dest.Collection = (Hl7.Fhir.Model.BiologicallyDerivedProduct.CollectionComponent)Collection.DeepCopy(); - if(Processing.Any()) dest.Processing = new List(Processing.DeepCopy()); - if(Manipulation != null) dest.Manipulation = (Hl7.Fhir.Model.BiologicallyDerivedProduct.ManipulationComponent)Manipulation.DeepCopy(); - if(Storage.Any()) dest.Storage = new List(Storage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ProductCategoryElement != null) dest.ProductCategoryElement = (Code)ProductCategoryElement.DeepCopyInternal(); + if(ProductCode != null) dest.ProductCode = (Hl7.Fhir.Model.CodeableConcept)ProductCode.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Request.Any()) dest.Request = new List(Request.DeepCopyInternal()); + if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.Integer)QuantityElement.DeepCopyInternal(); + if(Parent.Any()) dest.Parent = new List(Parent.DeepCopyInternal()); + if(Collection != null) dest.Collection = (Hl7.Fhir.Model.BiologicallyDerivedProduct.CollectionComponent)Collection.DeepCopyInternal(); + if(Processing.Any()) dest.Processing = new List(Processing.DeepCopyInternal()); + if(Manipulation != null) dest.Manipulation = (Hl7.Fhir.Model.BiologicallyDerivedProduct.ManipulationComponent)Manipulation.DeepCopyInternal(); + if(Storage.Any()) dest.Storage = new List(Storage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BiologicallyDerivedProduct()); + var instance = new BiologicallyDerivedProduct(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/BodyStructure.cs b/src/Hl7.Fhir.R4/Model/Generated/BodyStructure.cs index dbdb5b0a5e..8ba3de1c61 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/BodyStructure.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/BodyStructure.cs @@ -213,7 +213,7 @@ public Hl7.Fhir.Model.ResourceReference Patient Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Location; set => Location = value; } IEnumerable ICoded.ToCodings() => Location.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BodyStructure; @@ -222,21 +222,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Morphology != null) dest.Morphology = (Hl7.Fhir.Model.CodeableConcept)Morphology.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.CodeableConcept)Location.DeepCopy(); - if(LocationQualifier.Any()) dest.LocationQualifier = new List(LocationQualifier.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Image.Any()) dest.Image = new List(Image.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Morphology != null) dest.Morphology = (Hl7.Fhir.Model.CodeableConcept)Morphology.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.CodeableConcept)Location.DeepCopyInternal(); + if(LocationQualifier.Any()) dest.LocationQualifier = new List(LocationQualifier.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Image.Any()) dest.Image = new List(Image.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BodyStructure()); + var instance = new BodyStructure(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/CarePlan.cs b/src/Hl7.Fhir.R4/Model/Generated/CarePlan.cs index 95f4fb3385..dfe928d756 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/CarePlan.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/CarePlan.cs @@ -304,7 +304,7 @@ public Hl7.Fhir.Model.CarePlan.DetailComponent Detail private Hl7.Fhir.Model.CarePlan.DetailComponent _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActivityComponent; @@ -313,18 +313,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(OutcomeCodeableConcept.Any()) dest.OutcomeCodeableConcept = new List(OutcomeCodeableConcept.DeepCopy()); - if(OutcomeReference.Any()) dest.OutcomeReference = new List(OutcomeReference.DeepCopy()); - if(Progress.Any()) dest.Progress = new List(Progress.DeepCopy()); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.CarePlan.DetailComponent)Detail.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(OutcomeCodeableConcept.Any()) dest.OutcomeCodeableConcept = new List(OutcomeCodeableConcept.DeepCopyInternal()); + if(OutcomeReference.Any()) dest.OutcomeReference = new List(OutcomeReference.DeepCopyInternal()); + if(Progress.Any()) dest.Progress = new List(Progress.DeepCopyInternal()); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.CarePlan.DetailComponent)Detail.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActivityComponent()); + var instance = new ActivityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -776,7 +777,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -785,30 +786,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Goal.Any()) dest.Goal = new List(Goal.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Scheduled != null) dest.Scheduled = (Hl7.Fhir.Model.DataType)Scheduled.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopy(); - if(DailyAmount != null) dest.DailyAmount = (Hl7.Fhir.Model.Quantity)DailyAmount.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Goal.Any()) dest.Goal = new List(Goal.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Scheduled != null) dest.Scheduled = (Hl7.Fhir.Model.DataType)Scheduled.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopyInternal(); + if(DailyAmount != null) dest.DailyAmount = (Hl7.Fhir.Model.Quantity)DailyAmount.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1458,7 +1460,7 @@ public List Note List ICoded>.Code { get => Category; set => Category = value; } IEnumerable ICoded.ToCodings() => Category.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CarePlan; @@ -1467,36 +1469,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopy()); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Goal.Any()) dest.Goal = new List(Goal.DeepCopy()); - if(Activity.Any()) dest.Activity = new List(Activity.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopyInternal()); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Goal.Any()) dest.Goal = new List(Goal.DeepCopyInternal()); + if(Activity.Any()) dest.Activity = new List(Activity.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CarePlan()); + var instance = new CarePlan(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/CareTeam.cs b/src/Hl7.Fhir.R4/Model/Generated/CareTeam.cs index ab08177f94..7b47eddc98 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/CareTeam.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/CareTeam.cs @@ -173,7 +173,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -182,17 +182,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role.Any()) dest.Role = new List(Role.DeepCopy()); - if(Member != null) dest.Member = (Hl7.Fhir.Model.ResourceReference)Member.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role.Any()) dest.Role = new List(Role.DeepCopyInternal()); + if(Member != null) dest.Member = (Hl7.Fhir.Model.ResourceReference)Member.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -494,7 +495,7 @@ public List Note List ICoded>.Code { get => Category; set => Category = value; } IEnumerable ICoded.ToCodings() => Category.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CareTeam; @@ -503,26 +504,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(ManagingOrganization.Any()) dest.ManagingOrganization = new List(ManagingOrganization.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(ManagingOrganization.Any()) dest.ManagingOrganization = new List(ManagingOrganization.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CareTeam()); + var instance = new CareTeam(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/CatalogEntry.cs b/src/Hl7.Fhir.R4/Model/Generated/CatalogEntry.cs index 3dd33e1679..88f6d29011 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/CatalogEntry.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/CatalogEntry.cs @@ -147,7 +147,7 @@ public Hl7.Fhir.Model.ResourceReference Item private Hl7.Fhir.Model.ResourceReference _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedEntryComponent; @@ -156,15 +156,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RelationtypeElement != null) dest.RelationtypeElement = (Code)RelationtypeElement.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.ResourceReference)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RelationtypeElement != null) dest.RelationtypeElement = (Code)RelationtypeElement.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.ResourceReference)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedEntryComponent()); + var instance = new RelatedEntryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -475,7 +476,7 @@ public List RelatedEntry List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CatalogEntry; @@ -484,26 +485,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(OrderableElement != null) dest.OrderableElement = (Hl7.Fhir.Model.FhirBoolean)OrderableElement.DeepCopy(); - if(ReferencedItem != null) dest.ReferencedItem = (Hl7.Fhir.Model.ResourceReference)ReferencedItem.DeepCopy(); - if(AdditionalIdentifier.Any()) dest.AdditionalIdentifier = new List(AdditionalIdentifier.DeepCopy()); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopy(); - if(ValidToElement != null) dest.ValidToElement = (Hl7.Fhir.Model.FhirDateTime)ValidToElement.DeepCopy(); - if(LastUpdatedElement != null) dest.LastUpdatedElement = (Hl7.Fhir.Model.FhirDateTime)LastUpdatedElement.DeepCopy(); - if(AdditionalCharacteristic.Any()) dest.AdditionalCharacteristic = new List(AdditionalCharacteristic.DeepCopy()); - if(AdditionalClassification.Any()) dest.AdditionalClassification = new List(AdditionalClassification.DeepCopy()); - if(RelatedEntry.Any()) dest.RelatedEntry = new List(RelatedEntry.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(OrderableElement != null) dest.OrderableElement = (Hl7.Fhir.Model.FhirBoolean)OrderableElement.DeepCopyInternal(); + if(ReferencedItem != null) dest.ReferencedItem = (Hl7.Fhir.Model.ResourceReference)ReferencedItem.DeepCopyInternal(); + if(AdditionalIdentifier.Any()) dest.AdditionalIdentifier = new List(AdditionalIdentifier.DeepCopyInternal()); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopyInternal(); + if(ValidToElement != null) dest.ValidToElement = (Hl7.Fhir.Model.FhirDateTime)ValidToElement.DeepCopyInternal(); + if(LastUpdatedElement != null) dest.LastUpdatedElement = (Hl7.Fhir.Model.FhirDateTime)LastUpdatedElement.DeepCopyInternal(); + if(AdditionalCharacteristic.Any()) dest.AdditionalCharacteristic = new List(AdditionalCharacteristic.DeepCopyInternal()); + if(AdditionalClassification.Any()) dest.AdditionalClassification = new List(AdditionalClassification.DeepCopyInternal()); + if(RelatedEntry.Any()) dest.RelatedEntry = new List(RelatedEntry.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CatalogEntry()); + var instance = new CatalogEntry(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ChargeItem.cs b/src/Hl7.Fhir.R4/Model/Generated/ChargeItem.cs index bcf3bbdd67..08dd742169 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ChargeItem.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ChargeItem.cs @@ -157,7 +157,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -166,15 +166,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -726,7 +727,7 @@ public List SupportingInformation Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ChargeItem; @@ -735,39 +736,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(DefinitionUriElement.Any()) dest.DefinitionUriElement = new List(DefinitionUriElement.DeepCopy()); - if(DefinitionCanonicalElement.Any()) dest.DefinitionCanonicalElement = new List(DefinitionCanonicalElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(PerformingOrganization != null) dest.PerformingOrganization = (Hl7.Fhir.Model.ResourceReference)PerformingOrganization.DeepCopy(); - if(RequestingOrganization != null) dest.RequestingOrganization = (Hl7.Fhir.Model.ResourceReference)RequestingOrganization.DeepCopy(); - if(CostCenter != null) dest.CostCenter = (Hl7.Fhir.Model.ResourceReference)CostCenter.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Bodysite.Any()) dest.Bodysite = new List(Bodysite.DeepCopy()); - if(FactorOverrideElement != null) dest.FactorOverrideElement = (Hl7.Fhir.Model.FhirDecimal)FactorOverrideElement.DeepCopy(); - if(PriceOverride != null) dest.PriceOverride = (Hl7.Fhir.Model.Money)PriceOverride.DeepCopy(); - if(OverrideReasonElement != null) dest.OverrideReasonElement = (Hl7.Fhir.Model.FhirString)OverrideReasonElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(EnteredDateElement != null) dest.EnteredDateElement = (Hl7.Fhir.Model.FhirDateTime)EnteredDateElement.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Service.Any()) dest.Service = new List(Service.DeepCopy()); - if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopy(); - if(Account.Any()) dest.Account = new List(Account.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ChargeItem()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(DefinitionUriElement.Any()) dest.DefinitionUriElement = new List(DefinitionUriElement.DeepCopyInternal()); + if(DefinitionCanonicalElement.Any()) dest.DefinitionCanonicalElement = new List(DefinitionCanonicalElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(PerformingOrganization != null) dest.PerformingOrganization = (Hl7.Fhir.Model.ResourceReference)PerformingOrganization.DeepCopyInternal(); + if(RequestingOrganization != null) dest.RequestingOrganization = (Hl7.Fhir.Model.ResourceReference)RequestingOrganization.DeepCopyInternal(); + if(CostCenter != null) dest.CostCenter = (Hl7.Fhir.Model.ResourceReference)CostCenter.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Bodysite.Any()) dest.Bodysite = new List(Bodysite.DeepCopyInternal()); + if(FactorOverrideElement != null) dest.FactorOverrideElement = (Hl7.Fhir.Model.FhirDecimal)FactorOverrideElement.DeepCopyInternal(); + if(PriceOverride != null) dest.PriceOverride = (Hl7.Fhir.Model.Money)PriceOverride.DeepCopyInternal(); + if(OverrideReasonElement != null) dest.OverrideReasonElement = (Hl7.Fhir.Model.FhirString)OverrideReasonElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(EnteredDateElement != null) dest.EnteredDateElement = (Hl7.Fhir.Model.FhirDateTime)EnteredDateElement.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Service.Any()) dest.Service = new List(Service.DeepCopyInternal()); + if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopyInternal(); + if(Account.Any()) dest.Account = new List(Account.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ChargeItem(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ChargeItemDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/ChargeItemDefinition.cs index b754004743..e2c775cacb 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ChargeItemDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ChargeItemDefinition.cs @@ -169,7 +169,7 @@ public string Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ApplicabilityComponent; @@ -178,16 +178,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.FhirString)LanguageElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.FhirString)LanguageElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ApplicabilityComponent()); + var instance = new ApplicabilityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -295,7 +296,7 @@ public List PriceCo private List _PriceComponent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyGroupComponent; @@ -304,15 +305,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Applicability.Any()) dest.Applicability = new List(Applicability.DeepCopy()); - if(PriceComponent.Any()) dest.PriceComponent = new List(PriceComponent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Applicability.Any()) dest.Applicability = new List(Applicability.DeepCopyInternal()); + if(PriceComponent.Any()) dest.PriceComponent = new List(PriceComponent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyGroupComponent()); + var instance = new PropertyGroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -475,7 +477,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PriceComponentComponent; @@ -484,17 +486,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PriceComponentComponent()); + var instance = new PriceComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1140,7 +1143,7 @@ public List Property Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ChargeItemDefinition; @@ -1149,36 +1152,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DerivedFromUriElement.Any()) dest.DerivedFromUriElement = new List(DerivedFromUriElement.DeepCopy()); - if(PartOfElement.Any()) dest.PartOfElement = new List(PartOfElement.DeepCopy()); - if(ReplacesElement.Any()) dest.ReplacesElement = new List(ReplacesElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - if(Applicability.Any()) dest.Applicability = new List(Applicability.DeepCopy()); - if(PropertyGroup.Any()) dest.PropertyGroup = new List(PropertyGroup.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DerivedFromUriElement.Any()) dest.DerivedFromUriElement = new List(DerivedFromUriElement.DeepCopyInternal()); + if(PartOfElement.Any()) dest.PartOfElement = new List(PartOfElement.DeepCopyInternal()); + if(ReplacesElement.Any()) dest.ReplacesElement = new List(ReplacesElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); + if(Applicability.Any()) dest.Applicability = new List(Applicability.DeepCopyInternal()); + if(PropertyGroup.Any()) dest.PropertyGroup = new List(PropertyGroup.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ChargeItemDefinition()); + var instance = new ChargeItemDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Claim.cs b/src/Hl7.Fhir.R4/Model/Generated/Claim.cs index 396f2255e6..0cf95a7546 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Claim.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Claim.cs @@ -119,7 +119,7 @@ public Hl7.Fhir.Model.Identifier Reference private Hl7.Fhir.Model.Identifier _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedClaimComponent; @@ -128,16 +128,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedClaimComponent()); + var instance = new RelatedClaimComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -248,7 +249,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayeeComponent; @@ -257,15 +258,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayeeComponent()); + var instance = new PayeeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -444,7 +446,7 @@ public Hl7.Fhir.Model.CodeableConcept Qualification private Hl7.Fhir.Model.CodeableConcept _Qualification; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CareTeamComponent; @@ -453,18 +455,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Qualification != null) dest.Qualification = (Hl7.Fhir.Model.CodeableConcept)Qualification.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Qualification != null) dest.Qualification = (Hl7.Fhir.Model.CodeableConcept)Qualification.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CareTeamComponent()); + var instance = new CareTeamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -667,7 +670,7 @@ public Hl7.Fhir.Model.CodeableConcept Reason private Hl7.Fhir.Model.CodeableConcept _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportingInformationComponent; @@ -676,19 +679,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportingInformationComponent()); + var instance = new SupportingInformationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -885,7 +889,7 @@ public Hl7.Fhir.Model.CodeableConcept PackageCode private Hl7.Fhir.Model.CodeableConcept _PackageCode; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -894,18 +898,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(OnAdmission != null) dest.OnAdmission = (Hl7.Fhir.Model.CodeableConcept)OnAdmission.DeepCopy(); - if(PackageCode != null) dest.PackageCode = (Hl7.Fhir.Model.CodeableConcept)PackageCode.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(OnAdmission != null) dest.OnAdmission = (Hl7.Fhir.Model.CodeableConcept)OnAdmission.DeepCopyInternal(); + if(PackageCode != null) dest.PackageCode = (Hl7.Fhir.Model.CodeableConcept)PackageCode.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1113,7 +1118,7 @@ public List Udi private List _Udi; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcedureComponent; @@ -1122,18 +1127,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcedureComponent()); + var instance = new ProcedureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1401,7 +1407,7 @@ public Hl7.Fhir.Model.ResourceReference ClaimResponse private Hl7.Fhir.Model.ResourceReference _ClaimResponse; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -1410,20 +1416,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopy(); - if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopy()); - if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopyInternal(); + if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopyInternal()); + if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1597,7 +1604,7 @@ public Hl7.Fhir.Model.DataType Location private Hl7.Fhir.Model.DataType _Location; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AccidentComponent; @@ -1606,16 +1613,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AccidentComponent()); + var instance = new AccidentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2105,7 +2113,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -2114,34 +2122,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(CareTeamSequenceElement.Any()) dest.CareTeamSequenceElement = new List(CareTeamSequenceElement.DeepCopy()); - if(DiagnosisSequenceElement.Any()) dest.DiagnosisSequenceElement = new List(DiagnosisSequenceElement.DeepCopy()); - if(ProcedureSequenceElement.Any()) dest.ProcedureSequenceElement = new List(ProcedureSequenceElement.DeepCopy()); - if(InformationSequenceElement.Any()) dest.InformationSequenceElement = new List(InformationSequenceElement.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ItemComponent()); + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(CareTeamSequenceElement.Any()) dest.CareTeamSequenceElement = new List(CareTeamSequenceElement.DeepCopyInternal()); + if(DiagnosisSequenceElement.Any()) dest.DiagnosisSequenceElement = new List(DiagnosisSequenceElement.DeepCopyInternal()); + if(ProcedureSequenceElement.Any()) dest.ProcedureSequenceElement = new List(ProcedureSequenceElement.DeepCopyInternal()); + if(InformationSequenceElement.Any()) dest.InformationSequenceElement = new List(InformationSequenceElement.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); + if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2570,7 +2579,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -2579,25 +2588,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2940,7 +2950,7 @@ public List Udi private List _Udi; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubDetailComponent; @@ -2949,24 +2959,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubDetailComponent()); + var instance = new SubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3543,7 +3554,7 @@ public Hl7.Fhir.Model.Money Total Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Type; set => Type = value; } IEnumerable ICoded.ToCodings() => Type.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Claim; @@ -3552,40 +3563,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopy(); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopy(); - if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.Claim.PayeeComponent)Payee.DeepCopy(); - if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopy(); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Accident != null) dest.Accident = (Hl7.Fhir.Model.Claim.AccidentComponent)Accident.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - if(Total != null) dest.Total = (Hl7.Fhir.Model.Money)Total.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopyInternal(); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); + if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopyInternal(); + if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.Claim.PayeeComponent)Payee.DeepCopyInternal(); + if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopyInternal(); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Accident != null) dest.Accident = (Hl7.Fhir.Model.Claim.AccidentComponent)Accident.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + if(Total != null) dest.Total = (Hl7.Fhir.Model.Money)Total.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Claim()); + var instance = new Claim(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ClaimResponse.cs b/src/Hl7.Fhir.R4/Model/Generated/ClaimResponse.cs index 7ceee7880c..7415633d64 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ClaimResponse.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ClaimResponse.cs @@ -167,7 +167,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -176,17 +176,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemSequenceElement != null) dest.ItemSequenceElement = (Hl7.Fhir.Model.PositiveInt)ItemSequenceElement.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ItemSequenceElement != null) dest.ItemSequenceElement = (Hl7.Fhir.Model.PositiveInt)ItemSequenceElement.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -347,7 +348,7 @@ public decimal? Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdjudicationComponent; @@ -356,17 +357,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdjudicationComponent()); + var instance = new AdjudicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -546,7 +548,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemDetailComponent; @@ -555,17 +557,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DetailSequenceElement != null) dest.DetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceElement.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DetailSequenceElement != null) dest.DetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceElement.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemDetailComponent()); + var instance = new ItemDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -731,7 +734,7 @@ public List Adjudication private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubDetailComponent; @@ -740,16 +743,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SubDetailSequenceElement != null) dest.SubDetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)SubDetailSequenceElement.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SubDetailSequenceElement != null) dest.SubDetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)SubDetailSequenceElement.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubDetailComponent()); + var instance = new SubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1177,7 +1181,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemComponent; @@ -1186,31 +1190,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemSequenceElement.Any()) dest.ItemSequenceElement = new List(ItemSequenceElement.DeepCopy()); - if(DetailSequenceElement.Any()) dest.DetailSequenceElement = new List(DetailSequenceElement.DeepCopy()); - if(SubdetailSequenceElement.Any()) dest.SubdetailSequenceElement = new List(SubdetailSequenceElement.DeepCopy()); - if(Provider.Any()) dest.Provider = new List(Provider.DeepCopy()); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new AddedItemComponent()); + base.CopyToInternal(dest); + if(ItemSequenceElement.Any()) dest.ItemSequenceElement = new List(ItemSequenceElement.DeepCopyInternal()); + if(DetailSequenceElement.Any()) dest.DetailSequenceElement = new List(DetailSequenceElement.DeepCopyInternal()); + if(SubdetailSequenceElement.Any()) dest.SubdetailSequenceElement = new List(SubdetailSequenceElement.DeepCopyInternal()); + if(Provider.Any()) dest.Provider = new List(Provider.DeepCopyInternal()); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new AddedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1570,7 +1575,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemDetailComponent; @@ -1579,22 +1584,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemDetailComponent()); + var instance = new AddedItemDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1868,7 +1874,7 @@ public List Adjudication private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemSubDetailComponent; @@ -1877,21 +1883,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemSubDetailComponent()); + var instance = new AddedItemSubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2041,7 +2048,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TotalComponent; @@ -2050,15 +2057,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TotalComponent()); + var instance = new TotalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2230,7 +2238,7 @@ public Hl7.Fhir.Model.Identifier Identifier private Hl7.Fhir.Model.Identifier _Identifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentComponent; @@ -2239,19 +2247,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopy(); - if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopyInternal(); + if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentComponent()); + var instance = new PaymentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2465,7 +2474,7 @@ public Hl7.Fhir.Model.CodeableConcept Language private Hl7.Fhir.Model.CodeableConcept _Language; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NoteComponent; @@ -2474,17 +2483,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NoteComponent()); + var instance = new NoteComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2699,7 +2709,7 @@ public Hl7.Fhir.Model.ResourceReference ClaimResponse private Hl7.Fhir.Model.ResourceReference _ClaimResponse; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -2708,18 +2718,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopy(); - if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopyInternal(); + if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2924,7 +2935,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ErrorComponent; @@ -2933,17 +2944,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemSequenceElement != null) dest.ItemSequenceElement = (Hl7.Fhir.Model.PositiveInt)ItemSequenceElement.DeepCopy(); - if(DetailSequenceElement != null) dest.DetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceElement.DeepCopy(); - if(SubDetailSequenceElement != null) dest.SubDetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)SubDetailSequenceElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ItemSequenceElement != null) dest.ItemSequenceElement = (Hl7.Fhir.Model.PositiveInt)ItemSequenceElement.DeepCopyInternal(); + if(DetailSequenceElement != null) dest.DetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceElement.DeepCopyInternal(); + if(SubDetailSequenceElement != null) dest.SubDetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)SubDetailSequenceElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ErrorComponent()); + var instance = new ErrorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3513,7 +3525,7 @@ public List Error List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClaimResponse; @@ -3522,40 +3534,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopy(); - if(PreAuthPeriod != null) dest.PreAuthPeriod = (Hl7.Fhir.Model.Period)PreAuthPeriod.DeepCopy(); - if(PayeeType != null) dest.PayeeType = (Hl7.Fhir.Model.CodeableConcept)PayeeType.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Total.Any()) dest.Total = new List(Total.DeepCopy()); - if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ClaimResponse.PaymentComponent)Payment.DeepCopy(); - if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopy(); - if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.Attachment)Form.DeepCopy(); - if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopy()); - if(CommunicationRequest.Any()) dest.CommunicationRequest = new List(CommunicationRequest.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Error.Any()) dest.Error = new List(Error.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopyInternal(); + if(PreAuthPeriod != null) dest.PreAuthPeriod = (Hl7.Fhir.Model.Period)PreAuthPeriod.DeepCopyInternal(); + if(PayeeType != null) dest.PayeeType = (Hl7.Fhir.Model.CodeableConcept)PayeeType.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Total.Any()) dest.Total = new List(Total.DeepCopyInternal()); + if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ClaimResponse.PaymentComponent)Payment.DeepCopyInternal(); + if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopyInternal(); + if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.Attachment)Form.DeepCopyInternal(); + if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopyInternal()); + if(CommunicationRequest.Any()) dest.CommunicationRequest = new List(CommunicationRequest.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Error.Any()) dest.Error = new List(Error.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClaimResponse()); + var instance = new ClaimResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ClinicalImpression.cs b/src/Hl7.Fhir.R4/Model/Generated/ClinicalImpression.cs index e0c3501f80..e6240a7df9 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ClinicalImpression.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ClinicalImpression.cs @@ -134,7 +134,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InvestigationComponent; @@ -143,15 +143,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InvestigationComponent()); + var instance = new InvestigationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -283,7 +284,7 @@ public string Basis } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FindingComponent; @@ -292,16 +293,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemCodeableConcept != null) dest.ItemCodeableConcept = (Hl7.Fhir.Model.CodeableConcept)ItemCodeableConcept.DeepCopy(); - if(ItemReference != null) dest.ItemReference = (Hl7.Fhir.Model.ResourceReference)ItemReference.DeepCopy(); - if(BasisElement != null) dest.BasisElement = (Hl7.Fhir.Model.FhirString)BasisElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ItemCodeableConcept != null) dest.ItemCodeableConcept = (Hl7.Fhir.Model.CodeableConcept)ItemCodeableConcept.DeepCopyInternal(); + if(ItemReference != null) dest.ItemReference = (Hl7.Fhir.Model.ResourceReference)ItemReference.DeepCopyInternal(); + if(BasisElement != null) dest.BasisElement = (Hl7.Fhir.Model.FhirString)BasisElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FindingComponent()); + var instance = new FindingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -752,7 +754,7 @@ public List Note Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClinicalImpression; @@ -761,33 +763,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Assessor != null) dest.Assessor = (Hl7.Fhir.Model.ResourceReference)Assessor.DeepCopy(); - if(Previous != null) dest.Previous = (Hl7.Fhir.Model.ResourceReference)Previous.DeepCopy(); - if(Problem.Any()) dest.Problem = new List(Problem.DeepCopy()); - if(Investigation.Any()) dest.Investigation = new List(Investigation.DeepCopy()); - if(ProtocolElement.Any()) dest.ProtocolElement = new List(ProtocolElement.DeepCopy()); - if(SummaryElement != null) dest.SummaryElement = (Hl7.Fhir.Model.FhirString)SummaryElement.DeepCopy(); - if(Finding.Any()) dest.Finding = new List(Finding.DeepCopy()); - if(PrognosisCodeableConcept.Any()) dest.PrognosisCodeableConcept = new List(PrognosisCodeableConcept.DeepCopy()); - if(PrognosisReference.Any()) dest.PrognosisReference = new List(PrognosisReference.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ClinicalImpression()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Assessor != null) dest.Assessor = (Hl7.Fhir.Model.ResourceReference)Assessor.DeepCopyInternal(); + if(Previous != null) dest.Previous = (Hl7.Fhir.Model.ResourceReference)Previous.DeepCopyInternal(); + if(Problem.Any()) dest.Problem = new List(Problem.DeepCopyInternal()); + if(Investigation.Any()) dest.Investigation = new List(Investigation.DeepCopyInternal()); + if(ProtocolElement.Any()) dest.ProtocolElement = new List(ProtocolElement.DeepCopyInternal()); + if(SummaryElement != null) dest.SummaryElement = (Hl7.Fhir.Model.FhirString)SummaryElement.DeepCopyInternal(); + if(Finding.Any()) dest.Finding = new List(Finding.DeepCopyInternal()); + if(PrognosisCodeableConcept.Any()) dest.PrognosisCodeableConcept = new List(PrognosisCodeableConcept.DeepCopyInternal()); + if(PrognosisReference.Any()) dest.PrognosisReference = new List(PrognosisReference.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ClinicalImpression(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Communication.cs b/src/Hl7.Fhir.R4/Model/Generated/Communication.cs index c914668611..d7ae751c7d 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Communication.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Communication.cs @@ -92,7 +92,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayloadComponent; @@ -101,14 +101,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayloadComponent()); + var instance = new PayloadComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -610,7 +611,7 @@ public List Note List ICoded>.Code { get => Category; set => Category = value; } IEnumerable ICoded.ToCodings() => Category.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Communication; @@ -619,36 +620,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(InResponseTo.Any()) dest.InResponseTo = new List(InResponseTo.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Medium.Any()) dest.Medium = new List(Medium.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Topic != null) dest.Topic = (Hl7.Fhir.Model.CodeableConcept)Topic.DeepCopy(); - if(About.Any()) dest.About = new List(About.DeepCopy()); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(SentElement != null) dest.SentElement = (Hl7.Fhir.Model.FhirDateTime)SentElement.DeepCopy(); - if(ReceivedElement != null) dest.ReceivedElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedElement.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Payload.Any()) dest.Payload = new List(Payload.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Communication()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(InResponseTo.Any()) dest.InResponseTo = new List(InResponseTo.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Medium.Any()) dest.Medium = new List(Medium.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Topic != null) dest.Topic = (Hl7.Fhir.Model.CodeableConcept)Topic.DeepCopyInternal(); + if(About.Any()) dest.About = new List(About.DeepCopyInternal()); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(SentElement != null) dest.SentElement = (Hl7.Fhir.Model.FhirDateTime)SentElement.DeepCopyInternal(); + if(ReceivedElement != null) dest.ReceivedElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedElement.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); + if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Payload.Any()) dest.Payload = new List(Payload.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Communication(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/CommunicationRequest.cs b/src/Hl7.Fhir.R4/Model/Generated/CommunicationRequest.cs index d20d07b238..bdcc084a90 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/CommunicationRequest.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/CommunicationRequest.cs @@ -92,7 +92,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayloadComponent; @@ -101,14 +101,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayloadComponent()); + var instance = new PayloadComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -559,7 +560,7 @@ public List Note List ICoded>.Code { get => Category; set => Category = value; } IEnumerable ICoded.ToCodings() => Category.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CommunicationRequest; @@ -568,35 +569,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Medium.Any()) dest.Medium = new List(Medium.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(About.Any()) dest.About = new List(About.DeepCopy()); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Payload.Any()) dest.Payload = new List(Payload.DeepCopy()); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new CommunicationRequest()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Medium.Any()) dest.Medium = new List(Medium.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(About.Any()) dest.About = new List(About.DeepCopyInternal()); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Payload.Any()) dest.Payload = new List(Payload.DeepCopyInternal()); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); + if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new CommunicationRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/CompartmentDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/CompartmentDefinition.cs index 6ba15f0a53..dea31ec569 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/CompartmentDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/CompartmentDefinition.cs @@ -173,7 +173,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceComponent; @@ -182,16 +182,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(ParamElement.Any()) dest.ParamElement = new List(ParamElement.DeepCopy()); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(ParamElement.Any()) dest.ParamElement = new List(ParamElement.DeepCopyInternal()); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceComponent()); + var instance = new ResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -647,7 +648,7 @@ public List Resource private List _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CompartmentDefinition; @@ -656,27 +657,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(SearchElement != null) dest.SearchElement = (Hl7.Fhir.Model.FhirBoolean)SearchElement.DeepCopy(); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new CompartmentDefinition()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(SearchElement != null) dest.SearchElement = (Hl7.Fhir.Model.FhirBoolean)SearchElement.DeepCopyInternal(); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new CompartmentDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Composition.cs b/src/Hl7.Fhir.R4/Model/Generated/Composition.cs index 8274fd9a54..5413abd1b4 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Composition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Composition.cs @@ -254,7 +254,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AttesterComponent; @@ -263,16 +263,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AttesterComponent()); + var instance = new AttesterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -404,7 +405,7 @@ public Hl7.Fhir.Model.DataType Target private Hl7.Fhir.Model.DataType _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatesToComponent; @@ -413,15 +414,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatesToComponent()); + var instance = new RelatesToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -538,7 +540,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventComponent; @@ -547,16 +549,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventComponent()); + var instance = new EventComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -816,7 +819,7 @@ public List Section private List _Section; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SectionComponent; @@ -825,23 +828,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopy(); - if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopy(); - if(Entry.Any()) dest.Entry = new List(Entry.DeepCopy()); - if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopy(); - if(Section.Any()) dest.Section = new List(Section.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopyInternal(); + if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopyInternal(); + if(Entry.Any()) dest.Entry = new List(Entry.DeepCopyInternal()); + if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopyInternal(); + if(Section.Any()) dest.Section = new List(Section.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SectionComponent()); + var instance = new SectionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1257,7 +1261,7 @@ public List Section Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Type; set => Type = value; } IEnumerable ICoded.ToCodings() => Type.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Composition; @@ -1266,28 +1270,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ConfidentialityElement != null) dest.ConfidentialityElement = (Code)ConfidentialityElement.DeepCopy(); - if(Attester.Any()) dest.Attester = new List(Attester.DeepCopy()); - if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy(); - if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopy()); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - if(Section.Any()) dest.Section = new List(Section.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ConfidentialityElement != null) dest.ConfidentialityElement = (Code)ConfidentialityElement.DeepCopyInternal(); + if(Attester.Any()) dest.Attester = new List(Attester.DeepCopyInternal()); + if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopyInternal(); + if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopyInternal()); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); + if(Section.Any()) dest.Section = new List(Section.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Composition()); + var instance = new Composition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ConceptMap.cs b/src/Hl7.Fhir.R4/Model/Generated/ConceptMap.cs index 9d273dbae7..77350d936e 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ConceptMap.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ConceptMap.cs @@ -254,7 +254,7 @@ public Hl7.Fhir.Model.ConceptMap.UnmappedComponent Unmapped private Hl7.Fhir.Model.ConceptMap.UnmappedComponent _Unmapped; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -263,19 +263,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopy(); - if(SourceVersionElement != null) dest.SourceVersionElement = (Hl7.Fhir.Model.FhirString)SourceVersionElement.DeepCopy(); - if(TargetElement != null) dest.TargetElement = (Hl7.Fhir.Model.FhirUri)TargetElement.DeepCopy(); - if(TargetVersionElement != null) dest.TargetVersionElement = (Hl7.Fhir.Model.FhirString)TargetVersionElement.DeepCopy(); - if(Element.Any()) dest.Element = new List(Element.DeepCopy()); - if(Unmapped != null) dest.Unmapped = (Hl7.Fhir.Model.ConceptMap.UnmappedComponent)Unmapped.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopyInternal(); + if(SourceVersionElement != null) dest.SourceVersionElement = (Hl7.Fhir.Model.FhirString)SourceVersionElement.DeepCopyInternal(); + if(TargetElement != null) dest.TargetElement = (Hl7.Fhir.Model.FhirUri)TargetElement.DeepCopyInternal(); + if(TargetVersionElement != null) dest.TargetVersionElement = (Hl7.Fhir.Model.FhirString)TargetVersionElement.DeepCopyInternal(); + if(Element.Any()) dest.Element = new List(Element.DeepCopyInternal()); + if(Unmapped != null) dest.Unmapped = (Hl7.Fhir.Model.ConceptMap.UnmappedComponent)Unmapped.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -456,7 +457,7 @@ public List Target private List _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceElementComponent; @@ -465,16 +466,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceElementComponent()); + var instance = new SourceElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -710,7 +712,7 @@ public List Product private List _Product; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetElementComponent; @@ -719,19 +721,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(EquivalenceElement != null) dest.EquivalenceElement = (Code)EquivalenceElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopy()); - if(Product.Any()) dest.Product = new List(Product.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(EquivalenceElement != null) dest.EquivalenceElement = (Code)EquivalenceElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopyInternal()); + if(Product.Any()) dest.Product = new List(Product.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetElementComponent()); + var instance = new TargetElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -961,7 +964,7 @@ public string Display } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OtherElementComponent; @@ -970,17 +973,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PropertyElement != null) dest.PropertyElement = (Hl7.Fhir.Model.FhirUri)PropertyElement.DeepCopy(); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.Canonical)SystemElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PropertyElement != null) dest.PropertyElement = (Hl7.Fhir.Model.FhirUri)PropertyElement.DeepCopyInternal(); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.Canonical)SystemElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OtherElementComponent()); + var instance = new OtherElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1196,7 +1200,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UnmappedComponent; @@ -1205,17 +1209,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.Canonical)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.Canonical)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UnmappedComponent()); + var instance = new UnmappedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1733,7 +1738,7 @@ public List Group Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptMap; @@ -1742,31 +1747,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopy(); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopyInternal(); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptMap()); + var instance = new ConceptMap(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Condition.cs b/src/Hl7.Fhir.R4/Model/Generated/Condition.cs index 491ffbd7ea..e1f3c81907 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Condition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Condition.cs @@ -211,7 +211,7 @@ public Hl7.Fhir.Model.CodeableConcept Type private Hl7.Fhir.Model.CodeableConcept _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StageComponent; @@ -220,16 +220,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Summary != null) dest.Summary = (Hl7.Fhir.Model.CodeableConcept)Summary.DeepCopy(); - if(Assessment.Any()) dest.Assessment = new List(Assessment.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Summary != null) dest.Summary = (Hl7.Fhir.Model.CodeableConcept)Summary.DeepCopyInternal(); + if(Assessment.Any()) dest.Assessment = new List(Assessment.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StageComponent()); + var instance = new StageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -341,7 +342,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EvidenceComponent; @@ -350,15 +351,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EvidenceComponent()); + var instance = new EvidenceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -683,7 +685,7 @@ public List Note Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Condition; @@ -692,30 +694,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ClinicalStatus != null) dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopy(); - if(VerificationStatus != null) dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy(); - if(Abatement != null) dest.Abatement = (Hl7.Fhir.Model.DataType)Abatement.DeepCopy(); - if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy(); - if(Stage.Any()) dest.Stage = new List(Stage.DeepCopy()); - if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ClinicalStatus != null) dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopyInternal(); + if(VerificationStatus != null) dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopyInternal(); + if(Abatement != null) dest.Abatement = (Hl7.Fhir.Model.DataType)Abatement.DeepCopyInternal(); + if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopyInternal(); + if(Stage.Any()) dest.Stage = new List(Stage.DeepCopyInternal()); + if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Condition()); + var instance = new Condition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Consent.cs b/src/Hl7.Fhir.R4/Model/Generated/Consent.cs index 800cf5cf1d..17306de2f1 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Consent.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Consent.cs @@ -240,7 +240,7 @@ public string Uri } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PolicyComponent; @@ -249,15 +249,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AuthorityElement != null) dest.AuthorityElement = (Hl7.Fhir.Model.FhirUri)AuthorityElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AuthorityElement != null) dest.AuthorityElement = (Hl7.Fhir.Model.FhirUri)AuthorityElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PolicyComponent()); + var instance = new PolicyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -407,7 +408,7 @@ public string VerificationDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VerificationComponent; @@ -416,16 +417,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(VerifiedElement != null) dest.VerifiedElement = (Hl7.Fhir.Model.FhirBoolean)VerifiedElement.DeepCopy(); - if(VerifiedWith != null) dest.VerifiedWith = (Hl7.Fhir.Model.ResourceReference)VerifiedWith.DeepCopy(); - if(VerificationDateElement != null) dest.VerificationDateElement = (Hl7.Fhir.Model.FhirDateTime)VerificationDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(VerifiedElement != null) dest.VerifiedElement = (Hl7.Fhir.Model.FhirBoolean)VerifiedElement.DeepCopyInternal(); + if(VerifiedWith != null) dest.VerifiedWith = (Hl7.Fhir.Model.ResourceReference)VerifiedWith.DeepCopyInternal(); + if(VerificationDateElement != null) dest.VerificationDateElement = (Hl7.Fhir.Model.FhirDateTime)VerificationDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VerificationComponent()); + var instance = new VerificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -681,7 +683,7 @@ public List Provision private List _Provision; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as provisionComponent; @@ -690,24 +692,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Purpose.Any()) dest.Purpose = new List(Purpose.DeepCopy()); - if(Class.Any()) dest.Class = new List(Class.DeepCopy()); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(DataPeriod != null) dest.DataPeriod = (Hl7.Fhir.Model.Period)DataPeriod.DeepCopy(); - if(Data.Any()) dest.Data = new List(Data.DeepCopy()); - if(Provision.Any()) dest.Provision = new List(Provision.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Purpose.Any()) dest.Purpose = new List(Purpose.DeepCopyInternal()); + if(Class.Any()) dest.Class = new List(Class.DeepCopyInternal()); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(DataPeriod != null) dest.DataPeriod = (Hl7.Fhir.Model.Period)DataPeriod.DeepCopyInternal(); + if(Data.Any()) dest.Data = new List(Data.DeepCopyInternal()); + if(Provision.Any()) dest.Provision = new List(Provision.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new provisionComponent()); + var instance = new provisionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -882,7 +885,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as provisionActorComponent; @@ -891,15 +894,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new provisionActorComponent()); + var instance = new provisionActorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1021,7 +1025,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as provisionDataComponent; @@ -1030,15 +1034,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MeaningElement != null) dest.MeaningElement = (Code)MeaningElement.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MeaningElement != null) dest.MeaningElement = (Code)MeaningElement.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new provisionDataComponent()); + var instance = new provisionDataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1326,7 +1331,7 @@ public Hl7.Fhir.Model.Consent.provisionComponent Provision List ICoded>.Code { get => Category; set => Category = value; } IEnumerable ICoded.ToCodings() => Category.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Consent; @@ -1335,26 +1340,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Organization.Any()) dest.Organization = new List(Organization.DeepCopy()); - if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopy(); - if(Policy.Any()) dest.Policy = new List(Policy.DeepCopy()); - if(PolicyRule != null) dest.PolicyRule = (Hl7.Fhir.Model.CodeableConcept)PolicyRule.DeepCopy(); - if(Verification.Any()) dest.Verification = new List(Verification.DeepCopy()); - if(Provision != null) dest.Provision = (Hl7.Fhir.Model.Consent.provisionComponent)Provision.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Organization.Any()) dest.Organization = new List(Organization.DeepCopyInternal()); + if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopyInternal(); + if(Policy.Any()) dest.Policy = new List(Policy.DeepCopyInternal()); + if(PolicyRule != null) dest.PolicyRule = (Hl7.Fhir.Model.CodeableConcept)PolicyRule.DeepCopyInternal(); + if(Verification.Any()) dest.Verification = new List(Verification.DeepCopyInternal()); + if(Provision != null) dest.Provision = (Hl7.Fhir.Model.Consent.provisionComponent)Provision.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Consent()); + var instance = new Consent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Contract.cs b/src/Hl7.Fhir.R4/Model/Generated/Contract.cs index 657bdc0de4..9e7a441825 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Contract.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Contract.cs @@ -415,7 +415,7 @@ public string Copyright } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContentDefinitionComponent; @@ -424,19 +424,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(Publisher != null) dest.Publisher = (Hl7.Fhir.Model.ResourceReference)Publisher.DeepCopy(); - if(PublicationDateElement != null) dest.PublicationDateElement = (Hl7.Fhir.Model.FhirDateTime)PublicationDateElement.DeepCopy(); - if(PublicationStatusElement != null) dest.PublicationStatusElement = (Code)PublicationStatusElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(Publisher != null) dest.Publisher = (Hl7.Fhir.Model.ResourceReference)Publisher.DeepCopyInternal(); + if(PublicationDateElement != null) dest.PublicationDateElement = (Hl7.Fhir.Model.FhirDateTime)PublicationDateElement.DeepCopyInternal(); + if(PublicationStatusElement != null) dest.PublicationStatusElement = (Code)PublicationStatusElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContentDefinitionComponent()); + var instance = new ContentDefinitionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -742,7 +743,7 @@ public List Group private List _Group; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TermComponent; @@ -751,25 +752,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopy(); - if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopy(); - if(Topic != null) dest.Topic = (Hl7.Fhir.Model.DataType)Topic.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Offer != null) dest.Offer = (Hl7.Fhir.Model.Contract.ContractOfferComponent)Offer.DeepCopy(); - if(Asset.Any()) dest.Asset = new List(Asset.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopyInternal(); + if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopyInternal(); + if(Topic != null) dest.Topic = (Hl7.Fhir.Model.DataType)Topic.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Offer != null) dest.Offer = (Hl7.Fhir.Model.Contract.ContractOfferComponent)Offer.DeepCopyInternal(); + if(Asset.Any()) dest.Asset = new List(Asset.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TermComponent()); + var instance = new TermComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -998,7 +1000,7 @@ public List Control private List _Control; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SecurityLabelComponent; @@ -1007,17 +1009,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement.Any()) dest.NumberElement = new List(NumberElement.DeepCopy()); - if(Classification != null) dest.Classification = (Hl7.Fhir.Model.Coding)Classification.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Control.Any()) dest.Control = new List(Control.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NumberElement.Any()) dest.NumberElement = new List(NumberElement.DeepCopyInternal()); + if(Classification != null) dest.Classification = (Hl7.Fhir.Model.Coding)Classification.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Control.Any()) dest.Control = new List(Control.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SecurityLabelComponent()); + var instance = new SecurityLabelComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1300,7 +1303,7 @@ public IEnumerable SecurityLabelNumber } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContractOfferComponent; @@ -1309,23 +1312,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Party.Any()) dest.Party = new List(Party.DeepCopy()); - if(Topic != null) dest.Topic = (Hl7.Fhir.Model.ResourceReference)Topic.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopy(); - if(DecisionMode.Any()) dest.DecisionMode = new List(DecisionMode.DeepCopy()); - if(Answer.Any()) dest.Answer = new List(Answer.DeepCopy()); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopy()); - if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Party.Any()) dest.Party = new List(Party.DeepCopyInternal()); + if(Topic != null) dest.Topic = (Hl7.Fhir.Model.ResourceReference)Topic.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopyInternal(); + if(DecisionMode.Any()) dest.DecisionMode = new List(DecisionMode.DeepCopyInternal()); + if(Answer.Any()) dest.Answer = new List(Answer.DeepCopyInternal()); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopyInternal()); + if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContractOfferComponent()); + var instance = new ContractOfferComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1489,7 +1493,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContractPartyComponent; @@ -1498,15 +1502,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference.Any()) dest.Reference = new List(Reference.DeepCopy()); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference.Any()) dest.Reference = new List(Reference.DeepCopyInternal()); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContractPartyComponent()); + var instance = new ContractPartyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1592,7 +1597,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AnswerComponent; @@ -1601,14 +1606,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AnswerComponent()); + var instance = new AnswerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1954,7 +1960,7 @@ public List ValuedItem private List _ValuedItem; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContractAssetComponent; @@ -1963,28 +1969,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(TypeReference.Any()) dest.TypeReference = new List(TypeReference.DeepCopy()); - if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopy()); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.Coding)Relationship.DeepCopy(); - if(Context.Any()) dest.Context = new List(Context.DeepCopy()); - if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopy(); - if(PeriodType.Any()) dest.PeriodType = new List(PeriodType.DeepCopy()); - if(Period.Any()) dest.Period = new List(Period.DeepCopy()); - if(UsePeriod.Any()) dest.UsePeriod = new List(UsePeriod.DeepCopy()); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopy()); - if(Answer.Any()) dest.Answer = new List(Answer.DeepCopy()); - if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopy()); - if(ValuedItem.Any()) dest.ValuedItem = new List(ValuedItem.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(TypeReference.Any()) dest.TypeReference = new List(TypeReference.DeepCopyInternal()); + if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopyInternal()); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.Coding)Relationship.DeepCopyInternal(); + if(Context.Any()) dest.Context = new List(Context.DeepCopyInternal()); + if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopyInternal(); + if(PeriodType.Any()) dest.PeriodType = new List(PeriodType.DeepCopyInternal()); + if(Period.Any()) dest.Period = new List(Period.DeepCopyInternal()); + if(UsePeriod.Any()) dest.UsePeriod = new List(UsePeriod.DeepCopyInternal()); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopyInternal()); + if(Answer.Any()) dest.Answer = new List(Answer.DeepCopyInternal()); + if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopyInternal()); + if(ValuedItem.Any()) dest.ValuedItem = new List(ValuedItem.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContractAssetComponent()); + var instance = new ContractAssetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2218,7 +2225,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssetContextComponent; @@ -2227,16 +2234,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AssetContextComponent()); + var instance = new AssetContextComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2630,7 +2638,7 @@ public IEnumerable SecurityLabelNumber } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ValuedItemComponent; @@ -2639,27 +2647,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Entity != null) dest.Entity = (Hl7.Fhir.Model.DataType)Entity.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(EffectiveTimeElement != null) dest.EffectiveTimeElement = (Hl7.Fhir.Model.FhirDateTime)EffectiveTimeElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(PointsElement != null) dest.PointsElement = (Hl7.Fhir.Model.FhirDecimal)PointsElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(PaymentElement != null) dest.PaymentElement = (Hl7.Fhir.Model.FhirString)PaymentElement.DeepCopy(); - if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.FhirDateTime)PaymentDateElement.DeepCopy(); - if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy(); - if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopy(); - if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopy()); - if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Entity != null) dest.Entity = (Hl7.Fhir.Model.DataType)Entity.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(EffectiveTimeElement != null) dest.EffectiveTimeElement = (Hl7.Fhir.Model.FhirDateTime)EffectiveTimeElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(PointsElement != null) dest.PointsElement = (Hl7.Fhir.Model.FhirDecimal)PointsElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(PaymentElement != null) dest.PaymentElement = (Hl7.Fhir.Model.FhirString)PaymentElement.DeepCopyInternal(); + if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.FhirDateTime)PaymentDateElement.DeepCopyInternal(); + if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopyInternal(); + if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopyInternal(); + if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopyInternal()); + if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ValuedItemComponent()); + var instance = new ValuedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3278,7 +3287,7 @@ public IEnumerable SecurityLabelNumber } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionComponent; @@ -3287,34 +3296,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Intent != null) dest.Intent = (Hl7.Fhir.Model.CodeableConcept)Intent.DeepCopy(); - if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopy()); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(ContextLinkIdElement.Any()) dest.ContextLinkIdElement = new List(ContextLinkIdElement.DeepCopy()); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Requester.Any()) dest.Requester = new List(Requester.DeepCopy()); - if(RequesterLinkIdElement.Any()) dest.RequesterLinkIdElement = new List(RequesterLinkIdElement.DeepCopy()); - if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopy()); - if(PerformerRole != null) dest.PerformerRole = (Hl7.Fhir.Model.CodeableConcept)PerformerRole.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(PerformerLinkIdElement.Any()) dest.PerformerLinkIdElement = new List(PerformerLinkIdElement.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(ReasonElement.Any()) dest.ReasonElement = new List(ReasonElement.DeepCopy()); - if(ReasonLinkIdElement.Any()) dest.ReasonLinkIdElement = new List(ReasonLinkIdElement.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActionComponent()); + base.CopyToInternal(dest); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Intent != null) dest.Intent = (Hl7.Fhir.Model.CodeableConcept)Intent.DeepCopyInternal(); + if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopyInternal()); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(ContextLinkIdElement.Any()) dest.ContextLinkIdElement = new List(ContextLinkIdElement.DeepCopyInternal()); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Requester.Any()) dest.Requester = new List(Requester.DeepCopyInternal()); + if(RequesterLinkIdElement.Any()) dest.RequesterLinkIdElement = new List(RequesterLinkIdElement.DeepCopyInternal()); + if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopyInternal()); + if(PerformerRole != null) dest.PerformerRole = (Hl7.Fhir.Model.CodeableConcept)PerformerRole.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(PerformerLinkIdElement.Any()) dest.PerformerLinkIdElement = new List(PerformerLinkIdElement.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(ReasonElement.Any()) dest.ReasonElement = new List(ReasonElement.DeepCopyInternal()); + if(ReasonLinkIdElement.Any()) dest.ReasonLinkIdElement = new List(ReasonLinkIdElement.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3565,7 +3575,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionSubjectComponent; @@ -3574,15 +3584,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference.Any()) dest.Reference = new List(Reference.DeepCopy()); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference.Any()) dest.Reference = new List(Reference.DeepCopyInternal()); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActionSubjectComponent()); + var instance = new ActionSubjectComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3701,7 +3712,7 @@ public List Signature private List _Signature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SignatoryComponent; @@ -3710,16 +3721,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - if(Signature.Any()) dest.Signature = new List(Signature.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); + if(Signature.Any()) dest.Signature = new List(Signature.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SignatoryComponent()); + var instance = new SignatoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3816,7 +3828,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FriendlyLanguageComponent; @@ -3825,14 +3837,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FriendlyLanguageComponent()); + var instance = new FriendlyLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3913,7 +3926,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LegalLanguageComponent; @@ -3922,14 +3935,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LegalLanguageComponent()); + var instance = new LegalLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4010,7 +4024,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComputableLanguageComponent; @@ -4019,14 +4033,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComputableLanguageComponent()); + var instance = new ComputableLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4711,7 +4726,7 @@ public Hl7.Fhir.Model.DataType LegallyBinding List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Contract; @@ -4720,46 +4735,47 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(LegalState != null) dest.LegalState = (Hl7.Fhir.Model.CodeableConcept)LegalState.DeepCopy(); - if(InstantiatesCanonical != null) dest.InstantiatesCanonical = (Hl7.Fhir.Model.ResourceReference)InstantiatesCanonical.DeepCopy(); - if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopy(); - if(ContentDerivative != null) dest.ContentDerivative = (Hl7.Fhir.Model.CodeableConcept)ContentDerivative.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopy(); - if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopy(); - if(ExpirationType != null) dest.ExpirationType = (Hl7.Fhir.Model.CodeableConcept)ExpirationType.DeepCopy(); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Authority.Any()) dest.Authority = new List(Authority.DeepCopy()); - if(Domain.Any()) dest.Domain = new List(Domain.DeepCopy()); - if(Site.Any()) dest.Site = new List(Site.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopy(); - if(Topic != null) dest.Topic = (Hl7.Fhir.Model.DataType)Topic.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType.Any()) dest.SubType = new List(SubType.DeepCopy()); - if(ContentDefinition != null) dest.ContentDefinition = (Hl7.Fhir.Model.Contract.ContentDefinitionComponent)ContentDefinition.DeepCopy(); - if(Term.Any()) dest.Term = new List(Term.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - if(Signer.Any()) dest.Signer = new List(Signer.DeepCopy()); - if(Friendly.Any()) dest.Friendly = new List(Friendly.DeepCopy()); - if(Legal.Any()) dest.Legal = new List(Legal.DeepCopy()); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - if(LegallyBinding != null) dest.LegallyBinding = (Hl7.Fhir.Model.DataType)LegallyBinding.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(LegalState != null) dest.LegalState = (Hl7.Fhir.Model.CodeableConcept)LegalState.DeepCopyInternal(); + if(InstantiatesCanonical != null) dest.InstantiatesCanonical = (Hl7.Fhir.Model.ResourceReference)InstantiatesCanonical.DeepCopyInternal(); + if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopyInternal(); + if(ContentDerivative != null) dest.ContentDerivative = (Hl7.Fhir.Model.CodeableConcept)ContentDerivative.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopyInternal(); + if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopyInternal(); + if(ExpirationType != null) dest.ExpirationType = (Hl7.Fhir.Model.CodeableConcept)ExpirationType.DeepCopyInternal(); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Authority.Any()) dest.Authority = new List(Authority.DeepCopyInternal()); + if(Domain.Any()) dest.Domain = new List(Domain.DeepCopyInternal()); + if(Site.Any()) dest.Site = new List(Site.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopyInternal(); + if(Topic != null) dest.Topic = (Hl7.Fhir.Model.DataType)Topic.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType.Any()) dest.SubType = new List(SubType.DeepCopyInternal()); + if(ContentDefinition != null) dest.ContentDefinition = (Hl7.Fhir.Model.Contract.ContentDefinitionComponent)ContentDefinition.DeepCopyInternal(); + if(Term.Any()) dest.Term = new List(Term.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); + if(Signer.Any()) dest.Signer = new List(Signer.DeepCopyInternal()); + if(Friendly.Any()) dest.Friendly = new List(Friendly.DeepCopyInternal()); + if(Legal.Any()) dest.Legal = new List(Legal.DeepCopyInternal()); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); + if(LegallyBinding != null) dest.LegallyBinding = (Hl7.Fhir.Model.DataType)LegallyBinding.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Contract()); + var instance = new Contract(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Contributor.cs b/src/Hl7.Fhir.R4/Model/Generated/Contributor.cs index 30ee19d168..faed7067b0 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Contributor.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Contributor.cs @@ -173,7 +173,7 @@ public List Contact private List _Contact; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Contributor; @@ -182,16 +182,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Contributor()); + var instance = new Contributor(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Count.cs b/src/Hl7.Fhir.R4/Model/Generated/Count.cs index e964d92efb..a737eb5327 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Count.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Count.cs @@ -60,9 +60,11 @@ public partial class Count : Quantity /// public override string TypeName { get { return "Count"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Count()); + var instance = new Count(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.R4/Model/Generated/Coverage.cs b/src/Hl7.Fhir.R4/Model/Generated/Coverage.cs index 929c729cb1..8ab5290233 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Coverage.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Coverage.cs @@ -155,7 +155,7 @@ public string Name } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClassComponent; @@ -164,16 +164,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClassComponent()); + var instance = new ClassComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -298,7 +299,7 @@ public List Exception private List _Exception; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CostToBeneficiaryComponent; @@ -307,16 +308,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Exception.Any()) dest.Exception = new List(Exception.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Exception.Any()) dest.Exception = new List(Exception.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CostToBeneficiaryComponent()); + var instance = new CostToBeneficiaryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -424,7 +426,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExemptionComponent; @@ -433,15 +435,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExemptionComponent()); + var instance = new ExemptionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -852,7 +855,7 @@ public List Contract Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Type; set => Type = value; } IEnumerable ICoded.ToCodings() => Type.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Coverage; @@ -861,30 +864,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(PolicyHolder != null) dest.PolicyHolder = (Hl7.Fhir.Model.ResourceReference)PolicyHolder.DeepCopy(); - if(Subscriber != null) dest.Subscriber = (Hl7.Fhir.Model.ResourceReference)Subscriber.DeepCopy(); - if(SubscriberIdElement != null) dest.SubscriberIdElement = (Hl7.Fhir.Model.FhirString)SubscriberIdElement.DeepCopy(); - if(Beneficiary != null) dest.Beneficiary = (Hl7.Fhir.Model.ResourceReference)Beneficiary.DeepCopy(); - if(DependentElement != null) dest.DependentElement = (Hl7.Fhir.Model.FhirString)DependentElement.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Payor.Any()) dest.Payor = new List(Payor.DeepCopy()); - if(Class.Any()) dest.Class = new List(Class.DeepCopy()); - if(OrderElement != null) dest.OrderElement = (Hl7.Fhir.Model.PositiveInt)OrderElement.DeepCopy(); - if(NetworkElement != null) dest.NetworkElement = (Hl7.Fhir.Model.FhirString)NetworkElement.DeepCopy(); - if(CostToBeneficiary.Any()) dest.CostToBeneficiary = new List(CostToBeneficiary.DeepCopy()); - if(SubrogationElement != null) dest.SubrogationElement = (Hl7.Fhir.Model.FhirBoolean)SubrogationElement.DeepCopy(); - if(Contract.Any()) dest.Contract = new List(Contract.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(PolicyHolder != null) dest.PolicyHolder = (Hl7.Fhir.Model.ResourceReference)PolicyHolder.DeepCopyInternal(); + if(Subscriber != null) dest.Subscriber = (Hl7.Fhir.Model.ResourceReference)Subscriber.DeepCopyInternal(); + if(SubscriberIdElement != null) dest.SubscriberIdElement = (Hl7.Fhir.Model.FhirString)SubscriberIdElement.DeepCopyInternal(); + if(Beneficiary != null) dest.Beneficiary = (Hl7.Fhir.Model.ResourceReference)Beneficiary.DeepCopyInternal(); + if(DependentElement != null) dest.DependentElement = (Hl7.Fhir.Model.FhirString)DependentElement.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Payor.Any()) dest.Payor = new List(Payor.DeepCopyInternal()); + if(Class.Any()) dest.Class = new List(Class.DeepCopyInternal()); + if(OrderElement != null) dest.OrderElement = (Hl7.Fhir.Model.PositiveInt)OrderElement.DeepCopyInternal(); + if(NetworkElement != null) dest.NetworkElement = (Hl7.Fhir.Model.FhirString)NetworkElement.DeepCopyInternal(); + if(CostToBeneficiary.Any()) dest.CostToBeneficiary = new List(CostToBeneficiary.DeepCopyInternal()); + if(SubrogationElement != null) dest.SubrogationElement = (Hl7.Fhir.Model.FhirBoolean)SubrogationElement.DeepCopyInternal(); + if(Contract.Any()) dest.Contract = new List(Contract.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Coverage()); + var instance = new Coverage(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/CoverageEligibilityRequest.cs b/src/Hl7.Fhir.R4/Model/Generated/CoverageEligibilityRequest.cs index 45fc74b709..1bc14287be 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/CoverageEligibilityRequest.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/CoverageEligibilityRequest.cs @@ -189,7 +189,7 @@ public bool? AppliesToAll } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportingInformationComponent; @@ -198,16 +198,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Information != null) dest.Information = (Hl7.Fhir.Model.ResourceReference)Information.DeepCopy(); - if(AppliesToAllElement != null) dest.AppliesToAllElement = (Hl7.Fhir.Model.FhirBoolean)AppliesToAllElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Information != null) dest.Information = (Hl7.Fhir.Model.ResourceReference)Information.DeepCopyInternal(); + if(AppliesToAllElement != null) dest.AppliesToAllElement = (Hl7.Fhir.Model.FhirBoolean)AppliesToAllElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportingInformationComponent()); + var instance = new SupportingInformationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -366,7 +367,7 @@ public string BusinessArrangement } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -375,16 +376,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -625,7 +627,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailsComponent; @@ -634,23 +636,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SupportingInfoSequenceElement.Any()) dest.SupportingInfoSequenceElement = new List(SupportingInfoSequenceElement.DeepCopy()); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SupportingInfoSequenceElement.Any()) dest.SupportingInfoSequenceElement = new List(SupportingInfoSequenceElement.DeepCopyInternal()); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailsComponent()); + var instance = new DetailsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -803,7 +806,7 @@ public Hl7.Fhir.Model.DataType Diagnosis private Hl7.Fhir.Model.DataType _Diagnosis; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -812,14 +815,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1131,7 +1135,7 @@ public List Item List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageEligibilityRequest; @@ -1140,27 +1144,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(PurposeElement.Any()) dest.PurposeElement = new List>(PurposeElement.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(PurposeElement.Any()) dest.PurposeElement = new List>(PurposeElement.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageEligibilityRequest()); + var instance = new CoverageEligibilityRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/CoverageEligibilityResponse.cs b/src/Hl7.Fhir.R4/Model/Generated/CoverageEligibilityResponse.cs index 74c7d95f7c..48700ddc59 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/CoverageEligibilityResponse.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/CoverageEligibilityResponse.cs @@ -184,7 +184,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -193,17 +193,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(InforceElement != null) dest.InforceElement = (Hl7.Fhir.Model.FhirBoolean)InforceElement.DeepCopy(); - if(BenefitPeriod != null) dest.BenefitPeriod = (Hl7.Fhir.Model.Period)BenefitPeriod.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(InforceElement != null) dest.InforceElement = (Hl7.Fhir.Model.FhirBoolean)InforceElement.DeepCopyInternal(); + if(BenefitPeriod != null) dest.BenefitPeriod = (Hl7.Fhir.Model.Period)BenefitPeriod.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -575,7 +576,7 @@ public string AuthorizationUrl } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemsComponent; @@ -584,27 +585,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopy(); - if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopy()); - if(AuthorizationRequiredElement != null) dest.AuthorizationRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AuthorizationRequiredElement.DeepCopy(); - if(AuthorizationSupporting.Any()) dest.AuthorizationSupporting = new List(AuthorizationSupporting.DeepCopy()); - if(AuthorizationUrlElement != null) dest.AuthorizationUrlElement = (Hl7.Fhir.Model.FhirUri)AuthorizationUrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopyInternal(); + if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopyInternal()); + if(AuthorizationRequiredElement != null) dest.AuthorizationRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AuthorizationRequiredElement.DeepCopyInternal(); + if(AuthorizationSupporting.Any()) dest.AuthorizationSupporting = new List(AuthorizationSupporting.DeepCopyInternal()); + if(AuthorizationUrlElement != null) dest.AuthorizationUrlElement = (Hl7.Fhir.Model.FhirUri)AuthorizationUrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemsComponent()); + var instance = new ItemsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -817,7 +819,7 @@ public Hl7.Fhir.Model.DataType Used private Hl7.Fhir.Model.DataType _Used; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BenefitComponent; @@ -826,16 +828,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopy(); - if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopyInternal(); + if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BenefitComponent()); + var instance = new BenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -930,7 +933,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ErrorsComponent; @@ -939,14 +942,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ErrorsComponent()); + var instance = new ErrorsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1326,7 +1330,7 @@ public List Error List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageEligibilityResponse; @@ -1335,28 +1339,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(PurposeElement.Any()) dest.PurposeElement = new List>(PurposeElement.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(Error.Any()) dest.Error = new List(Error.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(PurposeElement.Any()) dest.PurposeElement = new List>(PurposeElement.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(Error.Any()) dest.Error = new List(Error.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageEligibilityResponse()); + var instance = new CoverageEligibilityResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/DataRequirement.cs b/src/Hl7.Fhir.R4/Model/Generated/DataRequirement.cs index 4c95b0dfc7..0dd55fab0b 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/DataRequirement.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/DataRequirement.cs @@ -204,7 +204,7 @@ public List Code private List _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeFilterComponent; @@ -213,17 +213,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CodeFilterComponent()); + var instance = new CodeFilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -388,7 +389,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DateFilterComponent; @@ -397,16 +398,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DateFilterComponent()); + var instance = new DateFilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -553,7 +555,7 @@ public Hl7.Fhir.Model.DataRequirement.SortDirection? Direction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SortComponent; @@ -562,15 +564,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SortComponent()); + var instance = new SortComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -814,7 +817,7 @@ public List Sort private List _Sort; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DataRequirement; @@ -823,21 +826,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(MustSupportElement.Any()) dest.MustSupportElement = new List(MustSupportElement.DeepCopy()); - if(CodeFilter.Any()) dest.CodeFilter = new List(CodeFilter.DeepCopy()); - if(DateFilter.Any()) dest.DateFilter = new List(DateFilter.DeepCopy()); - if(LimitElement != null) dest.LimitElement = (Hl7.Fhir.Model.PositiveInt)LimitElement.DeepCopy(); - if(Sort.Any()) dest.Sort = new List(Sort.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(MustSupportElement.Any()) dest.MustSupportElement = new List(MustSupportElement.DeepCopyInternal()); + if(CodeFilter.Any()) dest.CodeFilter = new List(CodeFilter.DeepCopyInternal()); + if(DateFilter.Any()) dest.DateFilter = new List(DateFilter.DeepCopyInternal()); + if(LimitElement != null) dest.LimitElement = (Hl7.Fhir.Model.PositiveInt)LimitElement.DeepCopyInternal(); + if(Sort.Any()) dest.Sort = new List(Sort.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DataRequirement()); + var instance = new DataRequirement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/DetectedIssue.cs b/src/Hl7.Fhir.R4/Model/Generated/DetectedIssue.cs index ebc9efc3ab..41eccec8fb 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/DetectedIssue.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/DetectedIssue.cs @@ -134,7 +134,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EvidenceComponent; @@ -143,15 +143,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EvidenceComponent()); + var instance = new EvidenceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -284,7 +285,7 @@ public Hl7.Fhir.Model.ResourceReference Author private Hl7.Fhir.Model.ResourceReference _Author; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MitigationComponent; @@ -293,16 +294,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MitigationComponent()); + var instance = new MitigationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -617,7 +619,7 @@ public List Mitigation Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetectedIssue; @@ -626,25 +628,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Identified != null) dest.Identified = (Hl7.Fhir.Model.DataType)Identified.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Implicated.Any()) dest.Implicated = new List(Implicated.DeepCopy()); - if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopy()); - if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopy(); - if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopy(); - if(Mitigation.Any()) dest.Mitigation = new List(Mitigation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Identified != null) dest.Identified = (Hl7.Fhir.Model.DataType)Identified.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Implicated.Any()) dest.Implicated = new List(Implicated.DeepCopyInternal()); + if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopyInternal()); + if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopyInternal(); + if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopyInternal(); + if(Mitigation.Any()) dest.Mitigation = new List(Mitigation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetectedIssue()); + var instance = new DetectedIssue(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Device.cs b/src/Hl7.Fhir.R4/Model/Generated/Device.cs index 6b8f8bad06..976c17ecc8 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Device.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Device.cs @@ -344,7 +344,7 @@ public Hl7.Fhir.Model.Device.UDIEntryType? EntryType } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UdiCarrierComponent; @@ -353,19 +353,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopy(); - if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopy(); - if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopy(); - if(CarrierAIDCElement != null) dest.CarrierAIDCElement = (Hl7.Fhir.Model.Base64Binary)CarrierAIDCElement.DeepCopy(); - if(CarrierHRFElement != null) dest.CarrierHRFElement = (Hl7.Fhir.Model.FhirString)CarrierHRFElement.DeepCopy(); - if(EntryTypeElement != null) dest.EntryTypeElement = (Code)EntryTypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopyInternal(); + if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopyInternal(); + if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopyInternal(); + if(CarrierAIDCElement != null) dest.CarrierAIDCElement = (Hl7.Fhir.Model.Base64Binary)CarrierAIDCElement.DeepCopyInternal(); + if(CarrierHRFElement != null) dest.CarrierHRFElement = (Hl7.Fhir.Model.FhirString)CarrierHRFElement.DeepCopyInternal(); + if(EntryTypeElement != null) dest.EntryTypeElement = (Code)EntryTypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UdiCarrierComponent()); + var instance = new UdiCarrierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -535,7 +536,7 @@ public Hl7.Fhir.Model.DeviceNameType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceNameComponent; @@ -544,15 +545,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceNameComponent()); + var instance = new DeviceNameComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -666,7 +668,7 @@ public string Version } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SpecializationComponent; @@ -675,15 +677,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SystemType != null) dest.SystemType = (Hl7.Fhir.Model.CodeableConcept)SystemType.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SystemType != null) dest.SystemType = (Hl7.Fhir.Model.CodeableConcept)SystemType.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SpecializationComponent()); + var instance = new SpecializationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -810,7 +813,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VersionComponent; @@ -819,16 +822,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Component != null) dest.Component = (Hl7.Fhir.Model.Identifier)Component.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Component != null) dest.Component = (Hl7.Fhir.Model.Identifier)Component.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VersionComponent()); + var instance = new VersionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -947,7 +951,7 @@ public List ValueCode private List _ValueCode; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -956,16 +960,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ValueQuantity.Any()) dest.ValueQuantity = new List(ValueQuantity.DeepCopy()); - if(ValueCode.Any()) dest.ValueCode = new List(ValueCode.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ValueQuantity.Any()) dest.ValueQuantity = new List(ValueQuantity.DeepCopyInternal()); + if(ValueCode.Any()) dest.ValueCode = new List(ValueCode.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1576,7 +1581,7 @@ public Hl7.Fhir.Model.ResourceReference Parent Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Type; set => Type = value; } IEnumerable ICoded.ToCodings() => Type.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Device; @@ -1585,39 +1590,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopy(); - if(UdiCarrier.Any()) dest.UdiCarrier = new List(UdiCarrier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopy()); - if(DistinctIdentifierElement != null) dest.DistinctIdentifierElement = (Hl7.Fhir.Model.FhirString)DistinctIdentifierElement.DeepCopy(); - if(ManufacturerElement != null) dest.ManufacturerElement = (Hl7.Fhir.Model.FhirString)ManufacturerElement.DeepCopy(); - if(ManufactureDateElement != null) dest.ManufactureDateElement = (Hl7.Fhir.Model.FhirDateTime)ManufactureDateElement.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopy(); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(SerialNumberElement != null) dest.SerialNumberElement = (Hl7.Fhir.Model.FhirString)SerialNumberElement.DeepCopy(); - if(DeviceName.Any()) dest.DeviceName = new List(DeviceName.DeepCopy()); - if(ModelNumberElement != null) dest.ModelNumberElement = (Hl7.Fhir.Model.FhirString)ModelNumberElement.DeepCopy(); - if(PartNumberElement != null) dest.PartNumberElement = (Hl7.Fhir.Model.FhirString)PartNumberElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Specialization.Any()) dest.Specialization = new List(Specialization.DeepCopy()); - if(Version.Any()) dest.Version = new List(Version.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Safety.Any()) dest.Safety = new List(Safety.DeepCopy()); - if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopyInternal(); + if(UdiCarrier.Any()) dest.UdiCarrier = new List(UdiCarrier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopyInternal()); + if(DistinctIdentifierElement != null) dest.DistinctIdentifierElement = (Hl7.Fhir.Model.FhirString)DistinctIdentifierElement.DeepCopyInternal(); + if(ManufacturerElement != null) dest.ManufacturerElement = (Hl7.Fhir.Model.FhirString)ManufacturerElement.DeepCopyInternal(); + if(ManufactureDateElement != null) dest.ManufactureDateElement = (Hl7.Fhir.Model.FhirDateTime)ManufactureDateElement.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopyInternal(); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(SerialNumberElement != null) dest.SerialNumberElement = (Hl7.Fhir.Model.FhirString)SerialNumberElement.DeepCopyInternal(); + if(DeviceName.Any()) dest.DeviceName = new List(DeviceName.DeepCopyInternal()); + if(ModelNumberElement != null) dest.ModelNumberElement = (Hl7.Fhir.Model.FhirString)ModelNumberElement.DeepCopyInternal(); + if(PartNumberElement != null) dest.PartNumberElement = (Hl7.Fhir.Model.FhirString)PartNumberElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Specialization.Any()) dest.Specialization = new List(Specialization.DeepCopyInternal()); + if(Version.Any()) dest.Version = new List(Version.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Safety.Any()) dest.Safety = new List(Safety.DeepCopyInternal()); + if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Device()); + var instance = new Device(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/DeviceDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/DeviceDefinition.cs index c02270614f..4818907ee9 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/DeviceDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/DeviceDefinition.cs @@ -172,7 +172,7 @@ public string Jurisdiction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UdiDeviceIdentifierComponent; @@ -181,16 +181,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopy(); - if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopy(); - if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopyInternal(); + if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopyInternal(); + if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UdiDeviceIdentifierComponent()); + var instance = new UdiDeviceIdentifierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -333,7 +334,7 @@ public Hl7.Fhir.Model.DeviceNameType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceNameComponent; @@ -342,15 +343,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceNameComponent()); + var instance = new DeviceNameComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -482,7 +484,7 @@ public string Version } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SpecializationComponent; @@ -491,15 +493,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SystemTypeElement != null) dest.SystemTypeElement = (Hl7.Fhir.Model.FhirString)SystemTypeElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SystemTypeElement != null) dest.SystemTypeElement = (Hl7.Fhir.Model.FhirString)SystemTypeElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SpecializationComponent()); + var instance = new SpecializationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -596,7 +599,7 @@ public List Description private List _Description; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CapabilityComponent; @@ -605,15 +608,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Description.Any()) dest.Description = new List(Description.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Description.Any()) dest.Description = new List(Description.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CapabilityComponent()); + var instance = new CapabilityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -724,7 +728,7 @@ public List ValueCode private List _ValueCode; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -733,16 +737,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ValueQuantity.Any()) dest.ValueQuantity = new List(ValueQuantity.DeepCopy()); - if(ValueCode.Any()) dest.ValueCode = new List(ValueCode.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ValueQuantity.Any()) dest.ValueQuantity = new List(ValueQuantity.DeepCopyInternal()); + if(ValueCode.Any()) dest.ValueCode = new List(ValueCode.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -895,7 +900,7 @@ public bool? AllergenicIndicator } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MaterialComponent; @@ -904,16 +909,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopy(); - if(AlternateElement != null) dest.AlternateElement = (Hl7.Fhir.Model.FhirBoolean)AlternateElement.DeepCopy(); - if(AllergenicIndicatorElement != null) dest.AllergenicIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)AllergenicIndicatorElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopyInternal(); + if(AlternateElement != null) dest.AlternateElement = (Hl7.Fhir.Model.FhirBoolean)AlternateElement.DeepCopyInternal(); + if(AllergenicIndicatorElement != null) dest.AllergenicIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)AllergenicIndicatorElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MaterialComponent()); + var instance = new MaterialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1359,7 +1365,7 @@ public List Material List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceDefinition; @@ -1368,35 +1374,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(UdiDeviceIdentifier.Any()) dest.UdiDeviceIdentifier = new List(UdiDeviceIdentifier.DeepCopy()); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.DataType)Manufacturer.DeepCopy(); - if(DeviceName.Any()) dest.DeviceName = new List(DeviceName.DeepCopy()); - if(ModelNumberElement != null) dest.ModelNumberElement = (Hl7.Fhir.Model.FhirString)ModelNumberElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Specialization.Any()) dest.Specialization = new List(Specialization.DeepCopy()); - if(VersionElement.Any()) dest.VersionElement = new List(VersionElement.DeepCopy()); - if(Safety.Any()) dest.Safety = new List(Safety.DeepCopy()); - if(ShelfLifeStorage.Any()) dest.ShelfLifeStorage = new List(ShelfLifeStorage.DeepCopy()); - if(PhysicalCharacteristics != null) dest.PhysicalCharacteristics = (Hl7.Fhir.Model.ProdCharacteristic)PhysicalCharacteristics.DeepCopy(); - if(LanguageCode.Any()) dest.LanguageCode = new List(LanguageCode.DeepCopy()); - if(Capability.Any()) dest.Capability = new List(Capability.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(OnlineInformationElement != null) dest.OnlineInformationElement = (Hl7.Fhir.Model.FhirUri)OnlineInformationElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(ParentDevice != null) dest.ParentDevice = (Hl7.Fhir.Model.ResourceReference)ParentDevice.DeepCopy(); - if(Material.Any()) dest.Material = new List(Material.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(UdiDeviceIdentifier.Any()) dest.UdiDeviceIdentifier = new List(UdiDeviceIdentifier.DeepCopyInternal()); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.DataType)Manufacturer.DeepCopyInternal(); + if(DeviceName.Any()) dest.DeviceName = new List(DeviceName.DeepCopyInternal()); + if(ModelNumberElement != null) dest.ModelNumberElement = (Hl7.Fhir.Model.FhirString)ModelNumberElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Specialization.Any()) dest.Specialization = new List(Specialization.DeepCopyInternal()); + if(VersionElement.Any()) dest.VersionElement = new List(VersionElement.DeepCopyInternal()); + if(Safety.Any()) dest.Safety = new List(Safety.DeepCopyInternal()); + if(ShelfLifeStorage.Any()) dest.ShelfLifeStorage = new List(ShelfLifeStorage.DeepCopyInternal()); + if(PhysicalCharacteristics != null) dest.PhysicalCharacteristics = (Hl7.Fhir.Model.ProdCharacteristic)PhysicalCharacteristics.DeepCopyInternal(); + if(LanguageCode.Any()) dest.LanguageCode = new List(LanguageCode.DeepCopyInternal()); + if(Capability.Any()) dest.Capability = new List(Capability.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(OnlineInformationElement != null) dest.OnlineInformationElement = (Hl7.Fhir.Model.FhirUri)OnlineInformationElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(ParentDevice != null) dest.ParentDevice = (Hl7.Fhir.Model.ResourceReference)ParentDevice.DeepCopyInternal(); + if(Material.Any()) dest.Material = new List(Material.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceDefinition()); + var instance = new DeviceDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/DeviceMetric.cs b/src/Hl7.Fhir.R4/Model/Generated/DeviceMetric.cs index 094ea01042..fae7165178 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/DeviceMetric.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/DeviceMetric.cs @@ -364,7 +364,7 @@ public DateTimeOffset? Time } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CalibrationComponent; @@ -373,16 +373,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(StateElement != null) dest.StateElement = (Code)StateElement.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.Instant)TimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(StateElement != null) dest.StateElement = (Code)StateElement.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.Instant)TimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CalibrationComponent()); + var instance = new CalibrationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -651,7 +652,7 @@ public List Calibration Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Type; set => Type = value; } IEnumerable ICoded.ToCodings() => Type.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceMetric; @@ -660,23 +661,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopy(); - if(OperationalStatusElement != null) dest.OperationalStatusElement = (Code)OperationalStatusElement.DeepCopy(); - if(ColorElement != null) dest.ColorElement = (Code)ColorElement.DeepCopy(); - if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopy(); - if(MeasurementPeriod != null) dest.MeasurementPeriod = (Hl7.Fhir.Model.Timing)MeasurementPeriod.DeepCopy(); - if(Calibration.Any()) dest.Calibration = new List(Calibration.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopyInternal(); + if(OperationalStatusElement != null) dest.OperationalStatusElement = (Code)OperationalStatusElement.DeepCopyInternal(); + if(ColorElement != null) dest.ColorElement = (Code)ColorElement.DeepCopyInternal(); + if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopyInternal(); + if(MeasurementPeriod != null) dest.MeasurementPeriod = (Hl7.Fhir.Model.Timing)MeasurementPeriod.DeepCopyInternal(); + if(Calibration.Any()) dest.Calibration = new List(Calibration.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceMetric()); + var instance = new DeviceMetric(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/DeviceRequest.cs b/src/Hl7.Fhir.R4/Model/Generated/DeviceRequest.cs index a1545138da..0d42ca4eee 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/DeviceRequest.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/DeviceRequest.cs @@ -104,7 +104,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -113,15 +113,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -651,7 +652,7 @@ public List RelevantHistory Hl7.Fhir.Model.DataType ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceRequest; @@ -660,37 +661,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PriorRequest.Any()) dest.PriorRequest = new List(PriorRequest.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.DataType)Code.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new DeviceRequest()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PriorRequest.Any()) dest.PriorRequest = new List(PriorRequest.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.DataType)Code.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new DeviceRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/DeviceUseStatement.cs b/src/Hl7.Fhir.R4/Model/Generated/DeviceUseStatement.cs index ca64e194cb..d7224bc7c6 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/DeviceUseStatement.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/DeviceUseStatement.cs @@ -338,7 +338,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceUseStatement; @@ -347,26 +347,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopy()); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(RecordedOnElement != null) dest.RecordedOnElement = (Hl7.Fhir.Model.FhirDateTime)RecordedOnElement.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopyInternal()); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(RecordedOnElement != null) dest.RecordedOnElement = (Hl7.Fhir.Model.FhirDateTime)RecordedOnElement.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceUseStatement()); + var instance = new DeviceUseStatement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/DiagnosticReport.cs b/src/Hl7.Fhir.R4/Model/Generated/DiagnosticReport.cs index eb5dda3d7f..29073329d1 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/DiagnosticReport.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/DiagnosticReport.cs @@ -193,7 +193,7 @@ public Hl7.Fhir.Model.ResourceReference Link private Hl7.Fhir.Model.ResourceReference _Link; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MediaComponent; @@ -202,15 +202,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Link != null) dest.Link = (Hl7.Fhir.Model.ResourceReference)Link.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Link != null) dest.Link = (Hl7.Fhir.Model.ResourceReference)Link.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MediaComponent()); + var instance = new MediaComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -595,7 +596,7 @@ public List PresentedForm Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosticReport; @@ -604,31 +605,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(ResultsInterpreter.Any()) dest.ResultsInterpreter = new List(ResultsInterpreter.DeepCopy()); - if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopy()); - if(Result.Any()) dest.Result = new List(Result.DeepCopy()); - if(ImagingStudy.Any()) dest.ImagingStudy = new List(ImagingStudy.DeepCopy()); - if(Media.Any()) dest.Media = new List(Media.DeepCopy()); - if(ConclusionElement != null) dest.ConclusionElement = (Hl7.Fhir.Model.FhirString)ConclusionElement.DeepCopy(); - if(ConclusionCode.Any()) dest.ConclusionCode = new List(ConclusionCode.DeepCopy()); - if(PresentedForm.Any()) dest.PresentedForm = new List(PresentedForm.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(ResultsInterpreter.Any()) dest.ResultsInterpreter = new List(ResultsInterpreter.DeepCopyInternal()); + if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopyInternal()); + if(Result.Any()) dest.Result = new List(Result.DeepCopyInternal()); + if(ImagingStudy.Any()) dest.ImagingStudy = new List(ImagingStudy.DeepCopyInternal()); + if(Media.Any()) dest.Media = new List(Media.DeepCopyInternal()); + if(ConclusionElement != null) dest.ConclusionElement = (Hl7.Fhir.Model.FhirString)ConclusionElement.DeepCopyInternal(); + if(ConclusionCode.Any()) dest.ConclusionCode = new List(ConclusionCode.DeepCopyInternal()); + if(PresentedForm.Any()) dest.PresentedForm = new List(PresentedForm.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosticReport()); + var instance = new DiagnosticReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Distance.cs b/src/Hl7.Fhir.R4/Model/Generated/Distance.cs index 9e42167de6..9cf246d897 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Distance.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Distance.cs @@ -59,9 +59,11 @@ public partial class Distance : Quantity /// public override string TypeName { get { return "Distance"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Distance()); + var instance = new Distance(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.R4/Model/Generated/DocumentManifest.cs b/src/Hl7.Fhir.R4/Model/Generated/DocumentManifest.cs index d726c39d7f..cc74555db0 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/DocumentManifest.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/DocumentManifest.cs @@ -104,7 +104,7 @@ public Hl7.Fhir.Model.ResourceReference Ref private Hl7.Fhir.Model.ResourceReference _Ref; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedComponent; @@ -113,15 +113,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Ref != null) dest.Ref = (Hl7.Fhir.Model.ResourceReference)Ref.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Ref != null) dest.Ref = (Hl7.Fhir.Model.ResourceReference)Ref.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedComponent()); + var instance = new RelatedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -424,7 +425,7 @@ public List Related List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DocumentManifest; @@ -433,25 +434,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MasterIdentifier != null) dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Content.Any()) dest.Content = new List(Content.DeepCopy()); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(MasterIdentifier != null) dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Content.Any()) dest.Content = new List(Content.DeepCopyInternal()); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DocumentManifest()); + var instance = new DocumentManifest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/DocumentReference.cs b/src/Hl7.Fhir.R4/Model/Generated/DocumentReference.cs index 993b976c9a..16bf51f227 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/DocumentReference.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/DocumentReference.cs @@ -127,7 +127,7 @@ public Hl7.Fhir.Model.ResourceReference Target private Hl7.Fhir.Model.ResourceReference _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatesToComponent; @@ -136,15 +136,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatesToComponent()); + var instance = new RelatesToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -244,7 +245,7 @@ public Hl7.Fhir.Model.Coding Format private Hl7.Fhir.Model.Coding _Format; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContentComponent; @@ -253,15 +254,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopy(); - if(Format != null) dest.Format = (Hl7.Fhir.Model.Coding)Format.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopyInternal(); + if(Format != null) dest.Format = (Hl7.Fhir.Model.Coding)Format.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContentComponent()); + var instance = new ContentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -437,7 +439,7 @@ public List Related private List _Related; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContextComponent; @@ -446,20 +448,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopy()); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(FacilityType != null) dest.FacilityType = (Hl7.Fhir.Model.CodeableConcept)FacilityType.DeepCopy(); - if(PracticeSetting != null) dest.PracticeSetting = (Hl7.Fhir.Model.CodeableConcept)PracticeSetting.DeepCopy(); - if(SourcePatientInfo != null) dest.SourcePatientInfo = (Hl7.Fhir.Model.ResourceReference)SourcePatientInfo.DeepCopy(); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopyInternal()); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(FacilityType != null) dest.FacilityType = (Hl7.Fhir.Model.CodeableConcept)FacilityType.DeepCopyInternal(); + if(PracticeSetting != null) dest.PracticeSetting = (Hl7.Fhir.Model.CodeableConcept)PracticeSetting.DeepCopyInternal(); + if(SourcePatientInfo != null) dest.SourcePatientInfo = (Hl7.Fhir.Model.ResourceReference)SourcePatientInfo.DeepCopyInternal(); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContextComponent()); + var instance = new ContextComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -859,7 +862,7 @@ public Hl7.Fhir.Model.DocumentReference.ContextComponent Context List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DocumentReference; @@ -868,29 +871,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MasterIdentifier != null) dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DocStatusElement != null) dest.DocStatusElement = (Code)DocStatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Instant)DateElement.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Authenticator != null) dest.Authenticator = (Hl7.Fhir.Model.ResourceReference)Authenticator.DeepCopy(); - if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy(); - if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Content.Any()) dest.Content = new List(Content.DeepCopy()); - if(Context != null) dest.Context = (Hl7.Fhir.Model.DocumentReference.ContextComponent)Context.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MasterIdentifier != null) dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DocStatusElement != null) dest.DocStatusElement = (Code)DocStatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Instant)DateElement.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Authenticator != null) dest.Authenticator = (Hl7.Fhir.Model.ResourceReference)Authenticator.DeepCopyInternal(); + if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopyInternal(); + if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Content.Any()) dest.Content = new List(Content.DeepCopyInternal()); + if(Context != null) dest.Context = (Hl7.Fhir.Model.DocumentReference.ContextComponent)Context.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DocumentReference()); + var instance = new DocumentReference(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Dosage.cs b/src/Hl7.Fhir.R4/Model/Generated/Dosage.cs index a2104e6edf..cb6633e6f8 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Dosage.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Dosage.cs @@ -119,7 +119,7 @@ public Hl7.Fhir.Model.DataType Rate private Hl7.Fhir.Model.DataType _Rate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DoseAndRateComponent; @@ -128,16 +128,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Dose != null) dest.Dose = (Hl7.Fhir.Model.DataType)Dose.DeepCopy(); - if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Dose != null) dest.Dose = (Hl7.Fhir.Model.DataType)Dose.DeepCopyInternal(); + if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DoseAndRateComponent()); + var instance = new DoseAndRateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -433,7 +434,7 @@ public Hl7.Fhir.Model.Quantity MaxDosePerLifetime private Hl7.Fhir.Model.Quantity _MaxDosePerLifetime; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Dosage; @@ -442,26 +443,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.Integer)SequenceElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(AdditionalInstruction.Any()) dest.AdditionalInstruction = new List(AdditionalInstruction.DeepCopy()); - if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.Timing)Timing.DeepCopy(); - if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopy(); - if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy(); - if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(DoseAndRate.Any()) dest.DoseAndRate = new List(DoseAndRate.DeepCopy()); - if(MaxDosePerPeriod != null) dest.MaxDosePerPeriod = (Hl7.Fhir.Model.Ratio)MaxDosePerPeriod.DeepCopy(); - if(MaxDosePerAdministration != null) dest.MaxDosePerAdministration = (Hl7.Fhir.Model.Quantity)MaxDosePerAdministration.DeepCopy(); - if(MaxDosePerLifetime != null) dest.MaxDosePerLifetime = (Hl7.Fhir.Model.Quantity)MaxDosePerLifetime.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.Integer)SequenceElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(AdditionalInstruction.Any()) dest.AdditionalInstruction = new List(AdditionalInstruction.DeepCopyInternal()); + if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.Timing)Timing.DeepCopyInternal(); + if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopyInternal(); + if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopyInternal(); + if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(DoseAndRate.Any()) dest.DoseAndRate = new List(DoseAndRate.DeepCopyInternal()); + if(MaxDosePerPeriod != null) dest.MaxDosePerPeriod = (Hl7.Fhir.Model.Ratio)MaxDosePerPeriod.DeepCopyInternal(); + if(MaxDosePerAdministration != null) dest.MaxDosePerAdministration = (Hl7.Fhir.Model.Quantity)MaxDosePerAdministration.DeepCopyInternal(); + if(MaxDosePerLifetime != null) dest.MaxDosePerLifetime = (Hl7.Fhir.Model.Quantity)MaxDosePerLifetime.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Dosage()); + var instance = new Dosage(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Duration.cs b/src/Hl7.Fhir.R4/Model/Generated/Duration.cs index a7076554b4..fcaf895ca5 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Duration.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Duration.cs @@ -59,9 +59,11 @@ public partial class Duration : Quantity /// public override string TypeName { get { return "Duration"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Duration()); + var instance = new Duration(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.R4/Model/Generated/EffectEvidenceSynthesis.cs b/src/Hl7.Fhir.R4/Model/Generated/EffectEvidenceSynthesis.cs index 9dbd09852a..561bb1ff36 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/EffectEvidenceSynthesis.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/EffectEvidenceSynthesis.cs @@ -190,7 +190,7 @@ public int? NumberOfParticipants } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SampleSizeComponent; @@ -199,16 +199,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(NumberOfStudiesElement != null) dest.NumberOfStudiesElement = (Hl7.Fhir.Model.Integer)NumberOfStudiesElement.DeepCopy(); - if(NumberOfParticipantsElement != null) dest.NumberOfParticipantsElement = (Hl7.Fhir.Model.Integer)NumberOfParticipantsElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(NumberOfStudiesElement != null) dest.NumberOfStudiesElement = (Hl7.Fhir.Model.Integer)NumberOfStudiesElement.DeepCopyInternal(); + if(NumberOfParticipantsElement != null) dest.NumberOfParticipantsElement = (Hl7.Fhir.Model.Integer)NumberOfParticipantsElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SampleSizeComponent()); + var instance = new SampleSizeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -382,7 +383,7 @@ public Hl7.Fhir.Model.ResourceReference RiskEvidenceSynthesis private Hl7.Fhir.Model.ResourceReference _RiskEvidenceSynthesis; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResultsByExposureComponent; @@ -391,17 +392,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(ExposureStateElement != null) dest.ExposureStateElement = (Code)ExposureStateElement.DeepCopy(); - if(VariantState != null) dest.VariantState = (Hl7.Fhir.Model.CodeableConcept)VariantState.DeepCopy(); - if(RiskEvidenceSynthesis != null) dest.RiskEvidenceSynthesis = (Hl7.Fhir.Model.ResourceReference)RiskEvidenceSynthesis.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(ExposureStateElement != null) dest.ExposureStateElement = (Code)ExposureStateElement.DeepCopyInternal(); + if(VariantState != null) dest.VariantState = (Hl7.Fhir.Model.CodeableConcept)VariantState.DeepCopyInternal(); + if(RiskEvidenceSynthesis != null) dest.RiskEvidenceSynthesis = (Hl7.Fhir.Model.ResourceReference)RiskEvidenceSynthesis.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResultsByExposureComponent()); + var instance = new ResultsByExposureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -607,7 +609,7 @@ public List P private List _PrecisionEstimate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EffectEstimateComponent; @@ -616,19 +618,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(VariantState != null) dest.VariantState = (Hl7.Fhir.Model.CodeableConcept)VariantState.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy(); - if(UnitOfMeasure != null) dest.UnitOfMeasure = (Hl7.Fhir.Model.CodeableConcept)UnitOfMeasure.DeepCopy(); - if(PrecisionEstimate.Any()) dest.PrecisionEstimate = new List(PrecisionEstimate.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(VariantState != null) dest.VariantState = (Hl7.Fhir.Model.CodeableConcept)VariantState.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopyInternal(); + if(UnitOfMeasure != null) dest.UnitOfMeasure = (Hl7.Fhir.Model.CodeableConcept)UnitOfMeasure.DeepCopyInternal(); + if(PrecisionEstimate.Any()) dest.PrecisionEstimate = new List(PrecisionEstimate.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EffectEstimateComponent()); + var instance = new EffectEstimateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -839,7 +842,7 @@ public decimal? To } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PrecisionEstimateComponent; @@ -848,17 +851,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(LevelElement != null) dest.LevelElement = (Hl7.Fhir.Model.FhirDecimal)LevelElement.DeepCopy(); - if(FromElement != null) dest.FromElement = (Hl7.Fhir.Model.FhirDecimal)FromElement.DeepCopy(); - if(ToElement != null) dest.ToElement = (Hl7.Fhir.Model.FhirDecimal)ToElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(LevelElement != null) dest.LevelElement = (Hl7.Fhir.Model.FhirDecimal)LevelElement.DeepCopyInternal(); + if(FromElement != null) dest.FromElement = (Hl7.Fhir.Model.FhirDecimal)FromElement.DeepCopyInternal(); + if(ToElement != null) dest.ToElement = (Hl7.Fhir.Model.FhirDecimal)ToElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PrecisionEstimateComponent()); + var instance = new PrecisionEstimateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -989,7 +993,7 @@ public List _CertaintySubcomponent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CertaintyComponent; @@ -998,16 +1002,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Rating.Any()) dest.Rating = new List(Rating.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(CertaintySubcomponent.Any()) dest.CertaintySubcomponent = new List(CertaintySubcomponent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Rating.Any()) dest.Rating = new List(Rating.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(CertaintySubcomponent.Any()) dest.CertaintySubcomponent = new List(CertaintySubcomponent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CertaintyComponent()); + var instance = new CertaintyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1130,7 +1135,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CertaintySubcomponentComponent; @@ -1139,16 +1144,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Rating.Any()) dest.Rating = new List(Rating.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Rating.Any()) dest.Rating = new List(Rating.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CertaintySubcomponentComponent()); + var instance = new CertaintySubcomponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1874,7 +1880,7 @@ public List Certainty List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EffectEvidenceSynthesis; @@ -1883,46 +1889,47 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(SynthesisType != null) dest.SynthesisType = (Hl7.Fhir.Model.CodeableConcept)SynthesisType.DeepCopy(); - if(StudyType != null) dest.StudyType = (Hl7.Fhir.Model.CodeableConcept)StudyType.DeepCopy(); - if(Population != null) dest.Population = (Hl7.Fhir.Model.ResourceReference)Population.DeepCopy(); - if(Exposure != null) dest.Exposure = (Hl7.Fhir.Model.ResourceReference)Exposure.DeepCopy(); - if(ExposureAlternative != null) dest.ExposureAlternative = (Hl7.Fhir.Model.ResourceReference)ExposureAlternative.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.ResourceReference)Outcome.DeepCopy(); - if(SampleSize != null) dest.SampleSize = (Hl7.Fhir.Model.EffectEvidenceSynthesis.SampleSizeComponent)SampleSize.DeepCopy(); - if(ResultsByExposure.Any()) dest.ResultsByExposure = new List(ResultsByExposure.DeepCopy()); - if(EffectEstimate.Any()) dest.EffectEstimate = new List(EffectEstimate.DeepCopy()); - if(Certainty.Any()) dest.Certainty = new List(Certainty.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(SynthesisType != null) dest.SynthesisType = (Hl7.Fhir.Model.CodeableConcept)SynthesisType.DeepCopyInternal(); + if(StudyType != null) dest.StudyType = (Hl7.Fhir.Model.CodeableConcept)StudyType.DeepCopyInternal(); + if(Population != null) dest.Population = (Hl7.Fhir.Model.ResourceReference)Population.DeepCopyInternal(); + if(Exposure != null) dest.Exposure = (Hl7.Fhir.Model.ResourceReference)Exposure.DeepCopyInternal(); + if(ExposureAlternative != null) dest.ExposureAlternative = (Hl7.Fhir.Model.ResourceReference)ExposureAlternative.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.ResourceReference)Outcome.DeepCopyInternal(); + if(SampleSize != null) dest.SampleSize = (Hl7.Fhir.Model.EffectEvidenceSynthesis.SampleSizeComponent)SampleSize.DeepCopyInternal(); + if(ResultsByExposure.Any()) dest.ResultsByExposure = new List(ResultsByExposure.DeepCopyInternal()); + if(EffectEstimate.Any()) dest.EffectEstimate = new List(EffectEstimate.DeepCopyInternal()); + if(Certainty.Any()) dest.Certainty = new List(Certainty.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EffectEvidenceSynthesis()); + var instance = new EffectEvidenceSynthesis(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Encounter.cs b/src/Hl7.Fhir.R4/Model/Generated/Encounter.cs index 9118b1d7ff..03ec91c6f5 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Encounter.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Encounter.cs @@ -224,7 +224,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StatusHistoryComponent; @@ -233,15 +233,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StatusHistoryComponent()); + var instance = new StatusHistoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -342,7 +343,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClassHistoryComponent; @@ -351,15 +352,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Class != null) dest.Class = (Hl7.Fhir.Model.Coding)Class.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Class != null) dest.Class = (Hl7.Fhir.Model.Coding)Class.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClassHistoryComponent()); + var instance = new ClassHistoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -474,7 +476,7 @@ public Hl7.Fhir.Model.ResourceReference Individual private Hl7.Fhir.Model.ResourceReference _Individual; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -483,16 +485,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Individual != null) dest.Individual = (Hl7.Fhir.Model.ResourceReference)Individual.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Individual != null) dest.Individual = (Hl7.Fhir.Model.ResourceReference)Individual.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -630,7 +633,7 @@ public int? Rank } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -639,16 +642,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopy(); - if(Use != null) dest.Use = (Hl7.Fhir.Model.CodeableConcept)Use.DeepCopy(); - if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopyInternal(); + if(Use != null) dest.Use = (Hl7.Fhir.Model.CodeableConcept)Use.DeepCopyInternal(); + if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -859,7 +863,7 @@ public Hl7.Fhir.Model.CodeableConcept DischargeDisposition private Hl7.Fhir.Model.CodeableConcept _DischargeDisposition; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HospitalizationComponent; @@ -868,22 +872,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PreAdmissionIdentifier != null) dest.PreAdmissionIdentifier = (Hl7.Fhir.Model.Identifier)PreAdmissionIdentifier.DeepCopy(); - if(Origin != null) dest.Origin = (Hl7.Fhir.Model.ResourceReference)Origin.DeepCopy(); - if(AdmitSource != null) dest.AdmitSource = (Hl7.Fhir.Model.CodeableConcept)AdmitSource.DeepCopy(); - if(ReAdmission != null) dest.ReAdmission = (Hl7.Fhir.Model.CodeableConcept)ReAdmission.DeepCopy(); - if(DietPreference.Any()) dest.DietPreference = new List(DietPreference.DeepCopy()); - if(SpecialCourtesy.Any()) dest.SpecialCourtesy = new List(SpecialCourtesy.DeepCopy()); - if(SpecialArrangement.Any()) dest.SpecialArrangement = new List(SpecialArrangement.DeepCopy()); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(DischargeDisposition != null) dest.DischargeDisposition = (Hl7.Fhir.Model.CodeableConcept)DischargeDisposition.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PreAdmissionIdentifier != null) dest.PreAdmissionIdentifier = (Hl7.Fhir.Model.Identifier)PreAdmissionIdentifier.DeepCopyInternal(); + if(Origin != null) dest.Origin = (Hl7.Fhir.Model.ResourceReference)Origin.DeepCopyInternal(); + if(AdmitSource != null) dest.AdmitSource = (Hl7.Fhir.Model.CodeableConcept)AdmitSource.DeepCopyInternal(); + if(ReAdmission != null) dest.ReAdmission = (Hl7.Fhir.Model.CodeableConcept)ReAdmission.DeepCopyInternal(); + if(DietPreference.Any()) dest.DietPreference = new List(DietPreference.DeepCopyInternal()); + if(SpecialCourtesy.Any()) dest.SpecialCourtesy = new List(SpecialCourtesy.DeepCopyInternal()); + if(SpecialArrangement.Any()) dest.SpecialArrangement = new List(SpecialArrangement.DeepCopyInternal()); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(DischargeDisposition != null) dest.DischargeDisposition = (Hl7.Fhir.Model.CodeableConcept)DischargeDisposition.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HospitalizationComponent()); + var instance = new HospitalizationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1088,7 +1093,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LocationComponent; @@ -1097,17 +1102,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(PhysicalType != null) dest.PhysicalType = (Hl7.Fhir.Model.CodeableConcept)PhysicalType.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(PhysicalType != null) dest.PhysicalType = (Hl7.Fhir.Model.CodeableConcept)PhysicalType.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LocationComponent()); + var instance = new LocationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1539,7 +1545,7 @@ public Hl7.Fhir.Model.ResourceReference PartOf List ICoded>.Code { get => Type; set => Type = value; } IEnumerable ICoded.ToCodings() => Type.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Encounter; @@ -1548,36 +1554,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopy()); - if(Class != null) dest.Class = (Hl7.Fhir.Model.Coding)Class.DeepCopy(); - if(ClassHistory.Any()) dest.ClassHistory = new List(ClassHistory.DeepCopy()); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(ServiceType != null) dest.ServiceType = (Hl7.Fhir.Model.CodeableConcept)ServiceType.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(EpisodeOfCare.Any()) dest.EpisodeOfCare = new List(EpisodeOfCare.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Appointment.Any()) dest.Appointment = new List(Appointment.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Length != null) dest.Length = (Hl7.Fhir.Model.Duration)Length.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Account.Any()) dest.Account = new List(Account.DeepCopy()); - if(Hospitalization != null) dest.Hospitalization = (Hl7.Fhir.Model.Encounter.HospitalizationComponent)Hospitalization.DeepCopy(); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(ServiceProvider != null) dest.ServiceProvider = (Hl7.Fhir.Model.ResourceReference)ServiceProvider.DeepCopy(); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopyInternal()); + if(Class != null) dest.Class = (Hl7.Fhir.Model.Coding)Class.DeepCopyInternal(); + if(ClassHistory.Any()) dest.ClassHistory = new List(ClassHistory.DeepCopyInternal()); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(ServiceType != null) dest.ServiceType = (Hl7.Fhir.Model.CodeableConcept)ServiceType.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(EpisodeOfCare.Any()) dest.EpisodeOfCare = new List(EpisodeOfCare.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Appointment.Any()) dest.Appointment = new List(Appointment.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Length != null) dest.Length = (Hl7.Fhir.Model.Duration)Length.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Account.Any()) dest.Account = new List(Account.DeepCopyInternal()); + if(Hospitalization != null) dest.Hospitalization = (Hl7.Fhir.Model.Encounter.HospitalizationComponent)Hospitalization.DeepCopyInternal(); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(ServiceProvider != null) dest.ServiceProvider = (Hl7.Fhir.Model.ResourceReference)ServiceProvider.DeepCopyInternal(); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Encounter()); + var instance = new Encounter(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Endpoint.cs b/src/Hl7.Fhir.R4/Model/Generated/Endpoint.cs index 88fc726a35..a7caad5a04 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Endpoint.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Endpoint.cs @@ -355,7 +355,7 @@ public IEnumerable Header List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Endpoint; @@ -364,24 +364,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ConnectionType != null) dest.ConnectionType = (Hl7.Fhir.Model.Coding)ConnectionType.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(PayloadType.Any()) dest.PayloadType = new List(PayloadType.DeepCopy()); - if(PayloadMimeTypeElement.Any()) dest.PayloadMimeTypeElement = new List(PayloadMimeTypeElement.DeepCopy()); - if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirUrl)AddressElement.DeepCopy(); - if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ConnectionType != null) dest.ConnectionType = (Hl7.Fhir.Model.Coding)ConnectionType.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(PayloadType.Any()) dest.PayloadType = new List(PayloadType.DeepCopyInternal()); + if(PayloadMimeTypeElement.Any()) dest.PayloadMimeTypeElement = new List(PayloadMimeTypeElement.DeepCopyInternal()); + if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirUrl)AddressElement.DeepCopyInternal(); + if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Endpoint()); + var instance = new Endpoint(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/EnrollmentRequest.cs b/src/Hl7.Fhir.R4/Model/Generated/EnrollmentRequest.cs index 5357f4c6db..e7afa571e4 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/EnrollmentRequest.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/EnrollmentRequest.cs @@ -199,7 +199,7 @@ public Hl7.Fhir.Model.ResourceReference Coverage List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnrollmentRequest; @@ -208,20 +208,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Candidate != null) dest.Candidate = (Hl7.Fhir.Model.ResourceReference)Candidate.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Candidate != null) dest.Candidate = (Hl7.Fhir.Model.ResourceReference)Candidate.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnrollmentRequest()); + var instance = new EnrollmentRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/EnrollmentResponse.cs b/src/Hl7.Fhir.R4/Model/Generated/EnrollmentResponse.cs index 9fa3c7047d..b422dde4fc 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/EnrollmentResponse.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/EnrollmentResponse.cs @@ -248,7 +248,7 @@ public Hl7.Fhir.Model.ResourceReference RequestProvider List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnrollmentResponse; @@ -257,21 +257,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnrollmentResponse()); + var instance = new EnrollmentResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/EpisodeOfCare.cs b/src/Hl7.Fhir.R4/Model/Generated/EpisodeOfCare.cs index f09ccfa105..03edfb793f 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/EpisodeOfCare.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/EpisodeOfCare.cs @@ -175,7 +175,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StatusHistoryComponent; @@ -184,15 +184,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StatusHistoryComponent()); + var instance = new StatusHistoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -322,7 +323,7 @@ public int? Rank } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -331,16 +332,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -607,7 +609,7 @@ public List Account List ICoded>.Code { get => Type; set => Type = value; } IEnumerable ICoded.ToCodings() => Type.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EpisodeOfCare; @@ -616,25 +618,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopy()); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(ReferralRequest.Any()) dest.ReferralRequest = new List(ReferralRequest.DeepCopy()); - if(CareManager != null) dest.CareManager = (Hl7.Fhir.Model.ResourceReference)CareManager.DeepCopy(); - if(Team.Any()) dest.Team = new List(Team.DeepCopy()); - if(Account.Any()) dest.Account = new List(Account.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopyInternal()); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(ReferralRequest.Any()) dest.ReferralRequest = new List(ReferralRequest.DeepCopyInternal()); + if(CareManager != null) dest.CareManager = (Hl7.Fhir.Model.ResourceReference)CareManager.DeepCopyInternal(); + if(Team.Any()) dest.Team = new List(Team.DeepCopyInternal()); + if(Account.Any()) dest.Account = new List(Account.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EpisodeOfCare()); + var instance = new EpisodeOfCare(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/EventDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/EventDefinition.cs index 3936e587b4..41ae047e97 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/EventDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/EventDefinition.cs @@ -715,7 +715,7 @@ public List Trigger List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventDefinition; @@ -724,41 +724,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventDefinition()); + var instance = new EventDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Evidence.cs b/src/Hl7.Fhir.R4/Model/Generated/Evidence.cs index 60dffd435c..4797d0c6e0 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Evidence.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Evidence.cs @@ -684,7 +684,7 @@ public List Outcome List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Evidence; @@ -693,41 +693,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(ExposureBackground != null) dest.ExposureBackground = (Hl7.Fhir.Model.ResourceReference)ExposureBackground.DeepCopy(); - if(ExposureVariant.Any()) dest.ExposureVariant = new List(ExposureVariant.DeepCopy()); - if(Outcome.Any()) dest.Outcome = new List(Outcome.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Evidence()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(ExposureBackground != null) dest.ExposureBackground = (Hl7.Fhir.Model.ResourceReference)ExposureBackground.DeepCopyInternal(); + if(ExposureVariant.Any()) dest.ExposureVariant = new List(ExposureVariant.DeepCopyInternal()); + if(Outcome.Any()) dest.Outcome = new List(Outcome.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Evidence(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/EvidenceVariable.cs b/src/Hl7.Fhir.R4/Model/Generated/EvidenceVariable.cs index 52fd75b5d2..0f5d7f6870 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/EvidenceVariable.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/EvidenceVariable.cs @@ -231,7 +231,7 @@ public Hl7.Fhir.Model.GroupMeasureCode? GroupMeasure } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -240,20 +240,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopy(); - if(UsageContext.Any()) dest.UsageContext = new List(UsageContext.DeepCopy()); - if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopy(); - if(ParticipantEffective != null) dest.ParticipantEffective = (Hl7.Fhir.Model.DataType)ParticipantEffective.DeepCopy(); - if(TimeFromStart != null) dest.TimeFromStart = (Hl7.Fhir.Model.Duration)TimeFromStart.DeepCopy(); - if(GroupMeasureElement != null) dest.GroupMeasureElement = (Code)GroupMeasureElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopyInternal(); + if(UsageContext.Any()) dest.UsageContext = new List(UsageContext.DeepCopyInternal()); + if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopyInternal(); + if(ParticipantEffective != null) dest.ParticipantEffective = (Hl7.Fhir.Model.DataType)ParticipantEffective.DeepCopyInternal(); + if(TimeFromStart != null) dest.TimeFromStart = (Hl7.Fhir.Model.Duration)TimeFromStart.DeepCopyInternal(); + if(GroupMeasureElement != null) dest.GroupMeasureElement = (Code)GroupMeasureElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -973,7 +974,7 @@ public List Characteris List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EvidenceVariable; @@ -982,40 +983,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EvidenceVariable()); + var instance = new EvidenceVariable(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ExampleScenario.cs b/src/Hl7.Fhir.R4/Model/Generated/ExampleScenario.cs index 407327082f..931de80353 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ExampleScenario.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ExampleScenario.cs @@ -219,7 +219,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActorComponent; @@ -228,17 +228,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ActorIdElement != null) dest.ActorIdElement = (Hl7.Fhir.Model.FhirString)ActorIdElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ActorIdElement != null) dest.ActorIdElement = (Hl7.Fhir.Model.FhirString)ActorIdElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActorComponent()); + var instance = new ActorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -479,7 +480,7 @@ public List Contained private List _ContainedInstance; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -488,19 +489,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResourceIdElement != null) dest.ResourceIdElement = (Hl7.Fhir.Model.FhirString)ResourceIdElement.DeepCopy(); - if(ResourceTypeElement != null) dest.ResourceTypeElement = (Code)ResourceTypeElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Version.Any()) dest.Version = new List(Version.DeepCopy()); - if(ContainedInstance.Any()) dest.ContainedInstance = new List(ContainedInstance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ResourceIdElement != null) dest.ResourceIdElement = (Hl7.Fhir.Model.FhirString)ResourceIdElement.DeepCopyInternal(); + if(ResourceTypeElement != null) dest.ResourceTypeElement = (Code)ResourceTypeElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Version.Any()) dest.Version = new List(Version.DeepCopyInternal()); + if(ContainedInstance.Any()) dest.ContainedInstance = new List(ContainedInstance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -665,7 +667,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VersionComponent; @@ -674,15 +676,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(VersionIdElement != null) dest.VersionIdElement = (Hl7.Fhir.Model.FhirString)VersionIdElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(VersionIdElement != null) dest.VersionIdElement = (Hl7.Fhir.Model.FhirString)VersionIdElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VersionComponent()); + var instance = new VersionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -817,7 +820,7 @@ public string VersionId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainedInstanceComponent; @@ -826,15 +829,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResourceIdElement != null) dest.ResourceIdElement = (Hl7.Fhir.Model.FhirString)ResourceIdElement.DeepCopy(); - if(VersionIdElement != null) dest.VersionIdElement = (Hl7.Fhir.Model.FhirString)VersionIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ResourceIdElement != null) dest.ResourceIdElement = (Hl7.Fhir.Model.FhirString)ResourceIdElement.DeepCopyInternal(); + if(VersionIdElement != null) dest.VersionIdElement = (Hl7.Fhir.Model.FhirString)VersionIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainedInstanceComponent()); + var instance = new ContainedInstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1042,7 +1046,7 @@ public List Step private List _Step; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcessComponent; @@ -1051,18 +1055,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(PreConditionsElement != null) dest.PreConditionsElement = (Hl7.Fhir.Model.Markdown)PreConditionsElement.DeepCopy(); - if(PostConditionsElement != null) dest.PostConditionsElement = (Hl7.Fhir.Model.Markdown)PostConditionsElement.DeepCopy(); - if(Step.Any()) dest.Step = new List(Step.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(PreConditionsElement != null) dest.PreConditionsElement = (Hl7.Fhir.Model.Markdown)PreConditionsElement.DeepCopyInternal(); + if(PostConditionsElement != null) dest.PostConditionsElement = (Hl7.Fhir.Model.Markdown)PostConditionsElement.DeepCopyInternal(); + if(Step.Any()) dest.Step = new List(Step.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcessComponent()); + var instance = new ProcessComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1227,7 +1232,7 @@ public List Alternative private List _Alternative; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StepComponent; @@ -1236,17 +1241,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Process.Any()) dest.Process = new List(Process.DeepCopy()); - if(PauseElement != null) dest.PauseElement = (Hl7.Fhir.Model.FhirBoolean)PauseElement.DeepCopy(); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.ExampleScenario.OperationComponent)Operation.DeepCopy(); - if(Alternative.Any()) dest.Alternative = new List(Alternative.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Process.Any()) dest.Process = new List(Process.DeepCopyInternal()); + if(PauseElement != null) dest.PauseElement = (Hl7.Fhir.Model.FhirBoolean)PauseElement.DeepCopyInternal(); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.ExampleScenario.OperationComponent)Operation.DeepCopyInternal(); + if(Alternative.Any()) dest.Alternative = new List(Alternative.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StepComponent()); + var instance = new StepComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1606,7 +1612,7 @@ public Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent Response private Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent _Response; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -1615,23 +1621,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.FhirString)NumberElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(InitiatorElement != null) dest.InitiatorElement = (Hl7.Fhir.Model.FhirString)InitiatorElement.DeepCopy(); - if(ReceiverElement != null) dest.ReceiverElement = (Hl7.Fhir.Model.FhirString)ReceiverElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(InitiatorActiveElement != null) dest.InitiatorActiveElement = (Hl7.Fhir.Model.FhirBoolean)InitiatorActiveElement.DeepCopy(); - if(ReceiverActiveElement != null) dest.ReceiverActiveElement = (Hl7.Fhir.Model.FhirBoolean)ReceiverActiveElement.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent)Request.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent)Response.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.FhirString)NumberElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(InitiatorElement != null) dest.InitiatorElement = (Hl7.Fhir.Model.FhirString)InitiatorElement.DeepCopyInternal(); + if(ReceiverElement != null) dest.ReceiverElement = (Hl7.Fhir.Model.FhirString)ReceiverElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(InitiatorActiveElement != null) dest.InitiatorActiveElement = (Hl7.Fhir.Model.FhirBoolean)InitiatorActiveElement.DeepCopyInternal(); + if(ReceiverActiveElement != null) dest.ReceiverActiveElement = (Hl7.Fhir.Model.FhirBoolean)ReceiverActiveElement.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent)Request.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent)Response.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationComponent()); + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1844,7 +1851,7 @@ public List Step private List _Step; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AlternativeComponent; @@ -1853,16 +1860,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Step.Any()) dest.Step = new List(Step.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Step.Any()) dest.Step = new List(Step.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AlternativeComponent()); + var instance = new AlternativeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2341,7 +2349,7 @@ public IEnumerable Workflow List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExampleScenario; @@ -2350,30 +2358,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - if(Process.Any()) dest.Process = new List(Process.DeepCopy()); - if(WorkflowElement.Any()) dest.WorkflowElement = new List(WorkflowElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); + if(Process.Any()) dest.Process = new List(Process.DeepCopyInternal()); + if(WorkflowElement.Any()) dest.WorkflowElement = new List(WorkflowElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExampleScenario()); + var instance = new ExampleScenario(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ExplanationOfBenefit.cs b/src/Hl7.Fhir.R4/Model/Generated/ExplanationOfBenefit.cs index cd9d5cdb95..b20ee783c0 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ExplanationOfBenefit.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ExplanationOfBenefit.cs @@ -152,7 +152,7 @@ public Hl7.Fhir.Model.Identifier Reference private Hl7.Fhir.Model.Identifier _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedClaimComponent; @@ -161,16 +161,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedClaimComponent()); + var instance = new RelatedClaimComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -280,7 +281,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayeeComponent; @@ -289,15 +290,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayeeComponent()); + var instance = new PayeeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -476,7 +478,7 @@ public Hl7.Fhir.Model.CodeableConcept Qualification private Hl7.Fhir.Model.CodeableConcept _Qualification; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CareTeamComponent; @@ -485,18 +487,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Qualification != null) dest.Qualification = (Hl7.Fhir.Model.CodeableConcept)Qualification.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Qualification != null) dest.Qualification = (Hl7.Fhir.Model.CodeableConcept)Qualification.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CareTeamComponent()); + var instance = new CareTeamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -699,7 +702,7 @@ public Hl7.Fhir.Model.Coding Reason private Hl7.Fhir.Model.Coding _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportingInformationComponent; @@ -708,19 +711,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.Coding)Reason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.Coding)Reason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportingInformationComponent()); + var instance = new SupportingInformationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -917,7 +921,7 @@ public Hl7.Fhir.Model.CodeableConcept PackageCode private Hl7.Fhir.Model.CodeableConcept _PackageCode; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -926,18 +930,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(OnAdmission != null) dest.OnAdmission = (Hl7.Fhir.Model.CodeableConcept)OnAdmission.DeepCopy(); - if(PackageCode != null) dest.PackageCode = (Hl7.Fhir.Model.CodeableConcept)PackageCode.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(OnAdmission != null) dest.OnAdmission = (Hl7.Fhir.Model.CodeableConcept)OnAdmission.DeepCopyInternal(); + if(PackageCode != null) dest.PackageCode = (Hl7.Fhir.Model.CodeableConcept)PackageCode.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1145,7 +1150,7 @@ public List Udi private List _Udi; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcedureComponent; @@ -1154,18 +1159,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcedureComponent()); + var instance = new ProcedureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1342,7 +1348,7 @@ public IEnumerable PreAuthRef } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -1351,16 +1357,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1501,7 +1508,7 @@ public Hl7.Fhir.Model.DataType Location private Hl7.Fhir.Model.DataType _Location; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AccidentComponent; @@ -1510,16 +1517,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AccidentComponent()); + var instance = new AccidentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2055,7 +2063,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -2064,36 +2072,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(CareTeamSequenceElement.Any()) dest.CareTeamSequenceElement = new List(CareTeamSequenceElement.DeepCopy()); - if(DiagnosisSequenceElement.Any()) dest.DiagnosisSequenceElement = new List(DiagnosisSequenceElement.DeepCopy()); - if(ProcedureSequenceElement.Any()) dest.ProcedureSequenceElement = new List(ProcedureSequenceElement.DeepCopy()); - if(InformationSequenceElement.Any()) dest.InformationSequenceElement = new List(InformationSequenceElement.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ItemComponent()); + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(CareTeamSequenceElement.Any()) dest.CareTeamSequenceElement = new List(CareTeamSequenceElement.DeepCopyInternal()); + if(DiagnosisSequenceElement.Any()) dest.DiagnosisSequenceElement = new List(DiagnosisSequenceElement.DeepCopyInternal()); + if(ProcedureSequenceElement.Any()) dest.ProcedureSequenceElement = new List(ProcedureSequenceElement.DeepCopyInternal()); + if(InformationSequenceElement.Any()) dest.InformationSequenceElement = new List(InformationSequenceElement.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); + if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2406,7 +2415,7 @@ public decimal? Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdjudicationComponent; @@ -2415,17 +2424,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdjudicationComponent()); + var instance = new AdjudicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2764,7 +2774,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -2773,27 +2783,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3198,7 +3209,7 @@ public List Adjudicat private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubDetailComponent; @@ -3207,26 +3218,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubDetailComponent()); + var instance = new SubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3734,7 +3746,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemComponent; @@ -3743,31 +3755,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemSequenceElement.Any()) dest.ItemSequenceElement = new List(ItemSequenceElement.DeepCopy()); - if(DetailSequenceElement.Any()) dest.DetailSequenceElement = new List(DetailSequenceElement.DeepCopy()); - if(SubDetailSequenceElement.Any()) dest.SubDetailSequenceElement = new List(SubDetailSequenceElement.DeepCopy()); - if(Provider.Any()) dest.Provider = new List(Provider.DeepCopy()); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new AddedItemComponent()); + base.CopyToInternal(dest); + if(ItemSequenceElement.Any()) dest.ItemSequenceElement = new List(ItemSequenceElement.DeepCopyInternal()); + if(DetailSequenceElement.Any()) dest.DetailSequenceElement = new List(DetailSequenceElement.DeepCopyInternal()); + if(SubDetailSequenceElement.Any()) dest.SubDetailSequenceElement = new List(SubDetailSequenceElement.DeepCopyInternal()); + if(Provider.Any()) dest.Provider = new List(Provider.DeepCopyInternal()); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new AddedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4127,7 +4140,7 @@ public List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemDetailComponent; @@ -4136,22 +4149,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemDetailComponent()); + var instance = new AddedItemDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4425,7 +4439,7 @@ public List Adjudicat private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemDetailSubDetailComponent; @@ -4434,21 +4448,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemDetailSubDetailComponent()); + var instance = new AddedItemDetailSubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4598,7 +4613,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TotalComponent; @@ -4607,15 +4622,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TotalComponent()); + var instance = new TotalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4785,7 +4801,7 @@ public Hl7.Fhir.Model.Identifier Identifier private Hl7.Fhir.Model.Identifier _Identifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentComponent; @@ -4794,19 +4810,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopy(); - if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopyInternal(); + if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentComponent()); + var instance = new PaymentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5019,7 +5036,7 @@ public Hl7.Fhir.Model.CodeableConcept Language private Hl7.Fhir.Model.CodeableConcept _Language; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NoteComponent; @@ -5028,17 +5045,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NoteComponent()); + var instance = new NoteComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5287,7 +5305,7 @@ public List Financial private List _Financial; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BenefitBalanceComponent; @@ -5296,21 +5314,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopy(); - if(Financial.Any()) dest.Financial = new List(Financial.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopyInternal(); + if(Financial.Any()) dest.Financial = new List(Financial.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BenefitBalanceComponent()); + var instance = new BenefitBalanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5475,7 +5494,7 @@ public Hl7.Fhir.Model.DataType Used private Hl7.Fhir.Model.DataType _Used; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BenefitComponent; @@ -5484,16 +5503,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopy(); - if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopyInternal(); + if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BenefitComponent()); + var instance = new BenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -6302,7 +6322,7 @@ public List Benefit Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Type; set => Type = value; } IEnumerable ICoded.ToCodings() => Type.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExplanationOfBenefit; @@ -6311,56 +6331,57 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(FundsReserveRequested != null) dest.FundsReserveRequested = (Hl7.Fhir.Model.CodeableConcept)FundsReserveRequested.DeepCopy(); - if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopy(); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopy(); - if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ExplanationOfBenefit.PayeeComponent)Payee.DeepCopy(); - if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopy(); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopy(); - if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopy()); - if(PreAuthRefPeriod.Any()) dest.PreAuthRefPeriod = new List(PreAuthRefPeriod.DeepCopy()); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopy()); - if(PrecedenceElement != null) dest.PrecedenceElement = (Hl7.Fhir.Model.PositiveInt)PrecedenceElement.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Accident != null) dest.Accident = (Hl7.Fhir.Model.ExplanationOfBenefit.AccidentComponent)Accident.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Total.Any()) dest.Total = new List(Total.DeepCopy()); - if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ExplanationOfBenefit.PaymentComponent)Payment.DeepCopy(); - if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.Attachment)Form.DeepCopy(); - if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopy()); - if(BenefitPeriod != null) dest.BenefitPeriod = (Hl7.Fhir.Model.Period)BenefitPeriod.DeepCopy(); - if(BenefitBalance.Any()) dest.BenefitBalance = new List(BenefitBalance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(FundsReserveRequested != null) dest.FundsReserveRequested = (Hl7.Fhir.Model.CodeableConcept)FundsReserveRequested.DeepCopyInternal(); + if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopyInternal(); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); + if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopyInternal(); + if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ExplanationOfBenefit.PayeeComponent)Payee.DeepCopyInternal(); + if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopyInternal(); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopyInternal(); + if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopyInternal()); + if(PreAuthRefPeriod.Any()) dest.PreAuthRefPeriod = new List(PreAuthRefPeriod.DeepCopyInternal()); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopyInternal()); + if(PrecedenceElement != null) dest.PrecedenceElement = (Hl7.Fhir.Model.PositiveInt)PrecedenceElement.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Accident != null) dest.Accident = (Hl7.Fhir.Model.ExplanationOfBenefit.AccidentComponent)Accident.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Total.Any()) dest.Total = new List(Total.DeepCopyInternal()); + if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ExplanationOfBenefit.PaymentComponent)Payment.DeepCopyInternal(); + if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.Attachment)Form.DeepCopyInternal(); + if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopyInternal()); + if(BenefitPeriod != null) dest.BenefitPeriod = (Hl7.Fhir.Model.Period)BenefitPeriod.DeepCopyInternal(); + if(BenefitBalance.Any()) dest.BenefitBalance = new List(BenefitBalance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExplanationOfBenefit()); + var instance = new ExplanationOfBenefit(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Expression.cs b/src/Hl7.Fhir.R4/Model/Generated/Expression.cs index 1b8328c94c..ce841473ba 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Expression.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Expression.cs @@ -216,7 +216,7 @@ public string Reference } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Expression; @@ -225,18 +225,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Expression()); + var instance = new Expression(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/FamilyMemberHistory.cs b/src/Hl7.Fhir.R4/Model/Generated/FamilyMemberHistory.cs index 893aadd4d0..5a29742fad 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/FamilyMemberHistory.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/FamilyMemberHistory.cs @@ -198,7 +198,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConditionComponent; @@ -207,18 +207,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(ContributedToDeathElement != null) dest.ContributedToDeathElement = (Hl7.Fhir.Model.FhirBoolean)ContributedToDeathElement.DeepCopy(); - if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(ContributedToDeathElement != null) dest.ContributedToDeathElement = (Hl7.Fhir.Model.FhirBoolean)ContributedToDeathElement.DeepCopyInternal(); + if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConditionComponent()); + var instance = new ConditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -668,7 +669,7 @@ public List Condition List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FamilyMemberHistory; @@ -677,31 +678,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Sex != null) dest.Sex = (Hl7.Fhir.Model.CodeableConcept)Sex.DeepCopy(); - if(Born != null) dest.Born = (Hl7.Fhir.Model.DataType)Born.DeepCopy(); - if(Age != null) dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopy(); - if(EstimatedAgeElement != null) dest.EstimatedAgeElement = (Hl7.Fhir.Model.FhirBoolean)EstimatedAgeElement.DeepCopy(); - if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new FamilyMemberHistory()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Sex != null) dest.Sex = (Hl7.Fhir.Model.CodeableConcept)Sex.DeepCopyInternal(); + if(Born != null) dest.Born = (Hl7.Fhir.Model.DataType)Born.DeepCopyInternal(); + if(Age != null) dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopyInternal(); + if(EstimatedAgeElement != null) dest.EstimatedAgeElement = (Hl7.Fhir.Model.FhirBoolean)EstimatedAgeElement.DeepCopyInternal(); + if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new FamilyMemberHistory(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Flag.cs b/src/Hl7.Fhir.R4/Model/Generated/Flag.cs index 81990c7ce1..a5ec707323 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Flag.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Flag.cs @@ -229,7 +229,7 @@ public Hl7.Fhir.Model.ResourceReference Author Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Flag; @@ -238,21 +238,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Flag()); + var instance = new Flag(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Goal.cs b/src/Hl7.Fhir.R4/Model/Generated/Goal.cs index 098ab78a39..03000dab28 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Goal.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Goal.cs @@ -186,7 +186,7 @@ public Hl7.Fhir.Model.DataType Due private Hl7.Fhir.Model.DataType _Due; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -195,16 +195,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopy(); - if(Due != null) dest.Due = (Hl7.Fhir.Model.DataType)Due.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopyInternal(); + if(Due != null) dest.Due = (Hl7.Fhir.Model.DataType)Due.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -563,7 +564,7 @@ public List OutcomeReference List ICoded>.Code { get => Category; set => Category = value; } IEnumerable ICoded.ToCodings() => Category.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Goal; @@ -572,29 +573,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(LifecycleStatusElement != null) dest.LifecycleStatusElement = (Code)LifecycleStatusElement.DeepCopy(); - if(AchievementStatus != null) dest.AchievementStatus = (Hl7.Fhir.Model.CodeableConcept)AchievementStatus.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Start != null) dest.Start = (Hl7.Fhir.Model.DataType)Start.DeepCopy(); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.Date)StatusDateElement.DeepCopy(); - if(StatusReasonElement != null) dest.StatusReasonElement = (Hl7.Fhir.Model.FhirString)StatusReasonElement.DeepCopy(); - if(ExpressedBy != null) dest.ExpressedBy = (Hl7.Fhir.Model.ResourceReference)ExpressedBy.DeepCopy(); - if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(OutcomeCode.Any()) dest.OutcomeCode = new List(OutcomeCode.DeepCopy()); - if(OutcomeReference.Any()) dest.OutcomeReference = new List(OutcomeReference.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(LifecycleStatusElement != null) dest.LifecycleStatusElement = (Code)LifecycleStatusElement.DeepCopyInternal(); + if(AchievementStatus != null) dest.AchievementStatus = (Hl7.Fhir.Model.CodeableConcept)AchievementStatus.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Start != null) dest.Start = (Hl7.Fhir.Model.DataType)Start.DeepCopyInternal(); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.Date)StatusDateElement.DeepCopyInternal(); + if(StatusReasonElement != null) dest.StatusReasonElement = (Hl7.Fhir.Model.FhirString)StatusReasonElement.DeepCopyInternal(); + if(ExpressedBy != null) dest.ExpressedBy = (Hl7.Fhir.Model.ResourceReference)ExpressedBy.DeepCopyInternal(); + if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(OutcomeCode.Any()) dest.OutcomeCode = new List(OutcomeCode.DeepCopyInternal()); + if(OutcomeReference.Any()) dest.OutcomeReference = new List(OutcomeReference.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Goal()); + var instance = new Goal(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/GraphDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/GraphDefinition.cs index 93a5d22761..63f322a203 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/GraphDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/GraphDefinition.cs @@ -297,7 +297,7 @@ public List Target private List _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -306,19 +306,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SliceNameElement != null) dest.SliceNameElement = (Hl7.Fhir.Model.FhirString)SliceNameElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SliceNameElement != null) dest.SliceNameElement = (Hl7.Fhir.Model.FhirString)SliceNameElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -543,7 +544,7 @@ public List Link private List _Link; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -552,18 +553,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - if(Compartment.Any()) dest.Compartment = new List(Compartment.DeepCopy()); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); + if(Compartment.Any()) dest.Compartment = new List(Compartment.DeepCopyInternal()); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -820,7 +822,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CompartmentComponent; @@ -829,18 +831,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(RuleElement != null) dest.RuleElement = (Code)RuleElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(RuleElement != null) dest.RuleElement = (Code)RuleElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CompartmentComponent()); + var instance = new CompartmentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1325,7 +1328,7 @@ public List Link private List _Link; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GraphDefinition; @@ -1334,28 +1337,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(StartElement != null) dest.StartElement = (Code)StartElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Code)StartElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GraphDefinition()); + var instance = new GraphDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Group.cs b/src/Hl7.Fhir.R4/Model/Generated/Group.cs index c740495411..2b415c5e13 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Group.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Group.cs @@ -200,7 +200,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -209,17 +209,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -367,7 +368,7 @@ public bool? Inactive } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MemberComponent; @@ -376,16 +377,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Entity != null) dest.Entity = (Hl7.Fhir.Model.ResourceReference)Entity.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Entity != null) dest.Entity = (Hl7.Fhir.Model.ResourceReference)Entity.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MemberComponent()); + var instance = new MemberComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -684,7 +686,7 @@ public List Member Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Group; @@ -693,23 +695,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.UnsignedInt)QuantityElement.DeepCopy(); - if(ManagingEntity != null) dest.ManagingEntity = (Hl7.Fhir.Model.ResourceReference)ManagingEntity.DeepCopy(); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(Member.Any()) dest.Member = new List(Member.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.UnsignedInt)QuantityElement.DeepCopyInternal(); + if(ManagingEntity != null) dest.ManagingEntity = (Hl7.Fhir.Model.ResourceReference)ManagingEntity.DeepCopyInternal(); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(Member.Any()) dest.Member = new List(Member.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Group()); + var instance = new Group(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/GuidanceResponse.cs b/src/Hl7.Fhir.R4/Model/Generated/GuidanceResponse.cs index 20f0a8d268..423649a2fb 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/GuidanceResponse.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/GuidanceResponse.cs @@ -367,7 +367,7 @@ public List DataRequirement Hl7.Fhir.Model.DataType ICoded.Code { get => Module; set => Module = value; } IEnumerable ICoded.ToCodings() => Module.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GuidanceResponse; @@ -376,28 +376,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RequestIdentifier != null) dest.RequestIdentifier = (Hl7.Fhir.Model.Identifier)RequestIdentifier.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Module != null) dest.Module = (Hl7.Fhir.Model.DataType)Module.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(OccurrenceDateTimeElement != null) dest.OccurrenceDateTimeElement = (Hl7.Fhir.Model.FhirDateTime)OccurrenceDateTimeElement.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(EvaluationMessage.Any()) dest.EvaluationMessage = new List(EvaluationMessage.DeepCopy()); - if(OutputParameters != null) dest.OutputParameters = (Hl7.Fhir.Model.ResourceReference)OutputParameters.DeepCopy(); - if(Result != null) dest.Result = (Hl7.Fhir.Model.ResourceReference)Result.DeepCopy(); - if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RequestIdentifier != null) dest.RequestIdentifier = (Hl7.Fhir.Model.Identifier)RequestIdentifier.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Module != null) dest.Module = (Hl7.Fhir.Model.DataType)Module.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(OccurrenceDateTimeElement != null) dest.OccurrenceDateTimeElement = (Hl7.Fhir.Model.FhirDateTime)OccurrenceDateTimeElement.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(EvaluationMessage.Any()) dest.EvaluationMessage = new List(EvaluationMessage.DeepCopyInternal()); + if(OutputParameters != null) dest.OutputParameters = (Hl7.Fhir.Model.ResourceReference)OutputParameters.DeepCopyInternal(); + if(Result != null) dest.Result = (Hl7.Fhir.Model.ResourceReference)Result.DeepCopyInternal(); + if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GuidanceResponse()); + var instance = new GuidanceResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/HealthcareService.cs b/src/Hl7.Fhir.R4/Model/Generated/HealthcareService.cs index 5cf6ae262a..9980bcf2ff 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/HealthcareService.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/HealthcareService.cs @@ -117,7 +117,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EligibilityComponent; @@ -126,15 +126,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EligibilityComponent()); + var instance = new EligibilityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -334,7 +335,7 @@ public string AvailableEndTime } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AvailableTimeComponent; @@ -343,17 +344,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopy()); - if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopy(); - if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopy(); - if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopyInternal()); + if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopyInternal(); + if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopyInternal(); + if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AvailableTimeComponent()); + var instance = new AvailableTimeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -486,7 +488,7 @@ public Hl7.Fhir.Model.Period During private Hl7.Fhir.Model.Period _During; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotAvailableComponent; @@ -495,15 +497,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotAvailableComponent()); + var instance = new NotAvailableComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1016,7 +1019,7 @@ public List Endpoint List ICoded>.Code { get => Type; set => Type = value; } IEnumerable ICoded.ToCodings() => Type.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HealthcareService; @@ -1025,37 +1028,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(ProvidedBy != null) dest.ProvidedBy = (Hl7.Fhir.Model.ResourceReference)ProvidedBy.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(ExtraDetailsElement != null) dest.ExtraDetailsElement = (Hl7.Fhir.Model.Markdown)ExtraDetailsElement.DeepCopy(); - if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopy()); - if(ServiceProvisionCode.Any()) dest.ServiceProvisionCode = new List(ServiceProvisionCode.DeepCopy()); - if(Eligibility.Any()) dest.Eligibility = new List(Eligibility.DeepCopy()); - if(Program.Any()) dest.Program = new List(Program.DeepCopy()); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - if(ReferralMethod.Any()) dest.ReferralMethod = new List(ReferralMethod.DeepCopy()); - if(AppointmentRequiredElement != null) dest.AppointmentRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AppointmentRequiredElement.DeepCopy(); - if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopy()); - if(NotAvailable.Any()) dest.NotAvailable = new List(NotAvailable.DeepCopy()); - if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(ProvidedBy != null) dest.ProvidedBy = (Hl7.Fhir.Model.ResourceReference)ProvidedBy.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(ExtraDetailsElement != null) dest.ExtraDetailsElement = (Hl7.Fhir.Model.Markdown)ExtraDetailsElement.DeepCopyInternal(); + if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopyInternal()); + if(ServiceProvisionCode.Any()) dest.ServiceProvisionCode = new List(ServiceProvisionCode.DeepCopyInternal()); + if(Eligibility.Any()) dest.Eligibility = new List(Eligibility.DeepCopyInternal()); + if(Program.Any()) dest.Program = new List(Program.DeepCopyInternal()); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); + if(ReferralMethod.Any()) dest.ReferralMethod = new List(ReferralMethod.DeepCopyInternal()); + if(AppointmentRequiredElement != null) dest.AppointmentRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AppointmentRequiredElement.DeepCopyInternal(); + if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopyInternal()); + if(NotAvailable.Any()) dest.NotAvailable = new List(NotAvailable.DeepCopyInternal()); + if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HealthcareService()); + var instance = new HealthcareService(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/HumanName.cs b/src/Hl7.Fhir.R4/Model/Generated/HumanName.cs index 5ea1aedc62..3d7bebaa10 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/HumanName.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/HumanName.cs @@ -316,7 +316,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HumanName; @@ -325,20 +325,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(FamilyElement != null) dest.FamilyElement = (Hl7.Fhir.Model.FhirString)FamilyElement.DeepCopy(); - if(GivenElement.Any()) dest.GivenElement = new List(GivenElement.DeepCopy()); - if(PrefixElement.Any()) dest.PrefixElement = new List(PrefixElement.DeepCopy()); - if(SuffixElement.Any()) dest.SuffixElement = new List(SuffixElement.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(FamilyElement != null) dest.FamilyElement = (Hl7.Fhir.Model.FhirString)FamilyElement.DeepCopyInternal(); + if(GivenElement.Any()) dest.GivenElement = new List(GivenElement.DeepCopyInternal()); + if(PrefixElement.Any()) dest.PrefixElement = new List(PrefixElement.DeepCopyInternal()); + if(SuffixElement.Any()) dest.SuffixElement = new List(SuffixElement.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HumanName()); + var instance = new HumanName(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ImagingStudy.cs b/src/Hl7.Fhir.R4/Model/Generated/ImagingStudy.cs index ba7c6ee3b6..d8c0f487e4 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ImagingStudy.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ImagingStudy.cs @@ -374,7 +374,7 @@ public List Instance private List _Instance; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SeriesComponent; @@ -383,25 +383,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopy(); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopy(); - if(Modality != null) dest.Modality = (Hl7.Fhir.Model.Coding)Modality.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.Coding)BodySite.DeepCopy(); - if(Laterality != null) dest.Laterality = (Hl7.Fhir.Model.Coding)Laterality.DeepCopy(); - if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopy()); - if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopyInternal(); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopyInternal(); + if(Modality != null) dest.Modality = (Hl7.Fhir.Model.Coding)Modality.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.Coding)BodySite.DeepCopyInternal(); + if(Laterality != null) dest.Laterality = (Hl7.Fhir.Model.Coding)Laterality.DeepCopyInternal(); + if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopyInternal()); + if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SeriesComponent()); + var instance = new SeriesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -584,7 +585,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -593,15 +594,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -782,7 +784,7 @@ public string Title } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -791,17 +793,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopy(); - if(SopClass != null) dest.SopClass = (Hl7.Fhir.Model.Coding)SopClass.DeepCopy(); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopyInternal(); + if(SopClass != null) dest.SopClass = (Hl7.Fhir.Model.Coding)SopClass.DeepCopyInternal(); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1260,7 +1263,7 @@ public List Series List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImagingStudy; @@ -1269,33 +1272,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Modality.Any()) dest.Modality = new List(Modality.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Referrer != null) dest.Referrer = (Hl7.Fhir.Model.ResourceReference)Referrer.DeepCopy(); - if(Interpreter.Any()) dest.Interpreter = new List(Interpreter.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(NumberOfSeriesElement != null) dest.NumberOfSeriesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfSeriesElement.DeepCopy(); - if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopy(); - if(ProcedureReference != null) dest.ProcedureReference = (Hl7.Fhir.Model.ResourceReference)ProcedureReference.DeepCopy(); - if(ProcedureCode.Any()) dest.ProcedureCode = new List(ProcedureCode.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Series.Any()) dest.Series = new List(Series.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Modality.Any()) dest.Modality = new List(Modality.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Referrer != null) dest.Referrer = (Hl7.Fhir.Model.ResourceReference)Referrer.DeepCopyInternal(); + if(Interpreter.Any()) dest.Interpreter = new List(Interpreter.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(NumberOfSeriesElement != null) dest.NumberOfSeriesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfSeriesElement.DeepCopyInternal(); + if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopyInternal(); + if(ProcedureReference != null) dest.ProcedureReference = (Hl7.Fhir.Model.ResourceReference)ProcedureReference.DeepCopyInternal(); + if(ProcedureCode.Any()) dest.ProcedureCode = new List(ProcedureCode.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Series.Any()) dest.Series = new List(Series.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImagingStudy()); + var instance = new ImagingStudy(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Immunization.cs b/src/Hl7.Fhir.R4/Model/Generated/Immunization.cs index 978721bc86..8aedff538a 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Immunization.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Immunization.cs @@ -133,7 +133,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -142,15 +142,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -346,7 +347,7 @@ public string PresentationDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EducationComponent; @@ -355,17 +356,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DocumentTypeElement != null) dest.DocumentTypeElement = (Hl7.Fhir.Model.FhirString)DocumentTypeElement.DeepCopy(); - if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopy(); - if(PublicationDateElement != null) dest.PublicationDateElement = (Hl7.Fhir.Model.FhirDateTime)PublicationDateElement.DeepCopy(); - if(PresentationDateElement != null) dest.PresentationDateElement = (Hl7.Fhir.Model.FhirDateTime)PresentationDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DocumentTypeElement != null) dest.DocumentTypeElement = (Hl7.Fhir.Model.FhirString)DocumentTypeElement.DeepCopyInternal(); + if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopyInternal(); + if(PublicationDateElement != null) dest.PublicationDateElement = (Hl7.Fhir.Model.FhirDateTime)PublicationDateElement.DeepCopyInternal(); + if(PresentationDateElement != null) dest.PresentationDateElement = (Hl7.Fhir.Model.FhirDateTime)PresentationDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EducationComponent()); + var instance = new EducationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -531,7 +533,7 @@ public bool? Reported } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReactionComponent; @@ -540,16 +542,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.ResourceReference)Detail.DeepCopy(); - if(ReportedElement != null) dest.ReportedElement = (Hl7.Fhir.Model.FhirBoolean)ReportedElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.ResourceReference)Detail.DeepCopyInternal(); + if(ReportedElement != null) dest.ReportedElement = (Hl7.Fhir.Model.FhirBoolean)ReportedElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReactionComponent()); + var instance = new ReactionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -721,7 +724,7 @@ public Hl7.Fhir.Model.DataType SeriesDoses private Hl7.Fhir.Model.DataType _SeriesDoses; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProtocolAppliedComponent; @@ -730,18 +733,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopy(); - if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopy(); - if(TargetDisease.Any()) dest.TargetDisease = new List(TargetDisease.DeepCopy()); - if(DoseNumber != null) dest.DoseNumber = (Hl7.Fhir.Model.DataType)DoseNumber.DeepCopy(); - if(SeriesDoses != null) dest.SeriesDoses = (Hl7.Fhir.Model.DataType)SeriesDoses.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopyInternal(); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopyInternal(); + if(TargetDisease.Any()) dest.TargetDisease = new List(TargetDisease.DeepCopyInternal()); + if(DoseNumber != null) dest.DoseNumber = (Hl7.Fhir.Model.DataType)DoseNumber.DeepCopyInternal(); + if(SeriesDoses != null) dest.SeriesDoses = (Hl7.Fhir.Model.DataType)SeriesDoses.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProtocolAppliedComponent()); + var instance = new ProtocolAppliedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1335,7 +1339,7 @@ public List ProtocolApplie Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => VaccineCode; set => VaccineCode = value; } IEnumerable ICoded.ToCodings() => VaccineCode.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Immunization; @@ -1344,41 +1348,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(VaccineCode != null) dest.VaccineCode = (Hl7.Fhir.Model.CodeableConcept)VaccineCode.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.FhirDateTime)RecordedElement.DeepCopy(); - if(PrimarySourceElement != null) dest.PrimarySourceElement = (Hl7.Fhir.Model.FhirBoolean)PrimarySourceElement.DeepCopy(); - if(ReportOrigin != null) dest.ReportOrigin = (Hl7.Fhir.Model.CodeableConcept)ReportOrigin.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy(); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.Date)ExpirationDateElement.DeepCopy(); - if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy(); - if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy(); - if(DoseQuantity != null) dest.DoseQuantity = (Hl7.Fhir.Model.Quantity)DoseQuantity.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(IsSubpotentElement != null) dest.IsSubpotentElement = (Hl7.Fhir.Model.FhirBoolean)IsSubpotentElement.DeepCopy(); - if(SubpotentReason.Any()) dest.SubpotentReason = new List(SubpotentReason.DeepCopy()); - if(Education.Any()) dest.Education = new List(Education.DeepCopy()); - if(ProgramEligibility.Any()) dest.ProgramEligibility = new List(ProgramEligibility.DeepCopy()); - if(FundingSource != null) dest.FundingSource = (Hl7.Fhir.Model.CodeableConcept)FundingSource.DeepCopy(); - if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopy()); - if(ProtocolApplied.Any()) dest.ProtocolApplied = new List(ProtocolApplied.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(VaccineCode != null) dest.VaccineCode = (Hl7.Fhir.Model.CodeableConcept)VaccineCode.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.FhirDateTime)RecordedElement.DeepCopyInternal(); + if(PrimarySourceElement != null) dest.PrimarySourceElement = (Hl7.Fhir.Model.FhirBoolean)PrimarySourceElement.DeepCopyInternal(); + if(ReportOrigin != null) dest.ReportOrigin = (Hl7.Fhir.Model.CodeableConcept)ReportOrigin.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopyInternal(); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.Date)ExpirationDateElement.DeepCopyInternal(); + if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopyInternal(); + if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopyInternal(); + if(DoseQuantity != null) dest.DoseQuantity = (Hl7.Fhir.Model.Quantity)DoseQuantity.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(IsSubpotentElement != null) dest.IsSubpotentElement = (Hl7.Fhir.Model.FhirBoolean)IsSubpotentElement.DeepCopyInternal(); + if(SubpotentReason.Any()) dest.SubpotentReason = new List(SubpotentReason.DeepCopyInternal()); + if(Education.Any()) dest.Education = new List(Education.DeepCopyInternal()); + if(ProgramEligibility.Any()) dest.ProgramEligibility = new List(ProgramEligibility.DeepCopyInternal()); + if(FundingSource != null) dest.FundingSource = (Hl7.Fhir.Model.CodeableConcept)FundingSource.DeepCopyInternal(); + if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopyInternal()); + if(ProtocolApplied.Any()) dest.ProtocolApplied = new List(ProtocolApplied.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Immunization()); + var instance = new Immunization(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ImmunizationEvaluation.cs b/src/Hl7.Fhir.R4/Model/Generated/ImmunizationEvaluation.cs index e1566383c3..cbe7d4b49f 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ImmunizationEvaluation.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ImmunizationEvaluation.cs @@ -346,7 +346,7 @@ public Hl7.Fhir.Model.DataType SeriesDoses List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImmunizationEvaluation; @@ -355,26 +355,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)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.Any()) dest.DoseStatusReason = new List(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(DoseNumber != null) dest.DoseNumber = (Hl7.Fhir.Model.DataType)DoseNumber.DeepCopy(); - if(SeriesDoses != null) dest.SeriesDoses = (Hl7.Fhir.Model.DataType)SeriesDoses.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopyInternal(); + if(TargetDisease != null) dest.TargetDisease = (Hl7.Fhir.Model.CodeableConcept)TargetDisease.DeepCopyInternal(); + if(ImmunizationEvent != null) dest.ImmunizationEvent = (Hl7.Fhir.Model.ResourceReference)ImmunizationEvent.DeepCopyInternal(); + if(DoseStatus != null) dest.DoseStatus = (Hl7.Fhir.Model.CodeableConcept)DoseStatus.DeepCopyInternal(); + if(DoseStatusReason.Any()) dest.DoseStatusReason = new List(DoseStatusReason.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopyInternal(); + if(DoseNumber != null) dest.DoseNumber = (Hl7.Fhir.Model.DataType)DoseNumber.DeepCopyInternal(); + if(SeriesDoses != null) dest.SeriesDoses = (Hl7.Fhir.Model.DataType)SeriesDoses.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImmunizationEvaluation()); + var instance = new ImmunizationEvaluation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ImmunizationRecommendation.cs b/src/Hl7.Fhir.R4/Model/Generated/ImmunizationRecommendation.cs index 3928030f6c..dcb7c2e6c4 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ImmunizationRecommendation.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ImmunizationRecommendation.cs @@ -284,7 +284,7 @@ public List SupportingPatientInformation private List _SupportingPatientInformation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RecommendationComponent; @@ -293,25 +293,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(VaccineCode.Any()) dest.VaccineCode = new List(VaccineCode.DeepCopy()); - if(TargetDisease != null) dest.TargetDisease = (Hl7.Fhir.Model.CodeableConcept)TargetDisease.DeepCopy(); - if(ContraindicatedVaccineCode.Any()) dest.ContraindicatedVaccineCode = new List(ContraindicatedVaccineCode.DeepCopy()); - if(ForecastStatus != null) dest.ForecastStatus = (Hl7.Fhir.Model.CodeableConcept)ForecastStatus.DeepCopy(); - if(ForecastReason.Any()) dest.ForecastReason = new List(ForecastReason.DeepCopy()); - if(DateCriterion.Any()) dest.DateCriterion = new List(DateCriterion.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopy(); - if(DoseNumber != null) dest.DoseNumber = (Hl7.Fhir.Model.DataType)DoseNumber.DeepCopy(); - if(SeriesDoses != null) dest.SeriesDoses = (Hl7.Fhir.Model.DataType)SeriesDoses.DeepCopy(); - if(SupportingImmunization.Any()) dest.SupportingImmunization = new List(SupportingImmunization.DeepCopy()); - if(SupportingPatientInformation.Any()) dest.SupportingPatientInformation = new List(SupportingPatientInformation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(VaccineCode.Any()) dest.VaccineCode = new List(VaccineCode.DeepCopyInternal()); + if(TargetDisease != null) dest.TargetDisease = (Hl7.Fhir.Model.CodeableConcept)TargetDisease.DeepCopyInternal(); + if(ContraindicatedVaccineCode.Any()) dest.ContraindicatedVaccineCode = new List(ContraindicatedVaccineCode.DeepCopyInternal()); + if(ForecastStatus != null) dest.ForecastStatus = (Hl7.Fhir.Model.CodeableConcept)ForecastStatus.DeepCopyInternal(); + if(ForecastReason.Any()) dest.ForecastReason = new List(ForecastReason.DeepCopyInternal()); + if(DateCriterion.Any()) dest.DateCriterion = new List(DateCriterion.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopyInternal(); + if(DoseNumber != null) dest.DoseNumber = (Hl7.Fhir.Model.DataType)DoseNumber.DeepCopyInternal(); + if(SeriesDoses != null) dest.SeriesDoses = (Hl7.Fhir.Model.DataType)SeriesDoses.DeepCopyInternal(); + if(SupportingImmunization.Any()) dest.SupportingImmunization = new List(SupportingImmunization.DeepCopyInternal()); + if(SupportingPatientInformation.Any()) dest.SupportingPatientInformation = new List(SupportingPatientInformation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RecommendationComponent()); + var instance = new RecommendationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -510,7 +511,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DateCriterionComponent; @@ -519,15 +520,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDateTime)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDateTime)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DateCriterionComponent()); + var instance = new DateCriterionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -676,7 +678,7 @@ public List R List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImmunizationRecommendation; @@ -685,18 +687,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.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(Recommendation.Any()) dest.Recommendation = new List(Recommendation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopyInternal(); + if(Recommendation.Any()) dest.Recommendation = new List(Recommendation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImmunizationRecommendation()); + var instance = new ImmunizationRecommendation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ImplementationGuide.cs b/src/Hl7.Fhir.R4/Model/Generated/ImplementationGuide.cs index ffe7c09a4a..7e5fe120f7 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ImplementationGuide.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ImplementationGuide.cs @@ -2359,7 +2359,7 @@ public string Version } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DependsOnComponent; @@ -2368,16 +2368,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.Canonical)UriElement.DeepCopy(); - if(PackageIdElement != null) dest.PackageIdElement = (Hl7.Fhir.Model.Id)PackageIdElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.Canonical)UriElement.DeepCopyInternal(); + if(PackageIdElement != null) dest.PackageIdElement = (Hl7.Fhir.Model.Id)PackageIdElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DependsOnComponent()); + var instance = new DependsOnComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2524,7 +2525,7 @@ public string Profile } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GlobalComponent; @@ -2533,15 +2534,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GlobalComponent()); + var instance = new GlobalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2683,7 +2685,7 @@ public List Template private List _Template; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DefinitionComponent; @@ -2692,18 +2694,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Grouping.Any()) dest.Grouping = new List(Grouping.DeepCopy()); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - if(Page != null) dest.Page = (Hl7.Fhir.Model.ImplementationGuide.PageComponent)Page.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Template.Any()) dest.Template = new List(Template.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Grouping.Any()) dest.Grouping = new List(Grouping.DeepCopyInternal()); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); + if(Page != null) dest.Page = (Hl7.Fhir.Model.ImplementationGuide.PageComponent)Page.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Template.Any()) dest.Template = new List(Template.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DefinitionComponent()); + var instance = new DefinitionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2863,7 +2866,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupingComponent; @@ -2872,15 +2875,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupingComponent()); + var instance = new GroupingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3110,7 +3114,7 @@ public string GroupingId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceComponent; @@ -3119,19 +3123,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(FhirVersionElement.Any()) dest.FhirVersionElement = new List>(FhirVersionElement.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Example != null) dest.Example = (Hl7.Fhir.Model.DataType)Example.DeepCopy(); - if(GroupingIdElement != null) dest.GroupingIdElement = (Hl7.Fhir.Model.Id)GroupingIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(FhirVersionElement.Any()) dest.FhirVersionElement = new List>(FhirVersionElement.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Example != null) dest.Example = (Hl7.Fhir.Model.DataType)Example.DeepCopyInternal(); + if(GroupingIdElement != null) dest.GroupingIdElement = (Hl7.Fhir.Model.Id)GroupingIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceComponent()); + var instance = new ResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3333,7 +3338,7 @@ public List Page private List _Page; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PageComponent; @@ -3342,17 +3347,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Name != null) dest.Name = (Hl7.Fhir.Model.DataType)Name.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(GenerationElement != null) dest.GenerationElement = (Code)GenerationElement.DeepCopy(); - if(Page.Any()) dest.Page = new List(Page.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Name != null) dest.Name = (Hl7.Fhir.Model.DataType)Name.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(GenerationElement != null) dest.GenerationElement = (Code)GenerationElement.DeepCopyInternal(); + if(Page.Any()) dest.Page = new List(Page.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PageComponent()); + var instance = new PageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3503,7 +3509,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -3512,15 +3518,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3684,7 +3691,7 @@ public string Scope } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TemplateComponent; @@ -3693,16 +3700,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopy(); - if(ScopeElement != null) dest.ScopeElement = (Hl7.Fhir.Model.FhirString)ScopeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopyInternal(); + if(ScopeElement != null) dest.ScopeElement = (Hl7.Fhir.Model.FhirString)ScopeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TemplateComponent()); + var instance = new TemplateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3905,7 +3913,7 @@ public IEnumerable Other } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManifestComponent; @@ -3914,18 +3922,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RenderingElement != null) dest.RenderingElement = (Hl7.Fhir.Model.FhirUrl)RenderingElement.DeepCopy(); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - if(Page.Any()) dest.Page = new List(Page.DeepCopy()); - if(ImageElement.Any()) dest.ImageElement = new List(ImageElement.DeepCopy()); - if(OtherElement.Any()) dest.OtherElement = new List(OtherElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RenderingElement != null) dest.RenderingElement = (Hl7.Fhir.Model.FhirUrl)RenderingElement.DeepCopyInternal(); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); + if(Page.Any()) dest.Page = new List(Page.DeepCopyInternal()); + if(ImageElement.Any()) dest.ImageElement = new List(ImageElement.DeepCopyInternal()); + if(OtherElement.Any()) dest.OtherElement = new List(OtherElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManifestComponent()); + var instance = new ManifestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4083,7 +4092,7 @@ public string RelativePath } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManifestResourceComponent; @@ -4092,16 +4101,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(Example != null) dest.Example = (Hl7.Fhir.Model.DataType)Example.DeepCopy(); - if(RelativePathElement != null) dest.RelativePathElement = (Hl7.Fhir.Model.FhirUrl)RelativePathElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(Example != null) dest.Example = (Hl7.Fhir.Model.DataType)Example.DeepCopyInternal(); + if(RelativePathElement != null) dest.RelativePathElement = (Hl7.Fhir.Model.FhirUrl)RelativePathElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManifestResourceComponent()); + var instance = new ManifestResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4276,7 +4286,7 @@ public IEnumerable Anchor } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManifestPageComponent; @@ -4285,16 +4295,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(AnchorElement.Any()) dest.AnchorElement = new List(AnchorElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(AnchorElement.Any()) dest.AnchorElement = new List(AnchorElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManifestPageComponent()); + var instance = new ManifestPageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4869,7 +4880,7 @@ public Hl7.Fhir.Model.ImplementationGuide.ManifestComponent Manifest private Hl7.Fhir.Model.ImplementationGuide.ManifestComponent _Manifest; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImplementationGuide; @@ -4878,33 +4889,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(PackageIdElement != null) dest.PackageIdElement = (Hl7.Fhir.Model.Id)PackageIdElement.DeepCopy(); - if(LicenseElement != null) dest.LicenseElement = (Code)LicenseElement.DeepCopy(); - if(FhirVersionElement.Any()) dest.FhirVersionElement = new List>(FhirVersionElement.DeepCopy()); - if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopy()); - if(Global.Any()) dest.Global = new List(Global.DeepCopy()); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ImplementationGuide.DefinitionComponent)Definition.DeepCopy(); - if(Manifest != null) dest.Manifest = (Hl7.Fhir.Model.ImplementationGuide.ManifestComponent)Manifest.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(PackageIdElement != null) dest.PackageIdElement = (Hl7.Fhir.Model.Id)PackageIdElement.DeepCopyInternal(); + if(LicenseElement != null) dest.LicenseElement = (Code)LicenseElement.DeepCopyInternal(); + if(FhirVersionElement.Any()) dest.FhirVersionElement = new List>(FhirVersionElement.DeepCopyInternal()); + if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopyInternal()); + if(Global.Any()) dest.Global = new List(Global.DeepCopyInternal()); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ImplementationGuide.DefinitionComponent)Definition.DeepCopyInternal(); + if(Manifest != null) dest.Manifest = (Hl7.Fhir.Model.ImplementationGuide.ManifestComponent)Manifest.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImplementationGuide()); + var instance = new ImplementationGuide(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/InsurancePlan.cs b/src/Hl7.Fhir.R4/Model/Generated/InsurancePlan.cs index 8f3ea6cd08..df3fa4fa4d 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/InsurancePlan.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/InsurancePlan.cs @@ -155,7 +155,7 @@ public Hl7.Fhir.Model.Address Address private Hl7.Fhir.Model.Address _Address; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContactComponent; @@ -164,17 +164,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Purpose != null) dest.Purpose = (Hl7.Fhir.Model.CodeableConcept)Purpose.DeepCopy(); - if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Purpose != null) dest.Purpose = (Hl7.Fhir.Model.CodeableConcept)Purpose.DeepCopyInternal(); + if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContactComponent()); + var instance = new ContactComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -306,7 +307,7 @@ public List Benefit private List _Benefit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageComponent; @@ -315,16 +316,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Network.Any()) dest.Network = new List(Network.DeepCopy()); - if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Network.Any()) dest.Network = new List(Network.DeepCopyInternal()); + if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageComponent()); + var instance = new CoverageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -463,7 +465,7 @@ public List Limit private List _Limit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageBenefitComponent; @@ -472,16 +474,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.FhirString)RequirementElement.DeepCopy(); - if(Limit.Any()) dest.Limit = new List(Limit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.FhirString)RequirementElement.DeepCopyInternal(); + if(Limit.Any()) dest.Limit = new List(Limit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageBenefitComponent()); + var instance = new CoverageBenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -587,7 +590,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LimitComponent; @@ -596,15 +599,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LimitComponent()); + var instance = new LimitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -763,7 +767,7 @@ public List SpecificCost private List _SpecificCost; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PlanComponent; @@ -772,19 +776,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopy()); - if(Network.Any()) dest.Network = new List(Network.DeepCopy()); - if(GeneralCost.Any()) dest.GeneralCost = new List(GeneralCost.DeepCopy()); - if(SpecificCost.Any()) dest.SpecificCost = new List(SpecificCost.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopyInternal()); + if(Network.Any()) dest.Network = new List(Network.DeepCopyInternal()); + if(GeneralCost.Any()) dest.GeneralCost = new List(GeneralCost.DeepCopyInternal()); + if(SpecificCost.Any()) dest.SpecificCost = new List(SpecificCost.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PlanComponent()); + var instance = new PlanComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -976,7 +981,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GeneralCostComponent; @@ -985,17 +990,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(GroupSizeElement != null) dest.GroupSizeElement = (Hl7.Fhir.Model.PositiveInt)GroupSizeElement.DeepCopy(); - if(Cost != null) dest.Cost = (Hl7.Fhir.Model.Money)Cost.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(GroupSizeElement != null) dest.GroupSizeElement = (Hl7.Fhir.Model.PositiveInt)GroupSizeElement.DeepCopyInternal(); + if(Cost != null) dest.Cost = (Hl7.Fhir.Model.Money)Cost.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GeneralCostComponent()); + var instance = new GeneralCostComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1111,7 +1117,7 @@ public List Benefit private List _Benefit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SpecificCostComponent; @@ -1120,15 +1126,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SpecificCostComponent()); + var instance = new SpecificCostComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1228,7 +1235,7 @@ public List Cost private List _Cost; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PlanBenefitComponent; @@ -1237,15 +1244,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Cost.Any()) dest.Cost = new List(Cost.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Cost.Any()) dest.Cost = new List(Cost.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PlanBenefitComponent()); + var instance = new PlanBenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1372,7 +1380,7 @@ public Hl7.Fhir.Model.Quantity Value private Hl7.Fhir.Model.Quantity _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CostComponent; @@ -1381,17 +1389,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Applicability != null) dest.Applicability = (Hl7.Fhir.Model.CodeableConcept)Applicability.DeepCopy(); - if(Qualifiers.Any()) dest.Qualifiers = new List(Qualifiers.DeepCopy()); - if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Applicability != null) dest.Applicability = (Hl7.Fhir.Model.CodeableConcept)Applicability.DeepCopyInternal(); + if(Qualifiers.Any()) dest.Qualifiers = new List(Qualifiers.DeepCopyInternal()); + if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CostComponent()); + var instance = new CostComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1723,7 +1732,7 @@ public List Plan List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsurancePlan; @@ -1732,27 +1741,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(OwnedBy != null) dest.OwnedBy = (Hl7.Fhir.Model.ResourceReference)OwnedBy.DeepCopy(); - if(AdministeredBy != null) dest.AdministeredBy = (Hl7.Fhir.Model.ResourceReference)AdministeredBy.DeepCopy(); - if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(Network.Any()) dest.Network = new List(Network.DeepCopy()); - if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopy()); - if(Plan.Any()) dest.Plan = new List(Plan.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(OwnedBy != null) dest.OwnedBy = (Hl7.Fhir.Model.ResourceReference)OwnedBy.DeepCopyInternal(); + if(AdministeredBy != null) dest.AdministeredBy = (Hl7.Fhir.Model.ResourceReference)AdministeredBy.DeepCopyInternal(); + if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(Network.Any()) dest.Network = new List(Network.DeepCopyInternal()); + if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopyInternal()); + if(Plan.Any()) dest.Plan = new List(Plan.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsurancePlan()); + var instance = new InsurancePlan(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Invoice.cs b/src/Hl7.Fhir.R4/Model/Generated/Invoice.cs index 6d67919973..41d1611def 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Invoice.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Invoice.cs @@ -144,7 +144,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -153,15 +153,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -295,7 +296,7 @@ public List PriceComponent private List _PriceComponent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LineItemComponent; @@ -304,16 +305,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(ChargeItem != null) dest.ChargeItem = (Hl7.Fhir.Model.DataType)ChargeItem.DeepCopy(); - if(PriceComponent.Any()) dest.PriceComponent = new List(PriceComponent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(ChargeItem != null) dest.ChargeItem = (Hl7.Fhir.Model.DataType)ChargeItem.DeepCopyInternal(); + if(PriceComponent.Any()) dest.PriceComponent = new List(PriceComponent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LineItemComponent()); + var instance = new LineItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -484,7 +486,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PriceComponentComponent; @@ -493,17 +495,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PriceComponentComponent()); + var instance = new PriceComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -873,7 +876,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Invoice; @@ -882,29 +885,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CancelledReasonElement != null) dest.CancelledReasonElement = (Hl7.Fhir.Model.FhirString)CancelledReasonElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopy(); - if(Account != null) dest.Account = (Hl7.Fhir.Model.ResourceReference)Account.DeepCopy(); - if(LineItem.Any()) dest.LineItem = new List(LineItem.DeepCopy()); - if(TotalPriceComponent.Any()) dest.TotalPriceComponent = new List(TotalPriceComponent.DeepCopy()); - if(TotalNet != null) dest.TotalNet = (Hl7.Fhir.Model.Money)TotalNet.DeepCopy(); - if(TotalGross != null) dest.TotalGross = (Hl7.Fhir.Model.Money)TotalGross.DeepCopy(); - if(PaymentTermsElement != null) dest.PaymentTermsElement = (Hl7.Fhir.Model.Markdown)PaymentTermsElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CancelledReasonElement != null) dest.CancelledReasonElement = (Hl7.Fhir.Model.FhirString)CancelledReasonElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopyInternal(); + if(Account != null) dest.Account = (Hl7.Fhir.Model.ResourceReference)Account.DeepCopyInternal(); + if(LineItem.Any()) dest.LineItem = new List(LineItem.DeepCopyInternal()); + if(TotalPriceComponent.Any()) dest.TotalPriceComponent = new List(TotalPriceComponent.DeepCopyInternal()); + if(TotalNet != null) dest.TotalNet = (Hl7.Fhir.Model.Money)TotalNet.DeepCopyInternal(); + if(TotalGross != null) dest.TotalGross = (Hl7.Fhir.Model.Money)TotalGross.DeepCopyInternal(); + if(PaymentTermsElement != null) dest.PaymentTermsElement = (Hl7.Fhir.Model.Markdown)PaymentTermsElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Invoice()); + var instance = new Invoice(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Library.cs b/src/Hl7.Fhir.R4/Model/Generated/Library.cs index 70859a3e95..508bc8fb54 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Library.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Library.cs @@ -761,7 +761,7 @@ public List Content List ICoded>.Code { get => Topic; set => Topic = value; } IEnumerable ICoded.ToCodings() => Topic.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Library; @@ -770,44 +770,45 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopy()); - if(Content.Any()) dest.Content = new List(Content.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopyInternal()); + if(Content.Any()) dest.Content = new List(Content.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Library()); + var instance = new Library(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Linkage.cs b/src/Hl7.Fhir.R4/Model/Generated/Linkage.cs index 00d34034a6..94dc598cc4 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Linkage.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Linkage.cs @@ -153,7 +153,7 @@ public Hl7.Fhir.Model.ResourceReference Resource private Hl7.Fhir.Model.ResourceReference _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -162,15 +162,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -286,7 +287,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Linkage; @@ -295,16 +296,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Linkage()); + var instance = new Linkage(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/List.cs b/src/Hl7.Fhir.R4/Model/Generated/List.cs index 3878651b52..f90d150ef7 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/List.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/List.cs @@ -193,7 +193,7 @@ public Hl7.Fhir.Model.ResourceReference Item private Hl7.Fhir.Model.ResourceReference _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EntryComponent; @@ -202,17 +202,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Flag != null) dest.Flag = (Hl7.Fhir.Model.CodeableConcept)Flag.DeepCopy(); - if(DeletedElement != null) dest.DeletedElement = (Hl7.Fhir.Model.FhirBoolean)DeletedElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.ResourceReference)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Flag != null) dest.Flag = (Hl7.Fhir.Model.CodeableConcept)Flag.DeepCopyInternal(); + if(DeletedElement != null) dest.DeletedElement = (Hl7.Fhir.Model.FhirBoolean)DeletedElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.ResourceReference)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EntryComponent()); + var instance = new EntryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -548,7 +549,7 @@ public Hl7.Fhir.Model.CodeableConcept EmptyReason Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as List; @@ -557,26 +558,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Entry.Any()) dest.Entry = new List(Entry.DeepCopy()); - if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Entry.Any()) dest.Entry = new List(Entry.DeepCopyInternal()); + if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new List()); + var instance = new List(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Location.cs b/src/Hl7.Fhir.R4/Model/Generated/Location.cs index dd2e18f4d1..9deb929116 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Location.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Location.cs @@ -220,7 +220,7 @@ public decimal? Altitude } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PositionComponent; @@ -229,16 +229,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LongitudeElement != null) dest.LongitudeElement = (Hl7.Fhir.Model.FhirDecimal)LongitudeElement.DeepCopy(); - if(LatitudeElement != null) dest.LatitudeElement = (Hl7.Fhir.Model.FhirDecimal)LatitudeElement.DeepCopy(); - if(AltitudeElement != null) dest.AltitudeElement = (Hl7.Fhir.Model.FhirDecimal)AltitudeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LongitudeElement != null) dest.LongitudeElement = (Hl7.Fhir.Model.FhirDecimal)LongitudeElement.DeepCopyInternal(); + if(LatitudeElement != null) dest.LatitudeElement = (Hl7.Fhir.Model.FhirDecimal)LatitudeElement.DeepCopyInternal(); + if(AltitudeElement != null) dest.AltitudeElement = (Hl7.Fhir.Model.FhirDecimal)AltitudeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PositionComponent()); + var instance = new PositionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -446,7 +447,7 @@ public string ClosingTime } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HoursOfOperationComponent; @@ -455,17 +456,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopy()); - if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopy(); - if(OpeningTimeElement != null) dest.OpeningTimeElement = (Hl7.Fhir.Model.Time)OpeningTimeElement.DeepCopy(); - if(ClosingTimeElement != null) dest.ClosingTimeElement = (Hl7.Fhir.Model.Time)ClosingTimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopyInternal()); + if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopyInternal(); + if(OpeningTimeElement != null) dest.OpeningTimeElement = (Hl7.Fhir.Model.Time)OpeningTimeElement.DeepCopyInternal(); + if(ClosingTimeElement != null) dest.ClosingTimeElement = (Hl7.Fhir.Model.Time)ClosingTimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HoursOfOperationComponent()); + var instance = new HoursOfOperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -890,7 +892,7 @@ public List Endpoint List ICoded>.Code { get => Type; set => Type = value; } IEnumerable ICoded.ToCodings() => Type.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Location; @@ -899,30 +901,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(OperationalStatus != null) dest.OperationalStatus = (Hl7.Fhir.Model.Coding)OperationalStatus.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - if(PhysicalType != null) dest.PhysicalType = (Hl7.Fhir.Model.CodeableConcept)PhysicalType.DeepCopy(); - if(Position != null) dest.Position = (Hl7.Fhir.Model.Location.PositionComponent)Position.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - if(HoursOfOperation.Any()) dest.HoursOfOperation = new List(HoursOfOperation.DeepCopy()); - if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(OperationalStatus != null) dest.OperationalStatus = (Hl7.Fhir.Model.Coding)OperationalStatus.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); + if(PhysicalType != null) dest.PhysicalType = (Hl7.Fhir.Model.CodeableConcept)PhysicalType.DeepCopyInternal(); + if(Position != null) dest.Position = (Hl7.Fhir.Model.Location.PositionComponent)Position.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); + if(HoursOfOperation.Any()) dest.HoursOfOperation = new List(HoursOfOperation.DeepCopyInternal()); + if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Location()); + var instance = new Location(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MarketingStatus.cs b/src/Hl7.Fhir.R4/Model/Generated/MarketingStatus.cs index cb2a6258d0..8c70534a6d 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MarketingStatus.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MarketingStatus.cs @@ -142,7 +142,7 @@ public string RestoreDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MarketingStatus; @@ -151,18 +151,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopy(); - if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(DateRange != null) dest.DateRange = (Hl7.Fhir.Model.Period)DateRange.DeepCopy(); - if(RestoreDateElement != null) dest.RestoreDateElement = (Hl7.Fhir.Model.FhirDateTime)RestoreDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopyInternal(); + if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(DateRange != null) dest.DateRange = (Hl7.Fhir.Model.Period)DateRange.DeepCopyInternal(); + if(RestoreDateElement != null) dest.RestoreDateElement = (Hl7.Fhir.Model.FhirDateTime)RestoreDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MarketingStatus()); + var instance = new MarketingStatus(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Measure.cs b/src/Hl7.Fhir.R4/Model/Generated/Measure.cs index 8f94ed96e7..56432fe91f 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Measure.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Measure.cs @@ -147,7 +147,7 @@ public List Stratifier private List _Stratifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -156,17 +156,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -313,7 +314,7 @@ public Hl7.Fhir.Model.Expression Criteria private Hl7.Fhir.Model.Expression _Criteria; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PopulationComponent; @@ -322,16 +323,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PopulationComponent()); + var instance = new PopulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -482,7 +484,7 @@ public List Component private List _Component; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierComponent; @@ -491,17 +493,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopy(); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopyInternal(); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierComponent()); + var instance = new StratifierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -648,7 +651,7 @@ public Hl7.Fhir.Model.Expression Criteria private Hl7.Fhir.Model.Expression _Criteria; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -657,16 +660,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -820,7 +824,7 @@ public Hl7.Fhir.Model.Expression Criteria private Hl7.Fhir.Model.Expression _Criteria; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplementalDataComponent; @@ -829,17 +833,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Usage.Any()) dest.Usage = new List(Usage.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Usage.Any()) dest.Usage = new List(Usage.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplementalDataComponent()); + var instance = new SupplementalDataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1891,7 +1896,7 @@ public List SupplementalData List ICoded>.Code { get => Topic; set => Topic = value; } IEnumerable ICoded.ToCodings() => Topic.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Measure; @@ -1900,54 +1905,55 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(DisclaimerElement != null) dest.DisclaimerElement = (Hl7.Fhir.Model.Markdown)DisclaimerElement.DeepCopy(); - if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopy(); - if(CompositeScoring != null) dest.CompositeScoring = (Hl7.Fhir.Model.CodeableConcept)CompositeScoring.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(RiskAdjustmentElement != null) dest.RiskAdjustmentElement = (Hl7.Fhir.Model.FhirString)RiskAdjustmentElement.DeepCopy(); - if(RateAggregationElement != null) dest.RateAggregationElement = (Hl7.Fhir.Model.FhirString)RateAggregationElement.DeepCopy(); - if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.Markdown)RationaleElement.DeepCopy(); - if(ClinicalRecommendationStatementElement != null) dest.ClinicalRecommendationStatementElement = (Hl7.Fhir.Model.Markdown)ClinicalRecommendationStatementElement.DeepCopy(); - if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopy(); - if(DefinitionElement.Any()) dest.DefinitionElement = new List(DefinitionElement.DeepCopy()); - if(GuidanceElement != null) dest.GuidanceElement = (Hl7.Fhir.Model.Markdown)GuidanceElement.DeepCopy(); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - if(SupplementalData.Any()) dest.SupplementalData = new List(SupplementalData.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Measure()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(DisclaimerElement != null) dest.DisclaimerElement = (Hl7.Fhir.Model.Markdown)DisclaimerElement.DeepCopyInternal(); + if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopyInternal(); + if(CompositeScoring != null) dest.CompositeScoring = (Hl7.Fhir.Model.CodeableConcept)CompositeScoring.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(RiskAdjustmentElement != null) dest.RiskAdjustmentElement = (Hl7.Fhir.Model.FhirString)RiskAdjustmentElement.DeepCopyInternal(); + if(RateAggregationElement != null) dest.RateAggregationElement = (Hl7.Fhir.Model.FhirString)RateAggregationElement.DeepCopyInternal(); + if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.Markdown)RationaleElement.DeepCopyInternal(); + if(ClinicalRecommendationStatementElement != null) dest.ClinicalRecommendationStatementElement = (Hl7.Fhir.Model.Markdown)ClinicalRecommendationStatementElement.DeepCopyInternal(); + if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopyInternal(); + if(DefinitionElement.Any()) dest.DefinitionElement = new List(DefinitionElement.DeepCopyInternal()); + if(GuidanceElement != null) dest.GuidanceElement = (Hl7.Fhir.Model.Markdown)GuidanceElement.DeepCopyInternal(); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); + if(SupplementalData.Any()) dest.SupplementalData = new List(SupplementalData.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Measure(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MeasureReport.cs b/src/Hl7.Fhir.R4/Model/Generated/MeasureReport.cs index 7401786d88..9f191e6b6b 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MeasureReport.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MeasureReport.cs @@ -191,7 +191,7 @@ public List Stratifier private List _Stratifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -200,17 +200,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(MeasureScore != null) dest.MeasureScore = (Hl7.Fhir.Model.Quantity)MeasureScore.DeepCopy(); - if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(MeasureScore != null) dest.MeasureScore = (Hl7.Fhir.Model.Quantity)MeasureScore.DeepCopyInternal(); + if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -358,7 +359,7 @@ public Hl7.Fhir.Model.ResourceReference SubjectResults private Hl7.Fhir.Model.ResourceReference _SubjectResults; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PopulationComponent; @@ -367,16 +368,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy(); - if(SubjectResults != null) dest.SubjectResults = (Hl7.Fhir.Model.ResourceReference)SubjectResults.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopyInternal(); + if(SubjectResults != null) dest.SubjectResults = (Hl7.Fhir.Model.ResourceReference)SubjectResults.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PopulationComponent()); + var instance = new PopulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -484,7 +486,7 @@ public List Stratum private List _Stratum; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierComponent; @@ -493,15 +495,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Stratum.Any()) dest.Stratum = new List(Stratum.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Stratum.Any()) dest.Stratum = new List(Stratum.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierComponent()); + var instance = new StratifierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -627,7 +630,7 @@ public Hl7.Fhir.Model.Quantity MeasureScore private Hl7.Fhir.Model.Quantity _MeasureScore; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierGroupComponent; @@ -636,17 +639,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.CodeableConcept)Value.DeepCopy(); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(MeasureScore != null) dest.MeasureScore = (Hl7.Fhir.Model.Quantity)MeasureScore.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.CodeableConcept)Value.DeepCopyInternal(); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(MeasureScore != null) dest.MeasureScore = (Hl7.Fhir.Model.Quantity)MeasureScore.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierGroupComponent()); + var instance = new StratifierGroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -762,7 +766,7 @@ public Hl7.Fhir.Model.CodeableConcept Value private Hl7.Fhir.Model.CodeableConcept _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -771,15 +775,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.CodeableConcept)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.CodeableConcept)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -911,7 +916,7 @@ public Hl7.Fhir.Model.ResourceReference SubjectResults private Hl7.Fhir.Model.ResourceReference _SubjectResults; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierGroupPopulationComponent; @@ -920,16 +925,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy(); - if(SubjectResults != null) dest.SubjectResults = (Hl7.Fhir.Model.ResourceReference)SubjectResults.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopyInternal(); + if(SubjectResults != null) dest.SubjectResults = (Hl7.Fhir.Model.ResourceReference)SubjectResults.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierGroupPopulationComponent()); + var instance = new StratifierGroupPopulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1228,7 +1234,7 @@ public List EvaluatedResource List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MeasureReport; @@ -1237,24 +1243,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(MeasureElement != null) dest.MeasureElement = (Hl7.Fhir.Model.Canonical)MeasureElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Reporter != null) dest.Reporter = (Hl7.Fhir.Model.ResourceReference)Reporter.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopy(); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - if(EvaluatedResource.Any()) dest.EvaluatedResource = new List(EvaluatedResource.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(MeasureElement != null) dest.MeasureElement = (Hl7.Fhir.Model.Canonical)MeasureElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Reporter != null) dest.Reporter = (Hl7.Fhir.Model.ResourceReference)Reporter.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopyInternal(); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); + if(EvaluatedResource.Any()) dest.EvaluatedResource = new List(EvaluatedResource.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MeasureReport()); + var instance = new MeasureReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Media.cs b/src/Hl7.Fhir.R4/Model/Generated/Media.cs index 143eee334a..aa12f9a808 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Media.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Media.cs @@ -498,7 +498,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Media; @@ -507,35 +507,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Modality != null) dest.Modality = (Hl7.Fhir.Model.CodeableConcept)Modality.DeepCopy(); - if(View != null) dest.View = (Hl7.Fhir.Model.CodeableConcept)View.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Created != null) dest.Created = (Hl7.Fhir.Model.DataType)Created.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy(); - if(Operator != null) dest.Operator = (Hl7.Fhir.Model.ResourceReference)Operator.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(DeviceNameElement != null) dest.DeviceNameElement = (Hl7.Fhir.Model.FhirString)DeviceNameElement.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(HeightElement != null) dest.HeightElement = (Hl7.Fhir.Model.PositiveInt)HeightElement.DeepCopy(); - if(WidthElement != null) dest.WidthElement = (Hl7.Fhir.Model.PositiveInt)WidthElement.DeepCopy(); - if(FramesElement != null) dest.FramesElement = (Hl7.Fhir.Model.PositiveInt)FramesElement.DeepCopy(); - if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopy(); - if(Content != null) dest.Content = (Hl7.Fhir.Model.Attachment)Content.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Media()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Modality != null) dest.Modality = (Hl7.Fhir.Model.CodeableConcept)Modality.DeepCopyInternal(); + if(View != null) dest.View = (Hl7.Fhir.Model.CodeableConcept)View.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Created != null) dest.Created = (Hl7.Fhir.Model.DataType)Created.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopyInternal(); + if(Operator != null) dest.Operator = (Hl7.Fhir.Model.ResourceReference)Operator.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(DeviceNameElement != null) dest.DeviceNameElement = (Hl7.Fhir.Model.FhirString)DeviceNameElement.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(HeightElement != null) dest.HeightElement = (Hl7.Fhir.Model.PositiveInt)HeightElement.DeepCopyInternal(); + if(WidthElement != null) dest.WidthElement = (Hl7.Fhir.Model.PositiveInt)WidthElement.DeepCopyInternal(); + if(FramesElement != null) dest.FramesElement = (Hl7.Fhir.Model.PositiveInt)FramesElement.DeepCopyInternal(); + if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopyInternal(); + if(Content != null) dest.Content = (Hl7.Fhir.Model.Attachment)Content.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Media(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Medication.cs b/src/Hl7.Fhir.R4/Model/Generated/Medication.cs index 8ee7d08813..73e15c38d9 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Medication.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Medication.cs @@ -165,7 +165,7 @@ public Hl7.Fhir.Model.Ratio Strength private Hl7.Fhir.Model.Ratio _Strength; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientComponent; @@ -174,16 +174,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - if(IsActiveElement != null) dest.IsActiveElement = (Hl7.Fhir.Model.FhirBoolean)IsActiveElement.DeepCopy(); - if(Strength != null) dest.Strength = (Hl7.Fhir.Model.Ratio)Strength.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); + if(IsActiveElement != null) dest.IsActiveElement = (Hl7.Fhir.Model.FhirBoolean)IsActiveElement.DeepCopyInternal(); + if(Strength != null) dest.Strength = (Hl7.Fhir.Model.Ratio)Strength.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientComponent()); + var instance = new IngredientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -325,7 +326,7 @@ public string ExpirationDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BatchComponent; @@ -334,15 +335,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BatchComponent()); + var instance = new BatchComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -533,7 +535,7 @@ public Hl7.Fhir.Model.Medication.BatchComponent Batch Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Medication; @@ -542,21 +544,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Ratio)Amount.DeepCopy(); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(Batch != null) dest.Batch = (Hl7.Fhir.Model.Medication.BatchComponent)Batch.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Ratio)Amount.DeepCopyInternal(); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(Batch != null) dest.Batch = (Hl7.Fhir.Model.Medication.BatchComponent)Batch.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Medication()); + var instance = new Medication(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicationAdministration.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicationAdministration.cs index 7a4a3d2c93..411c730e21 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicationAdministration.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicationAdministration.cs @@ -157,7 +157,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -166,15 +166,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -347,7 +348,7 @@ public Hl7.Fhir.Model.DataType Rate private Hl7.Fhir.Model.DataType _Rate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DosageComponent; @@ -356,19 +357,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy(); - if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Dose != null) dest.Dose = (Hl7.Fhir.Model.Quantity)Dose.DeepCopy(); - if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopyInternal(); + if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Dose != null) dest.Dose = (Hl7.Fhir.Model.Quantity)Dose.DeepCopyInternal(); + if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DosageComponent()); + var instance = new DosageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -786,7 +788,7 @@ public List EventHistory Hl7.Fhir.Model.DataType ICoded.Code { get => Medication; set => Medication = value; } IEnumerable ICoded.ToCodings() => Medication.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationAdministration; @@ -795,32 +797,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopy()); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Device.Any()) dest.Device = new List(Device.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Dosage != null) dest.Dosage = (Hl7.Fhir.Model.MedicationAdministration.DosageComponent)Dosage.DeepCopy(); - if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopyInternal()); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Device.Any()) dest.Device = new List(Device.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Dosage != null) dest.Dosage = (Hl7.Fhir.Model.MedicationAdministration.DosageComponent)Dosage.DeepCopyInternal(); + if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationAdministration()); + var instance = new MedicationAdministration(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicationDispense.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicationDispense.cs index d7c703218a..fbbed55efd 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicationDispense.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicationDispense.cs @@ -169,7 +169,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -178,15 +178,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -335,7 +336,7 @@ public List ResponsibleParty private List _ResponsibleParty; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstitutionComponent; @@ -344,17 +345,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(WasSubstitutedElement != null) dest.WasSubstitutedElement = (Hl7.Fhir.Model.FhirBoolean)WasSubstitutedElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(ResponsibleParty.Any()) dest.ResponsibleParty = new List(ResponsibleParty.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(WasSubstitutedElement != null) dest.WasSubstitutedElement = (Hl7.Fhir.Model.FhirBoolean)WasSubstitutedElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(ResponsibleParty.Any()) dest.ResponsibleParty = new List(ResponsibleParty.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstitutionComponent()); + var instance = new SubstitutionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -841,7 +843,7 @@ public List EventHistory Hl7.Fhir.Model.DataType ICoded.Code { get => Medication; set => Medication = value; } IEnumerable ICoded.ToCodings() => Medication.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationDispense; @@ -850,37 +852,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.DataType)StatusReason.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(AuthorizingPrescription.Any()) dest.AuthorizingPrescription = new List(AuthorizingPrescription.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(DaysSupply != null) dest.DaysSupply = (Hl7.Fhir.Model.Quantity)DaysSupply.DeepCopy(); - if(WhenPreparedElement != null) dest.WhenPreparedElement = (Hl7.Fhir.Model.FhirDateTime)WhenPreparedElement.DeepCopy(); - if(WhenHandedOverElement != null) dest.WhenHandedOverElement = (Hl7.Fhir.Model.FhirDateTime)WhenHandedOverElement.DeepCopy(); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopy()); - if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationDispense.SubstitutionComponent)Substitution.DeepCopy(); - if(DetectedIssue.Any()) dest.DetectedIssue = new List(DetectedIssue.DeepCopy()); - if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.DataType)StatusReason.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(AuthorizingPrescription.Any()) dest.AuthorizingPrescription = new List(AuthorizingPrescription.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(DaysSupply != null) dest.DaysSupply = (Hl7.Fhir.Model.Quantity)DaysSupply.DeepCopyInternal(); + if(WhenPreparedElement != null) dest.WhenPreparedElement = (Hl7.Fhir.Model.FhirDateTime)WhenPreparedElement.DeepCopyInternal(); + if(WhenHandedOverElement != null) dest.WhenHandedOverElement = (Hl7.Fhir.Model.FhirDateTime)WhenHandedOverElement.DeepCopyInternal(); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopyInternal()); + if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationDispense.SubstitutionComponent)Substitution.DeepCopyInternal(); + if(DetectedIssue.Any()) dest.DetectedIssue = new List(DetectedIssue.DeepCopyInternal()); + if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationDispense()); + var instance = new MedicationDispense(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicationKnowledge.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicationKnowledge.cs index 142a733c7f..337946d826 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicationKnowledge.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicationKnowledge.cs @@ -133,7 +133,7 @@ public List Reference private List _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedMedicationKnowledgeComponent; @@ -142,15 +142,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Reference.Any()) dest.Reference = new List(Reference.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Reference.Any()) dest.Reference = new List(Reference.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedMedicationKnowledgeComponent()); + var instance = new RelatedMedicationKnowledgeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -247,7 +248,7 @@ public Hl7.Fhir.Model.ResourceReference Source private Hl7.Fhir.Model.ResourceReference _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MonographComponent; @@ -256,15 +257,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MonographComponent()); + var instance = new MonographComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -397,7 +399,7 @@ public Hl7.Fhir.Model.Ratio Strength private Hl7.Fhir.Model.Ratio _Strength; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientComponent; @@ -406,16 +408,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - if(IsActiveElement != null) dest.IsActiveElement = (Hl7.Fhir.Model.FhirBoolean)IsActiveElement.DeepCopy(); - if(Strength != null) dest.Strength = (Hl7.Fhir.Model.Ratio)Strength.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); + if(IsActiveElement != null) dest.IsActiveElement = (Hl7.Fhir.Model.FhirBoolean)IsActiveElement.DeepCopyInternal(); + if(Strength != null) dest.Strength = (Hl7.Fhir.Model.Ratio)Strength.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientComponent()); + var instance = new IngredientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -554,7 +557,7 @@ public Hl7.Fhir.Model.Money Cost private Hl7.Fhir.Model.Money _Cost; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CostComponent; @@ -563,16 +566,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopy(); - if(Cost != null) dest.Cost = (Hl7.Fhir.Model.Money)Cost.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopyInternal(); + if(Cost != null) dest.Cost = (Hl7.Fhir.Model.Money)Cost.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CostComponent()); + var instance = new CostComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -696,7 +700,7 @@ public string Name } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MonitoringProgramComponent; @@ -705,15 +709,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MonitoringProgramComponent()); + var instance = new MonitoringProgramComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -829,7 +834,7 @@ public List private List _PatientCharacteristics; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdministrationGuidelinesComponent; @@ -838,16 +843,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - if(Indication != null) dest.Indication = (Hl7.Fhir.Model.DataType)Indication.DeepCopy(); - if(PatientCharacteristics.Any()) dest.PatientCharacteristics = new List(PatientCharacteristics.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); + if(Indication != null) dest.Indication = (Hl7.Fhir.Model.DataType)Indication.DeepCopyInternal(); + if(PatientCharacteristics.Any()) dest.PatientCharacteristics = new List(PatientCharacteristics.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdministrationGuidelinesComponent()); + var instance = new AdministrationGuidelinesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -952,7 +958,7 @@ public List Dosage private List _Dosage; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DosageComponent; @@ -961,15 +967,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DosageComponent()); + var instance = new DosageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1089,7 +1096,7 @@ public IEnumerable Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PatientCharacteristicsComponent; @@ -1098,15 +1105,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Characteristic != null) dest.Characteristic = (Hl7.Fhir.Model.DataType)Characteristic.DeepCopy(); - if(ValueElement.Any()) dest.ValueElement = new List(ValueElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Characteristic != null) dest.Characteristic = (Hl7.Fhir.Model.DataType)Characteristic.DeepCopyInternal(); + if(ValueElement.Any()) dest.ValueElement = new List(ValueElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PatientCharacteristicsComponent()); + var instance = new PatientCharacteristicsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1203,7 +1211,7 @@ public List Classification private List _Classification; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicineClassificationComponent; @@ -1212,15 +1220,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicineClassificationComponent()); + var instance = new MedicineClassificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1319,7 +1328,7 @@ public Hl7.Fhir.Model.Quantity Quantity private Hl7.Fhir.Model.Quantity _Quantity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PackagingComponent; @@ -1328,15 +1337,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PackagingComponent()); + var instance = new PackagingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1437,7 +1447,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DrugCharacteristicComponent; @@ -1446,15 +1456,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DrugCharacteristicComponent()); + var instance = new DrugCharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1580,7 +1591,7 @@ public Hl7.Fhir.Model.MedicationKnowledge.MaxDispenseComponent MaxDispense private Hl7.Fhir.Model.MedicationKnowledge.MaxDispenseComponent _MaxDispense; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RegulatoryComponent; @@ -1589,17 +1600,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RegulatoryAuthority != null) dest.RegulatoryAuthority = (Hl7.Fhir.Model.ResourceReference)RegulatoryAuthority.DeepCopy(); - if(Substitution.Any()) dest.Substitution = new List(Substitution.DeepCopy()); - if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopy()); - if(MaxDispense != null) dest.MaxDispense = (Hl7.Fhir.Model.MedicationKnowledge.MaxDispenseComponent)MaxDispense.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RegulatoryAuthority != null) dest.RegulatoryAuthority = (Hl7.Fhir.Model.ResourceReference)RegulatoryAuthority.DeepCopyInternal(); + if(Substitution.Any()) dest.Substitution = new List(Substitution.DeepCopyInternal()); + if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopyInternal()); + if(MaxDispense != null) dest.MaxDispense = (Hl7.Fhir.Model.MedicationKnowledge.MaxDispenseComponent)MaxDispense.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RegulatoryComponent()); + var instance = new RegulatoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1730,7 +1742,7 @@ public bool? Allowed } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstitutionComponent; @@ -1739,15 +1751,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(AllowedElement != null) dest.AllowedElement = (Hl7.Fhir.Model.FhirBoolean)AllowedElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(AllowedElement != null) dest.AllowedElement = (Hl7.Fhir.Model.FhirBoolean)AllowedElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstitutionComponent()); + var instance = new SubstitutionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1830,7 +1843,7 @@ public Hl7.Fhir.Model.CodeableConcept Schedule private Hl7.Fhir.Model.CodeableConcept _Schedule; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ScheduleComponent; @@ -1839,14 +1852,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.CodeableConcept)Schedule.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.CodeableConcept)Schedule.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ScheduleComponent()); + var instance = new ScheduleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1934,7 +1948,7 @@ public Hl7.Fhir.Model.Duration Period private Hl7.Fhir.Model.Duration _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MaxDispenseComponent; @@ -1943,15 +1957,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Duration)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Duration)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MaxDispenseComponent()); + var instance = new MaxDispenseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2061,7 +2076,7 @@ public Hl7.Fhir.Model.Duration HalfLifePeriod private Hl7.Fhir.Model.Duration _HalfLifePeriod; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as KineticsComponent; @@ -2070,16 +2085,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AreaUnderCurve.Any()) dest.AreaUnderCurve = new List(AreaUnderCurve.DeepCopy()); - if(LethalDose50.Any()) dest.LethalDose50 = new List(LethalDose50.DeepCopy()); - if(HalfLifePeriod != null) dest.HalfLifePeriod = (Hl7.Fhir.Model.Duration)HalfLifePeriod.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AreaUnderCurve.Any()) dest.AreaUnderCurve = new List(AreaUnderCurve.DeepCopyInternal()); + if(LethalDose50.Any()) dest.LethalDose50 = new List(LethalDose50.DeepCopyInternal()); + if(HalfLifePeriod != null) dest.HalfLifePeriod = (Hl7.Fhir.Model.Duration)HalfLifePeriod.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new KineticsComponent()); + var instance = new KineticsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2512,7 +2528,7 @@ public List Kinetics Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationKnowledge; @@ -2521,35 +2537,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy(); - if(DoseForm != null) dest.DoseForm = (Hl7.Fhir.Model.CodeableConcept)DoseForm.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - if(SynonymElement.Any()) dest.SynonymElement = new List(SynonymElement.DeepCopy()); - if(RelatedMedicationKnowledge.Any()) dest.RelatedMedicationKnowledge = new List(RelatedMedicationKnowledge.DeepCopy()); - if(AssociatedMedication.Any()) dest.AssociatedMedication = new List(AssociatedMedication.DeepCopy()); - if(ProductType.Any()) dest.ProductType = new List(ProductType.DeepCopy()); - if(Monograph.Any()) dest.Monograph = new List(Monograph.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(PreparationInstructionElement != null) dest.PreparationInstructionElement = (Hl7.Fhir.Model.Markdown)PreparationInstructionElement.DeepCopy(); - if(IntendedRoute.Any()) dest.IntendedRoute = new List(IntendedRoute.DeepCopy()); - if(Cost.Any()) dest.Cost = new List(Cost.DeepCopy()); - if(MonitoringProgram.Any()) dest.MonitoringProgram = new List(MonitoringProgram.DeepCopy()); - if(AdministrationGuidelines.Any()) dest.AdministrationGuidelines = new List(AdministrationGuidelines.DeepCopy()); - if(MedicineClassification.Any()) dest.MedicineClassification = new List(MedicineClassification.DeepCopy()); - if(Packaging != null) dest.Packaging = (Hl7.Fhir.Model.MedicationKnowledge.PackagingComponent)Packaging.DeepCopy(); - if(DrugCharacteristic.Any()) dest.DrugCharacteristic = new List(DrugCharacteristic.DeepCopy()); - if(Contraindication.Any()) dest.Contraindication = new List(Contraindication.DeepCopy()); - if(Regulatory.Any()) dest.Regulatory = new List(Regulatory.DeepCopy()); - if(Kinetics.Any()) dest.Kinetics = new List(Kinetics.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopyInternal(); + if(DoseForm != null) dest.DoseForm = (Hl7.Fhir.Model.CodeableConcept)DoseForm.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); + if(SynonymElement.Any()) dest.SynonymElement = new List(SynonymElement.DeepCopyInternal()); + if(RelatedMedicationKnowledge.Any()) dest.RelatedMedicationKnowledge = new List(RelatedMedicationKnowledge.DeepCopyInternal()); + if(AssociatedMedication.Any()) dest.AssociatedMedication = new List(AssociatedMedication.DeepCopyInternal()); + if(ProductType.Any()) dest.ProductType = new List(ProductType.DeepCopyInternal()); + if(Monograph.Any()) dest.Monograph = new List(Monograph.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(PreparationInstructionElement != null) dest.PreparationInstructionElement = (Hl7.Fhir.Model.Markdown)PreparationInstructionElement.DeepCopyInternal(); + if(IntendedRoute.Any()) dest.IntendedRoute = new List(IntendedRoute.DeepCopyInternal()); + if(Cost.Any()) dest.Cost = new List(Cost.DeepCopyInternal()); + if(MonitoringProgram.Any()) dest.MonitoringProgram = new List(MonitoringProgram.DeepCopyInternal()); + if(AdministrationGuidelines.Any()) dest.AdministrationGuidelines = new List(AdministrationGuidelines.DeepCopyInternal()); + if(MedicineClassification.Any()) dest.MedicineClassification = new List(MedicineClassification.DeepCopyInternal()); + if(Packaging != null) dest.Packaging = (Hl7.Fhir.Model.MedicationKnowledge.PackagingComponent)Packaging.DeepCopyInternal(); + if(DrugCharacteristic.Any()) dest.DrugCharacteristic = new List(DrugCharacteristic.DeepCopyInternal()); + if(Contraindication.Any()) dest.Contraindication = new List(Contraindication.DeepCopyInternal()); + if(Regulatory.Any()) dest.Regulatory = new List(Regulatory.DeepCopyInternal()); + if(Kinetics.Any()) dest.Kinetics = new List(Kinetics.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationKnowledge()); + var instance = new MedicationKnowledge(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicationRequest.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicationRequest.cs index c68fbfab56..44fbac954c 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicationRequest.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicationRequest.cs @@ -302,7 +302,7 @@ public Hl7.Fhir.Model.ResourceReference Performer private Hl7.Fhir.Model.ResourceReference _Performer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DispenseRequestComponent; @@ -311,20 +311,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(InitialFill != null) dest.InitialFill = (Hl7.Fhir.Model.MedicationRequest.InitialFillComponent)InitialFill.DeepCopy(); - if(DispenseInterval != null) dest.DispenseInterval = (Hl7.Fhir.Model.Duration)DispenseInterval.DeepCopy(); - if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopy(); - if(NumberOfRepeatsAllowedElement != null) dest.NumberOfRepeatsAllowedElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfRepeatsAllowedElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(ExpectedSupplyDuration != null) dest.ExpectedSupplyDuration = (Hl7.Fhir.Model.Duration)ExpectedSupplyDuration.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(InitialFill != null) dest.InitialFill = (Hl7.Fhir.Model.MedicationRequest.InitialFillComponent)InitialFill.DeepCopyInternal(); + if(DispenseInterval != null) dest.DispenseInterval = (Hl7.Fhir.Model.Duration)DispenseInterval.DeepCopyInternal(); + if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopyInternal(); + if(NumberOfRepeatsAllowedElement != null) dest.NumberOfRepeatsAllowedElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfRepeatsAllowedElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(ExpectedSupplyDuration != null) dest.ExpectedSupplyDuration = (Hl7.Fhir.Model.Duration)ExpectedSupplyDuration.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DispenseRequestComponent()); + var instance = new DispenseRequestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -463,7 +464,7 @@ public Hl7.Fhir.Model.Duration Duration private Hl7.Fhir.Model.Duration _Duration; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InitialFillComponent; @@ -472,15 +473,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InitialFillComponent()); + var instance = new InitialFillComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -583,7 +585,7 @@ public Hl7.Fhir.Model.CodeableConcept Reason private Hl7.Fhir.Model.CodeableConcept _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstitutionComponent; @@ -592,15 +594,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstitutionComponent()); + var instance = new SubstitutionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1262,7 +1265,7 @@ public List EventHistory Hl7.Fhir.Model.DataType ICoded.Code { get => Medication; set => Medication = value; } IEnumerable ICoded.ToCodings() => Medication.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationRequest; @@ -1271,45 +1274,46 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Reported != null) dest.Reported = (Hl7.Fhir.Model.DataType)Reported.DeepCopy(); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(CourseOfTherapyType != null) dest.CourseOfTherapyType = (Hl7.Fhir.Model.CodeableConcept)CourseOfTherapyType.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopy()); - if(DispenseRequest != null) dest.DispenseRequest = (Hl7.Fhir.Model.MedicationRequest.DispenseRequestComponent)DispenseRequest.DeepCopy(); - if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationRequest.SubstitutionComponent)Substitution.DeepCopy(); - if(PriorPrescription != null) dest.PriorPrescription = (Hl7.Fhir.Model.ResourceReference)PriorPrescription.DeepCopy(); - if(DetectedIssue.Any()) dest.DetectedIssue = new List(DetectedIssue.DeepCopy()); - if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Reported != null) dest.Reported = (Hl7.Fhir.Model.DataType)Reported.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(CourseOfTherapyType != null) dest.CourseOfTherapyType = (Hl7.Fhir.Model.CodeableConcept)CourseOfTherapyType.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopyInternal()); + if(DispenseRequest != null) dest.DispenseRequest = (Hl7.Fhir.Model.MedicationRequest.DispenseRequestComponent)DispenseRequest.DeepCopyInternal(); + if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationRequest.SubstitutionComponent)Substitution.DeepCopyInternal(); + if(PriorPrescription != null) dest.PriorPrescription = (Hl7.Fhir.Model.ResourceReference)PriorPrescription.DeepCopyInternal(); + if(DetectedIssue.Any()) dest.DetectedIssue = new List(DetectedIssue.DeepCopyInternal()); + if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationRequest()); + var instance = new MedicationRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicationStatement.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicationStatement.cs index fd8f06259c..2fd70a07e6 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicationStatement.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicationStatement.cs @@ -427,7 +427,7 @@ public List Dosage Hl7.Fhir.Model.DataType ICoded.Code { get => Medication; set => Medication = value; } IEnumerable ICoded.ToCodings() => Medication.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationStatement; @@ -436,30 +436,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopy()); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.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(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopyInternal()); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(DateAssertedElement != null) dest.DateAssertedElement = (Hl7.Fhir.Model.FhirDateTime)DateAssertedElement.DeepCopyInternal(); + if(InformationSource != null) dest.InformationSource = (Hl7.Fhir.Model.ResourceReference)InformationSource.DeepCopyInternal(); + if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationStatement()); + var instance = new MedicationStatement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProduct.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProduct.cs index a66c2e5de9..d76fc835f4 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProduct.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProduct.cs @@ -129,7 +129,7 @@ public List CountryLan private List _CountryLanguage; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NameComponent; @@ -138,16 +138,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopy(); - if(NamePart.Any()) dest.NamePart = new List(NamePart.DeepCopy()); - if(CountryLanguage.Any()) dest.CountryLanguage = new List(CountryLanguage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopyInternal(); + if(NamePart.Any()) dest.NamePart = new List(NamePart.DeepCopyInternal()); + if(CountryLanguage.Any()) dest.CountryLanguage = new List(CountryLanguage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NameComponent()); + var instance = new NameComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -270,7 +271,7 @@ public Hl7.Fhir.Model.Coding Type private Hl7.Fhir.Model.Coding _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NamePartComponent; @@ -279,15 +280,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PartElement != null) dest.PartElement = (Hl7.Fhir.Model.FhirString)PartElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PartElement != null) dest.PartElement = (Hl7.Fhir.Model.FhirString)PartElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NamePartComponent()); + var instance = new NamePartComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -397,7 +399,7 @@ public Hl7.Fhir.Model.CodeableConcept Language private Hl7.Fhir.Model.CodeableConcept _Language; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CountryLanguageComponent; @@ -406,16 +408,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopy(); - if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopy(); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopyInternal(); + if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopyInternal(); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CountryLanguageComponent()); + var instance = new CountryLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -593,7 +596,7 @@ public Hl7.Fhir.Model.ResourceReference Regulator private Hl7.Fhir.Model.ResourceReference _Regulator; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManufacturingBusinessOperationComponent; @@ -602,19 +605,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(OperationType != null) dest.OperationType = (Hl7.Fhir.Model.CodeableConcept)OperationType.DeepCopy(); - if(AuthorisationReferenceNumber != null) dest.AuthorisationReferenceNumber = (Hl7.Fhir.Model.Identifier)AuthorisationReferenceNumber.DeepCopy(); - if(EffectiveDateElement != null) dest.EffectiveDateElement = (Hl7.Fhir.Model.FhirDateTime)EffectiveDateElement.DeepCopy(); - if(ConfidentialityIndicator != null) dest.ConfidentialityIndicator = (Hl7.Fhir.Model.CodeableConcept)ConfidentialityIndicator.DeepCopy(); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(Regulator != null) dest.Regulator = (Hl7.Fhir.Model.ResourceReference)Regulator.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(OperationType != null) dest.OperationType = (Hl7.Fhir.Model.CodeableConcept)OperationType.DeepCopyInternal(); + if(AuthorisationReferenceNumber != null) dest.AuthorisationReferenceNumber = (Hl7.Fhir.Model.Identifier)AuthorisationReferenceNumber.DeepCopyInternal(); + if(EffectiveDateElement != null) dest.EffectiveDateElement = (Hl7.Fhir.Model.FhirDateTime)EffectiveDateElement.DeepCopyInternal(); + if(ConfidentialityIndicator != null) dest.ConfidentialityIndicator = (Hl7.Fhir.Model.CodeableConcept)ConfidentialityIndicator.DeepCopyInternal(); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(Regulator != null) dest.Regulator = (Hl7.Fhir.Model.ResourceReference)Regulator.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManufacturingBusinessOperationComponent()); + var instance = new ManufacturingBusinessOperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -828,7 +832,7 @@ public Hl7.Fhir.Model.CodeableConcept Species private Hl7.Fhir.Model.CodeableConcept _Species; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SpecialDesignationComponent; @@ -837,20 +841,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(IntendedUse != null) dest.IntendedUse = (Hl7.Fhir.Model.CodeableConcept)IntendedUse.DeepCopy(); - if(Indication != null) dest.Indication = (Hl7.Fhir.Model.DataType)Indication.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Species != null) dest.Species = (Hl7.Fhir.Model.CodeableConcept)Species.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(IntendedUse != null) dest.IntendedUse = (Hl7.Fhir.Model.CodeableConcept)IntendedUse.DeepCopyInternal(); + if(Indication != null) dest.Indication = (Hl7.Fhir.Model.DataType)Indication.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Species != null) dest.Species = (Hl7.Fhir.Model.CodeableConcept)Species.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SpecialDesignationComponent()); + var instance = new SpecialDesignationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1252,7 +1257,7 @@ public List Special List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicinalProduct; @@ -1261,33 +1266,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Domain != null) dest.Domain = (Hl7.Fhir.Model.Coding)Domain.DeepCopy(); - if(CombinedPharmaceuticalDoseForm != null) dest.CombinedPharmaceuticalDoseForm = (Hl7.Fhir.Model.CodeableConcept)CombinedPharmaceuticalDoseForm.DeepCopy(); - if(LegalStatusOfSupply != null) dest.LegalStatusOfSupply = (Hl7.Fhir.Model.CodeableConcept)LegalStatusOfSupply.DeepCopy(); - if(AdditionalMonitoringIndicator != null) dest.AdditionalMonitoringIndicator = (Hl7.Fhir.Model.CodeableConcept)AdditionalMonitoringIndicator.DeepCopy(); - if(SpecialMeasuresElement.Any()) dest.SpecialMeasuresElement = new List(SpecialMeasuresElement.DeepCopy()); - if(PaediatricUseIndicator != null) dest.PaediatricUseIndicator = (Hl7.Fhir.Model.CodeableConcept)PaediatricUseIndicator.DeepCopy(); - if(ProductClassification.Any()) dest.ProductClassification = new List(ProductClassification.DeepCopy()); - if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopy()); - if(PharmaceuticalProduct.Any()) dest.PharmaceuticalProduct = new List(PharmaceuticalProduct.DeepCopy()); - if(PackagedMedicinalProduct.Any()) dest.PackagedMedicinalProduct = new List(PackagedMedicinalProduct.DeepCopy()); - if(AttachedDocument.Any()) dest.AttachedDocument = new List(AttachedDocument.DeepCopy()); - if(MasterFile.Any()) dest.MasterFile = new List(MasterFile.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(ClinicalTrial.Any()) dest.ClinicalTrial = new List(ClinicalTrial.DeepCopy()); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(CrossReference.Any()) dest.CrossReference = new List(CrossReference.DeepCopy()); - if(ManufacturingBusinessOperation.Any()) dest.ManufacturingBusinessOperation = new List(ManufacturingBusinessOperation.DeepCopy()); - if(SpecialDesignation.Any()) dest.SpecialDesignation = new List(SpecialDesignation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Domain != null) dest.Domain = (Hl7.Fhir.Model.Coding)Domain.DeepCopyInternal(); + if(CombinedPharmaceuticalDoseForm != null) dest.CombinedPharmaceuticalDoseForm = (Hl7.Fhir.Model.CodeableConcept)CombinedPharmaceuticalDoseForm.DeepCopyInternal(); + if(LegalStatusOfSupply != null) dest.LegalStatusOfSupply = (Hl7.Fhir.Model.CodeableConcept)LegalStatusOfSupply.DeepCopyInternal(); + if(AdditionalMonitoringIndicator != null) dest.AdditionalMonitoringIndicator = (Hl7.Fhir.Model.CodeableConcept)AdditionalMonitoringIndicator.DeepCopyInternal(); + if(SpecialMeasuresElement.Any()) dest.SpecialMeasuresElement = new List(SpecialMeasuresElement.DeepCopyInternal()); + if(PaediatricUseIndicator != null) dest.PaediatricUseIndicator = (Hl7.Fhir.Model.CodeableConcept)PaediatricUseIndicator.DeepCopyInternal(); + if(ProductClassification.Any()) dest.ProductClassification = new List(ProductClassification.DeepCopyInternal()); + if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopyInternal()); + if(PharmaceuticalProduct.Any()) dest.PharmaceuticalProduct = new List(PharmaceuticalProduct.DeepCopyInternal()); + if(PackagedMedicinalProduct.Any()) dest.PackagedMedicinalProduct = new List(PackagedMedicinalProduct.DeepCopyInternal()); + if(AttachedDocument.Any()) dest.AttachedDocument = new List(AttachedDocument.DeepCopyInternal()); + if(MasterFile.Any()) dest.MasterFile = new List(MasterFile.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(ClinicalTrial.Any()) dest.ClinicalTrial = new List(ClinicalTrial.DeepCopyInternal()); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(CrossReference.Any()) dest.CrossReference = new List(CrossReference.DeepCopyInternal()); + if(ManufacturingBusinessOperation.Any()) dest.ManufacturingBusinessOperation = new List(ManufacturingBusinessOperation.DeepCopyInternal()); + if(SpecialDesignation.Any()) dest.SpecialDesignation = new List(SpecialDesignation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicinalProduct()); + var instance = new MedicinalProduct(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductAuthorization.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductAuthorization.cs index cd7c71d299..e457ccdc8a 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductAuthorization.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductAuthorization.cs @@ -136,7 +136,7 @@ public Hl7.Fhir.Model.Period ValidityPeriod private Hl7.Fhir.Model.Period _ValidityPeriod; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as JurisdictionalAuthorizationComponent; @@ -145,18 +145,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopy(); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(LegalStatusOfSupply != null) dest.LegalStatusOfSupply = (Hl7.Fhir.Model.CodeableConcept)LegalStatusOfSupply.DeepCopy(); - if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopyInternal(); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(LegalStatusOfSupply != null) dest.LegalStatusOfSupply = (Hl7.Fhir.Model.CodeableConcept)LegalStatusOfSupply.DeepCopyInternal(); + if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new JurisdictionalAuthorizationComponent()); + var instance = new JurisdictionalAuthorizationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -305,7 +306,7 @@ public List App private List _Application; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcedureComponent; @@ -314,17 +315,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Date != null) dest.Date = (Hl7.Fhir.Model.DataType)Date.DeepCopy(); - if(Application.Any()) dest.Application = new List(Application.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Date != null) dest.Date = (Hl7.Fhir.Model.DataType)Date.DeepCopyInternal(); + if(Application.Any()) dest.Application = new List(Application.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcedureComponent()); + var instance = new ProcedureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -688,7 +690,7 @@ public Hl7.Fhir.Model.MedicinalProductAuthorization.ProcedureComponent Procedure List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicinalProductAuthorization; @@ -697,29 +699,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Country.Any()) dest.Country = new List(Country.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopy(); - if(RestoreDateElement != null) dest.RestoreDateElement = (Hl7.Fhir.Model.FhirDateTime)RestoreDateElement.DeepCopy(); - if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopy(); - if(DataExclusivityPeriod != null) dest.DataExclusivityPeriod = (Hl7.Fhir.Model.Period)DataExclusivityPeriod.DeepCopy(); - if(DateOfFirstAuthorizationElement != null) dest.DateOfFirstAuthorizationElement = (Hl7.Fhir.Model.FhirDateTime)DateOfFirstAuthorizationElement.DeepCopy(); - if(InternationalBirthDateElement != null) dest.InternationalBirthDateElement = (Hl7.Fhir.Model.FhirDateTime)InternationalBirthDateElement.DeepCopy(); - if(LegalBasis != null) dest.LegalBasis = (Hl7.Fhir.Model.CodeableConcept)LegalBasis.DeepCopy(); - if(JurisdictionalAuthorization.Any()) dest.JurisdictionalAuthorization = new List(JurisdictionalAuthorization.DeepCopy()); - if(Holder != null) dest.Holder = (Hl7.Fhir.Model.ResourceReference)Holder.DeepCopy(); - if(Regulator != null) dest.Regulator = (Hl7.Fhir.Model.ResourceReference)Regulator.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.MedicinalProductAuthorization.ProcedureComponent)Procedure.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Country.Any()) dest.Country = new List(Country.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopyInternal(); + if(RestoreDateElement != null) dest.RestoreDateElement = (Hl7.Fhir.Model.FhirDateTime)RestoreDateElement.DeepCopyInternal(); + if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopyInternal(); + if(DataExclusivityPeriod != null) dest.DataExclusivityPeriod = (Hl7.Fhir.Model.Period)DataExclusivityPeriod.DeepCopyInternal(); + if(DateOfFirstAuthorizationElement != null) dest.DateOfFirstAuthorizationElement = (Hl7.Fhir.Model.FhirDateTime)DateOfFirstAuthorizationElement.DeepCopyInternal(); + if(InternationalBirthDateElement != null) dest.InternationalBirthDateElement = (Hl7.Fhir.Model.FhirDateTime)InternationalBirthDateElement.DeepCopyInternal(); + if(LegalBasis != null) dest.LegalBasis = (Hl7.Fhir.Model.CodeableConcept)LegalBasis.DeepCopyInternal(); + if(JurisdictionalAuthorization.Any()) dest.JurisdictionalAuthorization = new List(JurisdictionalAuthorization.DeepCopyInternal()); + if(Holder != null) dest.Holder = (Hl7.Fhir.Model.ResourceReference)Holder.DeepCopyInternal(); + if(Regulator != null) dest.Regulator = (Hl7.Fhir.Model.ResourceReference)Regulator.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.MedicinalProductAuthorization.ProcedureComponent)Procedure.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicinalProductAuthorization()); + var instance = new MedicinalProductAuthorization(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductContraindication.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductContraindication.cs index 24495f91b5..84ff5ccde7 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductContraindication.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductContraindication.cs @@ -103,7 +103,7 @@ public Hl7.Fhir.Model.DataType Medication private Hl7.Fhir.Model.DataType _Medication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OtherTherapyComponent; @@ -112,15 +112,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TherapyRelationshipType != null) dest.TherapyRelationshipType = (Hl7.Fhir.Model.CodeableConcept)TherapyRelationshipType.DeepCopy(); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TherapyRelationshipType != null) dest.TherapyRelationshipType = (Hl7.Fhir.Model.CodeableConcept)TherapyRelationshipType.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OtherTherapyComponent()); + var instance = new OtherTherapyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -276,7 +277,7 @@ public List Population private List _Population; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicinalProductContraindication; @@ -285,20 +286,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Disease != null) dest.Disease = (Hl7.Fhir.Model.CodeableConcept)Disease.DeepCopy(); - if(DiseaseStatus != null) dest.DiseaseStatus = (Hl7.Fhir.Model.CodeableConcept)DiseaseStatus.DeepCopy(); - if(Comorbidity.Any()) dest.Comorbidity = new List(Comorbidity.DeepCopy()); - if(TherapeuticIndication.Any()) dest.TherapeuticIndication = new List(TherapeuticIndication.DeepCopy()); - if(OtherTherapy.Any()) dest.OtherTherapy = new List(OtherTherapy.DeepCopy()); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Disease != null) dest.Disease = (Hl7.Fhir.Model.CodeableConcept)Disease.DeepCopyInternal(); + if(DiseaseStatus != null) dest.DiseaseStatus = (Hl7.Fhir.Model.CodeableConcept)DiseaseStatus.DeepCopyInternal(); + if(Comorbidity.Any()) dest.Comorbidity = new List(Comorbidity.DeepCopyInternal()); + if(TherapeuticIndication.Any()) dest.TherapeuticIndication = new List(TherapeuticIndication.DeepCopyInternal()); + if(OtherTherapy.Any()) dest.OtherTherapy = new List(OtherTherapy.DeepCopyInternal()); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicinalProductContraindication()); + var instance = new MedicinalProductContraindication(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductIndication.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductIndication.cs index 34adbd031c..f95dde9bef 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductIndication.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductIndication.cs @@ -103,7 +103,7 @@ public Hl7.Fhir.Model.DataType Medication private Hl7.Fhir.Model.DataType _Medication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OtherTherapyComponent; @@ -112,15 +112,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TherapyRelationshipType != null) dest.TherapyRelationshipType = (Hl7.Fhir.Model.CodeableConcept)TherapyRelationshipType.DeepCopy(); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TherapyRelationshipType != null) dest.TherapyRelationshipType = (Hl7.Fhir.Model.CodeableConcept)TherapyRelationshipType.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OtherTherapyComponent()); + var instance = new OtherTherapyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -302,7 +303,7 @@ public List Population private List _Population; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicinalProductIndication; @@ -311,22 +312,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(DiseaseSymptomProcedure != null) dest.DiseaseSymptomProcedure = (Hl7.Fhir.Model.CodeableConcept)DiseaseSymptomProcedure.DeepCopy(); - if(DiseaseStatus != null) dest.DiseaseStatus = (Hl7.Fhir.Model.CodeableConcept)DiseaseStatus.DeepCopy(); - if(Comorbidity.Any()) dest.Comorbidity = new List(Comorbidity.DeepCopy()); - if(IntendedEffect != null) dest.IntendedEffect = (Hl7.Fhir.Model.CodeableConcept)IntendedEffect.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Quantity)Duration.DeepCopy(); - if(OtherTherapy.Any()) dest.OtherTherapy = new List(OtherTherapy.DeepCopy()); - if(UndesirableEffect.Any()) dest.UndesirableEffect = new List(UndesirableEffect.DeepCopy()); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(DiseaseSymptomProcedure != null) dest.DiseaseSymptomProcedure = (Hl7.Fhir.Model.CodeableConcept)DiseaseSymptomProcedure.DeepCopyInternal(); + if(DiseaseStatus != null) dest.DiseaseStatus = (Hl7.Fhir.Model.CodeableConcept)DiseaseStatus.DeepCopyInternal(); + if(Comorbidity.Any()) dest.Comorbidity = new List(Comorbidity.DeepCopyInternal()); + if(IntendedEffect != null) dest.IntendedEffect = (Hl7.Fhir.Model.CodeableConcept)IntendedEffect.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Quantity)Duration.DeepCopyInternal(); + if(OtherTherapy.Any()) dest.OtherTherapy = new List(OtherTherapy.DeepCopyInternal()); + if(UndesirableEffect.Any()) dest.UndesirableEffect = new List(UndesirableEffect.DeepCopyInternal()); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicinalProductIndication()); + var instance = new MedicinalProductIndication(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductIngredient.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductIngredient.cs index fa7de264f2..b6d88548d3 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductIngredient.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductIngredient.cs @@ -124,7 +124,7 @@ public List Strengt private List _Strength; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SpecifiedSubstanceComponent; @@ -133,17 +133,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Group != null) dest.Group = (Hl7.Fhir.Model.CodeableConcept)Group.DeepCopy(); - if(Confidentiality != null) dest.Confidentiality = (Hl7.Fhir.Model.CodeableConcept)Confidentiality.DeepCopy(); - if(Strength.Any()) dest.Strength = new List(Strength.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Group != null) dest.Group = (Hl7.Fhir.Model.CodeableConcept)Group.DeepCopyInternal(); + if(Confidentiality != null) dest.Confidentiality = (Hl7.Fhir.Model.CodeableConcept)Confidentiality.DeepCopyInternal(); + if(Strength.Any()) dest.Strength = new List(Strength.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SpecifiedSubstanceComponent()); + var instance = new SpecifiedSubstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -340,7 +341,7 @@ public List _ReferenceStrength; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StrengthComponent; @@ -349,20 +350,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Presentation != null) dest.Presentation = (Hl7.Fhir.Model.Ratio)Presentation.DeepCopy(); - if(PresentationLowLimit != null) dest.PresentationLowLimit = (Hl7.Fhir.Model.Ratio)PresentationLowLimit.DeepCopy(); - if(Concentration != null) dest.Concentration = (Hl7.Fhir.Model.Ratio)Concentration.DeepCopy(); - if(ConcentrationLowLimit != null) dest.ConcentrationLowLimit = (Hl7.Fhir.Model.Ratio)ConcentrationLowLimit.DeepCopy(); - if(MeasurementPointElement != null) dest.MeasurementPointElement = (Hl7.Fhir.Model.FhirString)MeasurementPointElement.DeepCopy(); - if(Country.Any()) dest.Country = new List(Country.DeepCopy()); - if(ReferenceStrength.Any()) dest.ReferenceStrength = new List(ReferenceStrength.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Presentation != null) dest.Presentation = (Hl7.Fhir.Model.Ratio)Presentation.DeepCopyInternal(); + if(PresentationLowLimit != null) dest.PresentationLowLimit = (Hl7.Fhir.Model.Ratio)PresentationLowLimit.DeepCopyInternal(); + if(Concentration != null) dest.Concentration = (Hl7.Fhir.Model.Ratio)Concentration.DeepCopyInternal(); + if(ConcentrationLowLimit != null) dest.ConcentrationLowLimit = (Hl7.Fhir.Model.Ratio)ConcentrationLowLimit.DeepCopyInternal(); + if(MeasurementPointElement != null) dest.MeasurementPointElement = (Hl7.Fhir.Model.FhirString)MeasurementPointElement.DeepCopyInternal(); + if(Country.Any()) dest.Country = new List(Country.DeepCopyInternal()); + if(ReferenceStrength.Any()) dest.ReferenceStrength = new List(ReferenceStrength.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StrengthComponent()); + var instance = new StrengthComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -556,7 +558,7 @@ public List Country private List _Country; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferenceStrengthComponent; @@ -565,18 +567,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopy(); - if(Strength != null) dest.Strength = (Hl7.Fhir.Model.Ratio)Strength.DeepCopy(); - if(StrengthLowLimit != null) dest.StrengthLowLimit = (Hl7.Fhir.Model.Ratio)StrengthLowLimit.DeepCopy(); - if(MeasurementPointElement != null) dest.MeasurementPointElement = (Hl7.Fhir.Model.FhirString)MeasurementPointElement.DeepCopy(); - if(Country.Any()) dest.Country = new List(Country.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopyInternal(); + if(Strength != null) dest.Strength = (Hl7.Fhir.Model.Ratio)Strength.DeepCopyInternal(); + if(StrengthLowLimit != null) dest.StrengthLowLimit = (Hl7.Fhir.Model.Ratio)StrengthLowLimit.DeepCopyInternal(); + if(MeasurementPointElement != null) dest.MeasurementPointElement = (Hl7.Fhir.Model.FhirString)MeasurementPointElement.DeepCopyInternal(); + if(Country.Any()) dest.Country = new List(Country.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferenceStrengthComponent()); + var instance = new ReferenceStrengthComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -697,7 +700,7 @@ public List Strengt private List _Strength; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceComponent; @@ -706,15 +709,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Strength.Any()) dest.Strength = new List(Strength.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Strength.Any()) dest.Strength = new List(Strength.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceComponent()); + var instance = new SubstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -873,7 +877,7 @@ public Hl7.Fhir.Model.MedicinalProductIngredient.SubstanceComponent Substance Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicinalProductIngredient; @@ -882,19 +886,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(AllergenicIndicatorElement != null) dest.AllergenicIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)AllergenicIndicatorElement.DeepCopy(); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(SpecifiedSubstance.Any()) dest.SpecifiedSubstance = new List(SpecifiedSubstance.DeepCopy()); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.MedicinalProductIngredient.SubstanceComponent)Substance.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(AllergenicIndicatorElement != null) dest.AllergenicIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)AllergenicIndicatorElement.DeepCopyInternal(); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(SpecifiedSubstance.Any()) dest.SpecifiedSubstance = new List(SpecifiedSubstance.DeepCopyInternal()); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.MedicinalProductIngredient.SubstanceComponent)Substance.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicinalProductIngredient()); + var instance = new MedicinalProductIngredient(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductInteraction.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductInteraction.cs index ad0ef10a47..481525d9c6 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductInteraction.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductInteraction.cs @@ -89,7 +89,7 @@ public Hl7.Fhir.Model.DataType Item private Hl7.Fhir.Model.DataType _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InteractantComponent; @@ -98,14 +98,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InteractantComponent()); + var instance = new InteractantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -266,7 +267,7 @@ public Hl7.Fhir.Model.CodeableConcept Management private Hl7.Fhir.Model.CodeableConcept _Management; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicinalProductInteraction; @@ -275,20 +276,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Interactant.Any()) dest.Interactant = new List(Interactant.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Effect != null) dest.Effect = (Hl7.Fhir.Model.CodeableConcept)Effect.DeepCopy(); - if(Incidence != null) dest.Incidence = (Hl7.Fhir.Model.CodeableConcept)Incidence.DeepCopy(); - if(Management != null) dest.Management = (Hl7.Fhir.Model.CodeableConcept)Management.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Interactant.Any()) dest.Interactant = new List(Interactant.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Effect != null) dest.Effect = (Hl7.Fhir.Model.CodeableConcept)Effect.DeepCopyInternal(); + if(Incidence != null) dest.Incidence = (Hl7.Fhir.Model.CodeableConcept)Incidence.DeepCopyInternal(); + if(Management != null) dest.Management = (Hl7.Fhir.Model.CodeableConcept)Management.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicinalProductInteraction()); + var instance = new MedicinalProductInteraction(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductManufactured.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductManufactured.cs index 383be835aa..a8e7053544 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductManufactured.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductManufactured.cs @@ -156,7 +156,7 @@ public List OtherCharacteristics private List _OtherCharacteristics; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicinalProductManufactured; @@ -165,20 +165,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ManufacturedDoseForm != null) dest.ManufacturedDoseForm = (Hl7.Fhir.Model.CodeableConcept)ManufacturedDoseForm.DeepCopy(); - if(UnitOfPresentation != null) dest.UnitOfPresentation = (Hl7.Fhir.Model.CodeableConcept)UnitOfPresentation.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(PhysicalCharacteristics != null) dest.PhysicalCharacteristics = (Hl7.Fhir.Model.ProdCharacteristic)PhysicalCharacteristics.DeepCopy(); - if(OtherCharacteristics.Any()) dest.OtherCharacteristics = new List(OtherCharacteristics.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ManufacturedDoseForm != null) dest.ManufacturedDoseForm = (Hl7.Fhir.Model.CodeableConcept)ManufacturedDoseForm.DeepCopyInternal(); + if(UnitOfPresentation != null) dest.UnitOfPresentation = (Hl7.Fhir.Model.CodeableConcept)UnitOfPresentation.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(PhysicalCharacteristics != null) dest.PhysicalCharacteristics = (Hl7.Fhir.Model.ProdCharacteristic)PhysicalCharacteristics.DeepCopyInternal(); + if(OtherCharacteristics.Any()) dest.OtherCharacteristics = new List(OtherCharacteristics.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicinalProductManufactured()); + var instance = new MedicinalProductManufactured(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductPackaged.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductPackaged.cs index fef7aeff93..d01428acc0 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductPackaged.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductPackaged.cs @@ -96,7 +96,7 @@ public Hl7.Fhir.Model.Identifier ImmediatePackaging private Hl7.Fhir.Model.Identifier _ImmediatePackaging; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BatchIdentifierComponent; @@ -105,15 +105,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(OuterPackaging != null) dest.OuterPackaging = (Hl7.Fhir.Model.Identifier)OuterPackaging.DeepCopy(); - if(ImmediatePackaging != null) dest.ImmediatePackaging = (Hl7.Fhir.Model.Identifier)ImmediatePackaging.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(OuterPackaging != null) dest.OuterPackaging = (Hl7.Fhir.Model.Identifier)OuterPackaging.DeepCopyInternal(); + if(ImmediatePackaging != null) dest.ImmediatePackaging = (Hl7.Fhir.Model.Identifier)ImmediatePackaging.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BatchIdentifierComponent()); + var instance = new BatchIdentifierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -355,7 +356,7 @@ public List Manufacturer private List _Manufacturer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PackageItemComponent; @@ -364,25 +365,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Material.Any()) dest.Material = new List(Material.DeepCopy()); - if(AlternateMaterial.Any()) dest.AlternateMaterial = new List(AlternateMaterial.DeepCopy()); - if(Device.Any()) dest.Device = new List(Device.DeepCopy()); - if(ManufacturedItem.Any()) dest.ManufacturedItem = new List(ManufacturedItem.DeepCopy()); - if(PackageItem.Any()) dest.PackageItem = new List(PackageItem.DeepCopy()); - if(PhysicalCharacteristics != null) dest.PhysicalCharacteristics = (Hl7.Fhir.Model.ProdCharacteristic)PhysicalCharacteristics.DeepCopy(); - if(OtherCharacteristics.Any()) dest.OtherCharacteristics = new List(OtherCharacteristics.DeepCopy()); - if(ShelfLifeStorage.Any()) dest.ShelfLifeStorage = new List(ShelfLifeStorage.DeepCopy()); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Material.Any()) dest.Material = new List(Material.DeepCopyInternal()); + if(AlternateMaterial.Any()) dest.AlternateMaterial = new List(AlternateMaterial.DeepCopyInternal()); + if(Device.Any()) dest.Device = new List(Device.DeepCopyInternal()); + if(ManufacturedItem.Any()) dest.ManufacturedItem = new List(ManufacturedItem.DeepCopyInternal()); + if(PackageItem.Any()) dest.PackageItem = new List(PackageItem.DeepCopyInternal()); + if(PhysicalCharacteristics != null) dest.PhysicalCharacteristics = (Hl7.Fhir.Model.ProdCharacteristic)PhysicalCharacteristics.DeepCopyInternal(); + if(OtherCharacteristics.Any()) dest.OtherCharacteristics = new List(OtherCharacteristics.DeepCopyInternal()); + if(ShelfLifeStorage.Any()) dest.ShelfLifeStorage = new List(ShelfLifeStorage.DeepCopyInternal()); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PackageItemComponent()); + var instance = new PackageItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -667,7 +669,7 @@ public List Packag List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicinalProductPackaged; @@ -676,22 +678,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(LegalStatusOfSupply != null) dest.LegalStatusOfSupply = (Hl7.Fhir.Model.CodeableConcept)LegalStatusOfSupply.DeepCopy(); - if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopy()); - if(MarketingAuthorization != null) dest.MarketingAuthorization = (Hl7.Fhir.Model.ResourceReference)MarketingAuthorization.DeepCopy(); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(BatchIdentifier.Any()) dest.BatchIdentifier = new List(BatchIdentifier.DeepCopy()); - if(PackageItem.Any()) dest.PackageItem = new List(PackageItem.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(LegalStatusOfSupply != null) dest.LegalStatusOfSupply = (Hl7.Fhir.Model.CodeableConcept)LegalStatusOfSupply.DeepCopyInternal(); + if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopyInternal()); + if(MarketingAuthorization != null) dest.MarketingAuthorization = (Hl7.Fhir.Model.ResourceReference)MarketingAuthorization.DeepCopyInternal(); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(BatchIdentifier.Any()) dest.BatchIdentifier = new List(BatchIdentifier.DeepCopyInternal()); + if(PackageItem.Any()) dest.PackageItem = new List(PackageItem.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicinalProductPackaged()); + var instance = new MedicinalProductPackaged(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductPharmaceutical.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductPharmaceutical.cs index 427cd681c1..1726888e79 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductPharmaceutical.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductPharmaceutical.cs @@ -96,7 +96,7 @@ public Hl7.Fhir.Model.CodeableConcept Status private Hl7.Fhir.Model.CodeableConcept _Status; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicsComponent; @@ -105,15 +105,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicsComponent()); + var instance = new CharacteristicsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -275,7 +276,7 @@ public List _TargetSpecies; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RouteOfAdministrationComponent; @@ -284,20 +285,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(FirstDose != null) dest.FirstDose = (Hl7.Fhir.Model.Quantity)FirstDose.DeepCopy(); - if(MaxSingleDose != null) dest.MaxSingleDose = (Hl7.Fhir.Model.Quantity)MaxSingleDose.DeepCopy(); - if(MaxDosePerDay != null) dest.MaxDosePerDay = (Hl7.Fhir.Model.Quantity)MaxDosePerDay.DeepCopy(); - if(MaxDosePerTreatmentPeriod != null) dest.MaxDosePerTreatmentPeriod = (Hl7.Fhir.Model.Ratio)MaxDosePerTreatmentPeriod.DeepCopy(); - if(MaxTreatmentPeriod != null) dest.MaxTreatmentPeriod = (Hl7.Fhir.Model.Duration)MaxTreatmentPeriod.DeepCopy(); - if(TargetSpecies.Any()) dest.TargetSpecies = new List(TargetSpecies.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(FirstDose != null) dest.FirstDose = (Hl7.Fhir.Model.Quantity)FirstDose.DeepCopyInternal(); + if(MaxSingleDose != null) dest.MaxSingleDose = (Hl7.Fhir.Model.Quantity)MaxSingleDose.DeepCopyInternal(); + if(MaxDosePerDay != null) dest.MaxDosePerDay = (Hl7.Fhir.Model.Quantity)MaxDosePerDay.DeepCopyInternal(); + if(MaxDosePerTreatmentPeriod != null) dest.MaxDosePerTreatmentPeriod = (Hl7.Fhir.Model.Ratio)MaxDosePerTreatmentPeriod.DeepCopyInternal(); + if(MaxTreatmentPeriod != null) dest.MaxTreatmentPeriod = (Hl7.Fhir.Model.Duration)MaxTreatmentPeriod.DeepCopyInternal(); + if(TargetSpecies.Any()) dest.TargetSpecies = new List(TargetSpecies.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RouteOfAdministrationComponent()); + var instance = new RouteOfAdministrationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -434,7 +436,7 @@ public List _WithdrawalPeriod; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetSpeciesComponent; @@ -443,15 +445,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(WithdrawalPeriod.Any()) dest.WithdrawalPeriod = new List(WithdrawalPeriod.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(WithdrawalPeriod.Any()) dest.WithdrawalPeriod = new List(WithdrawalPeriod.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetSpeciesComponent()); + var instance = new TargetSpeciesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -579,7 +582,7 @@ public string SupportingInformation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as WithdrawalPeriodComponent; @@ -588,16 +591,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Tissue != null) dest.Tissue = (Hl7.Fhir.Model.CodeableConcept)Tissue.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopy(); - if(SupportingInformationElement != null) dest.SupportingInformationElement = (Hl7.Fhir.Model.FhirString)SupportingInformationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Tissue != null) dest.Tissue = (Hl7.Fhir.Model.CodeableConcept)Tissue.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopyInternal(); + if(SupportingInformationElement != null) dest.SupportingInformationElement = (Hl7.Fhir.Model.FhirString)SupportingInformationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new WithdrawalPeriodComponent()); + var instance = new WithdrawalPeriodComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -764,7 +768,7 @@ public List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicinalProductPharmaceutical; @@ -773,20 +777,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(AdministrableDoseForm != null) dest.AdministrableDoseForm = (Hl7.Fhir.Model.CodeableConcept)AdministrableDoseForm.DeepCopy(); - if(UnitOfPresentation != null) dest.UnitOfPresentation = (Hl7.Fhir.Model.CodeableConcept)UnitOfPresentation.DeepCopy(); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(Device.Any()) dest.Device = new List(Device.DeepCopy()); - if(Characteristics.Any()) dest.Characteristics = new List(Characteristics.DeepCopy()); - if(RouteOfAdministration.Any()) dest.RouteOfAdministration = new List(RouteOfAdministration.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(AdministrableDoseForm != null) dest.AdministrableDoseForm = (Hl7.Fhir.Model.CodeableConcept)AdministrableDoseForm.DeepCopyInternal(); + if(UnitOfPresentation != null) dest.UnitOfPresentation = (Hl7.Fhir.Model.CodeableConcept)UnitOfPresentation.DeepCopyInternal(); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(Device.Any()) dest.Device = new List(Device.DeepCopyInternal()); + if(Characteristics.Any()) dest.Characteristics = new List(Characteristics.DeepCopyInternal()); + if(RouteOfAdministration.Any()) dest.RouteOfAdministration = new List(RouteOfAdministration.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicinalProductPharmaceutical()); + var instance = new MedicinalProductPharmaceutical(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductUndesirableEffect.cs b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductUndesirableEffect.cs index 1e68c27fa6..393ef963a2 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductUndesirableEffect.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MedicinalProductUndesirableEffect.cs @@ -128,7 +128,7 @@ public List Population private List _Population; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicinalProductUndesirableEffect; @@ -137,18 +137,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(SymptomConditionEffect != null) dest.SymptomConditionEffect = (Hl7.Fhir.Model.CodeableConcept)SymptomConditionEffect.DeepCopy(); - if(Classification != null) dest.Classification = (Hl7.Fhir.Model.CodeableConcept)Classification.DeepCopy(); - if(FrequencyOfOccurrence != null) dest.FrequencyOfOccurrence = (Hl7.Fhir.Model.CodeableConcept)FrequencyOfOccurrence.DeepCopy(); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(SymptomConditionEffect != null) dest.SymptomConditionEffect = (Hl7.Fhir.Model.CodeableConcept)SymptomConditionEffect.DeepCopyInternal(); + if(Classification != null) dest.Classification = (Hl7.Fhir.Model.CodeableConcept)Classification.DeepCopyInternal(); + if(FrequencyOfOccurrence != null) dest.FrequencyOfOccurrence = (Hl7.Fhir.Model.CodeableConcept)FrequencyOfOccurrence.DeepCopyInternal(); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicinalProductUndesirableEffect()); + var instance = new MedicinalProductUndesirableEffect(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MessageDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/MessageDefinition.cs index 3409642520..52ce27ab69 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MessageDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MessageDefinition.cs @@ -232,7 +232,7 @@ public string Max } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FocusComponent; @@ -241,17 +241,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FocusComponent()); + var instance = new FocusComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -403,7 +404,7 @@ public string Situation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AllowedResponseComponent; @@ -412,15 +413,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Canonical)MessageElement.DeepCopy(); - if(SituationElement != null) dest.SituationElement = (Hl7.Fhir.Model.Markdown)SituationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Canonical)MessageElement.DeepCopyInternal(); + if(SituationElement != null) dest.SituationElement = (Hl7.Fhir.Model.Markdown)SituationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AllowedResponseComponent()); + var instance = new AllowedResponseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1121,7 +1123,7 @@ public IEnumerable Graph Hl7.Fhir.Model.DataType ICoded.Code { get => Event; set => Event = value; } IEnumerable ICoded.ToCodings() => Event.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageDefinition; @@ -1130,37 +1132,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ReplacesElement.Any()) dest.ReplacesElement = new List(ReplacesElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(BaseElement != null) dest.BaseElement = (Hl7.Fhir.Model.Canonical)BaseElement.DeepCopy(); - if(ParentElement.Any()) dest.ParentElement = new List(ParentElement.DeepCopy()); - if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopy(); - if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(ResponseRequiredElement != null) dest.ResponseRequiredElement = (Code)ResponseRequiredElement.DeepCopy(); - if(AllowedResponse.Any()) dest.AllowedResponse = new List(AllowedResponse.DeepCopy()); - if(GraphElement.Any()) dest.GraphElement = new List(GraphElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ReplacesElement.Any()) dest.ReplacesElement = new List(ReplacesElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(BaseElement != null) dest.BaseElement = (Hl7.Fhir.Model.Canonical)BaseElement.DeepCopyInternal(); + if(ParentElement.Any()) dest.ParentElement = new List(ParentElement.DeepCopyInternal()); + if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopyInternal(); + if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(ResponseRequiredElement != null) dest.ResponseRequiredElement = (Code)ResponseRequiredElement.DeepCopyInternal(); + if(AllowedResponse.Any()) dest.AllowedResponse = new List(AllowedResponse.DeepCopyInternal()); + if(GraphElement.Any()) dest.GraphElement = new List(GraphElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageDefinition()); + var instance = new MessageDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MessageHeader.cs b/src/Hl7.Fhir.R4/Model/Generated/MessageHeader.cs index 6ad3ad914a..927e3d68e2 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MessageHeader.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MessageHeader.cs @@ -197,7 +197,7 @@ public Hl7.Fhir.Model.ResourceReference Receiver private Hl7.Fhir.Model.ResourceReference _Receiver; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageDestinationComponent; @@ -206,17 +206,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopy(); - if(Receiver != null) dest.Receiver = (Hl7.Fhir.Model.ResourceReference)Receiver.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); + if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopyInternal(); + if(Receiver != null) dest.Receiver = (Hl7.Fhir.Model.ResourceReference)Receiver.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageDestinationComponent()); + var instance = new MessageDestinationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -442,7 +443,7 @@ public string Endpoint } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageSourceComponent; @@ -451,18 +452,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(SoftwareElement != null) dest.SoftwareElement = (Hl7.Fhir.Model.FhirString)SoftwareElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(Contact != null) dest.Contact = (Hl7.Fhir.Model.ContactPoint)Contact.DeepCopy(); - if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(SoftwareElement != null) dest.SoftwareElement = (Hl7.Fhir.Model.FhirString)SoftwareElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(Contact != null) dest.Contact = (Hl7.Fhir.Model.ContactPoint)Contact.DeepCopyInternal(); + if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageSourceComponent()); + var instance = new MessageSourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -639,7 +641,7 @@ public Hl7.Fhir.Model.ResourceReference Details private Hl7.Fhir.Model.ResourceReference _Details; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResponseComponent; @@ -648,16 +650,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IdentifierElement != null) dest.IdentifierElement = (Hl7.Fhir.Model.Id)IdentifierElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Details != null) dest.Details = (Hl7.Fhir.Model.ResourceReference)Details.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IdentifierElement != null) dest.IdentifierElement = (Hl7.Fhir.Model.Id)IdentifierElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Details != null) dest.Details = (Hl7.Fhir.Model.ResourceReference)Details.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResponseComponent()); + var instance = new ResponseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -900,7 +903,7 @@ public string Definition } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageHeader; @@ -909,24 +912,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopy(); - if(Destination.Any()) dest.Destination = new List(Destination.DeepCopy()); - if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.MessageHeader.MessageSourceComponent)Source.DeepCopy(); - if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.MessageHeader.ResponseComponent)Response.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopyInternal(); + if(Destination.Any()) dest.Destination = new List(Destination.DeepCopyInternal()); + if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.MessageHeader.MessageSourceComponent)Source.DeepCopyInternal(); + if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.MessageHeader.ResponseComponent)Response.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageHeader()); + var instance = new MessageHeader(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/MolecularSequence.cs b/src/Hl7.Fhir.R4/Model/Generated/MolecularSequence.cs index 97bb697e42..ffe448225a 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/MolecularSequence.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/MolecularSequence.cs @@ -448,7 +448,7 @@ public int? WindowEnd } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferenceSeqComponent; @@ -457,22 +457,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Chromosome != null) dest.Chromosome = (Hl7.Fhir.Model.CodeableConcept)Chromosome.DeepCopy(); - if(GenomeBuildElement != null) dest.GenomeBuildElement = (Hl7.Fhir.Model.FhirString)GenomeBuildElement.DeepCopy(); - if(OrientationElement != null) dest.OrientationElement = (Code)OrientationElement.DeepCopy(); - if(ReferenceSeqId != null) dest.ReferenceSeqId = (Hl7.Fhir.Model.CodeableConcept)ReferenceSeqId.DeepCopy(); - if(ReferenceSeqPointer != null) dest.ReferenceSeqPointer = (Hl7.Fhir.Model.ResourceReference)ReferenceSeqPointer.DeepCopy(); - if(ReferenceSeqStringElement != null) dest.ReferenceSeqStringElement = (Hl7.Fhir.Model.FhirString)ReferenceSeqStringElement.DeepCopy(); - if(StrandElement != null) dest.StrandElement = (Code)StrandElement.DeepCopy(); - if(WindowStartElement != null) dest.WindowStartElement = (Hl7.Fhir.Model.Integer)WindowStartElement.DeepCopy(); - if(WindowEndElement != null) dest.WindowEndElement = (Hl7.Fhir.Model.Integer)WindowEndElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Chromosome != null) dest.Chromosome = (Hl7.Fhir.Model.CodeableConcept)Chromosome.DeepCopyInternal(); + if(GenomeBuildElement != null) dest.GenomeBuildElement = (Hl7.Fhir.Model.FhirString)GenomeBuildElement.DeepCopyInternal(); + if(OrientationElement != null) dest.OrientationElement = (Code)OrientationElement.DeepCopyInternal(); + if(ReferenceSeqId != null) dest.ReferenceSeqId = (Hl7.Fhir.Model.CodeableConcept)ReferenceSeqId.DeepCopyInternal(); + if(ReferenceSeqPointer != null) dest.ReferenceSeqPointer = (Hl7.Fhir.Model.ResourceReference)ReferenceSeqPointer.DeepCopyInternal(); + if(ReferenceSeqStringElement != null) dest.ReferenceSeqStringElement = (Hl7.Fhir.Model.FhirString)ReferenceSeqStringElement.DeepCopyInternal(); + if(StrandElement != null) dest.StrandElement = (Code)StrandElement.DeepCopyInternal(); + if(WindowStartElement != null) dest.WindowStartElement = (Hl7.Fhir.Model.Integer)WindowStartElement.DeepCopyInternal(); + if(WindowEndElement != null) dest.WindowEndElement = (Hl7.Fhir.Model.Integer)WindowEndElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferenceSeqComponent()); + var instance = new ReferenceSeqComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -770,7 +771,7 @@ public Hl7.Fhir.Model.ResourceReference VariantPointer private Hl7.Fhir.Model.ResourceReference _VariantPointer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VariantComponent; @@ -779,19 +780,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopy(); - if(ObservedAlleleElement != null) dest.ObservedAlleleElement = (Hl7.Fhir.Model.FhirString)ObservedAlleleElement.DeepCopy(); - if(ReferenceAlleleElement != null) dest.ReferenceAlleleElement = (Hl7.Fhir.Model.FhirString)ReferenceAlleleElement.DeepCopy(); - if(CigarElement != null) dest.CigarElement = (Hl7.Fhir.Model.FhirString)CigarElement.DeepCopy(); - if(VariantPointer != null) dest.VariantPointer = (Hl7.Fhir.Model.ResourceReference)VariantPointer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopyInternal(); + if(ObservedAlleleElement != null) dest.ObservedAlleleElement = (Hl7.Fhir.Model.FhirString)ObservedAlleleElement.DeepCopyInternal(); + if(ReferenceAlleleElement != null) dest.ReferenceAlleleElement = (Hl7.Fhir.Model.FhirString)ReferenceAlleleElement.DeepCopyInternal(); + if(CigarElement != null) dest.CigarElement = (Hl7.Fhir.Model.FhirString)CigarElement.DeepCopyInternal(); + if(VariantPointer != null) dest.VariantPointer = (Hl7.Fhir.Model.ResourceReference)VariantPointer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VariantComponent()); + var instance = new VariantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1293,7 +1295,7 @@ public Hl7.Fhir.Model.MolecularSequence.RocComponent Roc private Hl7.Fhir.Model.MolecularSequence.RocComponent _Roc; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QualityComponent; @@ -1302,28 +1304,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(StandardSequence != null) dest.StandardSequence = (Hl7.Fhir.Model.CodeableConcept)StandardSequence.DeepCopy(); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopy(); - if(Score != null) dest.Score = (Hl7.Fhir.Model.Quantity)Score.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(TruthTPElement != null) dest.TruthTPElement = (Hl7.Fhir.Model.FhirDecimal)TruthTPElement.DeepCopy(); - if(QueryTPElement != null) dest.QueryTPElement = (Hl7.Fhir.Model.FhirDecimal)QueryTPElement.DeepCopy(); - if(TruthFNElement != null) dest.TruthFNElement = (Hl7.Fhir.Model.FhirDecimal)TruthFNElement.DeepCopy(); - if(QueryFPElement != null) dest.QueryFPElement = (Hl7.Fhir.Model.FhirDecimal)QueryFPElement.DeepCopy(); - if(GtFPElement != null) dest.GtFPElement = (Hl7.Fhir.Model.FhirDecimal)GtFPElement.DeepCopy(); - if(PrecisionElement != null) dest.PrecisionElement = (Hl7.Fhir.Model.FhirDecimal)PrecisionElement.DeepCopy(); - if(RecallElement != null) dest.RecallElement = (Hl7.Fhir.Model.FhirDecimal)RecallElement.DeepCopy(); - if(FScoreElement != null) dest.FScoreElement = (Hl7.Fhir.Model.FhirDecimal)FScoreElement.DeepCopy(); - if(Roc != null) dest.Roc = (Hl7.Fhir.Model.MolecularSequence.RocComponent)Roc.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(StandardSequence != null) dest.StandardSequence = (Hl7.Fhir.Model.CodeableConcept)StandardSequence.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopyInternal(); + if(Score != null) dest.Score = (Hl7.Fhir.Model.Quantity)Score.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(TruthTPElement != null) dest.TruthTPElement = (Hl7.Fhir.Model.FhirDecimal)TruthTPElement.DeepCopyInternal(); + if(QueryTPElement != null) dest.QueryTPElement = (Hl7.Fhir.Model.FhirDecimal)QueryTPElement.DeepCopyInternal(); + if(TruthFNElement != null) dest.TruthFNElement = (Hl7.Fhir.Model.FhirDecimal)TruthFNElement.DeepCopyInternal(); + if(QueryFPElement != null) dest.QueryFPElement = (Hl7.Fhir.Model.FhirDecimal)QueryFPElement.DeepCopyInternal(); + if(GtFPElement != null) dest.GtFPElement = (Hl7.Fhir.Model.FhirDecimal)GtFPElement.DeepCopyInternal(); + if(PrecisionElement != null) dest.PrecisionElement = (Hl7.Fhir.Model.FhirDecimal)PrecisionElement.DeepCopyInternal(); + if(RecallElement != null) dest.RecallElement = (Hl7.Fhir.Model.FhirDecimal)RecallElement.DeepCopyInternal(); + if(FScoreElement != null) dest.FScoreElement = (Hl7.Fhir.Model.FhirDecimal)FScoreElement.DeepCopyInternal(); + if(Roc != null) dest.Roc = (Hl7.Fhir.Model.MolecularSequence.RocComponent)Roc.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QualityComponent()); + var instance = new QualityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1723,7 +1726,7 @@ public IEnumerable FMeasure } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RocComponent; @@ -1732,20 +1735,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ScoreElement.Any()) dest.ScoreElement = new List(ScoreElement.DeepCopy()); - if(NumTPElement.Any()) dest.NumTPElement = new List(NumTPElement.DeepCopy()); - if(NumFPElement.Any()) dest.NumFPElement = new List(NumFPElement.DeepCopy()); - if(NumFNElement.Any()) dest.NumFNElement = new List(NumFNElement.DeepCopy()); - if(PrecisionElement.Any()) dest.PrecisionElement = new List(PrecisionElement.DeepCopy()); - if(SensitivityElement.Any()) dest.SensitivityElement = new List(SensitivityElement.DeepCopy()); - if(FMeasureElement.Any()) dest.FMeasureElement = new List(FMeasureElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ScoreElement.Any()) dest.ScoreElement = new List(ScoreElement.DeepCopyInternal()); + if(NumTPElement.Any()) dest.NumTPElement = new List(NumTPElement.DeepCopyInternal()); + if(NumFPElement.Any()) dest.NumFPElement = new List(NumFPElement.DeepCopyInternal()); + if(NumFNElement.Any()) dest.NumFNElement = new List(NumFNElement.DeepCopyInternal()); + if(PrecisionElement.Any()) dest.PrecisionElement = new List(PrecisionElement.DeepCopyInternal()); + if(SensitivityElement.Any()) dest.SensitivityElement = new List(SensitivityElement.DeepCopyInternal()); + if(FMeasureElement.Any()) dest.FMeasureElement = new List(FMeasureElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RocComponent()); + var instance = new RocComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2046,7 +2050,7 @@ public string ReadsetId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepositoryComponent; @@ -2055,19 +2059,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DatasetIdElement != null) dest.DatasetIdElement = (Hl7.Fhir.Model.FhirString)DatasetIdElement.DeepCopy(); - if(VariantsetIdElement != null) dest.VariantsetIdElement = (Hl7.Fhir.Model.FhirString)VariantsetIdElement.DeepCopy(); - if(ReadsetIdElement != null) dest.ReadsetIdElement = (Hl7.Fhir.Model.FhirString)ReadsetIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DatasetIdElement != null) dest.DatasetIdElement = (Hl7.Fhir.Model.FhirString)DatasetIdElement.DeepCopyInternal(); + if(VariantsetIdElement != null) dest.VariantsetIdElement = (Hl7.Fhir.Model.FhirString)VariantsetIdElement.DeepCopyInternal(); + if(ReadsetIdElement != null) dest.ReadsetIdElement = (Hl7.Fhir.Model.FhirString)ReadsetIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepositoryComponent()); + var instance = new RepositoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2273,7 +2278,7 @@ public Hl7.Fhir.Model.MolecularSequence.InnerComponent Inner private Hl7.Fhir.Model.MolecularSequence.InnerComponent _Inner; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureVariantComponent; @@ -2282,18 +2287,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(VariantType != null) dest.VariantType = (Hl7.Fhir.Model.CodeableConcept)VariantType.DeepCopy(); - if(ExactElement != null) dest.ExactElement = (Hl7.Fhir.Model.FhirBoolean)ExactElement.DeepCopy(); - if(LengthElement != null) dest.LengthElement = (Hl7.Fhir.Model.Integer)LengthElement.DeepCopy(); - if(Outer != null) dest.Outer = (Hl7.Fhir.Model.MolecularSequence.OuterComponent)Outer.DeepCopy(); - if(Inner != null) dest.Inner = (Hl7.Fhir.Model.MolecularSequence.InnerComponent)Inner.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(VariantType != null) dest.VariantType = (Hl7.Fhir.Model.CodeableConcept)VariantType.DeepCopyInternal(); + if(ExactElement != null) dest.ExactElement = (Hl7.Fhir.Model.FhirBoolean)ExactElement.DeepCopyInternal(); + if(LengthElement != null) dest.LengthElement = (Hl7.Fhir.Model.Integer)LengthElement.DeepCopyInternal(); + if(Outer != null) dest.Outer = (Hl7.Fhir.Model.MolecularSequence.OuterComponent)Outer.DeepCopyInternal(); + if(Inner != null) dest.Inner = (Hl7.Fhir.Model.MolecularSequence.InnerComponent)Inner.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureVariantComponent()); + var instance = new StructureVariantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2448,7 +2454,7 @@ public int? End } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OuterComponent; @@ -2457,15 +2463,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OuterComponent()); + var instance = new OuterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2596,7 +2603,7 @@ public int? End } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InnerComponent; @@ -2605,15 +2612,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InnerComponent()); + var instance = new InnerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2970,7 +2978,7 @@ public List Structur List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MolecularSequence; @@ -2979,29 +2987,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(CoordinateSystemElement != null) dest.CoordinateSystemElement = (Hl7.Fhir.Model.Integer)CoordinateSystemElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(ReferenceSeq != null) dest.ReferenceSeq = (Hl7.Fhir.Model.MolecularSequence.ReferenceSeqComponent)ReferenceSeq.DeepCopy(); - if(Variant.Any()) dest.Variant = new List(Variant.DeepCopy()); - if(ObservedSeqElement != null) dest.ObservedSeqElement = (Hl7.Fhir.Model.FhirString)ObservedSeqElement.DeepCopy(); - if(Quality.Any()) dest.Quality = new List(Quality.DeepCopy()); - if(ReadCoverageElement != null) dest.ReadCoverageElement = (Hl7.Fhir.Model.Integer)ReadCoverageElement.DeepCopy(); - if(Repository.Any()) dest.Repository = new List(Repository.DeepCopy()); - if(Pointer.Any()) dest.Pointer = new List(Pointer.DeepCopy()); - if(StructureVariant.Any()) dest.StructureVariant = new List(StructureVariant.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(CoordinateSystemElement != null) dest.CoordinateSystemElement = (Hl7.Fhir.Model.Integer)CoordinateSystemElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(ReferenceSeq != null) dest.ReferenceSeq = (Hl7.Fhir.Model.MolecularSequence.ReferenceSeqComponent)ReferenceSeq.DeepCopyInternal(); + if(Variant.Any()) dest.Variant = new List(Variant.DeepCopyInternal()); + if(ObservedSeqElement != null) dest.ObservedSeqElement = (Hl7.Fhir.Model.FhirString)ObservedSeqElement.DeepCopyInternal(); + if(Quality.Any()) dest.Quality = new List(Quality.DeepCopyInternal()); + if(ReadCoverageElement != null) dest.ReadCoverageElement = (Hl7.Fhir.Model.Integer)ReadCoverageElement.DeepCopyInternal(); + if(Repository.Any()) dest.Repository = new List(Repository.DeepCopyInternal()); + if(Pointer.Any()) dest.Pointer = new List(Pointer.DeepCopyInternal()); + if(StructureVariant.Any()) dest.StructureVariant = new List(StructureVariant.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MolecularSequence()); + var instance = new MolecularSequence(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Money.cs b/src/Hl7.Fhir.R4/Model/Generated/Money.cs index 85b5d4a463..b8b93935da 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Money.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Money.cs @@ -1222,7 +1222,7 @@ public Hl7.Fhir.Model.Money.Currencies? Currency } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Money; @@ -1231,15 +1231,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy(); - if(CurrencyElement != null) dest.CurrencyElement = (Code)CurrencyElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopyInternal(); + if(CurrencyElement != null) dest.CurrencyElement = (Code)CurrencyElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Money()); + var instance = new Money(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/NamingSystem.cs b/src/Hl7.Fhir.R4/Model/Generated/NamingSystem.cs index 8a18ce830d..9650fd1466 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/NamingSystem.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/NamingSystem.cs @@ -279,7 +279,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UniqueIdComponent; @@ -288,18 +288,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UniqueIdComponent()); + var instance = new UniqueIdComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -706,7 +707,7 @@ public List UniqueId private List _UniqueId; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NamingSystem; @@ -715,26 +716,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirString)ResponsibleElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(UniqueId.Any()) dest.UniqueId = new List(UniqueId.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirString)ResponsibleElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(UniqueId.Any()) dest.UniqueId = new List(UniqueId.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NamingSystem()); + var instance = new NamingSystem(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/NutritionOrder.cs b/src/Hl7.Fhir.R4/Model/Generated/NutritionOrder.cs index 2e955f6993..fb474676a1 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/NutritionOrder.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/NutritionOrder.cs @@ -179,7 +179,7 @@ public string Instruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OralDietComponent; @@ -188,19 +188,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopy()); - if(Nutrient.Any()) dest.Nutrient = new List(Nutrient.DeepCopy()); - if(Texture.Any()) dest.Texture = new List(Texture.DeepCopy()); - if(FluidConsistencyType.Any()) dest.FluidConsistencyType = new List(FluidConsistencyType.DeepCopy()); - if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopyInternal()); + if(Nutrient.Any()) dest.Nutrient = new List(Nutrient.DeepCopyInternal()); + if(Texture.Any()) dest.Texture = new List(Texture.DeepCopyInternal()); + if(FluidConsistencyType.Any()) dest.FluidConsistencyType = new List(FluidConsistencyType.DeepCopyInternal()); + if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OralDietComponent()); + var instance = new OralDietComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -331,7 +332,7 @@ public Hl7.Fhir.Model.Quantity Amount private Hl7.Fhir.Model.Quantity _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NutrientComponent; @@ -340,15 +341,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NutrientComponent()); + var instance = new NutrientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -448,7 +450,7 @@ public Hl7.Fhir.Model.CodeableConcept FoodType private Hl7.Fhir.Model.CodeableConcept _FoodType; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TextureComponent; @@ -457,15 +459,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopy(); - if(FoodType != null) dest.FoodType = (Hl7.Fhir.Model.CodeableConcept)FoodType.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopyInternal(); + if(FoodType != null) dest.FoodType = (Hl7.Fhir.Model.CodeableConcept)FoodType.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TextureComponent()); + var instance = new TextureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -640,7 +643,7 @@ public string Instruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplementComponent; @@ -649,18 +652,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopy(); - if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopyInternal(); + if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplementComponent()); + var instance = new SupplementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -931,7 +935,7 @@ public string AdministrationInstruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnteralFormulaComponent; @@ -940,22 +944,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(BaseFormulaType != null) dest.BaseFormulaType = (Hl7.Fhir.Model.CodeableConcept)BaseFormulaType.DeepCopy(); - if(BaseFormulaProductNameElement != null) dest.BaseFormulaProductNameElement = (Hl7.Fhir.Model.FhirString)BaseFormulaProductNameElement.DeepCopy(); - if(AdditiveType != null) dest.AdditiveType = (Hl7.Fhir.Model.CodeableConcept)AdditiveType.DeepCopy(); - if(AdditiveProductNameElement != null) dest.AdditiveProductNameElement = (Hl7.Fhir.Model.FhirString)AdditiveProductNameElement.DeepCopy(); - if(CaloricDensity != null) dest.CaloricDensity = (Hl7.Fhir.Model.Quantity)CaloricDensity.DeepCopy(); - if(RouteofAdministration != null) dest.RouteofAdministration = (Hl7.Fhir.Model.CodeableConcept)RouteofAdministration.DeepCopy(); - if(Administration.Any()) dest.Administration = new List(Administration.DeepCopy()); - if(MaxVolumeToDeliver != null) dest.MaxVolumeToDeliver = (Hl7.Fhir.Model.Quantity)MaxVolumeToDeliver.DeepCopy(); - if(AdministrationInstructionElement != null) dest.AdministrationInstructionElement = (Hl7.Fhir.Model.FhirString)AdministrationInstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(BaseFormulaType != null) dest.BaseFormulaType = (Hl7.Fhir.Model.CodeableConcept)BaseFormulaType.DeepCopyInternal(); + if(BaseFormulaProductNameElement != null) dest.BaseFormulaProductNameElement = (Hl7.Fhir.Model.FhirString)BaseFormulaProductNameElement.DeepCopyInternal(); + if(AdditiveType != null) dest.AdditiveType = (Hl7.Fhir.Model.CodeableConcept)AdditiveType.DeepCopyInternal(); + if(AdditiveProductNameElement != null) dest.AdditiveProductNameElement = (Hl7.Fhir.Model.FhirString)AdditiveProductNameElement.DeepCopyInternal(); + if(CaloricDensity != null) dest.CaloricDensity = (Hl7.Fhir.Model.Quantity)CaloricDensity.DeepCopyInternal(); + if(RouteofAdministration != null) dest.RouteofAdministration = (Hl7.Fhir.Model.CodeableConcept)RouteofAdministration.DeepCopyInternal(); + if(Administration.Any()) dest.Administration = new List(Administration.DeepCopyInternal()); + if(MaxVolumeToDeliver != null) dest.MaxVolumeToDeliver = (Hl7.Fhir.Model.Quantity)MaxVolumeToDeliver.DeepCopyInternal(); + if(AdministrationInstructionElement != null) dest.AdministrationInstructionElement = (Hl7.Fhir.Model.FhirString)AdministrationInstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnteralFormulaComponent()); + var instance = new EnteralFormulaComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1125,7 +1130,7 @@ public Hl7.Fhir.Model.DataType Rate private Hl7.Fhir.Model.DataType _Rate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdministrationComponent; @@ -1134,16 +1139,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.Timing)Schedule.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.Timing)Schedule.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdministrationComponent()); + var instance = new AdministrationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1565,7 +1571,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NutritionOrder; @@ -1574,30 +1580,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopy(); - if(Orderer != null) dest.Orderer = (Hl7.Fhir.Model.ResourceReference)Orderer.DeepCopy(); - if(AllergyIntolerance.Any()) dest.AllergyIntolerance = new List(AllergyIntolerance.DeepCopy()); - if(FoodPreferenceModifier.Any()) dest.FoodPreferenceModifier = new List(FoodPreferenceModifier.DeepCopy()); - if(ExcludeFoodModifier.Any()) dest.ExcludeFoodModifier = new List(ExcludeFoodModifier.DeepCopy()); - if(OralDiet != null) dest.OralDiet = (Hl7.Fhir.Model.NutritionOrder.OralDietComponent)OralDiet.DeepCopy(); - if(Supplement.Any()) dest.Supplement = new List(Supplement.DeepCopy()); - if(EnteralFormula != null) dest.EnteralFormula = (Hl7.Fhir.Model.NutritionOrder.EnteralFormulaComponent)EnteralFormula.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopyInternal(); + if(Orderer != null) dest.Orderer = (Hl7.Fhir.Model.ResourceReference)Orderer.DeepCopyInternal(); + if(AllergyIntolerance.Any()) dest.AllergyIntolerance = new List(AllergyIntolerance.DeepCopyInternal()); + if(FoodPreferenceModifier.Any()) dest.FoodPreferenceModifier = new List(FoodPreferenceModifier.DeepCopyInternal()); + if(ExcludeFoodModifier.Any()) dest.ExcludeFoodModifier = new List(ExcludeFoodModifier.DeepCopyInternal()); + if(OralDiet != null) dest.OralDiet = (Hl7.Fhir.Model.NutritionOrder.OralDietComponent)OralDiet.DeepCopyInternal(); + if(Supplement.Any()) dest.Supplement = new List(Supplement.DeepCopyInternal()); + if(EnteralFormula != null) dest.EnteralFormula = (Hl7.Fhir.Model.NutritionOrder.EnteralFormulaComponent)EnteralFormula.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NutritionOrder()); + var instance = new NutritionOrder(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Observation.cs b/src/Hl7.Fhir.R4/Model/Generated/Observation.cs index 70df6b7c58..42eca7b198 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Observation.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Observation.cs @@ -176,7 +176,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferenceRangeComponent; @@ -185,19 +185,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Low != null) dest.Low = (Hl7.Fhir.Model.Quantity)Low.DeepCopy(); - if(High != null) dest.High = (Hl7.Fhir.Model.Quantity)High.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopy()); - if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Low != null) dest.Low = (Hl7.Fhir.Model.Quantity)Low.DeepCopyInternal(); + if(High != null) dest.High = (Hl7.Fhir.Model.Quantity)High.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopyInternal()); + if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferenceRangeComponent()); + var instance = new ReferenceRangeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -375,7 +376,7 @@ public List ReferenceRange private List _ReferenceRange; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -384,18 +385,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy(); - if(Interpretation.Any()) dest.Interpretation = new List(Interpretation.DeepCopy()); - if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopyInternal(); + if(Interpretation.Any()) dest.Interpretation = new List(Interpretation.DeepCopyInternal()); + if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -874,7 +876,7 @@ public List Component Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Observation; @@ -883,37 +885,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy(); - if(Interpretation.Any()) dest.Interpretation = new List(Interpretation.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopy()); - if(HasMember.Any()) dest.HasMember = new List(HasMember.DeepCopy()); - if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopy()); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopyInternal(); + if(Interpretation.Any()) dest.Interpretation = new List(Interpretation.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopyInternal()); + if(HasMember.Any()) dest.HasMember = new List(HasMember.DeepCopyInternal()); + if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopyInternal()); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Observation()); + var instance = new Observation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ObservationDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/ObservationDefinition.cs index 37f12e5052..bdf554b254 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ObservationDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ObservationDefinition.cs @@ -270,7 +270,7 @@ public int? DecimalPrecision } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QuantitativeDetailsComponent; @@ -279,17 +279,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CustomaryUnit != null) dest.CustomaryUnit = (Hl7.Fhir.Model.CodeableConcept)CustomaryUnit.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(ConversionFactorElement != null) dest.ConversionFactorElement = (Hl7.Fhir.Model.FhirDecimal)ConversionFactorElement.DeepCopy(); - if(DecimalPrecisionElement != null) dest.DecimalPrecisionElement = (Hl7.Fhir.Model.Integer)DecimalPrecisionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CustomaryUnit != null) dest.CustomaryUnit = (Hl7.Fhir.Model.CodeableConcept)CustomaryUnit.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(ConversionFactorElement != null) dest.ConversionFactorElement = (Hl7.Fhir.Model.FhirDecimal)ConversionFactorElement.DeepCopyInternal(); + if(DecimalPrecisionElement != null) dest.DecimalPrecisionElement = (Hl7.Fhir.Model.Integer)DecimalPrecisionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QuantitativeDetailsComponent()); + var instance = new QuantitativeDetailsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -542,7 +543,7 @@ public string Condition } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QualifiedIntervalComponent; @@ -551,21 +552,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopy(); - if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.CodeableConcept)Context.DeepCopy(); - if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopy(); - if(GestationalAge != null) dest.GestationalAge = (Hl7.Fhir.Model.Range)GestationalAge.DeepCopy(); - if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopyInternal(); + if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.CodeableConcept)Context.DeepCopyInternal(); + if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopyInternal(); + if(GestationalAge != null) dest.GestationalAge = (Hl7.Fhir.Model.Range)GestationalAge.DeepCopyInternal(); + if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QualifiedIntervalComponent()); + var instance = new QualifiedIntervalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -915,7 +917,7 @@ public Hl7.Fhir.Model.ResourceReference CriticalCodedValueSet Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ObservationDefinition; @@ -924,26 +926,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(PermittedDataTypeElement.Any()) dest.PermittedDataTypeElement = new List>(PermittedDataTypeElement.DeepCopy()); - if(MultipleResultsAllowedElement != null) dest.MultipleResultsAllowedElement = (Hl7.Fhir.Model.FhirBoolean)MultipleResultsAllowedElement.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(PreferredReportNameElement != null) dest.PreferredReportNameElement = (Hl7.Fhir.Model.FhirString)PreferredReportNameElement.DeepCopy(); - if(QuantitativeDetails != null) dest.QuantitativeDetails = (Hl7.Fhir.Model.ObservationDefinition.QuantitativeDetailsComponent)QuantitativeDetails.DeepCopy(); - if(QualifiedInterval.Any()) dest.QualifiedInterval = new List(QualifiedInterval.DeepCopy()); - if(ValidCodedValueSet != null) dest.ValidCodedValueSet = (Hl7.Fhir.Model.ResourceReference)ValidCodedValueSet.DeepCopy(); - if(NormalCodedValueSet != null) dest.NormalCodedValueSet = (Hl7.Fhir.Model.ResourceReference)NormalCodedValueSet.DeepCopy(); - if(AbnormalCodedValueSet != null) dest.AbnormalCodedValueSet = (Hl7.Fhir.Model.ResourceReference)AbnormalCodedValueSet.DeepCopy(); - if(CriticalCodedValueSet != null) dest.CriticalCodedValueSet = (Hl7.Fhir.Model.ResourceReference)CriticalCodedValueSet.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(PermittedDataTypeElement.Any()) dest.PermittedDataTypeElement = new List>(PermittedDataTypeElement.DeepCopyInternal()); + if(MultipleResultsAllowedElement != null) dest.MultipleResultsAllowedElement = (Hl7.Fhir.Model.FhirBoolean)MultipleResultsAllowedElement.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(PreferredReportNameElement != null) dest.PreferredReportNameElement = (Hl7.Fhir.Model.FhirString)PreferredReportNameElement.DeepCopyInternal(); + if(QuantitativeDetails != null) dest.QuantitativeDetails = (Hl7.Fhir.Model.ObservationDefinition.QuantitativeDetailsComponent)QuantitativeDetails.DeepCopyInternal(); + if(QualifiedInterval.Any()) dest.QualifiedInterval = new List(QualifiedInterval.DeepCopyInternal()); + if(ValidCodedValueSet != null) dest.ValidCodedValueSet = (Hl7.Fhir.Model.ResourceReference)ValidCodedValueSet.DeepCopyInternal(); + if(NormalCodedValueSet != null) dest.NormalCodedValueSet = (Hl7.Fhir.Model.ResourceReference)NormalCodedValueSet.DeepCopyInternal(); + if(AbnormalCodedValueSet != null) dest.AbnormalCodedValueSet = (Hl7.Fhir.Model.ResourceReference)AbnormalCodedValueSet.DeepCopyInternal(); + if(CriticalCodedValueSet != null) dest.CriticalCodedValueSet = (Hl7.Fhir.Model.ResourceReference)CriticalCodedValueSet.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ObservationDefinition()); + var instance = new ObservationDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/OperationDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/OperationDefinition.cs index 1353153ab0..ccbb1ffe4d 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/OperationDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/OperationDefinition.cs @@ -398,7 +398,7 @@ public List Part private List _Part; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -407,24 +407,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TargetProfileElement.Any()) dest.TargetProfileElement = new List(TargetProfileElement.DeepCopy()); - if(SearchTypeElement != null) dest.SearchTypeElement = (Code)SearchTypeElement.DeepCopy(); - if(Binding != null) dest.Binding = (Hl7.Fhir.Model.OperationDefinition.BindingComponent)Binding.DeepCopy(); - if(ReferencedFrom.Any()) dest.ReferencedFrom = new List(ReferencedFrom.DeepCopy()); - if(Part.Any()) dest.Part = new List(Part.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TargetProfileElement.Any()) dest.TargetProfileElement = new List(TargetProfileElement.DeepCopyInternal()); + if(SearchTypeElement != null) dest.SearchTypeElement = (Code)SearchTypeElement.DeepCopyInternal(); + if(Binding != null) dest.Binding = (Hl7.Fhir.Model.OperationDefinition.BindingComponent)Binding.DeepCopyInternal(); + if(ReferencedFrom.Any()) dest.ReferencedFrom = new List(ReferencedFrom.DeepCopyInternal()); + if(Part.Any()) dest.Part = new List(Part.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -634,7 +635,7 @@ public string ValueSet } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BindingComponent; @@ -643,15 +644,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StrengthElement != null) dest.StrengthElement = (Code)StrengthElement.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StrengthElement != null) dest.StrengthElement = (Code)StrengthElement.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BindingComponent()); + var instance = new BindingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -787,7 +789,7 @@ public string SourceId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferencedFromComponent; @@ -796,15 +798,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.FhirString)SourceIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.FhirString)SourceIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferencedFromComponent()); + var instance = new ReferencedFromComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -940,7 +943,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OverloadComponent; @@ -949,15 +952,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ParameterNameElement.Any()) dest.ParameterNameElement = new List(ParameterNameElement.DeepCopy()); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ParameterNameElement.Any()) dest.ParameterNameElement = new List(ParameterNameElement.DeepCopyInternal()); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OverloadComponent()); + var instance = new OverloadComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1752,7 +1756,7 @@ public List Overload Hl7.Fhir.Model.Code ICoded.Code { get => CodeElement; set => CodeElement = value; } IEnumerable ICoded.ToCodings() => CodeElement.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationDefinition; @@ -1761,39 +1765,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(AffectsStateElement != null) dest.AffectsStateElement = (Hl7.Fhir.Model.FhirBoolean)AffectsStateElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopy(); - if(BaseElement != null) dest.BaseElement = (Hl7.Fhir.Model.Canonical)BaseElement.DeepCopy(); - if(ResourceElement.Any()) dest.ResourceElement = new List>(ResourceElement.DeepCopy()); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirBoolean)SystemElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirBoolean)TypeElement.DeepCopy(); - if(InstanceElement != null) dest.InstanceElement = (Hl7.Fhir.Model.FhirBoolean)InstanceElement.DeepCopy(); - if(InputProfileElement != null) dest.InputProfileElement = (Hl7.Fhir.Model.Canonical)InputProfileElement.DeepCopy(); - if(OutputProfileElement != null) dest.OutputProfileElement = (Hl7.Fhir.Model.Canonical)OutputProfileElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Overload.Any()) dest.Overload = new List(Overload.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(AffectsStateElement != null) dest.AffectsStateElement = (Hl7.Fhir.Model.FhirBoolean)AffectsStateElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopyInternal(); + if(BaseElement != null) dest.BaseElement = (Hl7.Fhir.Model.Canonical)BaseElement.DeepCopyInternal(); + if(ResourceElement.Any()) dest.ResourceElement = new List>(ResourceElement.DeepCopyInternal()); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirBoolean)SystemElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirBoolean)TypeElement.DeepCopyInternal(); + if(InstanceElement != null) dest.InstanceElement = (Hl7.Fhir.Model.FhirBoolean)InstanceElement.DeepCopyInternal(); + if(InputProfileElement != null) dest.InputProfileElement = (Hl7.Fhir.Model.Canonical)InputProfileElement.DeepCopyInternal(); + if(OutputProfileElement != null) dest.OutputProfileElement = (Hl7.Fhir.Model.Canonical)OutputProfileElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Overload.Any()) dest.Overload = new List(Overload.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationDefinition()); + var instance = new OperationDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Organization.cs b/src/Hl7.Fhir.R4/Model/Generated/Organization.cs index 17756632d7..a432c9c4ca 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Organization.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Organization.cs @@ -129,7 +129,7 @@ public Hl7.Fhir.Model.Address Address private Hl7.Fhir.Model.Address _Address; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContactComponent; @@ -138,17 +138,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Purpose != null) dest.Purpose = (Hl7.Fhir.Model.CodeableConcept)Purpose.DeepCopy(); - if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Purpose != null) dest.Purpose = (Hl7.Fhir.Model.CodeableConcept)Purpose.DeepCopyInternal(); + if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContactComponent()); + var instance = new ContactComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -418,7 +419,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Organization; @@ -427,23 +428,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Organization()); + var instance = new Organization(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/OrganizationAffiliation.cs b/src/Hl7.Fhir.R4/Model/Generated/OrganizationAffiliation.cs index f6f501bc53..57225b22f1 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/OrganizationAffiliation.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/OrganizationAffiliation.cs @@ -254,7 +254,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OrganizationAffiliation; @@ -263,25 +263,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(ParticipatingOrganization != null) dest.ParticipatingOrganization = (Hl7.Fhir.Model.ResourceReference)ParticipatingOrganization.DeepCopy(); - if(Network.Any()) dest.Network = new List(Network.DeepCopy()); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(ParticipatingOrganization != null) dest.ParticipatingOrganization = (Hl7.Fhir.Model.ResourceReference)ParticipatingOrganization.DeepCopyInternal(); + if(Network.Any()) dest.Network = new List(Network.DeepCopyInternal()); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OrganizationAffiliation()); + var instance = new OrganizationAffiliation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ParameterDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/ParameterDefinition.cs index b77c1d930a..2b1a4c49ee 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ParameterDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ParameterDefinition.cs @@ -282,7 +282,7 @@ public string Profile } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterDefinition; @@ -291,20 +291,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterDefinition()); + var instance = new ParameterDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Patient.cs b/src/Hl7.Fhir.R4/Model/Generated/Patient.cs index 9dce8bd8eb..1cb050c089 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Patient.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Patient.cs @@ -10,8 +10,6 @@ using Hl7.Fhir.Specification; using Hl7.Fhir.Utility; using Hl7.Fhir.Validation; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using SystemPrimitive = Hl7.Fhir.ElementModel.Types; /* @@ -45,1238 +43,1070 @@ POSSIBILITY OF SUCH DAMAGE. namespace Hl7.Fhir.Model { + /// + /// Information about an individual or animal receiving health care services + /// + /// + /// Demographics and other administrative information about an individual or animal receiving care or other health-related services. + /// + [Serializable] + [DataContract] + [FhirType("Patient","http://hl7.org/fhir/StructureDefinition/Patient")] + public partial class Patient : Hl7.Fhir.Model.DomainResource, Hl7.Fhir.Model.IPatient, IIdentifiable> + { /// - /// Information about an individual or animal receiving health care services + /// FHIR Type Name + /// + public override string TypeName { get { return "Patient"; } } + + /// + /// The type of link between this patient resource and another patient resource. + /// (url: http://hl7.org/fhir/ValueSet/link-type) + /// (system: http://hl7.org/fhir/link-type) + /// + [FhirEnumeration("LinkType", "http://hl7.org/fhir/ValueSet/link-type", "http://hl7.org/fhir/link-type")] + public enum LinkType + { + /// + /// The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains this link. + /// (system: http://hl7.org/fhir/link-type) + /// + [EnumLiteral("replaced-by"), Description("Replaced-by")] + ReplacedBy, + /// + /// The patient resource containing this link is the current active patient record. The link points back to an inactive patient resource that has been merged into this resource, and should be consulted to retrieve additional referenced information. + /// (system: http://hl7.org/fhir/link-type) + /// + [EnumLiteral("replaces"), Description("Replaces")] + Replaces, + /// + /// The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information. + /// (system: http://hl7.org/fhir/link-type) + /// + [EnumLiteral("refer"), Description("Refer")] + Refer, + /// + /// The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid. + /// (system: http://hl7.org/fhir/link-type) + /// + [EnumLiteral("seealso"), Description("See also")] + Seealso, + } + + /// + /// A contact party (e.g. guardian, partner, friend) for the patient /// /// - /// Demographics and other administrative information about an individual or animal receiving care or other health-related services. + /// Contact covers all kinds of contact parties: family members, business contacts, guardians, caregivers. Not applicable to register pedigree and family ties beyond use of having contact. /// [Serializable] [DataContract] - [FhirType("Patient", "http://hl7.org/fhir/StructureDefinition/Patient")] - public partial class Patient : Hl7.Fhir.Model.DomainResource, Hl7.Fhir.Model.IPatient, IIdentifiable> + [FhirType("Patient.contact", IsBackboneType=true)] + public partial class ContactComponent : Hl7.Fhir.Model.BackboneElement { - /// - /// FHIR Type Name - /// - public override string TypeName { get { return "Patient"; } } - - /// - /// The type of link between this patient resource and another patient resource. - /// (url: http://hl7.org/fhir/ValueSet/link-type) - /// (system: http://hl7.org/fhir/link-type) - /// - [FhirEnumeration("LinkType", "http://hl7.org/fhir/ValueSet/link-type", "http://hl7.org/fhir/link-type")] - public enum LinkType + /// + /// FHIR Type Name + /// + public override string TypeName { get { return "Patient.contact"; } } + + /// + /// The kind of relationship. + /// + [FhirElement("relationship", Order=40)] + [Binding("ContactRelationship")] + [Cardinality(Min=0,Max=-1)] + [DataMember] + public List Relationship + { + get { if(_Relationship==null) _Relationship = new List(); return _Relationship; } + set { _Relationship = value; OnPropertyChanged("Relationship"); } + } + + private List _Relationship; + + /// + /// A name associated with the contact person. + /// + [FhirElement("name", Order=50)] + [DataMember] + public Hl7.Fhir.Model.HumanName Name + { + get { return _Name; } + set { _Name = value; OnPropertyChanged("Name"); } + } + + private Hl7.Fhir.Model.HumanName _Name; + + /// + /// A contact detail for the person. + /// + [FhirElement("telecom", Order=60)] + [Cardinality(Min=0,Max=-1)] + [DataMember] + public List Telecom + { + get { if(_Telecom==null) _Telecom = new List(); return _Telecom; } + set { _Telecom = value; OnPropertyChanged("Telecom"); } + } + + private List _Telecom; + + /// + /// Address for the contact person. + /// + [FhirElement("address", Order=70)] + [DataMember] + public Hl7.Fhir.Model.Address Address + { + get { return _Address; } + set { _Address = value; OnPropertyChanged("Address"); } + } + + private Hl7.Fhir.Model.Address _Address; + + /// + /// male | female | other | unknown. + /// + [FhirElement("gender", Order=80)] + [DeclaredType(Type = typeof(Code))] + [Binding("AdministrativeGender")] + [DataMember] + public Code GenderElement + { + get { return _GenderElement; } + set { _GenderElement = value; OnPropertyChanged("GenderElement"); } + } + + private Code _GenderElement; + + /// + /// male | female | other | unknown + /// + /// This uses the native .NET datatype, rather than the FHIR equivalent + [IgnoreDataMember] + public Hl7.Fhir.Model.AdministrativeGender? Gender + { + get { return GenderElement != null ? GenderElement.Value : null; } + set { - /// - /// The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains this link. - /// (system: http://hl7.org/fhir/link-type) - /// - [EnumLiteral("replaced-by"), Description("Replaced-by")] - ReplacedBy, - - /// - /// The patient resource containing this link is the current active patient record. The link points back to an inactive patient resource that has been merged into this resource, and should be consulted to retrieve additional referenced information. - /// (system: http://hl7.org/fhir/link-type) - /// - [EnumLiteral("replaces"), Description("Replaces")] - Replaces, - - /// - /// The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information. - /// (system: http://hl7.org/fhir/link-type) - /// - [EnumLiteral("refer"), Description("Refer")] - Refer, - - /// - /// The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid. - /// (system: http://hl7.org/fhir/link-type) - /// - [EnumLiteral("seealso"), Description("See also")] - Seealso, + if (value == null) + GenderElement = null; + else + GenderElement = new Code(value); + OnPropertyChanged("Gender"); } - - /// - /// A contact party (e.g. guardian, partner, friend) for the patient - /// - /// - /// Contact covers all kinds of contact parties: family members, business contacts, guardians, caregivers. Not applicable to register pedigree and family ties beyond use of having contact. - /// - [Serializable] - [DataContract] - [FhirType("Patient.contact", IsBackboneType = true)] - public partial class ContactComponent : Hl7.Fhir.Model.BackboneElement + } + + /// + /// Organization that is associated with the contact. + /// + [FhirElement("organization", Order=90)] + [CLSCompliant(false)] + [References("Organization")] + [DataMember] + public Hl7.Fhir.Model.ResourceReference Organization + { + get { return _Organization; } + set { _Organization = value; OnPropertyChanged("Organization"); } + } + + private Hl7.Fhir.Model.ResourceReference _Organization; + + /// + /// The period during which this contact person or organization is valid to be contacted relating to this patient. + /// + [FhirElement("period", Order=100)] + [DataMember] + public Hl7.Fhir.Model.Period Period + { + get { return _Period; } + set { _Period = value; OnPropertyChanged("Period"); } + } + + private Hl7.Fhir.Model.Period _Period; + + protected internal override void CopyToInternal(Base other) + { + var dest = other as ContactComponent; + + if (dest == null) { - /// - /// FHIR Type Name - /// - public override string TypeName { get { return "Patient.contact"; } } - - /// - /// The kind of relationship. - /// - [FhirElement("relationship", Order = 40)] - [Binding("ContactRelationship")] - [Cardinality(Min = 0, Max = -1)] - [DataMember] - public List Relationship - { - get - { - if (_Relationship == null) _Relationship = new List(); - return _Relationship; - } - set - { - _Relationship = value; - OnPropertyChanged("Relationship"); - } - } - - private List _Relationship; - - /// - /// A name associated with the contact person. - /// - [FhirElement("name", Order = 50)] - [DataMember] - public Hl7.Fhir.Model.HumanName Name - { - get { return _Name; } - set - { - _Name = value; - OnPropertyChanged("Name"); - } - } - - private Hl7.Fhir.Model.HumanName _Name; - - /// - /// A contact detail for the person. - /// - [FhirElement("telecom", Order = 60)] - [Cardinality(Min = 0, Max = -1)] - [DataMember] - public List Telecom - { - get - { - if (_Telecom == null) _Telecom = new List(); - return _Telecom; - } - set - { - _Telecom = value; - OnPropertyChanged("Telecom"); - } - } - - private List _Telecom; - - /// - /// Address for the contact person. - /// - [FhirElement("address", Order = 70)] - [DataMember] - public Hl7.Fhir.Model.Address Address - { - get { return _Address; } - set - { - _Address = value; - OnPropertyChanged("Address"); - } - } - - private Hl7.Fhir.Model.Address _Address; - - /// - /// male | female | other | unknown. - /// - [FhirElement("gender", Order = 80)] - [DeclaredType(Type = typeof(Code))] - [Binding("AdministrativeGender")] - [DataMember] - public Code GenderElement - { - get { return _GenderElement; } - set - { - _GenderElement = value; - OnPropertyChanged("GenderElement"); - } - } - - private Code _GenderElement; - - /// - /// male | female | other | unknown - /// - /// This uses the native .NET datatype, rather than the FHIR equivalent - [IgnoreDataMember] - public Hl7.Fhir.Model.AdministrativeGender? Gender - { - get { return GenderElement != null ? GenderElement.Value : null; } - set - { - if (value == null) - GenderElement = null; - else - GenderElement = new Code(value); - OnPropertyChanged("Gender"); - } - } - - /// - /// Organization that is associated with the contact. - /// - [FhirElement("organization", Order = 90)] - [CLSCompliant(false)] - [References("Organization")] - [DataMember] - public Hl7.Fhir.Model.ResourceReference Organization - { - get { return _Organization; } - set - { - _Organization = value; - OnPropertyChanged("Organization"); - } - } - - private Hl7.Fhir.Model.ResourceReference _Organization; - - /// - /// The period during which this contact person or organization is valid to be contacted relating to this patient. - /// - [FhirElement("period", Order = 100)] - [DataMember] - public Hl7.Fhir.Model.Period Period - { - get { return _Period; } - set - { - _Period = value; - OnPropertyChanged("Period"); - } - } - - private Hl7.Fhir.Model.Period _Period; - - public override IDeepCopyable CopyTo(IDeepCopyable other) - { - var dest = other as ContactComponent; - - if (dest == null) - { - throw new ArgumentException("Can only copy to an object of the same type", "other"); - } - - base.CopyTo(dest); - if (Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopy()); - if (Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy(); - if (Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if (Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - if (GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if (Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if (Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ContactComponent()); - } - - public override bool CompareChildren(Base other, IEqualityComparer comparer) - { - var otherT = other as ContactComponent; - if (otherT == null) return false; - - if (!base.CompareChildren(otherT, comparer)) return false; - if (!comparer.ListEquals(Relationship, otherT.Relationship)) return false; - if (!comparer.Equals(Name, otherT.Name)) return false; - if (!comparer.ListEquals(Telecom, otherT.Telecom)) return false; - if (!comparer.Equals(Address, otherT.Address)) return false; - if (!comparer.Equals(GenderElement, otherT.GenderElement)) return false; - if (!comparer.Equals(Organization, otherT.Organization)) return false; - if (!comparer.Equals(Period, otherT.Period)) return false; - - return true; - } - - public override bool TryGetValue(string key, out object value) - { - switch (key) - { - case "relationship": - value = Relationship; - return Relationship?.Any() == true; - case "name": - value = Name; - return Name is not null; - case "telecom": - value = Telecom; - return Telecom?.Any() == true; - case "address": - value = Address; - return Address is not null; - case "gender": - value = GenderElement; - return GenderElement is not null; - case "organization": - value = Organization; - return Organization is not null; - case "period": - value = Period; - return Period is not null; - default: - return base.TryGetValue(key, out value); - } - - } - - public override Base SetValue(string key, object value) - { - switch (key) - { - case "relationship": - Relationship = (List)value; - return this; - case "name": - Name = (Hl7.Fhir.Model.HumanName)value; - return this; - case "telecom": - Telecom = (List)value; - return this; - case "address": - Address = (Hl7.Fhir.Model.Address)value; - return this; - case "gender": - GenderElement = (Code)value; - return this; - case "organization": - Organization = (Hl7.Fhir.Model.ResourceReference)value; - return this; - case "period": - Period = (Hl7.Fhir.Model.Period)value; - return this; - default: - return base.SetValue(key, value); - } - - } - - public override IEnumerable> EnumerateElements() - { - foreach (var kvp in base.EnumerateElements()) yield return kvp; - if (Relationship?.Any() == true) yield return new KeyValuePair("relationship", Relationship); - if (Name is not null) yield return new KeyValuePair("name", Name); - if (Telecom?.Any() == true) yield return new KeyValuePair("telecom", Telecom); - if (Address is not null) yield return new KeyValuePair("address", Address); - if (GenderElement is not null) yield return new KeyValuePair("gender", GenderElement); - if (Organization is not null) yield return new KeyValuePair("organization", Organization); - if (Period is not null) yield return new KeyValuePair("period", Period); - } - + throw new ArgumentException("Can only copy to an object of the same type", "other"); } - /// - /// A language which may be used to communicate with the patient about his or her health - /// - /// - /// If no language is specified, this *implies* that the default local language is spoken. If you need to convey proficiency for multiple modes, then you need multiple Patient.Communication associations. For animals, language is not a relevant field, and should be absent from the instance. If the Patient does not speak the default local language, then the Interpreter Required Standard can be used to explicitly declare that an interpreter is required. - /// - [Serializable] - [DataContract] - [FhirType("Patient.communication", IsBackboneType = true)] - public partial class CommunicationComponent : Hl7.Fhir.Model.BackboneElement + base.CopyToInternal(dest); + if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopyInternal()); + if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ContactComponent(); + CopyToInternal(instance); + return instance; + } + + public override bool CompareChildren(Base other, IEqualityComparer comparer) + { + var otherT = other as ContactComponent; + if(otherT == null) return false; + + if(!base.CompareChildren(otherT, comparer)) return false; + if(!comparer.ListEquals(Relationship, otherT.Relationship)) return false; + if(!comparer.Equals(Name, otherT.Name)) return false; + if(!comparer.ListEquals(Telecom, otherT.Telecom)) return false; + if(!comparer.Equals(Address, otherT.Address)) return false; + if(!comparer.Equals(GenderElement, otherT.GenderElement)) return false; + if(!comparer.Equals(Organization, otherT.Organization)) return false; + if(!comparer.Equals(Period, otherT.Period)) return false; + + return true; + } + + public override bool TryGetValue(string key, out object value) + { + switch (key) { - /// - /// FHIR Type Name - /// - public override string TypeName { get { return "Patient.communication"; } } - - /// - /// The language which can be used to communicate with the patient about his or her health. - /// - [FhirElement("language", Order = 40)] - [Binding("Language")] - [Cardinality(Min = 1, Max = 1)] - [DataMember] - public Hl7.Fhir.Model.CodeableConcept Language - { - get { return _Language; } - set - { - _Language = value; - OnPropertyChanged("Language"); - } - } - - private Hl7.Fhir.Model.CodeableConcept _Language; - - /// - /// Language preference indicator. - /// - [FhirElement("preferred", Order = 50)] - [DataMember] - public Hl7.Fhir.Model.FhirBoolean PreferredElement - { - get { return _PreferredElement; } - set - { - _PreferredElement = value; - OnPropertyChanged("PreferredElement"); - } - } - - private Hl7.Fhir.Model.FhirBoolean _PreferredElement; - - /// - /// Language preference indicator - /// - /// This uses the native .NET datatype, rather than the FHIR equivalent - [IgnoreDataMember] - public bool? Preferred - { - get { return PreferredElement != null ? PreferredElement.Value : null; } - set - { - if (value == null) - PreferredElement = null; - else - PreferredElement = new Hl7.Fhir.Model.FhirBoolean(value); - OnPropertyChanged("Preferred"); - } - } - - public override IDeepCopyable CopyTo(IDeepCopyable other) - { - var dest = other as CommunicationComponent; - - if (dest == null) - { - throw new ArgumentException("Can only copy to an object of the same type", "other"); - } - - base.CopyTo(dest); - if (Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if (PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new CommunicationComponent()); - } - - public override bool CompareChildren(Base other, IEqualityComparer comparer) - { - var otherT = other as CommunicationComponent; - if (otherT == null) return false; - - if (!base.CompareChildren(otherT, comparer)) return false; - if (!comparer.Equals(Language, otherT.Language)) return false; - if (!comparer.Equals(PreferredElement, otherT.PreferredElement)) return false; - - return true; - } - - public override bool TryGetValue(string key, out object value) - { - switch (key) - { - case "language": - value = Language; - return Language is not null; - case "preferred": - value = PreferredElement; - return PreferredElement is not null; - default: - return base.TryGetValue(key, out value); - } - - } - - public override Base SetValue(string key, object value) - { - switch (key) - { - case "language": - Language = (Hl7.Fhir.Model.CodeableConcept)value; - return this; - case "preferred": - PreferredElement = (Hl7.Fhir.Model.FhirBoolean)value; - return this; - default: - return base.SetValue(key, value); - } - - } - - public override IEnumerable> EnumerateElements() - { - foreach (var kvp in base.EnumerateElements()) yield return kvp; - if (Language is not null) yield return new KeyValuePair("language", Language); - if (PreferredElement is not null) yield return new KeyValuePair("preferred", PreferredElement); - } - + case "relationship": + value = Relationship; + return Relationship?.Any() == true; + case "name": + value = Name; + return Name is not null; + case "telecom": + value = Telecom; + return Telecom?.Any() == true; + case "address": + value = Address; + return Address is not null; + case "gender": + value = GenderElement; + return GenderElement is not null; + case "organization": + value = Organization; + return Organization is not null; + case "period": + value = Period; + return Period is not null; + default: + return base.TryGetValue(key, out value); } - /// - /// Link to another patient resource that concerns the same actual person - /// - /// - /// Link to another patient resource that concerns the same actual patient. - /// There is no assumption that linked patient records have mutual links. - /// - [Serializable] - [DataContract] - [FhirType("Patient.link", IsBackboneType = true)] - public partial class LinkComponent : Hl7.Fhir.Model.BackboneElement - { - /// - /// FHIR Type Name - /// - public override string TypeName { get { return "Patient.link"; } } - - /// - /// The other patient or related person resource that the link refers to. - /// - [FhirElement("other", InSummary = true, Order = 40)] - [CLSCompliant(false)] - [References("Patient", "RelatedPerson")] - [Cardinality(Min = 1, Max = 1)] - [DataMember] - public Hl7.Fhir.Model.ResourceReference Other - { - get { return _Other; } - set - { - _Other = value; - OnPropertyChanged("Other"); - } - } - - private Hl7.Fhir.Model.ResourceReference _Other; - - /// - /// replaced-by | replaces | refer | seealso. - /// - [FhirElement("type", InSummary = true, Order = 50)] - [DeclaredType(Type = typeof(Code))] - [Binding("LinkType")] - [Cardinality(Min = 1, Max = 1)] - [DataMember] - public Code TypeElement - { - get { return _TypeElement; } - set - { - _TypeElement = value; - OnPropertyChanged("TypeElement"); - } - } - - private Code _TypeElement; - - /// - /// replaced-by | replaces | refer | seealso - /// - /// This uses the native .NET datatype, rather than the FHIR equivalent - [IgnoreDataMember] - public Hl7.Fhir.Model.Patient.LinkType? Type - { - get { return TypeElement != null ? TypeElement.Value : null; } - set - { - if (value == null) - TypeElement = null; - else - TypeElement = new Code(value); - OnPropertyChanged("Type"); - } - } - - public override IDeepCopyable CopyTo(IDeepCopyable other) - { - var dest = other as LinkComponent; - - if (dest == null) - { - throw new ArgumentException("Can only copy to an object of the same type", "other"); - } - - base.CopyTo(dest); - if (Other != null) dest.Other = (Hl7.Fhir.Model.ResourceReference)Other.DeepCopy(); - if (TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new LinkComponent()); - } - - public override bool CompareChildren(Base other, IEqualityComparer comparer) - { - var otherT = other as LinkComponent; - if (otherT == null) return false; - - if (!base.CompareChildren(otherT, comparer)) return false; - if (!comparer.Equals(Other, otherT.Other)) return false; - if (!comparer.Equals(TypeElement, otherT.TypeElement)) return false; - - return true; - } - - public override bool TryGetValue(string key, out object value) - { - switch (key) - { - case "other": - value = Other; - return Other is not null; - case "type": - value = TypeElement; - return TypeElement is not null; - default: - return base.TryGetValue(key, out value); - } - - } - - public override Base SetValue(string key, object value) - { - switch (key) - { - case "other": - Other = (Hl7.Fhir.Model.ResourceReference)value; - return this; - case "type": - TypeElement = (Code)value; - return this; - default: - return base.SetValue(key, value); - } - - } - - public override IEnumerable> EnumerateElements() - { - foreach (var kvp in base.EnumerateElements()) yield return kvp; - if (Other is not null) yield return new KeyValuePair("other", Other); - if (TypeElement is not null) yield return new KeyValuePair("type", TypeElement); - } - - } + } - /// - /// An identifier for this patient. - /// - [FhirElement("identifier", InSummary = true, Order = 90, FiveWs = "FiveWs.identifier")] - [Cardinality(Min = 0, Max = -1)] - [DataMember] - public List Identifier + public override Base SetValue(string key, object value) + { + switch (key) { - get - { - if (_Identifier == null) _Identifier = new List(); - return _Identifier; - } - set - { - _Identifier = value; - OnPropertyChanged("Identifier"); - } + case "relationship": + Relationship = (List)value; + return this; + case "name": + Name = (Hl7.Fhir.Model.HumanName)value; + return this; + case "telecom": + Telecom = (List)value; + return this; + case "address": + Address = (Hl7.Fhir.Model.Address)value; + return this; + case "gender": + GenderElement = (Code)value; + return this; + case "organization": + Organization = (Hl7.Fhir.Model.ResourceReference)value; + return this; + case "period": + Period = (Hl7.Fhir.Model.Period)value; + return this; + default: + return base.SetValue(key, value); } - private List _Identifier; + } + + public override IEnumerable> EnumerateElements() + { + foreach (var kvp in base.EnumerateElements()) yield return kvp; + if (Relationship?.Any() == true) yield return new KeyValuePair("relationship",Relationship); + if (Name is not null) yield return new KeyValuePair("name",Name); + if (Telecom?.Any() == true) yield return new KeyValuePair("telecom",Telecom); + if (Address is not null) yield return new KeyValuePair("address",Address); + if (GenderElement is not null) yield return new KeyValuePair("gender",GenderElement); + if (Organization is not null) yield return new KeyValuePair("organization",Organization); + if (Period is not null) yield return new KeyValuePair("period",Period); + } + + } - /// - /// Whether this patient's record is in active use. - /// - [FhirElement("active", InSummary = true, IsModifier = true, Order = 100, FiveWs = "FiveWs.status")] - [DataMember] - public Hl7.Fhir.Model.FhirBoolean ActiveElement + /// + /// A language which may be used to communicate with the patient about his or her health + /// + /// + /// If no language is specified, this *implies* that the default local language is spoken. If you need to convey proficiency for multiple modes, then you need multiple Patient.Communication associations. For animals, language is not a relevant field, and should be absent from the instance. If the Patient does not speak the default local language, then the Interpreter Required Standard can be used to explicitly declare that an interpreter is required. + /// + [Serializable] + [DataContract] + [FhirType("Patient.communication", IsBackboneType=true)] + public partial class CommunicationComponent : Hl7.Fhir.Model.BackboneElement + { + /// + /// FHIR Type Name + /// + public override string TypeName { get { return "Patient.communication"; } } + + /// + /// The language which can be used to communicate with the patient about his or her health. + /// + [FhirElement("language", Order=40)] + [Binding("Language")] + [Cardinality(Min=1,Max=1)] + [DataMember] + public Hl7.Fhir.Model.CodeableConcept Language + { + get { return _Language; } + set { _Language = value; OnPropertyChanged("Language"); } + } + + private Hl7.Fhir.Model.CodeableConcept _Language; + + /// + /// Language preference indicator. + /// + [FhirElement("preferred", Order=50)] + [DataMember] + public Hl7.Fhir.Model.FhirBoolean PreferredElement + { + get { return _PreferredElement; } + set { _PreferredElement = value; OnPropertyChanged("PreferredElement"); } + } + + private Hl7.Fhir.Model.FhirBoolean _PreferredElement; + + /// + /// Language preference indicator + /// + /// This uses the native .NET datatype, rather than the FHIR equivalent + [IgnoreDataMember] + public bool? Preferred + { + get { return PreferredElement != null ? PreferredElement.Value : null; } + set { - get { return _ActiveElement; } - set - { - _ActiveElement = value; - OnPropertyChanged("ActiveElement"); - } + if (value == null) + PreferredElement = null; + else + PreferredElement = new Hl7.Fhir.Model.FhirBoolean(value); + OnPropertyChanged("Preferred"); } + } - private Hl7.Fhir.Model.FhirBoolean _ActiveElement; + protected internal override void CopyToInternal(Base other) + { + var dest = other as CommunicationComponent; - /// - /// Whether this patient's record is in active use - /// - /// This uses the native .NET datatype, rather than the FHIR equivalent - [IgnoreDataMember] - public bool? Active + if (dest == null) { - get { return ActiveElement != null ? ActiveElement.Value : null; } - set - { - if (value == null) - ActiveElement = null; - else - ActiveElement = new Hl7.Fhir.Model.FhirBoolean(value); - OnPropertyChanged("Active"); - } + throw new ArgumentException("Can only copy to an object of the same type", "other"); } - /// - /// A name associated with the patient. - /// - [FhirElement("name", InSummary = true, Order = 110)] - [Cardinality(Min = 0, Max = -1)] - [DataMember] - public List Name + base.CopyToInternal(dest); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new CommunicationComponent(); + CopyToInternal(instance); + return instance; + } + + public override bool CompareChildren(Base other, IEqualityComparer comparer) + { + var otherT = other as CommunicationComponent; + if(otherT == null) return false; + + if(!base.CompareChildren(otherT, comparer)) return false; + if(!comparer.Equals(Language, otherT.Language)) return false; + if(!comparer.Equals(PreferredElement, otherT.PreferredElement)) return false; + + return true; + } + + public override bool TryGetValue(string key, out object value) + { + switch (key) { - get - { - if (_Name == null) _Name = new List(); - return _Name; - } - set - { - _Name = value; - OnPropertyChanged("Name"); - } + case "language": + value = Language; + return Language is not null; + case "preferred": + value = PreferredElement; + return PreferredElement is not null; + default: + return base.TryGetValue(key, out value); } - private List _Name; + } - /// - /// A contact detail for the individual. - /// - [FhirElement("telecom", InSummary = true, Order = 120)] - [Cardinality(Min = 0, Max = -1)] - [DataMember] - public List Telecom + public override Base SetValue(string key, object value) + { + switch (key) { - get - { - if (_Telecom == null) _Telecom = new List(); - return _Telecom; - } - set - { - _Telecom = value; - OnPropertyChanged("Telecom"); - } + case "language": + Language = (Hl7.Fhir.Model.CodeableConcept)value; + return this; + case "preferred": + PreferredElement = (Hl7.Fhir.Model.FhirBoolean)value; + return this; + default: + return base.SetValue(key, value); } - private List _Telecom; + } + + public override IEnumerable> EnumerateElements() + { + foreach (var kvp in base.EnumerateElements()) yield return kvp; + if (Language is not null) yield return new KeyValuePair("language",Language); + if (PreferredElement is not null) yield return new KeyValuePair("preferred",PreferredElement); + } - /// - /// male | female | other | unknown. - /// - [FhirElement("gender", InSummary = true, Order = 130)] - [DeclaredType(Type = typeof(Code))] - [Binding("AdministrativeGender")] - [DataMember] - public Code GenderElement + } + + /// + /// Link to another patient resource that concerns the same actual person + /// + /// + /// Link to another patient resource that concerns the same actual patient. + /// There is no assumption that linked patient records have mutual links. + /// + [Serializable] + [DataContract] + [FhirType("Patient.link", IsBackboneType=true)] + public partial class LinkComponent : Hl7.Fhir.Model.BackboneElement + { + /// + /// FHIR Type Name + /// + public override string TypeName { get { return "Patient.link"; } } + + /// + /// The other patient or related person resource that the link refers to. + /// + [FhirElement("other", InSummary=true, Order=40)] + [CLSCompliant(false)] + [References("Patient","RelatedPerson")] + [Cardinality(Min=1,Max=1)] + [DataMember] + public Hl7.Fhir.Model.ResourceReference Other + { + get { return _Other; } + set { _Other = value; OnPropertyChanged("Other"); } + } + + private Hl7.Fhir.Model.ResourceReference _Other; + + /// + /// replaced-by | replaces | refer | seealso. + /// + [FhirElement("type", InSummary=true, Order=50)] + [DeclaredType(Type = typeof(Code))] + [Binding("LinkType")] + [Cardinality(Min=1,Max=1)] + [DataMember] + public Code TypeElement + { + get { return _TypeElement; } + set { _TypeElement = value; OnPropertyChanged("TypeElement"); } + } + + private Code _TypeElement; + + /// + /// replaced-by | replaces | refer | seealso + /// + /// This uses the native .NET datatype, rather than the FHIR equivalent + [IgnoreDataMember] + public Hl7.Fhir.Model.Patient.LinkType? Type + { + get { return TypeElement != null ? TypeElement.Value : null; } + set { - get { return _GenderElement; } - set - { - _GenderElement = value; - OnPropertyChanged("GenderElement"); - } + if (value == null) + TypeElement = null; + else + TypeElement = new Code(value); + OnPropertyChanged("Type"); } + } - private Code _GenderElement; + protected internal override void CopyToInternal(Base other) + { + var dest = other as LinkComponent; - /// - /// male | female | other | unknown - /// - /// This uses the native .NET datatype, rather than the FHIR equivalent - [IgnoreDataMember] - public Hl7.Fhir.Model.AdministrativeGender? Gender + if (dest == null) { - get { return GenderElement != null ? GenderElement.Value : null; } - set - { - if (value == null) - GenderElement = null; - else - GenderElement = new Code(value); - OnPropertyChanged("Gender"); - } + throw new ArgumentException("Can only copy to an object of the same type", "other"); } - /// - /// The date of birth for the individual. - /// - [FhirElement("birthDate", InSummary = true, Order = 140)] - [DataMember] - public Hl7.Fhir.Model.Date BirthDateElement + base.CopyToInternal(dest); + if(Other != null) dest.Other = (Hl7.Fhir.Model.ResourceReference)Other.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; + } + + public override bool CompareChildren(Base other, IEqualityComparer comparer) + { + var otherT = other as LinkComponent; + if(otherT == null) return false; + + if(!base.CompareChildren(otherT, comparer)) return false; + if(!comparer.Equals(Other, otherT.Other)) return false; + if(!comparer.Equals(TypeElement, otherT.TypeElement)) return false; + + return true; + } + + public override bool TryGetValue(string key, out object value) + { + switch (key) { - get { return _BirthDateElement; } - set - { - _BirthDateElement = value; - OnPropertyChanged("BirthDateElement"); - } + case "other": + value = Other; + return Other is not null; + case "type": + value = TypeElement; + return TypeElement is not null; + default: + return base.TryGetValue(key, out value); } - private Hl7.Fhir.Model.Date _BirthDateElement; + } - /// - /// The date of birth for the individual - /// - /// This uses the native .NET datatype, rather than the FHIR equivalent - [IgnoreDataMember] - public string BirthDate + public override Base SetValue(string key, object value) + { + switch (key) { - get { return BirthDateElement != null ? BirthDateElement.Value : null; } - set - { - if (value == null) - BirthDateElement = null; - else - BirthDateElement = new Hl7.Fhir.Model.Date(value); - OnPropertyChanged("BirthDate"); - } + case "other": + Other = (Hl7.Fhir.Model.ResourceReference)value; + return this; + case "type": + TypeElement = (Code)value; + return this; + default: + return base.SetValue(key, value); } - /// - /// Indicates if the individual is deceased or not. - /// - [FhirElement("deceased", InSummary = true, IsModifier = true, Order = 150, Choice = ChoiceType.DatatypeChoice)] - [CLSCompliant(false)] - [AllowedTypes(typeof(Hl7.Fhir.Model.FhirBoolean), typeof(Hl7.Fhir.Model.FhirDateTime))] - [DataMember] - public Hl7.Fhir.Model.DataType Deceased - { - get { return _Deceased; } - set - { - _Deceased = value; - OnPropertyChanged("Deceased"); - } - } + } - private Hl7.Fhir.Model.DataType _Deceased; + public override IEnumerable> EnumerateElements() + { + foreach (var kvp in base.EnumerateElements()) yield return kvp; + if (Other is not null) yield return new KeyValuePair("other",Other); + if (TypeElement is not null) yield return new KeyValuePair("type",TypeElement); + } - /// - /// An address for the individual. - /// - [FhirElement("address", InSummary = true, Order = 160)] - [Cardinality(Min = 0, Max = -1)] - [DataMember] - public List Address - { - get - { - if (_Address == null) _Address = new List(); - return _Address; - } - set - { - _Address = value; - OnPropertyChanged("Address"); - } - } + } - private List _Address; + /// + /// An identifier for this patient. + /// + [FhirElement("identifier", InSummary=true, Order=90, FiveWs="FiveWs.identifier")] + [Cardinality(Min=0,Max=-1)] + [DataMember] + public List Identifier + { + get { if(_Identifier==null) _Identifier = new List(); return _Identifier; } + set { _Identifier = value; OnPropertyChanged("Identifier"); } + } - /// - /// Marital (civil) status of a patient. - /// - [FhirElement("maritalStatus", Order = 170)] - [Binding("MaritalStatus")] - [DataMember] - public Hl7.Fhir.Model.CodeableConcept MaritalStatus - { - get { return _MaritalStatus; } - set - { - _MaritalStatus = value; - OnPropertyChanged("MaritalStatus"); - } - } + private List _Identifier; - private Hl7.Fhir.Model.CodeableConcept _MaritalStatus; + /// + /// Whether this patient's record is in active use. + /// + [FhirElement("active", InSummary=true, IsModifier=true, Order=100, FiveWs="FiveWs.status")] + [DataMember] + public Hl7.Fhir.Model.FhirBoolean ActiveElement + { + get { return _ActiveElement; } + set { _ActiveElement = value; OnPropertyChanged("ActiveElement"); } + } - /// - /// Whether patient is part of a multiple birth. - /// - [FhirElement("multipleBirth", Order = 180, Choice = ChoiceType.DatatypeChoice)] - [CLSCompliant(false)] - [AllowedTypes(typeof(Hl7.Fhir.Model.FhirBoolean), typeof(Hl7.Fhir.Model.Integer))] - [DataMember] - public Hl7.Fhir.Model.DataType MultipleBirth - { - get { return _MultipleBirth; } - set - { - _MultipleBirth = value; - OnPropertyChanged("MultipleBirth"); - } - } + private Hl7.Fhir.Model.FhirBoolean _ActiveElement; - private Hl7.Fhir.Model.DataType _MultipleBirth; + /// + /// Whether this patient's record is in active use + /// + /// This uses the native .NET datatype, rather than the FHIR equivalent + [IgnoreDataMember] + public bool? Active + { + get { return ActiveElement != null ? ActiveElement.Value : null; } + set + { + if (value == null) + ActiveElement = null; + else + ActiveElement = new Hl7.Fhir.Model.FhirBoolean(value); + OnPropertyChanged("Active"); + } + } - /// - /// Image of the patient. - /// - [FhirElement("photo", Order = 190)] - [Cardinality(Min = 0, Max = -1)] - [DataMember] - public List Photo - { - get - { - if (_Photo == null) _Photo = new List(); - return _Photo; - } - set - { - _Photo = value; - OnPropertyChanged("Photo"); - } - } + /// + /// A name associated with the patient. + /// + [FhirElement("name", InSummary=true, Order=110)] + [Cardinality(Min=0,Max=-1)] + [DataMember] + public List Name + { + get { if(_Name==null) _Name = new List(); return _Name; } + set { _Name = value; OnPropertyChanged("Name"); } + } - private List _Photo; + private List _Name; - /// - /// A contact party (e.g. guardian, partner, friend) for the patient. - /// - [FhirElement("contact", Order = 200)] - [Cardinality(Min = 0, Max = -1)] - [DataMember] - public List Contact - { - get - { - if (_Contact == null) _Contact = new List(); - return _Contact; - } - set - { - _Contact = value; - OnPropertyChanged("Contact"); - } - } + /// + /// A contact detail for the individual. + /// + [FhirElement("telecom", InSummary=true, Order=120)] + [Cardinality(Min=0,Max=-1)] + [DataMember] + public List Telecom + { + get { if(_Telecom==null) _Telecom = new List(); return _Telecom; } + set { _Telecom = value; OnPropertyChanged("Telecom"); } + } - private List _Contact; + private List _Telecom; - /// - /// A language which may be used to communicate with the patient about his or her health. - /// - [FhirElement("communication", Order = 210)] - [Cardinality(Min = 0, Max = -1)] - [DataMember] - public List Communication - { - get - { - if (_Communication == null) _Communication = new List(); - return _Communication; - } - set - { - _Communication = value; - OnPropertyChanged("Communication"); - } - } + /// + /// male | female | other | unknown. + /// + [FhirElement("gender", InSummary=true, Order=130)] + [DeclaredType(Type = typeof(Code))] + [Binding("AdministrativeGender")] + [DataMember] + public Code GenderElement + { + get { return _GenderElement; } + set { _GenderElement = value; OnPropertyChanged("GenderElement"); } + } - private List _Communication; - - /// - /// Patient's nominated primary care provider. - /// - [FhirElement("generalPractitioner", Order = 220)] - [CLSCompliant(false)] - [References("Organization", "Practitioner", "PractitionerRole")] - [Cardinality(Min = 0, Max = -1)] - [DataMember] - public List GeneralPractitioner - { - get - { - if (_GeneralPractitioner == null) _GeneralPractitioner = new List(); - return _GeneralPractitioner; - } - set - { - _GeneralPractitioner = value; - OnPropertyChanged("GeneralPractitioner"); - } - } + private Code _GenderElement; - private List _GeneralPractitioner; + /// + /// male | female | other | unknown + /// + /// This uses the native .NET datatype, rather than the FHIR equivalent + [IgnoreDataMember] + public Hl7.Fhir.Model.AdministrativeGender? Gender + { + get { return GenderElement != null ? GenderElement.Value : null; } + set + { + if (value == null) + GenderElement = null; + else + GenderElement = new Code(value); + OnPropertyChanged("Gender"); + } + } - /// - /// Organization that is the custodian of the patient record. - /// - [FhirElement("managingOrganization", InSummary = true, Order = 230)] - [CLSCompliant(false)] - [References("Organization")] - [DataMember] - public Hl7.Fhir.Model.ResourceReference ManagingOrganization - { - get { return _ManagingOrganization; } - set - { - _ManagingOrganization = value; - OnPropertyChanged("ManagingOrganization"); - } - } + /// + /// The date of birth for the individual. + /// + [FhirElement("birthDate", InSummary=true, Order=140)] + [DataMember] + public Hl7.Fhir.Model.Date BirthDateElement + { + get { return _BirthDateElement; } + set { _BirthDateElement = value; OnPropertyChanged("BirthDateElement"); } + } - private Hl7.Fhir.Model.ResourceReference _ManagingOrganization; + private Hl7.Fhir.Model.Date _BirthDateElement; - /// - /// Link to another patient resource that concerns the same actual person. - /// - [FhirElement("link", InSummary = true, IsModifier = true, Order = 240)] - [Cardinality(Min = 0, Max = -1)] - [DataMember] - public List Link - { - get - { - if (_Link == null) _Link = new List(); - return _Link; - } - set - { - _Link = value; - OnPropertyChanged("Link"); - } - } + /// + /// The date of birth for the individual + /// + /// This uses the native .NET datatype, rather than the FHIR equivalent + [IgnoreDataMember] + public string BirthDate + { + get { return BirthDateElement != null ? BirthDateElement.Value : null; } + set + { + if (value == null) + BirthDateElement = null; + else + BirthDateElement = new Hl7.Fhir.Model.Date(value); + OnPropertyChanged("BirthDate"); + } + } - private List _Link; + /// + /// Indicates if the individual is deceased or not. + /// + [FhirElement("deceased", InSummary=true, IsModifier=true, Order=150, Choice=ChoiceType.DatatypeChoice)] + [CLSCompliant(false)] + [AllowedTypes(typeof(Hl7.Fhir.Model.FhirBoolean),typeof(Hl7.Fhir.Model.FhirDateTime))] + [DataMember] + public Hl7.Fhir.Model.DataType Deceased + { + get { return _Deceased; } + set { _Deceased = value; OnPropertyChanged("Deceased"); } + } - List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } + private Hl7.Fhir.Model.DataType _Deceased; - Hl7.Fhir.Model.Date Hl7.Fhir.Model.IPatient.BirthDate => BirthDateElement; + /// + /// An address for the individual. + /// + [FhirElement("address", InSummary=true, Order=160)] + [Cardinality(Min=0,Max=-1)] + [DataMember] + public List Address + { + get { if(_Address==null) _Address = new List(); return _Address; } + set { _Address = value; OnPropertyChanged("Address"); } + } - public override IDeepCopyable CopyTo(IDeepCopyable other) - { - var dest = other as Patient; - - if (dest == null) - { - throw new ArgumentException("Can only copy to an object of the same type", "other"); - } - - base.CopyTo(dest); - if (Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if (ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if (Name.Any()) dest.Name = new List(Name.DeepCopy()); - if (Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if (GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if (BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if (Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy(); - if (Address.Any()) dest.Address = new List(Address.DeepCopy()); - if (MaritalStatus != null) dest.MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)MaritalStatus.DeepCopy(); - if (MultipleBirth != null) dest.MultipleBirth = (Hl7.Fhir.Model.DataType)MultipleBirth.DeepCopy(); - if (Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if (Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if (Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - if (GeneralPractitioner.Any()) dest.GeneralPractitioner = new List(GeneralPractitioner.DeepCopy()); - if (ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if (Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; - } + private List _Address; - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Patient()); - } + /// + /// Marital (civil) status of a patient. + /// + [FhirElement("maritalStatus", Order=170)] + [Binding("MaritalStatus")] + [DataMember] + public Hl7.Fhir.Model.CodeableConcept MaritalStatus + { + get { return _MaritalStatus; } + set { _MaritalStatus = value; OnPropertyChanged("MaritalStatus"); } + } - public override bool CompareChildren(Base other, IEqualityComparer comparer) - { - var otherT = other as Patient; - if (otherT == null) return false; - - if (!base.CompareChildren(otherT, comparer)) return false; - if (!comparer.ListEquals(Identifier, otherT.Identifier)) return false; - if (!comparer.Equals(ActiveElement, otherT.ActiveElement)) return false; - if (!comparer.ListEquals(Name, otherT.Name)) return false; - if (!comparer.ListEquals(Telecom, otherT.Telecom)) return false; - if (!comparer.Equals(GenderElement, otherT.GenderElement)) return false; - if (!comparer.Equals(BirthDateElement, otherT.BirthDateElement)) return false; - if (!comparer.Equals(Deceased, otherT.Deceased)) return false; - if (!comparer.ListEquals(Address, otherT.Address)) return false; - if (!comparer.Equals(MaritalStatus, otherT.MaritalStatus)) return false; - if (!comparer.Equals(MultipleBirth, otherT.MultipleBirth)) return false; - if (!comparer.ListEquals(Photo, otherT.Photo)) return false; - if (!comparer.ListEquals(Contact, otherT.Contact)) return false; - if (!comparer.ListEquals(Communication, otherT.Communication)) return false; - if (!comparer.ListEquals(GeneralPractitioner, otherT.GeneralPractitioner)) return false; - if (!comparer.Equals(ManagingOrganization, otherT.ManagingOrganization)) return false; - if (!comparer.ListEquals(Link, otherT.Link)) return false; - - return true; - } + private Hl7.Fhir.Model.CodeableConcept _MaritalStatus; - public override bool TryGetValue(string key, out object value) - { - switch (key) - { - case "identifier": - value = Identifier; - return Identifier?.Any() == true; - case "active": - value = ActiveElement; - return ActiveElement is not null; - case "name": - value = Name; - return Name?.Any() == true; - case "telecom": - value = Telecom; - return Telecom?.Any() == true; - case "gender": - value = GenderElement; - return GenderElement is not null; - case "birthDate": - value = BirthDateElement; - return BirthDateElement is not null; - case "deceased": - value = Deceased; - return Deceased is not null; - case "address": - value = Address; - return Address?.Any() == true; - case "maritalStatus": - value = MaritalStatus; - return MaritalStatus is not null; - case "multipleBirth": - value = MultipleBirth; - return MultipleBirth is not null; - case "photo": - value = Photo; - return Photo?.Any() == true; - case "contact": - value = Contact; - return Contact?.Any() == true; - case "communication": - value = Communication; - return Communication?.Any() == true; - case "generalPractitioner": - value = GeneralPractitioner; - return GeneralPractitioner?.Any() == true; - case "managingOrganization": - value = ManagingOrganization; - return ManagingOrganization is not null; - case "link": - value = Link; - return Link?.Any() == true; - default: - return base.TryGetValue(key, out value); - } + /// + /// Whether patient is part of a multiple birth. + /// + [FhirElement("multipleBirth", Order=180, Choice=ChoiceType.DatatypeChoice)] + [CLSCompliant(false)] + [AllowedTypes(typeof(Hl7.Fhir.Model.FhirBoolean),typeof(Hl7.Fhir.Model.Integer))] + [DataMember] + public Hl7.Fhir.Model.DataType MultipleBirth + { + get { return _MultipleBirth; } + set { _MultipleBirth = value; OnPropertyChanged("MultipleBirth"); } + } - } + private Hl7.Fhir.Model.DataType _MultipleBirth; - public override Base SetValue(string key, object value) - { - switch (key) - { - case "identifier": - Identifier = (List)value; - return this; - case "active": - ActiveElement = (Hl7.Fhir.Model.FhirBoolean)value; - return this; - case "name": - Name = (List)value; - return this; - case "telecom": - Telecom = (List)value; - return this; - case "gender": - GenderElement = (Code)value; - return this; - case "birthDate": - BirthDateElement = (Hl7.Fhir.Model.Date)value; - return this; - case "deceased": - Deceased = (Hl7.Fhir.Model.DataType)value; - return this; - case "address": - Address = (List)value; - return this; - case "maritalStatus": - MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)value; - return this; - case "multipleBirth": - MultipleBirth = (Hl7.Fhir.Model.DataType)value; - return this; - case "photo": - Photo = (List)value; - return this; - case "contact": - Contact = (List)value; - return this; - case "communication": - Communication = (List)value; - return this; - case "generalPractitioner": - GeneralPractitioner = (List)value; - return this; - case "managingOrganization": - ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)value; - return this; - case "link": - Link = (List)value; - return this; - default: - return base.SetValue(key, value); - } + /// + /// Image of the patient. + /// + [FhirElement("photo", Order=190)] + [Cardinality(Min=0,Max=-1)] + [DataMember] + public List Photo + { + get { if(_Photo==null) _Photo = new List(); return _Photo; } + set { _Photo = value; OnPropertyChanged("Photo"); } + } - } + private List _Photo; - public override IEnumerable> EnumerateElements() - { - foreach (var kvp in base.EnumerateElements()) yield return kvp; - if (Identifier?.Any() == true) yield return new KeyValuePair("identifier", Identifier); - if (ActiveElement is not null) yield return new KeyValuePair("active", ActiveElement); - if (Name?.Any() == true) yield return new KeyValuePair("name", Name); - if (Telecom?.Any() == true) yield return new KeyValuePair("telecom", Telecom); - if (GenderElement is not null) yield return new KeyValuePair("gender", GenderElement); - if (BirthDateElement is not null) yield return new KeyValuePair("birthDate", BirthDateElement); - if (Deceased is not null) yield return new KeyValuePair("deceased", Deceased); - if (Address?.Any() == true) yield return new KeyValuePair("address", Address); - if (MaritalStatus is not null) yield return new KeyValuePair("maritalStatus", MaritalStatus); - if (MultipleBirth is not null) yield return new KeyValuePair("multipleBirth", MultipleBirth); - if (Photo?.Any() == true) yield return new KeyValuePair("photo", Photo); - if (Contact?.Any() == true) yield return new KeyValuePair("contact", Contact); - if (Communication?.Any() == true) yield return new KeyValuePair("communication", Communication); - if (GeneralPractitioner?.Any() == true) yield return new KeyValuePair("generalPractitioner", GeneralPractitioner); - if (ManagingOrganization is not null) yield return new KeyValuePair("managingOrganization", ManagingOrganization); - if (Link?.Any() == true) yield return new KeyValuePair("link", Link); - } + /// + /// A contact party (e.g. guardian, partner, friend) for the patient. + /// + [FhirElement("contact", Order=200)] + [Cardinality(Min=0,Max=-1)] + [DataMember] + public List Contact + { + get { if(_Contact==null) _Contact = new List(); return _Contact; } + set { _Contact = value; OnPropertyChanged("Contact"); } + } - public unsafe Span ToSpan() - { - var span = MemoryMarshal.CreateSpan(ref this._Identifier, 16); - var elements = MemoryMarshal.CreateSpan(ref Unsafe.AsRef((void*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(span))), 16); + private List _Contact; - return elements; - } + /// + /// A language which may be used to communicate with the patient about his or her health. + /// + [FhirElement("communication", Order=210)] + [Cardinality(Min=0,Max=-1)] + [DataMember] + public List Communication + { + get { if(_Communication==null) _Communication = new List(); return _Communication; } + set { _Communication = value; OnPropertyChanged("Communication"); } + } + + private List _Communication; + + /// + /// Patient's nominated primary care provider. + /// + [FhirElement("generalPractitioner", Order=220)] + [CLSCompliant(false)] + [References("Organization","Practitioner","PractitionerRole")] + [Cardinality(Min=0,Max=-1)] + [DataMember] + public List GeneralPractitioner + { + get { if(_GeneralPractitioner==null) _GeneralPractitioner = new List(); return _GeneralPractitioner; } + set { _GeneralPractitioner = value; OnPropertyChanged("GeneralPractitioner"); } + } + + private List _GeneralPractitioner; + + /// + /// Organization that is the custodian of the patient record. + /// + [FhirElement("managingOrganization", InSummary=true, Order=230)] + [CLSCompliant(false)] + [References("Organization")] + [DataMember] + public Hl7.Fhir.Model.ResourceReference ManagingOrganization + { + get { return _ManagingOrganization; } + set { _ManagingOrganization = value; OnPropertyChanged("ManagingOrganization"); } } - public static class ObjectExtensions + private Hl7.Fhir.Model.ResourceReference _ManagingOrganization; + + /// + /// Link to another patient resource that concerns the same actual person. + /// + [FhirElement("link", InSummary=true, IsModifier=true, Order=240)] + [Cardinality(Min=0,Max=-1)] + [DataMember] + public List Link { - // public static unsafe Span ToSpan(this Base @base) - // { - // var span = MemoryMarshal.CreateSpan(ref this._Identifier, 16); - // var elements =MemoryMarshal.CreateSpan(ref Unsafe.AsRef((void*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(span[1..]))), 16); - // - // return elements; - // } + get { if(_Link==null) _Link = new List(); return _Link; } + set { _Link = value; OnPropertyChanged("Link"); } } + + private List _Link; + + List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } + + Hl7.Fhir.Model.Date Hl7.Fhir.Model.IPatient.BirthDate => BirthDateElement; + + protected internal override void CopyToInternal(Base other) + { + var dest = other as Patient; + + if (dest == null) + { + throw new ArgumentException("Can only copy to an object of the same type", "other"); + } + + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopyInternal(); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(MaritalStatus != null) dest.MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)MaritalStatus.DeepCopyInternal(); + if(MultipleBirth != null) dest.MultipleBirth = (Hl7.Fhir.Model.DataType)MultipleBirth.DeepCopyInternal(); + if(Photo.Any()) dest.Photo = new List(Photo.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); + if(GeneralPractitioner.Any()) dest.GeneralPractitioner = new List(GeneralPractitioner.DeepCopyInternal()); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Patient(); + CopyToInternal(instance); + return instance; + } + + public override bool CompareChildren(Base other, IEqualityComparer comparer) + { + var otherT = other as Patient; + if(otherT == null) return false; + + if(!base.CompareChildren(otherT, comparer)) return false; + if(!comparer.ListEquals(Identifier, otherT.Identifier)) return false; + if(!comparer.Equals(ActiveElement, otherT.ActiveElement)) return false; + if(!comparer.ListEquals(Name, otherT.Name)) return false; + if(!comparer.ListEquals(Telecom, otherT.Telecom)) return false; + if(!comparer.Equals(GenderElement, otherT.GenderElement)) return false; + if(!comparer.Equals(BirthDateElement, otherT.BirthDateElement)) return false; + if(!comparer.Equals(Deceased, otherT.Deceased)) return false; + if(!comparer.ListEquals(Address, otherT.Address)) return false; + if(!comparer.Equals(MaritalStatus, otherT.MaritalStatus)) return false; + if(!comparer.Equals(MultipleBirth, otherT.MultipleBirth)) return false; + if(!comparer.ListEquals(Photo, otherT.Photo)) return false; + if(!comparer.ListEquals(Contact, otherT.Contact)) return false; + if(!comparer.ListEquals(Communication, otherT.Communication)) return false; + if(!comparer.ListEquals(GeneralPractitioner, otherT.GeneralPractitioner)) return false; + if(!comparer.Equals(ManagingOrganization, otherT.ManagingOrganization)) return false; + if(!comparer.ListEquals(Link, otherT.Link)) return false; + + return true; + } + + public override bool TryGetValue(string key, out object value) + { + switch (key) + { + case "identifier": + value = Identifier; + return Identifier?.Any() == true; + case "active": + value = ActiveElement; + return ActiveElement is not null; + case "name": + value = Name; + return Name?.Any() == true; + case "telecom": + value = Telecom; + return Telecom?.Any() == true; + case "gender": + value = GenderElement; + return GenderElement is not null; + case "birthDate": + value = BirthDateElement; + return BirthDateElement is not null; + case "deceased": + value = Deceased; + return Deceased is not null; + case "address": + value = Address; + return Address?.Any() == true; + case "maritalStatus": + value = MaritalStatus; + return MaritalStatus is not null; + case "multipleBirth": + value = MultipleBirth; + return MultipleBirth is not null; + case "photo": + value = Photo; + return Photo?.Any() == true; + case "contact": + value = Contact; + return Contact?.Any() == true; + case "communication": + value = Communication; + return Communication?.Any() == true; + case "generalPractitioner": + value = GeneralPractitioner; + return GeneralPractitioner?.Any() == true; + case "managingOrganization": + value = ManagingOrganization; + return ManagingOrganization is not null; + case "link": + value = Link; + return Link?.Any() == true; + default: + return base.TryGetValue(key, out value); + } + + } + + public override Base SetValue(string key, object value) + { + switch (key) + { + case "identifier": + Identifier = (List)value; + return this; + case "active": + ActiveElement = (Hl7.Fhir.Model.FhirBoolean)value; + return this; + case "name": + Name = (List)value; + return this; + case "telecom": + Telecom = (List)value; + return this; + case "gender": + GenderElement = (Code)value; + return this; + case "birthDate": + BirthDateElement = (Hl7.Fhir.Model.Date)value; + return this; + case "deceased": + Deceased = (Hl7.Fhir.Model.DataType)value; + return this; + case "address": + Address = (List)value; + return this; + case "maritalStatus": + MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)value; + return this; + case "multipleBirth": + MultipleBirth = (Hl7.Fhir.Model.DataType)value; + return this; + case "photo": + Photo = (List)value; + return this; + case "contact": + Contact = (List)value; + return this; + case "communication": + Communication = (List)value; + return this; + case "generalPractitioner": + GeneralPractitioner = (List)value; + return this; + case "managingOrganization": + ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)value; + return this; + case "link": + Link = (List)value; + return this; + default: + return base.SetValue(key, value); + } + + } + + public override IEnumerable> EnumerateElements() + { + foreach (var kvp in base.EnumerateElements()) yield return kvp; + if (Identifier?.Any() == true) yield return new KeyValuePair("identifier",Identifier); + if (ActiveElement is not null) yield return new KeyValuePair("active",ActiveElement); + if (Name?.Any() == true) yield return new KeyValuePair("name",Name); + if (Telecom?.Any() == true) yield return new KeyValuePair("telecom",Telecom); + if (GenderElement is not null) yield return new KeyValuePair("gender",GenderElement); + if (BirthDateElement is not null) yield return new KeyValuePair("birthDate",BirthDateElement); + if (Deceased is not null) yield return new KeyValuePair("deceased",Deceased); + if (Address?.Any() == true) yield return new KeyValuePair("address",Address); + if (MaritalStatus is not null) yield return new KeyValuePair("maritalStatus",MaritalStatus); + if (MultipleBirth is not null) yield return new KeyValuePair("multipleBirth",MultipleBirth); + if (Photo?.Any() == true) yield return new KeyValuePair("photo",Photo); + if (Contact?.Any() == true) yield return new KeyValuePair("contact",Contact); + if (Communication?.Any() == true) yield return new KeyValuePair("communication",Communication); + if (GeneralPractitioner?.Any() == true) yield return new KeyValuePair("generalPractitioner",GeneralPractitioner); + if (ManagingOrganization is not null) yield return new KeyValuePair("managingOrganization",ManagingOrganization); + if (Link?.Any() == true) yield return new KeyValuePair("link",Link); + } + + } + } // end of file diff --git a/src/Hl7.Fhir.R4/Model/Generated/PaymentNotice.cs b/src/Hl7.Fhir.R4/Model/Generated/PaymentNotice.cs index 75ed535d8c..78e8a692d1 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/PaymentNotice.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/PaymentNotice.cs @@ -292,7 +292,7 @@ public Hl7.Fhir.Model.CodeableConcept PaymentStatus List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentNotice; @@ -301,25 +301,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ResourceReference)Payment.DeepCopy(); - if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.Date)PaymentDateElement.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopy(); - if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(PaymentStatus != null) dest.PaymentStatus = (Hl7.Fhir.Model.CodeableConcept)PaymentStatus.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ResourceReference)Payment.DeepCopyInternal(); + if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.Date)PaymentDateElement.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopyInternal(); + if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(PaymentStatus != null) dest.PaymentStatus = (Hl7.Fhir.Model.CodeableConcept)PaymentStatus.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentNotice()); + var instance = new PaymentNotice(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/PaymentReconciliation.cs b/src/Hl7.Fhir.R4/Model/Generated/PaymentReconciliation.cs index a8f9faef9a..0553ece780 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/PaymentReconciliation.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/PaymentReconciliation.cs @@ -235,7 +235,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailsComponent; @@ -244,23 +244,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Predecessor != null) dest.Predecessor = (Hl7.Fhir.Model.Identifier)Predecessor.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Submitter != null) dest.Submitter = (Hl7.Fhir.Model.ResourceReference)Submitter.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Predecessor != null) dest.Predecessor = (Hl7.Fhir.Model.Identifier)Predecessor.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Submitter != null) dest.Submitter = (Hl7.Fhir.Model.ResourceReference)Submitter.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailsComponent()); + var instance = new DetailsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -460,7 +461,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotesComponent; @@ -469,15 +470,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotesComponent()); + var instance = new NotesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -838,7 +840,7 @@ public List ProcessNote List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentReconciliation; @@ -847,28 +849,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(PaymentIssuer != null) dest.PaymentIssuer = (Hl7.Fhir.Model.ResourceReference)PaymentIssuer.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.Date)PaymentDateElement.DeepCopy(); - if(PaymentAmount != null) dest.PaymentAmount = (Hl7.Fhir.Model.Money)PaymentAmount.DeepCopy(); - if(PaymentIdentifier != null) dest.PaymentIdentifier = (Hl7.Fhir.Model.Identifier)PaymentIdentifier.DeepCopy(); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopy(); - if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(PaymentIssuer != null) dest.PaymentIssuer = (Hl7.Fhir.Model.ResourceReference)PaymentIssuer.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.Date)PaymentDateElement.DeepCopyInternal(); + if(PaymentAmount != null) dest.PaymentAmount = (Hl7.Fhir.Model.Money)PaymentAmount.DeepCopyInternal(); + if(PaymentIdentifier != null) dest.PaymentIdentifier = (Hl7.Fhir.Model.Identifier)PaymentIdentifier.DeepCopyInternal(); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopyInternal(); + if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentReconciliation()); + var instance = new PaymentReconciliation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Person.cs b/src/Hl7.Fhir.R4/Model/Generated/Person.cs index 4c9e942b61..4d9e79915a 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Person.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Person.cs @@ -156,7 +156,7 @@ public Hl7.Fhir.Model.Person.IdentityAssuranceLevel? Assurance } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -165,15 +165,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - if(AssuranceElement != null) dest.AssuranceElement = (Code)AssuranceElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); + if(AssuranceElement != null) dest.AssuranceElement = (Code)AssuranceElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -424,7 +425,7 @@ public List Link List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Person; @@ -433,23 +434,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Person()); + var instance = new Person(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/PlanDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/PlanDefinition.cs index 8d237d149b..b4aaaa65bf 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/PlanDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/PlanDefinition.cs @@ -175,7 +175,7 @@ public List Target private List _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GoalComponent; @@ -184,20 +184,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(Start != null) dest.Start = (Hl7.Fhir.Model.CodeableConcept)Start.DeepCopy(); - if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopy()); - if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopy()); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(Start != null) dest.Start = (Hl7.Fhir.Model.CodeableConcept)Start.DeepCopyInternal(); + if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopyInternal()); + if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopyInternal()); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GoalComponent()); + var instance = new GoalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -351,7 +352,7 @@ public Hl7.Fhir.Model.Duration Due private Hl7.Fhir.Model.Duration _Due; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -360,16 +361,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopy(); - if(Due != null) dest.Due = (Hl7.Fhir.Model.Duration)Due.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopyInternal(); + if(Due != null) dest.Due = (Hl7.Fhir.Model.Duration)Due.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1050,7 +1052,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionComponent; @@ -1059,40 +1061,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.FhirString)TextEquivalentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopy()); - if(GoalIdElement.Any()) dest.GoalIdElement = new List(GoalIdElement.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Output.Any()) dest.Output = new List(Output.DeepCopy()); - if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopy()); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopy(); - if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopy(); - if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopy(); - if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopy(); - if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopy(); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopy(); - if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopy(); - if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActionComponent()); + base.CopyToInternal(dest); + if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.FhirString)TextEquivalentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopyInternal()); + if(GoalIdElement.Any()) dest.GoalIdElement = new List(GoalIdElement.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Output.Any()) dest.Output = new List(Output.DeepCopyInternal()); + if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopyInternal()); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopyInternal(); + if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopyInternal(); + if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopyInternal(); + if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopyInternal(); + if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopyInternal(); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopyInternal(); + if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopyInternal(); + if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1412,7 +1415,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConditionComponent; @@ -1421,15 +1424,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConditionComponent()); + var instance = new ConditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1583,7 +1587,7 @@ public Hl7.Fhir.Model.DataType Offset private Hl7.Fhir.Model.DataType _Offset; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedActionComponent; @@ -1592,16 +1596,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ActionIdElement != null) dest.ActionIdElement = (Hl7.Fhir.Model.Id)ActionIdElement.DeepCopy(); - if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopy(); - if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ActionIdElement != null) dest.ActionIdElement = (Hl7.Fhir.Model.Id)ActionIdElement.DeepCopyInternal(); + if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopyInternal(); + if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedActionComponent()); + var instance = new RelatedActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1729,7 +1734,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -1738,15 +1743,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1863,7 +1869,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DynamicValueComponent; @@ -1872,15 +1878,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DynamicValueComponent()); + var instance = new DynamicValueComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2652,7 +2659,7 @@ public List Action List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PlanDefinition; @@ -2661,44 +2668,45 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(Goal.Any()) dest.Goal = new List(Goal.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(Goal.Any()) dest.Goal = new List(Goal.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PlanDefinition()); + var instance = new PlanDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Population.cs b/src/Hl7.Fhir.R4/Model/Generated/Population.cs index b2dab68a01..dea7ca0eec 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Population.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Population.cs @@ -113,7 +113,7 @@ public Hl7.Fhir.Model.CodeableConcept PhysiologicalCondition private Hl7.Fhir.Model.CodeableConcept _PhysiologicalCondition; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Population; @@ -122,17 +122,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Age != null) dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopy(); - if(Gender != null) dest.Gender = (Hl7.Fhir.Model.CodeableConcept)Gender.DeepCopy(); - if(Race != null) dest.Race = (Hl7.Fhir.Model.CodeableConcept)Race.DeepCopy(); - if(PhysiologicalCondition != null) dest.PhysiologicalCondition = (Hl7.Fhir.Model.CodeableConcept)PhysiologicalCondition.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Age != null) dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopyInternal(); + if(Gender != null) dest.Gender = (Hl7.Fhir.Model.CodeableConcept)Gender.DeepCopyInternal(); + if(Race != null) dest.Race = (Hl7.Fhir.Model.CodeableConcept)Race.DeepCopyInternal(); + if(PhysiologicalCondition != null) dest.PhysiologicalCondition = (Hl7.Fhir.Model.CodeableConcept)PhysiologicalCondition.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Population()); + var instance = new Population(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Practitioner.cs b/src/Hl7.Fhir.R4/Model/Generated/Practitioner.cs index a7069e7b09..4c7a7183ba 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Practitioner.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Practitioner.cs @@ -132,7 +132,7 @@ public Hl7.Fhir.Model.ResourceReference Issuer private Hl7.Fhir.Model.ResourceReference _Issuer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QualificationComponent; @@ -141,17 +141,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QualificationComponent()); + var instance = new QualificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -419,7 +420,7 @@ public List Communication List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Practitioner; @@ -428,23 +429,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if(Qualification.Any()) dest.Qualification = new List(Qualification.DeepCopy()); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Photo.Any()) dest.Photo = new List(Photo.DeepCopyInternal()); + if(Qualification.Any()) dest.Qualification = new List(Qualification.DeepCopyInternal()); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Practitioner()); + var instance = new Practitioner(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/PractitionerRole.cs b/src/Hl7.Fhir.R4/Model/Generated/PractitionerRole.cs index b83654d6e1..1b2541a6bc 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/PractitionerRole.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/PractitionerRole.cs @@ -203,7 +203,7 @@ public string AvailableEndTime } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AvailableTimeComponent; @@ -212,17 +212,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopy()); - if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopy(); - if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopy(); - if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopyInternal()); + if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopyInternal(); + if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopyInternal(); + if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AvailableTimeComponent()); + var instance = new AvailableTimeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -355,7 +356,7 @@ public Hl7.Fhir.Model.Period During private Hl7.Fhir.Model.Period _During; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotAvailableComponent; @@ -364,15 +365,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotAvailableComponent()); + var instance = new NotAvailableComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -672,7 +674,7 @@ public List Endpoint List ICoded>.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PractitionerRole; @@ -681,27 +683,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Practitioner != null) dest.Practitioner = (Hl7.Fhir.Model.ResourceReference)Practitioner.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopy()); - if(NotAvailable.Any()) dest.NotAvailable = new List(NotAvailable.DeepCopy()); - if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Practitioner != null) dest.Practitioner = (Hl7.Fhir.Model.ResourceReference)Practitioner.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopyInternal()); + if(NotAvailable.Any()) dest.NotAvailable = new List(NotAvailable.DeepCopyInternal()); + if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PractitionerRole()); + var instance = new PractitionerRole(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Procedure.cs b/src/Hl7.Fhir.R4/Model/Generated/Procedure.cs index f2d85d84db..501167be93 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Procedure.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Procedure.cs @@ -120,7 +120,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -129,16 +129,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -248,7 +249,7 @@ public Hl7.Fhir.Model.ResourceReference Manipulated private Hl7.Fhir.Model.ResourceReference _Manipulated; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FocalDeviceComponent; @@ -257,15 +258,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopy(); - if(Manipulated != null) dest.Manipulated = (Hl7.Fhir.Model.ResourceReference)Manipulated.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopyInternal(); + if(Manipulated != null) dest.Manipulated = (Hl7.Fhir.Model.ResourceReference)Manipulated.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FocalDeviceComponent()); + var instance = new FocalDeviceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -798,7 +800,7 @@ public List UsedCode Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Procedure; @@ -807,41 +809,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Performed != null) dest.Performed = (Hl7.Fhir.Model.DataType)Performed.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(Report.Any()) dest.Report = new List(Report.DeepCopy()); - if(Complication.Any()) dest.Complication = new List(Complication.DeepCopy()); - if(ComplicationDetail.Any()) dest.ComplicationDetail = new List(ComplicationDetail.DeepCopy()); - if(FollowUp.Any()) dest.FollowUp = new List(FollowUp.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(FocalDevice.Any()) dest.FocalDevice = new List(FocalDevice.DeepCopy()); - if(UsedReference.Any()) dest.UsedReference = new List(UsedReference.DeepCopy()); - if(UsedCode.Any()) dest.UsedCode = new List(UsedCode.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Performed != null) dest.Performed = (Hl7.Fhir.Model.DataType)Performed.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(Report.Any()) dest.Report = new List(Report.DeepCopyInternal()); + if(Complication.Any()) dest.Complication = new List(Complication.DeepCopyInternal()); + if(ComplicationDetail.Any()) dest.ComplicationDetail = new List(ComplicationDetail.DeepCopyInternal()); + if(FollowUp.Any()) dest.FollowUp = new List(FollowUp.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(FocalDevice.Any()) dest.FocalDevice = new List(FocalDevice.DeepCopyInternal()); + if(UsedReference.Any()) dest.UsedReference = new List(UsedReference.DeepCopyInternal()); + if(UsedCode.Any()) dest.UsedCode = new List(UsedCode.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Procedure()); + var instance = new Procedure(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ProdCharacteristic.cs b/src/Hl7.Fhir.R4/Model/Generated/ProdCharacteristic.cs index b0568c3b7f..48136d566f 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ProdCharacteristic.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ProdCharacteristic.cs @@ -256,7 +256,7 @@ public Hl7.Fhir.Model.CodeableConcept Scoring private Hl7.Fhir.Model.CodeableConcept _Scoring; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProdCharacteristic; @@ -265,24 +265,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Height != null) dest.Height = (Hl7.Fhir.Model.Quantity)Height.DeepCopy(); - if(Width != null) dest.Width = (Hl7.Fhir.Model.Quantity)Width.DeepCopy(); - if(Depth != null) dest.Depth = (Hl7.Fhir.Model.Quantity)Depth.DeepCopy(); - if(Weight != null) dest.Weight = (Hl7.Fhir.Model.Quantity)Weight.DeepCopy(); - if(NominalVolume != null) dest.NominalVolume = (Hl7.Fhir.Model.Quantity)NominalVolume.DeepCopy(); - if(ExternalDiameter != null) dest.ExternalDiameter = (Hl7.Fhir.Model.Quantity)ExternalDiameter.DeepCopy(); - if(ShapeElement != null) dest.ShapeElement = (Hl7.Fhir.Model.FhirString)ShapeElement.DeepCopy(); - if(ColorElement.Any()) dest.ColorElement = new List(ColorElement.DeepCopy()); - if(ImprintElement.Any()) dest.ImprintElement = new List(ImprintElement.DeepCopy()); - if(Image.Any()) dest.Image = new List(Image.DeepCopy()); - if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Height != null) dest.Height = (Hl7.Fhir.Model.Quantity)Height.DeepCopyInternal(); + if(Width != null) dest.Width = (Hl7.Fhir.Model.Quantity)Width.DeepCopyInternal(); + if(Depth != null) dest.Depth = (Hl7.Fhir.Model.Quantity)Depth.DeepCopyInternal(); + if(Weight != null) dest.Weight = (Hl7.Fhir.Model.Quantity)Weight.DeepCopyInternal(); + if(NominalVolume != null) dest.NominalVolume = (Hl7.Fhir.Model.Quantity)NominalVolume.DeepCopyInternal(); + if(ExternalDiameter != null) dest.ExternalDiameter = (Hl7.Fhir.Model.Quantity)ExternalDiameter.DeepCopyInternal(); + if(ShapeElement != null) dest.ShapeElement = (Hl7.Fhir.Model.FhirString)ShapeElement.DeepCopyInternal(); + if(ColorElement.Any()) dest.ColorElement = new List(ColorElement.DeepCopyInternal()); + if(ImprintElement.Any()) dest.ImprintElement = new List(ImprintElement.DeepCopyInternal()); + if(Image.Any()) dest.Image = new List(Image.DeepCopyInternal()); + if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProdCharacteristic()); + var instance = new ProdCharacteristic(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ProductShelfLife.cs b/src/Hl7.Fhir.R4/Model/Generated/ProductShelfLife.cs index 8218dbd4ee..fffaf79a9b 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ProductShelfLife.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ProductShelfLife.cs @@ -111,7 +111,7 @@ public List SpecialPrecautionsForStorage private List _SpecialPrecautionsForStorage; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProductShelfLife; @@ -120,17 +120,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Quantity)Period.DeepCopy(); - if(SpecialPrecautionsForStorage.Any()) dest.SpecialPrecautionsForStorage = new List(SpecialPrecautionsForStorage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Quantity)Period.DeepCopyInternal(); + if(SpecialPrecautionsForStorage.Any()) dest.SpecialPrecautionsForStorage = new List(SpecialPrecautionsForStorage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProductShelfLife()); + var instance = new ProductShelfLife(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Provenance.cs b/src/Hl7.Fhir.R4/Model/Generated/Provenance.cs index 46f7dafbc7..73404d6d48 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Provenance.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Provenance.cs @@ -177,7 +177,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AgentComponent; @@ -186,17 +186,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Role.Any()) dest.Role = new List(Role.DeepCopy()); - if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Role.Any()) dest.Role = new List(Role.DeepCopyInternal()); + if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AgentComponent()); + var instance = new AgentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -345,7 +346,7 @@ public List Agent private List _Agent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EntityComponent; @@ -354,16 +355,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RoleElement != null) dest.RoleElement = (Code)RoleElement.DeepCopy(); - if(What != null) dest.What = (Hl7.Fhir.Model.ResourceReference)What.DeepCopy(); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RoleElement != null) dest.RoleElement = (Code)RoleElement.DeepCopyInternal(); + if(What != null) dest.What = (Hl7.Fhir.Model.ResourceReference)What.DeepCopyInternal(); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EntityComponent()); + var instance = new EntityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -608,7 +610,7 @@ public List Signature private List _Signature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Provenance; @@ -617,23 +619,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(Occurred != null) dest.Occurred = (Hl7.Fhir.Model.DataType)Occurred.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopy(); - if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopy(); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - if(Entity.Any()) dest.Entity = new List(Entity.DeepCopy()); - if(Signature.Any()) dest.Signature = new List(Signature.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(Occurred != null) dest.Occurred = (Hl7.Fhir.Model.DataType)Occurred.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopyInternal(); + if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopyInternal(); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); + if(Entity.Any()) dest.Entity = new List(Entity.DeepCopyInternal()); + if(Signature.Any()) dest.Signature = new List(Signature.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Provenance()); + var instance = new Provenance(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Questionnaire.cs b/src/Hl7.Fhir.R4/Model/Generated/Questionnaire.cs index 027c085f24..046412a347 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Questionnaire.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Questionnaire.cs @@ -674,7 +674,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -683,29 +683,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(EnableWhen.Any()) dest.EnableWhen = new List(EnableWhen.DeepCopy()); - if(EnableBehaviorElement != null) dest.EnableBehaviorElement = (Code)EnableBehaviorElement.DeepCopy(); - if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopy(); - if(RepeatsElement != null) dest.RepeatsElement = (Hl7.Fhir.Model.FhirBoolean)RepeatsElement.DeepCopy(); - if(ReadOnlyElement != null) dest.ReadOnlyElement = (Hl7.Fhir.Model.FhirBoolean)ReadOnlyElement.DeepCopy(); - if(MaxLengthElement != null) dest.MaxLengthElement = (Hl7.Fhir.Model.Integer)MaxLengthElement.DeepCopy(); - if(AnswerValueSetElement != null) dest.AnswerValueSetElement = (Hl7.Fhir.Model.Canonical)AnswerValueSetElement.DeepCopy(); - if(AnswerOption.Any()) dest.AnswerOption = new List(AnswerOption.DeepCopy()); - if(Initial.Any()) dest.Initial = new List(Initial.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(EnableWhen.Any()) dest.EnableWhen = new List(EnableWhen.DeepCopyInternal()); + if(EnableBehaviorElement != null) dest.EnableBehaviorElement = (Code)EnableBehaviorElement.DeepCopyInternal(); + if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopyInternal(); + if(RepeatsElement != null) dest.RepeatsElement = (Hl7.Fhir.Model.FhirBoolean)RepeatsElement.DeepCopyInternal(); + if(ReadOnlyElement != null) dest.ReadOnlyElement = (Hl7.Fhir.Model.FhirBoolean)ReadOnlyElement.DeepCopyInternal(); + if(MaxLengthElement != null) dest.MaxLengthElement = (Hl7.Fhir.Model.Integer)MaxLengthElement.DeepCopyInternal(); + if(AnswerValueSetElement != null) dest.AnswerValueSetElement = (Hl7.Fhir.Model.Canonical)AnswerValueSetElement.DeepCopyInternal(); + if(AnswerOption.Any()) dest.AnswerOption = new List(AnswerOption.DeepCopyInternal()); + if(Initial.Any()) dest.Initial = new List(Initial.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -974,7 +975,7 @@ public Hl7.Fhir.Model.DataType Answer private Hl7.Fhir.Model.DataType _Answer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnableWhenComponent; @@ -983,16 +984,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(QuestionElement != null) dest.QuestionElement = (Hl7.Fhir.Model.FhirString)QuestionElement.DeepCopy(); - if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopy(); - if(Answer != null) dest.Answer = (Hl7.Fhir.Model.DataType)Answer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(QuestionElement != null) dest.QuestionElement = (Hl7.Fhir.Model.FhirString)QuestionElement.DeepCopyInternal(); + if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopyInternal(); + if(Answer != null) dest.Answer = (Hl7.Fhir.Model.DataType)Answer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnableWhenComponent()); + var instance = new EnableWhenComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1122,7 +1124,7 @@ public bool? InitialSelected } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AnswerOptionComponent; @@ -1131,15 +1133,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(InitialSelectedElement != null) dest.InitialSelectedElement = (Hl7.Fhir.Model.FhirBoolean)InitialSelectedElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(InitialSelectedElement != null) dest.InitialSelectedElement = (Hl7.Fhir.Model.FhirBoolean)InitialSelectedElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AnswerOptionComponent()); + var instance = new AnswerOptionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1230,7 +1233,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InitialComponent; @@ -1239,14 +1242,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InitialComponent()); + var instance = new InitialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1870,7 +1874,7 @@ public List Item Hl7.Fhir.Model.FhirString ICoded.Code { get => NameElement; set => NameElement = value; } IEnumerable ICoded.ToCodings() => NameElement.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Questionnaire; @@ -1879,35 +1883,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(SubjectTypeElement.Any()) dest.SubjectTypeElement = new List>(SubjectTypeElement.DeepCopy()); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(SubjectTypeElement.Any()) dest.SubjectTypeElement = new List>(SubjectTypeElement.DeepCopyInternal()); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Questionnaire()); + var instance = new Questionnaire(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/QuestionnaireResponse.cs b/src/Hl7.Fhir.R4/Model/Generated/QuestionnaireResponse.cs index 3648766352..cd79624001 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/QuestionnaireResponse.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/QuestionnaireResponse.cs @@ -239,7 +239,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -248,18 +248,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Answer.Any()) dest.Answer = new List(Answer.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Answer.Any()) dest.Answer = new List(Answer.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -387,7 +388,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AnswerComponent; @@ -396,15 +397,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AnswerComponent()); + var instance = new AnswerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -677,7 +679,7 @@ public List Item Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QuestionnaireResponse; @@ -686,24 +688,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(QuestionnaireElement != null) dest.QuestionnaireElement = (Hl7.Fhir.Model.Canonical)QuestionnaireElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(AuthoredElement != null) dest.AuthoredElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(QuestionnaireElement != null) dest.QuestionnaireElement = (Hl7.Fhir.Model.Canonical)QuestionnaireElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(AuthoredElement != null) dest.AuthoredElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QuestionnaireResponse()); + var instance = new QuestionnaireResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Ratio.cs b/src/Hl7.Fhir.R4/Model/Generated/Ratio.cs index 98943718e7..0930eb9973 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Ratio.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Ratio.cs @@ -86,7 +86,7 @@ public Hl7.Fhir.Model.Quantity Denominator private Hl7.Fhir.Model.Quantity _Denominator; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Ratio; @@ -95,15 +95,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Numerator != null) dest.Numerator = (Hl7.Fhir.Model.Quantity)Numerator.DeepCopy(); - if(Denominator != null) dest.Denominator = (Hl7.Fhir.Model.Quantity)Denominator.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Numerator != null) dest.Numerator = (Hl7.Fhir.Model.Quantity)Numerator.DeepCopyInternal(); + if(Denominator != null) dest.Denominator = (Hl7.Fhir.Model.Quantity)Denominator.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Ratio()); + var instance = new Ratio(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/RelatedPerson.cs b/src/Hl7.Fhir.R4/Model/Generated/RelatedPerson.cs index 26928000e7..896d48a6c2 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/RelatedPerson.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/RelatedPerson.cs @@ -121,7 +121,7 @@ public bool? Preferred } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CommunicationComponent; @@ -130,15 +130,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CommunicationComponent()); + var instance = new CommunicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -422,7 +423,7 @@ public List Communication List ICoded>.Code { get => Relationship; set => Relationship = value; } IEnumerable ICoded.ToCodings() => Relationship.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedPerson; @@ -431,25 +432,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopy()); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopyInternal()); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(Photo.Any()) dest.Photo = new List(Photo.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedPerson()); + var instance = new RelatedPerson(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/RequestGroup.cs b/src/Hl7.Fhir.R4/Model/Generated/RequestGroup.cs index 15b4e851e9..1bd11c7f2a 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/RequestGroup.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/RequestGroup.cs @@ -527,7 +527,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionComponent; @@ -536,32 +536,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.FhirString)TextEquivalentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopy()); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopy(); - if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopy(); - if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopy(); - if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopy(); - if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActionComponent()); + base.CopyToInternal(dest); + if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.FhirString)TextEquivalentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopyInternal()); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopyInternal(); + if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopyInternal(); + if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopyInternal(); + if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopyInternal(); + if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -817,7 +818,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConditionComponent; @@ -826,15 +827,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConditionComponent()); + var instance = new ConditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -987,7 +989,7 @@ public Hl7.Fhir.Model.DataType Offset private Hl7.Fhir.Model.DataType _Offset; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedActionComponent; @@ -996,16 +998,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ActionIdElement != null) dest.ActionIdElement = (Hl7.Fhir.Model.Id)ActionIdElement.DeepCopy(); - if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopy(); - if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ActionIdElement != null) dest.ActionIdElement = (Hl7.Fhir.Model.Id)ActionIdElement.DeepCopyInternal(); + if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopyInternal(); + if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedActionComponent()); + var instance = new RelatedActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1445,7 +1448,7 @@ public List Action Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequestGroup; @@ -1454,31 +1457,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequestGroup()); + var instance = new RequestGroup(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ResearchDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/ResearchDefinition.cs index ed7a9d1c4f..03007f9c2f 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ResearchDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ResearchDefinition.cs @@ -857,7 +857,7 @@ public Hl7.Fhir.Model.ResourceReference Outcome List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResearchDefinition; @@ -866,47 +866,48 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(CommentElement.Any()) dest.CommentElement = new List(CommentElement.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(Population != null) dest.Population = (Hl7.Fhir.Model.ResourceReference)Population.DeepCopy(); - if(Exposure != null) dest.Exposure = (Hl7.Fhir.Model.ResourceReference)Exposure.DeepCopy(); - if(ExposureAlternative != null) dest.ExposureAlternative = (Hl7.Fhir.Model.ResourceReference)ExposureAlternative.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.ResourceReference)Outcome.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(CommentElement.Any()) dest.CommentElement = new List(CommentElement.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(Population != null) dest.Population = (Hl7.Fhir.Model.ResourceReference)Population.DeepCopyInternal(); + if(Exposure != null) dest.Exposure = (Hl7.Fhir.Model.ResourceReference)Exposure.DeepCopyInternal(); + if(ExposureAlternative != null) dest.ExposureAlternative = (Hl7.Fhir.Model.ResourceReference)ExposureAlternative.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.ResourceReference)Outcome.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResearchDefinition()); + var instance = new ResearchDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ResearchElementDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/ResearchElementDefinition.cs index f17cc11b0b..b2ebe67f43 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ResearchElementDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ResearchElementDefinition.cs @@ -364,7 +364,7 @@ public Hl7.Fhir.Model.GroupMeasureCode? ParticipantEffectiveGroupMeasure } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -373,25 +373,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopy(); - if(UsageContext.Any()) dest.UsageContext = new List(UsageContext.DeepCopy()); - if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopy(); - if(UnitOfMeasure != null) dest.UnitOfMeasure = (Hl7.Fhir.Model.CodeableConcept)UnitOfMeasure.DeepCopy(); - if(StudyEffectiveDescriptionElement != null) dest.StudyEffectiveDescriptionElement = (Hl7.Fhir.Model.FhirString)StudyEffectiveDescriptionElement.DeepCopy(); - if(StudyEffective != null) dest.StudyEffective = (Hl7.Fhir.Model.DataType)StudyEffective.DeepCopy(); - if(StudyEffectiveTimeFromStart != null) dest.StudyEffectiveTimeFromStart = (Hl7.Fhir.Model.Duration)StudyEffectiveTimeFromStart.DeepCopy(); - if(StudyEffectiveGroupMeasureElement != null) dest.StudyEffectiveGroupMeasureElement = (Code)StudyEffectiveGroupMeasureElement.DeepCopy(); - if(ParticipantEffectiveDescriptionElement != null) dest.ParticipantEffectiveDescriptionElement = (Hl7.Fhir.Model.FhirString)ParticipantEffectiveDescriptionElement.DeepCopy(); - if(ParticipantEffective != null) dest.ParticipantEffective = (Hl7.Fhir.Model.DataType)ParticipantEffective.DeepCopy(); - if(ParticipantEffectiveTimeFromStart != null) dest.ParticipantEffectiveTimeFromStart = (Hl7.Fhir.Model.Duration)ParticipantEffectiveTimeFromStart.DeepCopy(); - if(ParticipantEffectiveGroupMeasureElement != null) dest.ParticipantEffectiveGroupMeasureElement = (Code)ParticipantEffectiveGroupMeasureElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopyInternal(); + if(UsageContext.Any()) dest.UsageContext = new List(UsageContext.DeepCopyInternal()); + if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopyInternal(); + if(UnitOfMeasure != null) dest.UnitOfMeasure = (Hl7.Fhir.Model.CodeableConcept)UnitOfMeasure.DeepCopyInternal(); + if(StudyEffectiveDescriptionElement != null) dest.StudyEffectiveDescriptionElement = (Hl7.Fhir.Model.FhirString)StudyEffectiveDescriptionElement.DeepCopyInternal(); + if(StudyEffective != null) dest.StudyEffective = (Hl7.Fhir.Model.DataType)StudyEffective.DeepCopyInternal(); + if(StudyEffectiveTimeFromStart != null) dest.StudyEffectiveTimeFromStart = (Hl7.Fhir.Model.Duration)StudyEffectiveTimeFromStart.DeepCopyInternal(); + if(StudyEffectiveGroupMeasureElement != null) dest.StudyEffectiveGroupMeasureElement = (Code)StudyEffectiveGroupMeasureElement.DeepCopyInternal(); + if(ParticipantEffectiveDescriptionElement != null) dest.ParticipantEffectiveDescriptionElement = (Hl7.Fhir.Model.FhirString)ParticipantEffectiveDescriptionElement.DeepCopyInternal(); + if(ParticipantEffective != null) dest.ParticipantEffective = (Hl7.Fhir.Model.DataType)ParticipantEffective.DeepCopyInternal(); + if(ParticipantEffectiveTimeFromStart != null) dest.ParticipantEffectiveTimeFromStart = (Hl7.Fhir.Model.Duration)ParticipantEffectiveTimeFromStart.DeepCopyInternal(); + if(ParticipantEffectiveGroupMeasureElement != null) dest.ParticipantEffectiveGroupMeasureElement = (Code)ParticipantEffectiveGroupMeasureElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1345,7 +1346,7 @@ public List Ch List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResearchElementDefinition; @@ -1354,46 +1355,47 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(CommentElement.Any()) dest.CommentElement = new List(CommentElement.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(VariableTypeElement != null) dest.VariableTypeElement = (Code)VariableTypeElement.DeepCopy(); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(CommentElement.Any()) dest.CommentElement = new List(CommentElement.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(VariableTypeElement != null) dest.VariableTypeElement = (Code)VariableTypeElement.DeepCopyInternal(); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResearchElementDefinition()); + var instance = new ResearchElementDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ResearchStudy.cs b/src/Hl7.Fhir.R4/Model/Generated/ResearchStudy.cs index 4731251ad5..ed9051cc98 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ResearchStudy.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ResearchStudy.cs @@ -228,7 +228,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ArmComponent; @@ -237,16 +237,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ArmComponent()); + var instance = new ArmComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -371,7 +372,7 @@ public Hl7.Fhir.Model.CodeableConcept Type private Hl7.Fhir.Model.CodeableConcept _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ObjectiveComponent; @@ -380,15 +381,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ObjectiveComponent()); + var instance = new ObjectiveComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -850,7 +852,7 @@ public List Objective List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResearchStudy; @@ -859,37 +861,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Protocol.Any()) dest.Protocol = new List(Protocol.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(PrimaryPurposeType != null) dest.PrimaryPurposeType = (Hl7.Fhir.Model.CodeableConcept)PrimaryPurposeType.DeepCopy(); - if(Phase != null) dest.Phase = (Hl7.Fhir.Model.CodeableConcept)Phase.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Keyword.Any()) dest.Keyword = new List(Keyword.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Enrollment.Any()) dest.Enrollment = new List(Enrollment.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Sponsor != null) dest.Sponsor = (Hl7.Fhir.Model.ResourceReference)Sponsor.DeepCopy(); - if(PrincipalInvestigator != null) dest.PrincipalInvestigator = (Hl7.Fhir.Model.ResourceReference)PrincipalInvestigator.DeepCopy(); - if(Site.Any()) dest.Site = new List(Site.DeepCopy()); - if(ReasonStopped != null) dest.ReasonStopped = (Hl7.Fhir.Model.CodeableConcept)ReasonStopped.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Arm.Any()) dest.Arm = new List(Arm.DeepCopy()); - if(Objective.Any()) dest.Objective = new List(Objective.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Protocol.Any()) dest.Protocol = new List(Protocol.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(PrimaryPurposeType != null) dest.PrimaryPurposeType = (Hl7.Fhir.Model.CodeableConcept)PrimaryPurposeType.DeepCopyInternal(); + if(Phase != null) dest.Phase = (Hl7.Fhir.Model.CodeableConcept)Phase.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Keyword.Any()) dest.Keyword = new List(Keyword.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Enrollment.Any()) dest.Enrollment = new List(Enrollment.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Sponsor != null) dest.Sponsor = (Hl7.Fhir.Model.ResourceReference)Sponsor.DeepCopyInternal(); + if(PrincipalInvestigator != null) dest.PrincipalInvestigator = (Hl7.Fhir.Model.ResourceReference)PrincipalInvestigator.DeepCopyInternal(); + if(Site.Any()) dest.Site = new List(Site.DeepCopyInternal()); + if(ReasonStopped != null) dest.ReasonStopped = (Hl7.Fhir.Model.CodeableConcept)ReasonStopped.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Arm.Any()) dest.Arm = new List(Arm.DeepCopyInternal()); + if(Objective.Any()) dest.Objective = new List(Objective.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResearchStudy()); + var instance = new ResearchStudy(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ResearchSubject.cs b/src/Hl7.Fhir.R4/Model/Generated/ResearchSubject.cs index 88e1cc79e0..6b1dad43da 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ResearchSubject.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ResearchSubject.cs @@ -320,7 +320,7 @@ public Hl7.Fhir.Model.ResourceReference Consent List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResearchSubject; @@ -329,21 +329,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Study != null) dest.Study = (Hl7.Fhir.Model.ResourceReference)Study.DeepCopy(); - if(Individual != null) dest.Individual = (Hl7.Fhir.Model.ResourceReference)Individual.DeepCopy(); - if(AssignedArmElement != null) dest.AssignedArmElement = (Hl7.Fhir.Model.FhirString)AssignedArmElement.DeepCopy(); - if(ActualArmElement != null) dest.ActualArmElement = (Hl7.Fhir.Model.FhirString)ActualArmElement.DeepCopy(); - if(Consent != null) dest.Consent = (Hl7.Fhir.Model.ResourceReference)Consent.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Study != null) dest.Study = (Hl7.Fhir.Model.ResourceReference)Study.DeepCopyInternal(); + if(Individual != null) dest.Individual = (Hl7.Fhir.Model.ResourceReference)Individual.DeepCopyInternal(); + if(AssignedArmElement != null) dest.AssignedArmElement = (Hl7.Fhir.Model.FhirString)AssignedArmElement.DeepCopyInternal(); + if(ActualArmElement != null) dest.ActualArmElement = (Hl7.Fhir.Model.FhirString)ActualArmElement.DeepCopyInternal(); + if(Consent != null) dest.Consent = (Hl7.Fhir.Model.ResourceReference)Consent.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResearchSubject()); + var instance = new ResearchSubject(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/RiskAssessment.cs b/src/Hl7.Fhir.R4/Model/Generated/RiskAssessment.cs index 37693916a2..5e2467d060 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/RiskAssessment.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/RiskAssessment.cs @@ -196,7 +196,7 @@ public string Rationale } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PredictionComponent; @@ -205,19 +205,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(Probability != null) dest.Probability = (Hl7.Fhir.Model.DataType)Probability.DeepCopy(); - if(QualitativeRisk != null) dest.QualitativeRisk = (Hl7.Fhir.Model.CodeableConcept)QualitativeRisk.DeepCopy(); - if(RelativeRiskElement != null) dest.RelativeRiskElement = (Hl7.Fhir.Model.FhirDecimal)RelativeRiskElement.DeepCopy(); - if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopy(); - if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.FhirString)RationaleElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(Probability != null) dest.Probability = (Hl7.Fhir.Model.DataType)Probability.DeepCopyInternal(); + if(QualitativeRisk != null) dest.QualitativeRisk = (Hl7.Fhir.Model.CodeableConcept)QualitativeRisk.DeepCopyInternal(); + if(RelativeRiskElement != null) dest.RelativeRiskElement = (Hl7.Fhir.Model.FhirDecimal)RelativeRiskElement.DeepCopyInternal(); + if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopyInternal(); + if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.FhirString)RationaleElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PredictionComponent()); + var instance = new PredictionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -596,7 +597,7 @@ public List Note Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RiskAssessment; @@ -605,30 +606,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn != null) dest.BasedOn = (Hl7.Fhir.Model.ResourceReference)BasedOn.DeepCopy(); - if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Basis.Any()) dest.Basis = new List(Basis.DeepCopy()); - if(Prediction.Any()) dest.Prediction = new List(Prediction.DeepCopy()); - if(MitigationElement != null) dest.MitigationElement = (Hl7.Fhir.Model.FhirString)MitigationElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn != null) dest.BasedOn = (Hl7.Fhir.Model.ResourceReference)BasedOn.DeepCopyInternal(); + if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Basis.Any()) dest.Basis = new List(Basis.DeepCopyInternal()); + if(Prediction.Any()) dest.Prediction = new List(Prediction.DeepCopyInternal()); + if(MitigationElement != null) dest.MitigationElement = (Hl7.Fhir.Model.FhirString)MitigationElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RiskAssessment()); + var instance = new RiskAssessment(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/RiskEvidenceSynthesis.cs b/src/Hl7.Fhir.R4/Model/Generated/RiskEvidenceSynthesis.cs index 6af31e2f33..67b5b39cb2 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/RiskEvidenceSynthesis.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/RiskEvidenceSynthesis.cs @@ -168,7 +168,7 @@ public int? NumberOfParticipants } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SampleSizeComponent; @@ -177,16 +177,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(NumberOfStudiesElement != null) dest.NumberOfStudiesElement = (Hl7.Fhir.Model.Integer)NumberOfStudiesElement.DeepCopy(); - if(NumberOfParticipantsElement != null) dest.NumberOfParticipantsElement = (Hl7.Fhir.Model.Integer)NumberOfParticipantsElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(NumberOfStudiesElement != null) dest.NumberOfStudiesElement = (Hl7.Fhir.Model.Integer)NumberOfStudiesElement.DeepCopyInternal(); + if(NumberOfParticipantsElement != null) dest.NumberOfParticipantsElement = (Hl7.Fhir.Model.Integer)NumberOfParticipantsElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SampleSizeComponent()); + var instance = new SampleSizeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -432,7 +433,7 @@ public List Pre private List _PrecisionEstimate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RiskEstimateComponent; @@ -441,20 +442,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy(); - if(UnitOfMeasure != null) dest.UnitOfMeasure = (Hl7.Fhir.Model.CodeableConcept)UnitOfMeasure.DeepCopy(); - if(DenominatorCountElement != null) dest.DenominatorCountElement = (Hl7.Fhir.Model.Integer)DenominatorCountElement.DeepCopy(); - if(NumeratorCountElement != null) dest.NumeratorCountElement = (Hl7.Fhir.Model.Integer)NumeratorCountElement.DeepCopy(); - if(PrecisionEstimate.Any()) dest.PrecisionEstimate = new List(PrecisionEstimate.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopyInternal(); + if(UnitOfMeasure != null) dest.UnitOfMeasure = (Hl7.Fhir.Model.CodeableConcept)UnitOfMeasure.DeepCopyInternal(); + if(DenominatorCountElement != null) dest.DenominatorCountElement = (Hl7.Fhir.Model.Integer)DenominatorCountElement.DeepCopyInternal(); + if(NumeratorCountElement != null) dest.NumeratorCountElement = (Hl7.Fhir.Model.Integer)NumeratorCountElement.DeepCopyInternal(); + if(PrecisionEstimate.Any()) dest.PrecisionEstimate = new List(PrecisionEstimate.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RiskEstimateComponent()); + var instance = new RiskEstimateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -673,7 +675,7 @@ public decimal? To } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PrecisionEstimateComponent; @@ -682,17 +684,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(LevelElement != null) dest.LevelElement = (Hl7.Fhir.Model.FhirDecimal)LevelElement.DeepCopy(); - if(FromElement != null) dest.FromElement = (Hl7.Fhir.Model.FhirDecimal)FromElement.DeepCopy(); - if(ToElement != null) dest.ToElement = (Hl7.Fhir.Model.FhirDecimal)ToElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(LevelElement != null) dest.LevelElement = (Hl7.Fhir.Model.FhirDecimal)LevelElement.DeepCopyInternal(); + if(FromElement != null) dest.FromElement = (Hl7.Fhir.Model.FhirDecimal)FromElement.DeepCopyInternal(); + if(ToElement != null) dest.ToElement = (Hl7.Fhir.Model.FhirDecimal)ToElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PrecisionEstimateComponent()); + var instance = new PrecisionEstimateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -823,7 +826,7 @@ public List private List _CertaintySubcomponent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CertaintyComponent; @@ -832,16 +835,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Rating.Any()) dest.Rating = new List(Rating.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(CertaintySubcomponent.Any()) dest.CertaintySubcomponent = new List(CertaintySubcomponent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Rating.Any()) dest.Rating = new List(Rating.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(CertaintySubcomponent.Any()) dest.CertaintySubcomponent = new List(CertaintySubcomponent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CertaintyComponent()); + var instance = new CertaintyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -964,7 +968,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CertaintySubcomponentComponent; @@ -973,16 +977,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Rating.Any()) dest.Rating = new List(Rating.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Rating.Any()) dest.Rating = new List(Rating.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CertaintySubcomponentComponent()); + var instance = new CertaintySubcomponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1676,7 +1681,7 @@ public List Certainty List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RiskEvidenceSynthesis; @@ -1685,44 +1690,45 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(SynthesisType != null) dest.SynthesisType = (Hl7.Fhir.Model.CodeableConcept)SynthesisType.DeepCopy(); - if(StudyType != null) dest.StudyType = (Hl7.Fhir.Model.CodeableConcept)StudyType.DeepCopy(); - if(Population != null) dest.Population = (Hl7.Fhir.Model.ResourceReference)Population.DeepCopy(); - if(Exposure != null) dest.Exposure = (Hl7.Fhir.Model.ResourceReference)Exposure.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.ResourceReference)Outcome.DeepCopy(); - if(SampleSize != null) dest.SampleSize = (Hl7.Fhir.Model.RiskEvidenceSynthesis.SampleSizeComponent)SampleSize.DeepCopy(); - if(RiskEstimate != null) dest.RiskEstimate = (Hl7.Fhir.Model.RiskEvidenceSynthesis.RiskEstimateComponent)RiskEstimate.DeepCopy(); - if(Certainty.Any()) dest.Certainty = new List(Certainty.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(SynthesisType != null) dest.SynthesisType = (Hl7.Fhir.Model.CodeableConcept)SynthesisType.DeepCopyInternal(); + if(StudyType != null) dest.StudyType = (Hl7.Fhir.Model.CodeableConcept)StudyType.DeepCopyInternal(); + if(Population != null) dest.Population = (Hl7.Fhir.Model.ResourceReference)Population.DeepCopyInternal(); + if(Exposure != null) dest.Exposure = (Hl7.Fhir.Model.ResourceReference)Exposure.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.ResourceReference)Outcome.DeepCopyInternal(); + if(SampleSize != null) dest.SampleSize = (Hl7.Fhir.Model.RiskEvidenceSynthesis.SampleSizeComponent)SampleSize.DeepCopyInternal(); + if(RiskEstimate != null) dest.RiskEstimate = (Hl7.Fhir.Model.RiskEvidenceSynthesis.RiskEstimateComponent)RiskEstimate.DeepCopyInternal(); + if(Certainty.Any()) dest.Certainty = new List(Certainty.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RiskEvidenceSynthesis()); + var instance = new RiskEvidenceSynthesis(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/SampledData.cs b/src/Hl7.Fhir.R4/Model/Generated/SampledData.cs index 10c94b33d9..2a131bf41f 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/SampledData.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/SampledData.cs @@ -262,7 +262,7 @@ public string Data } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SampledData; @@ -271,20 +271,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Origin != null) dest.Origin = (Hl7.Fhir.Model.Quantity)Origin.DeepCopy(); - if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(LowerLimitElement != null) dest.LowerLimitElement = (Hl7.Fhir.Model.FhirDecimal)LowerLimitElement.DeepCopy(); - if(UpperLimitElement != null) dest.UpperLimitElement = (Hl7.Fhir.Model.FhirDecimal)UpperLimitElement.DeepCopy(); - if(DimensionsElement != null) dest.DimensionsElement = (Hl7.Fhir.Model.PositiveInt)DimensionsElement.DeepCopy(); - if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.FhirString)DataElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Origin != null) dest.Origin = (Hl7.Fhir.Model.Quantity)Origin.DeepCopyInternal(); + if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(LowerLimitElement != null) dest.LowerLimitElement = (Hl7.Fhir.Model.FhirDecimal)LowerLimitElement.DeepCopyInternal(); + if(UpperLimitElement != null) dest.UpperLimitElement = (Hl7.Fhir.Model.FhirDecimal)UpperLimitElement.DeepCopyInternal(); + if(DimensionsElement != null) dest.DimensionsElement = (Hl7.Fhir.Model.PositiveInt)DimensionsElement.DeepCopyInternal(); + if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.FhirString)DataElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SampledData()); + var instance = new SampledData(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Schedule.cs b/src/Hl7.Fhir.R4/Model/Generated/Schedule.cs index f536ac77d1..bd623df7d7 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Schedule.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Schedule.cs @@ -208,7 +208,7 @@ public string Comment List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Schedule; @@ -217,21 +217,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopy()); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(PlanningHorizon != null) dest.PlanningHorizon = (Hl7.Fhir.Model.Period)PlanningHorizon.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopyInternal()); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(PlanningHorizon != null) dest.PlanningHorizon = (Hl7.Fhir.Model.Period)PlanningHorizon.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Schedule()); + var instance = new Schedule(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/SearchParameter.cs b/src/Hl7.Fhir.R4/Model/Generated/SearchParameter.cs index 40d5a9fd1d..e2bbbb0fc5 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/SearchParameter.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/SearchParameter.cs @@ -326,7 +326,7 @@ public string Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -335,15 +335,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1166,7 +1167,7 @@ public List Component List> ICoded>>.Code { get => TargetElement; set => TargetElement = value; } IEnumerable ICoded.ToCodings() => TargetElement.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SearchParameter; @@ -1175,39 +1176,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DerivedFromElement != null) dest.DerivedFromElement = (Hl7.Fhir.Model.Canonical)DerivedFromElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(BaseElement.Any()) dest.BaseElement = new List>(BaseElement.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(XpathElement != null) dest.XpathElement = (Hl7.Fhir.Model.FhirString)XpathElement.DeepCopy(); - if(XpathUsageElement != null) dest.XpathUsageElement = (Code)XpathUsageElement.DeepCopy(); - if(TargetElement.Any()) dest.TargetElement = new List>(TargetElement.DeepCopy()); - if(MultipleOrElement != null) dest.MultipleOrElement = (Hl7.Fhir.Model.FhirBoolean)MultipleOrElement.DeepCopy(); - if(MultipleAndElement != null) dest.MultipleAndElement = (Hl7.Fhir.Model.FhirBoolean)MultipleAndElement.DeepCopy(); - if(ComparatorElement.Any()) dest.ComparatorElement = new List>(ComparatorElement.DeepCopy()); - if(ModifierElement.Any()) dest.ModifierElement = new List>(ModifierElement.DeepCopy()); - if(ChainElement.Any()) dest.ChainElement = new List(ChainElement.DeepCopy()); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DerivedFromElement != null) dest.DerivedFromElement = (Hl7.Fhir.Model.Canonical)DerivedFromElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(BaseElement.Any()) dest.BaseElement = new List>(BaseElement.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(XpathElement != null) dest.XpathElement = (Hl7.Fhir.Model.FhirString)XpathElement.DeepCopyInternal(); + if(XpathUsageElement != null) dest.XpathUsageElement = (Code)XpathUsageElement.DeepCopyInternal(); + if(TargetElement.Any()) dest.TargetElement = new List>(TargetElement.DeepCopyInternal()); + if(MultipleOrElement != null) dest.MultipleOrElement = (Hl7.Fhir.Model.FhirBoolean)MultipleOrElement.DeepCopyInternal(); + if(MultipleAndElement != null) dest.MultipleAndElement = (Hl7.Fhir.Model.FhirBoolean)MultipleAndElement.DeepCopyInternal(); + if(ComparatorElement.Any()) dest.ComparatorElement = new List>(ComparatorElement.DeepCopyInternal()); + if(ModifierElement.Any()) dest.ModifierElement = new List>(ModifierElement.DeepCopyInternal()); + if(ChainElement.Any()) dest.ChainElement = new List(ChainElement.DeepCopyInternal()); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SearchParameter()); + var instance = new SearchParameter(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/ServiceRequest.cs b/src/Hl7.Fhir.R4/Model/Generated/ServiceRequest.cs index 4bee390a4d..60e198094b 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/ServiceRequest.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/ServiceRequest.cs @@ -702,7 +702,7 @@ public List RelevantHistory Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ServiceRequest; @@ -711,46 +711,47 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(Requisition != null) dest.Requisition = (Hl7.Fhir.Model.Identifier)Requisition.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(OrderDetail.Any()) dest.OrderDetail = new List(OrderDetail.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.DataType)Quantity.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(LocationCode.Any()) dest.LocationCode = new List(LocationCode.DeepCopy()); - if(LocationReference.Any()) dest.LocationReference = new List(LocationReference.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopy(); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(Requisition != null) dest.Requisition = (Hl7.Fhir.Model.Identifier)Requisition.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(OrderDetail.Any()) dest.OrderDetail = new List(OrderDetail.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.DataType)Quantity.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(LocationCode.Any()) dest.LocationCode = new List(LocationCode.DeepCopyInternal()); + if(LocationReference.Any()) dest.LocationReference = new List(LocationReference.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopyInternal(); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ServiceRequest()); + var instance = new ServiceRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Slot.cs b/src/Hl7.Fhir.R4/Model/Generated/Slot.cs index 539878a04a..afeb89297d 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Slot.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Slot.cs @@ -347,7 +347,7 @@ public string Comment List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Slot; @@ -356,24 +356,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopy()); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopy(); - if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.ResourceReference)Schedule.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(OverbookedElement != null) dest.OverbookedElement = (Hl7.Fhir.Model.FhirBoolean)OverbookedElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopyInternal()); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopyInternal(); + if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.ResourceReference)Schedule.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(OverbookedElement != null) dest.OverbookedElement = (Hl7.Fhir.Model.FhirBoolean)OverbookedElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Slot()); + var instance = new Slot(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Specimen.cs b/src/Hl7.Fhir.R4/Model/Generated/Specimen.cs index 0d11885cf3..b4132223fc 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Specimen.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Specimen.cs @@ -209,7 +209,7 @@ public Hl7.Fhir.Model.DataType FastingStatus private Hl7.Fhir.Model.DataType _FastingStatus; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CollectionComponent; @@ -218,20 +218,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopy(); - if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(FastingStatus != null) dest.FastingStatus = (Hl7.Fhir.Model.DataType)FastingStatus.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopyInternal(); + if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(FastingStatus != null) dest.FastingStatus = (Hl7.Fhir.Model.DataType)FastingStatus.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CollectionComponent()); + var instance = new CollectionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -419,7 +420,7 @@ public Hl7.Fhir.Model.DataType Time private Hl7.Fhir.Model.DataType _Time; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcessingComponent; @@ -428,17 +429,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.CodeableConcept)Procedure.DeepCopy(); - if(Additive.Any()) dest.Additive = new List(Additive.DeepCopy()); - if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.CodeableConcept)Procedure.DeepCopyInternal(); + if(Additive.Any()) dest.Additive = new List(Additive.DeepCopyInternal()); + if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcessingComponent()); + var instance = new ProcessingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -628,7 +630,7 @@ public Hl7.Fhir.Model.DataType Additive private Hl7.Fhir.Model.DataType _Additive; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainerComponent; @@ -637,19 +639,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Capacity != null) dest.Capacity = (Hl7.Fhir.Model.Quantity)Capacity.DeepCopy(); - if(SpecimenQuantity != null) dest.SpecimenQuantity = (Hl7.Fhir.Model.Quantity)SpecimenQuantity.DeepCopy(); - if(Additive != null) dest.Additive = (Hl7.Fhir.Model.DataType)Additive.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Capacity != null) dest.Capacity = (Hl7.Fhir.Model.Quantity)Capacity.DeepCopyInternal(); + if(SpecimenQuantity != null) dest.SpecimenQuantity = (Hl7.Fhir.Model.Quantity)SpecimenQuantity.DeepCopyInternal(); + if(Additive != null) dest.Additive = (Hl7.Fhir.Model.DataType)Additive.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainerComponent()); + var instance = new ContainerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -964,7 +967,7 @@ public List Note Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Type; set => Type = value; } IEnumerable ICoded.ToCodings() => Type.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Specimen; @@ -973,26 +976,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(AccessionIdentifier != null) dest.AccessionIdentifier = (Hl7.Fhir.Model.Identifier)AccessionIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(ReceivedTimeElement != null) dest.ReceivedTimeElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedTimeElement.DeepCopy(); - if(Parent.Any()) dest.Parent = new List(Parent.DeepCopy()); - if(Request.Any()) dest.Request = new List(Request.DeepCopy()); - if(Collection != null) dest.Collection = (Hl7.Fhir.Model.Specimen.CollectionComponent)Collection.DeepCopy(); - if(Processing.Any()) dest.Processing = new List(Processing.DeepCopy()); - if(Container.Any()) dest.Container = new List(Container.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(AccessionIdentifier != null) dest.AccessionIdentifier = (Hl7.Fhir.Model.Identifier)AccessionIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(ReceivedTimeElement != null) dest.ReceivedTimeElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedTimeElement.DeepCopyInternal(); + if(Parent.Any()) dest.Parent = new List(Parent.DeepCopyInternal()); + if(Request.Any()) dest.Request = new List(Request.DeepCopyInternal()); + if(Collection != null) dest.Collection = (Hl7.Fhir.Model.Specimen.CollectionComponent)Collection.DeepCopyInternal(); + if(Processing.Any()) dest.Processing = new List(Processing.DeepCopyInternal()); + if(Container.Any()) dest.Container = new List(Container.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Specimen()); + var instance = new Specimen(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/SpecimenDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/SpecimenDefinition.cs index 728ffa4378..1c4905120a 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/SpecimenDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/SpecimenDefinition.cs @@ -262,7 +262,7 @@ public List Handling private List _Handling; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TypeTestedComponent; @@ -271,21 +271,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IsDerivedElement != null) dest.IsDerivedElement = (Hl7.Fhir.Model.FhirBoolean)IsDerivedElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(PreferenceElement != null) dest.PreferenceElement = (Code)PreferenceElement.DeepCopy(); - if(Container != null) dest.Container = (Hl7.Fhir.Model.SpecimenDefinition.ContainerComponent)Container.DeepCopy(); - if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.FhirString)RequirementElement.DeepCopy(); - if(RetentionTime != null) dest.RetentionTime = (Hl7.Fhir.Model.Duration)RetentionTime.DeepCopy(); - if(RejectionCriterion.Any()) dest.RejectionCriterion = new List(RejectionCriterion.DeepCopy()); - if(Handling.Any()) dest.Handling = new List(Handling.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(IsDerivedElement != null) dest.IsDerivedElement = (Hl7.Fhir.Model.FhirBoolean)IsDerivedElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(PreferenceElement != null) dest.PreferenceElement = (Code)PreferenceElement.DeepCopyInternal(); + if(Container != null) dest.Container = (Hl7.Fhir.Model.SpecimenDefinition.ContainerComponent)Container.DeepCopyInternal(); + if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.FhirString)RequirementElement.DeepCopyInternal(); + if(RetentionTime != null) dest.RetentionTime = (Hl7.Fhir.Model.Duration)RetentionTime.DeepCopyInternal(); + if(RejectionCriterion.Any()) dest.RejectionCriterion = new List(RejectionCriterion.DeepCopyInternal()); + if(Handling.Any()) dest.Handling = new List(Handling.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TypeTestedComponent()); + var instance = new TypeTestedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -548,7 +549,7 @@ public string Preparation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainerComponent; @@ -557,21 +558,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Material != null) dest.Material = (Hl7.Fhir.Model.CodeableConcept)Material.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Cap != null) dest.Cap = (Hl7.Fhir.Model.CodeableConcept)Cap.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Capacity != null) dest.Capacity = (Hl7.Fhir.Model.Quantity)Capacity.DeepCopy(); - if(MinimumVolume != null) dest.MinimumVolume = (Hl7.Fhir.Model.DataType)MinimumVolume.DeepCopy(); - if(Additive.Any()) dest.Additive = new List(Additive.DeepCopy()); - if(PreparationElement != null) dest.PreparationElement = (Hl7.Fhir.Model.FhirString)PreparationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Material != null) dest.Material = (Hl7.Fhir.Model.CodeableConcept)Material.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Cap != null) dest.Cap = (Hl7.Fhir.Model.CodeableConcept)Cap.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Capacity != null) dest.Capacity = (Hl7.Fhir.Model.Quantity)Capacity.DeepCopyInternal(); + if(MinimumVolume != null) dest.MinimumVolume = (Hl7.Fhir.Model.DataType)MinimumVolume.DeepCopyInternal(); + if(Additive.Any()) dest.Additive = new List(Additive.DeepCopyInternal()); + if(PreparationElement != null) dest.PreparationElement = (Hl7.Fhir.Model.FhirString)PreparationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainerComponent()); + var instance = new ContainerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -709,7 +711,7 @@ public Hl7.Fhir.Model.DataType Additive private Hl7.Fhir.Model.DataType _Additive; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdditiveComponent; @@ -718,14 +720,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Additive != null) dest.Additive = (Hl7.Fhir.Model.DataType)Additive.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Additive != null) dest.Additive = (Hl7.Fhir.Model.DataType)Additive.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdditiveComponent()); + var instance = new AdditiveComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -860,7 +863,7 @@ public string Instruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HandlingComponent; @@ -869,17 +872,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TemperatureQualifier != null) dest.TemperatureQualifier = (Hl7.Fhir.Model.CodeableConcept)TemperatureQualifier.DeepCopy(); - if(TemperatureRange != null) dest.TemperatureRange = (Hl7.Fhir.Model.Range)TemperatureRange.DeepCopy(); - if(MaxDuration != null) dest.MaxDuration = (Hl7.Fhir.Model.Duration)MaxDuration.DeepCopy(); - if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TemperatureQualifier != null) dest.TemperatureQualifier = (Hl7.Fhir.Model.CodeableConcept)TemperatureQualifier.DeepCopyInternal(); + if(TemperatureRange != null) dest.TemperatureRange = (Hl7.Fhir.Model.Range)TemperatureRange.DeepCopyInternal(); + if(MaxDuration != null) dest.MaxDuration = (Hl7.Fhir.Model.Duration)MaxDuration.DeepCopyInternal(); + if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HandlingComponent()); + var instance = new HandlingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1055,7 +1059,7 @@ public List TypeTested Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SpecimenDefinition; @@ -1064,19 +1068,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(TypeCollected != null) dest.TypeCollected = (Hl7.Fhir.Model.CodeableConcept)TypeCollected.DeepCopy(); - if(PatientPreparation.Any()) dest.PatientPreparation = new List(PatientPreparation.DeepCopy()); - if(TimeAspectElement != null) dest.TimeAspectElement = (Hl7.Fhir.Model.FhirString)TimeAspectElement.DeepCopy(); - if(Collection.Any()) dest.Collection = new List(Collection.DeepCopy()); - if(TypeTested.Any()) dest.TypeTested = new List(TypeTested.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(TypeCollected != null) dest.TypeCollected = (Hl7.Fhir.Model.CodeableConcept)TypeCollected.DeepCopyInternal(); + if(PatientPreparation.Any()) dest.PatientPreparation = new List(PatientPreparation.DeepCopyInternal()); + if(TimeAspectElement != null) dest.TimeAspectElement = (Hl7.Fhir.Model.FhirString)TimeAspectElement.DeepCopyInternal(); + if(Collection.Any()) dest.Collection = new List(Collection.DeepCopyInternal()); + if(TypeTested.Any()) dest.TypeTested = new List(TypeTested.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SpecimenDefinition()); + var instance = new SpecimenDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/StructureMap.cs b/src/Hl7.Fhir.R4/Model/Generated/StructureMap.cs index d6d16e3e66..aacc5a18a1 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/StructureMap.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/StructureMap.cs @@ -493,7 +493,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureComponent; @@ -502,17 +502,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.Canonical)UrlElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(AliasElement != null) dest.AliasElement = (Hl7.Fhir.Model.FhirString)AliasElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.Canonical)UrlElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(AliasElement != null) dest.AliasElement = (Hl7.Fhir.Model.FhirString)AliasElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureComponent()); + var instance = new StructureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -756,7 +757,7 @@ public List Rule private List _Rule; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -765,19 +766,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(ExtendsElement != null) dest.ExtendsElement = (Hl7.Fhir.Model.Id)ExtendsElement.DeepCopy(); - if(TypeModeElement != null) dest.TypeModeElement = (Code)TypeModeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(ExtendsElement != null) dest.ExtendsElement = (Hl7.Fhir.Model.Id)ExtendsElement.DeepCopyInternal(); + if(TypeModeElement != null) dest.TypeModeElement = (Code)TypeModeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1010,7 +1012,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InputComponent; @@ -1019,17 +1021,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InputComponent()); + var instance = new InputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1233,7 +1236,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RuleComponent; @@ -1242,19 +1245,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - if(Dependent.Any()) dest.Dependent = new List(Dependent.DeepCopy()); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); + if(Dependent.Any()) dest.Dependent = new List(Dependent.DeepCopyInternal()); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RuleComponent()); + var instance = new RuleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1683,7 +1687,7 @@ public string LogMessage } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceComponent; @@ -1692,24 +1696,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopy(); - if(DefaultValue != null) dest.DefaultValue = (Hl7.Fhir.Model.DataType)DefaultValue.DeepCopy(); - if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopy(); - if(ListModeElement != null) dest.ListModeElement = (Code)ListModeElement.DeepCopy(); - if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopy(); - if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopy(); - if(CheckElement != null) dest.CheckElement = (Hl7.Fhir.Model.FhirString)CheckElement.DeepCopy(); - if(LogMessageElement != null) dest.LogMessageElement = (Hl7.Fhir.Model.FhirString)LogMessageElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopyInternal(); + if(DefaultValue != null) dest.DefaultValue = (Hl7.Fhir.Model.DataType)DefaultValue.DeepCopyInternal(); + if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopyInternal(); + if(ListModeElement != null) dest.ListModeElement = (Code)ListModeElement.DeepCopyInternal(); + if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopyInternal(); + if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopyInternal(); + if(CheckElement != null) dest.CheckElement = (Hl7.Fhir.Model.FhirString)CheckElement.DeepCopyInternal(); + if(LogMessageElement != null) dest.LogMessageElement = (Hl7.Fhir.Model.FhirString)LogMessageElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceComponent()); + var instance = new SourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2088,7 +2093,7 @@ public List Parameter private List _Parameter; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -2097,21 +2102,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopy(); - if(ContextTypeElement != null) dest.ContextTypeElement = (Code)ContextTypeElement.DeepCopy(); - if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopy(); - if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopy(); - if(ListModeElement.Any()) dest.ListModeElement = new List>(ListModeElement.DeepCopy()); - if(ListRuleIdElement != null) dest.ListRuleIdElement = (Hl7.Fhir.Model.Id)ListRuleIdElement.DeepCopy(); - if(TransformElement != null) dest.TransformElement = (Code)TransformElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopyInternal(); + if(ContextTypeElement != null) dest.ContextTypeElement = (Code)ContextTypeElement.DeepCopyInternal(); + if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopyInternal(); + if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopyInternal(); + if(ListModeElement.Any()) dest.ListModeElement = new List>(ListModeElement.DeepCopyInternal()); + if(ListRuleIdElement != null) dest.ListRuleIdElement = (Hl7.Fhir.Model.Id)ListRuleIdElement.DeepCopyInternal(); + if(TransformElement != null) dest.TransformElement = (Code)TransformElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2244,7 +2250,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -2253,14 +2259,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2385,7 +2392,7 @@ public IEnumerable Variable } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DependentComponent; @@ -2394,15 +2401,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(VariableElement.Any()) dest.VariableElement = new List(VariableElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(VariableElement.Any()) dest.VariableElement = new List(VariableElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DependentComponent()); + var instance = new DependentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2923,7 +2931,7 @@ public List Group List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureMap; @@ -2932,31 +2940,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(Structure.Any()) dest.Structure = new List(Structure.DeepCopy()); - if(ImportElement.Any()) dest.ImportElement = new List(ImportElement.DeepCopy()); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(Structure.Any()) dest.Structure = new List(Structure.DeepCopyInternal()); + if(ImportElement.Any()) dest.ImportElement = new List(ImportElement.DeepCopyInternal()); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureMap()); + var instance = new StructureMap(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Subscription.cs b/src/Hl7.Fhir.R4/Model/Generated/Subscription.cs index 7a988c71a2..bf645f20da 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Subscription.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Subscription.cs @@ -278,7 +278,7 @@ public IEnumerable Header } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ChannelComponent; @@ -287,17 +287,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopy(); - if(PayloadElement != null) dest.PayloadElement = (Hl7.Fhir.Model.Code)PayloadElement.DeepCopy(); - if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopyInternal(); + if(PayloadElement != null) dest.PayloadElement = (Hl7.Fhir.Model.Code)PayloadElement.DeepCopyInternal(); + if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ChannelComponent()); + var instance = new ChannelComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -557,7 +558,7 @@ public Hl7.Fhir.Model.Subscription.ChannelComponent Channel private Hl7.Fhir.Model.Subscription.ChannelComponent _Channel; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Subscription; @@ -566,20 +567,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(ReasonElement != null) dest.ReasonElement = (Hl7.Fhir.Model.FhirString)ReasonElement.DeepCopy(); - if(CriteriaElement != null) dest.CriteriaElement = (Hl7.Fhir.Model.FhirString)CriteriaElement.DeepCopy(); - if(ErrorElement != null) dest.ErrorElement = (Hl7.Fhir.Model.FhirString)ErrorElement.DeepCopy(); - if(Channel != null) dest.Channel = (Hl7.Fhir.Model.Subscription.ChannelComponent)Channel.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(ReasonElement != null) dest.ReasonElement = (Hl7.Fhir.Model.FhirString)ReasonElement.DeepCopyInternal(); + if(CriteriaElement != null) dest.CriteriaElement = (Hl7.Fhir.Model.FhirString)CriteriaElement.DeepCopyInternal(); + if(ErrorElement != null) dest.ErrorElement = (Hl7.Fhir.Model.FhirString)ErrorElement.DeepCopyInternal(); + if(Channel != null) dest.Channel = (Hl7.Fhir.Model.Subscription.ChannelComponent)Channel.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Subscription()); + var instance = new Subscription(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Substance.cs b/src/Hl7.Fhir.R4/Model/Generated/Substance.cs index 9d1c743bf0..e4cba8e2cd 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Substance.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Substance.cs @@ -157,7 +157,7 @@ public Hl7.Fhir.Model.Quantity Quantity private Hl7.Fhir.Model.Quantity _Quantity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -166,16 +166,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -286,7 +287,7 @@ public Hl7.Fhir.Model.DataType Substance private Hl7.Fhir.Model.DataType _Substance; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientComponent; @@ -295,15 +296,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Ratio)Quantity.DeepCopy(); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.DataType)Substance.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Ratio)Quantity.DeepCopyInternal(); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.DataType)Substance.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientComponent()); + var instance = new IngredientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -500,7 +502,7 @@ public List Ingredient Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Substance; @@ -509,20 +511,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Substance()); + var instance = new Substance(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/SubstanceAmount.cs b/src/Hl7.Fhir.R4/Model/Generated/SubstanceAmount.cs index c052dec7ad..d290c374aa 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/SubstanceAmount.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/SubstanceAmount.cs @@ -95,7 +95,7 @@ public Hl7.Fhir.Model.Quantity HighLimit private Hl7.Fhir.Model.Quantity _HighLimit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferenceRangeComponent; @@ -104,15 +104,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LowLimit != null) dest.LowLimit = (Hl7.Fhir.Model.Quantity)LowLimit.DeepCopy(); - if(HighLimit != null) dest.HighLimit = (Hl7.Fhir.Model.Quantity)HighLimit.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LowLimit != null) dest.LowLimit = (Hl7.Fhir.Model.Quantity)LowLimit.DeepCopyInternal(); + if(HighLimit != null) dest.HighLimit = (Hl7.Fhir.Model.Quantity)HighLimit.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferenceRangeComponent()); + var instance = new ReferenceRangeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -240,7 +241,7 @@ public Hl7.Fhir.Model.SubstanceAmount.ReferenceRangeComponent ReferenceRange private Hl7.Fhir.Model.SubstanceAmount.ReferenceRangeComponent _ReferenceRange; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceAmount; @@ -249,17 +250,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopy(); - if(AmountType != null) dest.AmountType = (Hl7.Fhir.Model.CodeableConcept)AmountType.DeepCopy(); - if(AmountTextElement != null) dest.AmountTextElement = (Hl7.Fhir.Model.FhirString)AmountTextElement.DeepCopy(); - if(ReferenceRange != null) dest.ReferenceRange = (Hl7.Fhir.Model.SubstanceAmount.ReferenceRangeComponent)ReferenceRange.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopyInternal(); + if(AmountType != null) dest.AmountType = (Hl7.Fhir.Model.CodeableConcept)AmountType.DeepCopyInternal(); + if(AmountTextElement != null) dest.AmountTextElement = (Hl7.Fhir.Model.FhirString)AmountTextElement.DeepCopyInternal(); + if(ReferenceRange != null) dest.ReferenceRange = (Hl7.Fhir.Model.SubstanceAmount.ReferenceRangeComponent)ReferenceRange.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceAmount()); + var instance = new SubstanceAmount(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/SubstanceNucleicAcid.cs b/src/Hl7.Fhir.R4/Model/Generated/SubstanceNucleicAcid.cs index 78818237be..23bb15e24c 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/SubstanceNucleicAcid.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/SubstanceNucleicAcid.cs @@ -229,7 +229,7 @@ public List Sugar private List _Sugar; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubunitComponent; @@ -238,21 +238,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SubunitElement != null) dest.SubunitElement = (Hl7.Fhir.Model.Integer)SubunitElement.DeepCopy(); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.FhirString)SequenceElement.DeepCopy(); - if(LengthElement != null) dest.LengthElement = (Hl7.Fhir.Model.Integer)LengthElement.DeepCopy(); - if(SequenceAttachment != null) dest.SequenceAttachment = (Hl7.Fhir.Model.Attachment)SequenceAttachment.DeepCopy(); - if(FivePrime != null) dest.FivePrime = (Hl7.Fhir.Model.CodeableConcept)FivePrime.DeepCopy(); - if(ThreePrime != null) dest.ThreePrime = (Hl7.Fhir.Model.CodeableConcept)ThreePrime.DeepCopy(); - if(Linkage.Any()) dest.Linkage = new List(Linkage.DeepCopy()); - if(Sugar.Any()) dest.Sugar = new List(Sugar.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SubunitElement != null) dest.SubunitElement = (Hl7.Fhir.Model.Integer)SubunitElement.DeepCopyInternal(); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.FhirString)SequenceElement.DeepCopyInternal(); + if(LengthElement != null) dest.LengthElement = (Hl7.Fhir.Model.Integer)LengthElement.DeepCopyInternal(); + if(SequenceAttachment != null) dest.SequenceAttachment = (Hl7.Fhir.Model.Attachment)SequenceAttachment.DeepCopyInternal(); + if(FivePrime != null) dest.FivePrime = (Hl7.Fhir.Model.CodeableConcept)FivePrime.DeepCopyInternal(); + if(ThreePrime != null) dest.ThreePrime = (Hl7.Fhir.Model.CodeableConcept)ThreePrime.DeepCopyInternal(); + if(Linkage.Any()) dest.Linkage = new List(Linkage.DeepCopyInternal()); + if(Sugar.Any()) dest.Sugar = new List(Sugar.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubunitComponent()); + var instance = new SubunitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -475,7 +476,7 @@ public string ResidueSite } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkageComponent; @@ -484,17 +485,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ConnectivityElement != null) dest.ConnectivityElement = (Hl7.Fhir.Model.FhirString)ConnectivityElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(ResidueSiteElement != null) dest.ResidueSiteElement = (Hl7.Fhir.Model.FhirString)ResidueSiteElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ConnectivityElement != null) dest.ConnectivityElement = (Hl7.Fhir.Model.FhirString)ConnectivityElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(ResidueSiteElement != null) dest.ResidueSiteElement = (Hl7.Fhir.Model.FhirString)ResidueSiteElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkageComponent()); + var instance = new LinkageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -654,7 +656,7 @@ public string ResidueSite } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SugarComponent; @@ -663,16 +665,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(ResidueSiteElement != null) dest.ResidueSiteElement = (Hl7.Fhir.Model.FhirString)ResidueSiteElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(ResidueSiteElement != null) dest.ResidueSiteElement = (Hl7.Fhir.Model.FhirString)ResidueSiteElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SugarComponent()); + var instance = new SugarComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -838,7 +841,7 @@ public List Subunit private List _Subunit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceNucleicAcid; @@ -847,18 +850,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceType != null) dest.SequenceType = (Hl7.Fhir.Model.CodeableConcept)SequenceType.DeepCopy(); - if(NumberOfSubunitsElement != null) dest.NumberOfSubunitsElement = (Hl7.Fhir.Model.Integer)NumberOfSubunitsElement.DeepCopy(); - if(AreaOfHybridisationElement != null) dest.AreaOfHybridisationElement = (Hl7.Fhir.Model.FhirString)AreaOfHybridisationElement.DeepCopy(); - if(OligoNucleotideType != null) dest.OligoNucleotideType = (Hl7.Fhir.Model.CodeableConcept)OligoNucleotideType.DeepCopy(); - if(Subunit.Any()) dest.Subunit = new List(Subunit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceType != null) dest.SequenceType = (Hl7.Fhir.Model.CodeableConcept)SequenceType.DeepCopyInternal(); + if(NumberOfSubunitsElement != null) dest.NumberOfSubunitsElement = (Hl7.Fhir.Model.Integer)NumberOfSubunitsElement.DeepCopyInternal(); + if(AreaOfHybridisationElement != null) dest.AreaOfHybridisationElement = (Hl7.Fhir.Model.FhirString)AreaOfHybridisationElement.DeepCopyInternal(); + if(OligoNucleotideType != null) dest.OligoNucleotideType = (Hl7.Fhir.Model.CodeableConcept)OligoNucleotideType.DeepCopyInternal(); + if(Subunit.Any()) dest.Subunit = new List(Subunit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceNucleicAcid()); + var instance = new SubstanceNucleicAcid(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/SubstancePolymer.cs b/src/Hl7.Fhir.R4/Model/Generated/SubstancePolymer.cs index 1c77f7897c..87287c7a82 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/SubstancePolymer.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/SubstancePolymer.cs @@ -96,7 +96,7 @@ public List StartingM private List _StartingMaterial; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MonomerSetComponent; @@ -105,15 +105,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RatioType != null) dest.RatioType = (Hl7.Fhir.Model.CodeableConcept)RatioType.DeepCopy(); - if(StartingMaterial.Any()) dest.StartingMaterial = new List(StartingMaterial.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RatioType != null) dest.RatioType = (Hl7.Fhir.Model.CodeableConcept)RatioType.DeepCopyInternal(); + if(StartingMaterial.Any()) dest.StartingMaterial = new List(StartingMaterial.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MonomerSetComponent()); + var instance = new MonomerSetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -252,7 +253,7 @@ public Hl7.Fhir.Model.SubstanceAmount Amount private Hl7.Fhir.Model.SubstanceAmount _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StartingMaterialComponent; @@ -261,17 +262,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Material != null) dest.Material = (Hl7.Fhir.Model.CodeableConcept)Material.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(IsDefiningElement != null) dest.IsDefiningElement = (Hl7.Fhir.Model.FhirBoolean)IsDefiningElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.SubstanceAmount)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Material != null) dest.Material = (Hl7.Fhir.Model.CodeableConcept)Material.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(IsDefiningElement != null) dest.IsDefiningElement = (Hl7.Fhir.Model.FhirBoolean)IsDefiningElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.SubstanceAmount)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StartingMaterialComponent()); + var instance = new StartingMaterialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -445,7 +447,7 @@ public List RepeatUnit private List _RepeatUnit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepeatComponent; @@ -454,17 +456,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberOfUnitsElement != null) dest.NumberOfUnitsElement = (Hl7.Fhir.Model.Integer)NumberOfUnitsElement.DeepCopy(); - if(AverageMolecularFormulaElement != null) dest.AverageMolecularFormulaElement = (Hl7.Fhir.Model.FhirString)AverageMolecularFormulaElement.DeepCopy(); - if(RepeatUnitAmountType != null) dest.RepeatUnitAmountType = (Hl7.Fhir.Model.CodeableConcept)RepeatUnitAmountType.DeepCopy(); - if(RepeatUnit.Any()) dest.RepeatUnit = new List(RepeatUnit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NumberOfUnitsElement != null) dest.NumberOfUnitsElement = (Hl7.Fhir.Model.Integer)NumberOfUnitsElement.DeepCopyInternal(); + if(AverageMolecularFormulaElement != null) dest.AverageMolecularFormulaElement = (Hl7.Fhir.Model.FhirString)AverageMolecularFormulaElement.DeepCopyInternal(); + if(RepeatUnitAmountType != null) dest.RepeatUnitAmountType = (Hl7.Fhir.Model.CodeableConcept)RepeatUnitAmountType.DeepCopyInternal(); + if(RepeatUnit.Any()) dest.RepeatUnit = new List(RepeatUnit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepeatComponent()); + var instance = new RepeatComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -634,7 +637,7 @@ public List S private List _StructuralRepresentation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepeatUnitComponent; @@ -643,18 +646,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(OrientationOfPolymerisation != null) dest.OrientationOfPolymerisation = (Hl7.Fhir.Model.CodeableConcept)OrientationOfPolymerisation.DeepCopy(); - if(RepeatUnitElement != null) dest.RepeatUnitElement = (Hl7.Fhir.Model.FhirString)RepeatUnitElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.SubstanceAmount)Amount.DeepCopy(); - if(DegreeOfPolymerisation.Any()) dest.DegreeOfPolymerisation = new List(DegreeOfPolymerisation.DeepCopy()); - if(StructuralRepresentation.Any()) dest.StructuralRepresentation = new List(StructuralRepresentation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(OrientationOfPolymerisation != null) dest.OrientationOfPolymerisation = (Hl7.Fhir.Model.CodeableConcept)OrientationOfPolymerisation.DeepCopyInternal(); + if(RepeatUnitElement != null) dest.RepeatUnitElement = (Hl7.Fhir.Model.FhirString)RepeatUnitElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.SubstanceAmount)Amount.DeepCopyInternal(); + if(DegreeOfPolymerisation.Any()) dest.DegreeOfPolymerisation = new List(DegreeOfPolymerisation.DeepCopyInternal()); + if(StructuralRepresentation.Any()) dest.StructuralRepresentation = new List(StructuralRepresentation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepeatUnitComponent()); + var instance = new RepeatUnitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -773,7 +777,7 @@ public Hl7.Fhir.Model.SubstanceAmount Amount private Hl7.Fhir.Model.SubstanceAmount _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DegreeOfPolymerisationComponent; @@ -782,15 +786,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Degree != null) dest.Degree = (Hl7.Fhir.Model.CodeableConcept)Degree.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.SubstanceAmount)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Degree != null) dest.Degree = (Hl7.Fhir.Model.CodeableConcept)Degree.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.SubstanceAmount)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DegreeOfPolymerisationComponent()); + var instance = new DegreeOfPolymerisationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -916,7 +921,7 @@ public Hl7.Fhir.Model.Attachment Attachment private Hl7.Fhir.Model.Attachment _Attachment; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructuralRepresentationComponent; @@ -925,16 +930,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(RepresentationElement != null) dest.RepresentationElement = (Hl7.Fhir.Model.FhirString)RepresentationElement.DeepCopy(); - if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(RepresentationElement != null) dest.RepresentationElement = (Hl7.Fhir.Model.FhirString)RepresentationElement.DeepCopyInternal(); + if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructuralRepresentationComponent()); + var instance = new StructuralRepresentationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1098,7 +1104,7 @@ public List Repeat private List _Repeat; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstancePolymer; @@ -1107,19 +1113,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy(); - if(Geometry != null) dest.Geometry = (Hl7.Fhir.Model.CodeableConcept)Geometry.DeepCopy(); - if(CopolymerConnectivity.Any()) dest.CopolymerConnectivity = new List(CopolymerConnectivity.DeepCopy()); - if(ModificationElement.Any()) dest.ModificationElement = new List(ModificationElement.DeepCopy()); - if(MonomerSet.Any()) dest.MonomerSet = new List(MonomerSet.DeepCopy()); - if(Repeat.Any()) dest.Repeat = new List(Repeat.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopyInternal(); + if(Geometry != null) dest.Geometry = (Hl7.Fhir.Model.CodeableConcept)Geometry.DeepCopyInternal(); + if(CopolymerConnectivity.Any()) dest.CopolymerConnectivity = new List(CopolymerConnectivity.DeepCopyInternal()); + if(ModificationElement.Any()) dest.ModificationElement = new List(ModificationElement.DeepCopyInternal()); + if(MonomerSet.Any()) dest.MonomerSet = new List(MonomerSet.DeepCopyInternal()); + if(Repeat.Any()) dest.Repeat = new List(Repeat.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstancePolymer()); + var instance = new SubstancePolymer(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/SubstanceProtein.cs b/src/Hl7.Fhir.R4/Model/Generated/SubstanceProtein.cs index 4ee13ef773..834b65bdf5 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/SubstanceProtein.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/SubstanceProtein.cs @@ -263,7 +263,7 @@ public string CTerminalModification } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubunitComponent; @@ -272,21 +272,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SubunitElement != null) dest.SubunitElement = (Hl7.Fhir.Model.Integer)SubunitElement.DeepCopy(); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.FhirString)SequenceElement.DeepCopy(); - if(LengthElement != null) dest.LengthElement = (Hl7.Fhir.Model.Integer)LengthElement.DeepCopy(); - if(SequenceAttachment != null) dest.SequenceAttachment = (Hl7.Fhir.Model.Attachment)SequenceAttachment.DeepCopy(); - if(NTerminalModificationId != null) dest.NTerminalModificationId = (Hl7.Fhir.Model.Identifier)NTerminalModificationId.DeepCopy(); - if(NTerminalModificationElement != null) dest.NTerminalModificationElement = (Hl7.Fhir.Model.FhirString)NTerminalModificationElement.DeepCopy(); - if(CTerminalModificationId != null) dest.CTerminalModificationId = (Hl7.Fhir.Model.Identifier)CTerminalModificationId.DeepCopy(); - if(CTerminalModificationElement != null) dest.CTerminalModificationElement = (Hl7.Fhir.Model.FhirString)CTerminalModificationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SubunitElement != null) dest.SubunitElement = (Hl7.Fhir.Model.Integer)SubunitElement.DeepCopyInternal(); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.FhirString)SequenceElement.DeepCopyInternal(); + if(LengthElement != null) dest.LengthElement = (Hl7.Fhir.Model.Integer)LengthElement.DeepCopyInternal(); + if(SequenceAttachment != null) dest.SequenceAttachment = (Hl7.Fhir.Model.Attachment)SequenceAttachment.DeepCopyInternal(); + if(NTerminalModificationId != null) dest.NTerminalModificationId = (Hl7.Fhir.Model.Identifier)NTerminalModificationId.DeepCopyInternal(); + if(NTerminalModificationElement != null) dest.NTerminalModificationElement = (Hl7.Fhir.Model.FhirString)NTerminalModificationElement.DeepCopyInternal(); + if(CTerminalModificationId != null) dest.CTerminalModificationId = (Hl7.Fhir.Model.Identifier)CTerminalModificationId.DeepCopyInternal(); + if(CTerminalModificationElement != null) dest.CTerminalModificationElement = (Hl7.Fhir.Model.FhirString)CTerminalModificationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubunitComponent()); + var instance = new SubunitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -480,7 +481,7 @@ public List Subunit private List _Subunit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceProtein; @@ -489,17 +490,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceType != null) dest.SequenceType = (Hl7.Fhir.Model.CodeableConcept)SequenceType.DeepCopy(); - if(NumberOfSubunitsElement != null) dest.NumberOfSubunitsElement = (Hl7.Fhir.Model.Integer)NumberOfSubunitsElement.DeepCopy(); - if(DisulfideLinkageElement.Any()) dest.DisulfideLinkageElement = new List(DisulfideLinkageElement.DeepCopy()); - if(Subunit.Any()) dest.Subunit = new List(Subunit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceType != null) dest.SequenceType = (Hl7.Fhir.Model.CodeableConcept)SequenceType.DeepCopyInternal(); + if(NumberOfSubunitsElement != null) dest.NumberOfSubunitsElement = (Hl7.Fhir.Model.Integer)NumberOfSubunitsElement.DeepCopyInternal(); + if(DisulfideLinkageElement.Any()) dest.DisulfideLinkageElement = new List(DisulfideLinkageElement.DeepCopyInternal()); + if(Subunit.Any()) dest.Subunit = new List(Subunit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceProtein()); + var instance = new SubstanceProtein(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/SubstanceReferenceInformation.cs b/src/Hl7.Fhir.R4/Model/Generated/SubstanceReferenceInformation.cs index 46ad75dd3a..99dcc790a8 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/SubstanceReferenceInformation.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/SubstanceReferenceInformation.cs @@ -111,7 +111,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GeneComponent; @@ -120,16 +120,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(GeneSequenceOrigin != null) dest.GeneSequenceOrigin = (Hl7.Fhir.Model.CodeableConcept)GeneSequenceOrigin.DeepCopy(); - if(Gene != null) dest.Gene = (Hl7.Fhir.Model.CodeableConcept)Gene.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(GeneSequenceOrigin != null) dest.GeneSequenceOrigin = (Hl7.Fhir.Model.CodeableConcept)GeneSequenceOrigin.DeepCopyInternal(); + if(Gene != null) dest.Gene = (Hl7.Fhir.Model.CodeableConcept)Gene.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GeneComponent()); + var instance = new GeneComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -248,7 +249,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GeneElementComponent; @@ -257,16 +258,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Element != null) dest.Element = (Hl7.Fhir.Model.Identifier)Element.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Element != null) dest.Element = (Hl7.Fhir.Model.Identifier)Element.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GeneElementComponent()); + var instance = new GeneElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -399,7 +401,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClassificationComponent; @@ -408,17 +410,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Domain != null) dest.Domain = (Hl7.Fhir.Model.CodeableConcept)Domain.DeepCopy(); - if(Classification != null) dest.Classification = (Hl7.Fhir.Model.CodeableConcept)Classification.DeepCopy(); - if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopy()); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Domain != null) dest.Domain = (Hl7.Fhir.Model.CodeableConcept)Domain.DeepCopyInternal(); + if(Classification != null) dest.Classification = (Hl7.Fhir.Model.CodeableConcept)Classification.DeepCopyInternal(); + if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopyInternal()); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClassificationComponent()); + var instance = new ClassificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -612,7 +615,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -621,21 +624,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Target != null) dest.Target = (Hl7.Fhir.Model.Identifier)Target.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Interaction != null) dest.Interaction = (Hl7.Fhir.Model.CodeableConcept)Interaction.DeepCopy(); - if(Organism != null) dest.Organism = (Hl7.Fhir.Model.CodeableConcept)Organism.DeepCopy(); - if(OrganismType != null) dest.OrganismType = (Hl7.Fhir.Model.CodeableConcept)OrganismType.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopy(); - if(AmountType != null) dest.AmountType = (Hl7.Fhir.Model.CodeableConcept)AmountType.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Target != null) dest.Target = (Hl7.Fhir.Model.Identifier)Target.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Interaction != null) dest.Interaction = (Hl7.Fhir.Model.CodeableConcept)Interaction.DeepCopyInternal(); + if(Organism != null) dest.Organism = (Hl7.Fhir.Model.CodeableConcept)Organism.DeepCopyInternal(); + if(OrganismType != null) dest.OrganismType = (Hl7.Fhir.Model.CodeableConcept)OrganismType.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopyInternal(); + if(AmountType != null) dest.AmountType = (Hl7.Fhir.Model.CodeableConcept)AmountType.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -826,7 +830,7 @@ public List Target private List _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceReferenceInformation; @@ -835,18 +839,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Gene.Any()) dest.Gene = new List(Gene.DeepCopy()); - if(GeneElement.Any()) dest.GeneElement = new List(GeneElement.DeepCopy()); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Gene.Any()) dest.Gene = new List(Gene.DeepCopyInternal()); + if(GeneElement.Any()) dest.GeneElement = new List(GeneElement.DeepCopyInternal()); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceReferenceInformation()); + var instance = new SubstanceReferenceInformation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/SubstanceSourceMaterial.cs b/src/Hl7.Fhir.R4/Model/Generated/SubstanceSourceMaterial.cs index d82e56d434..9d438cf313 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/SubstanceSourceMaterial.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/SubstanceSourceMaterial.cs @@ -113,7 +113,7 @@ public Hl7.Fhir.Model.CodeableConcept MaterialType private Hl7.Fhir.Model.CodeableConcept _MaterialType; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FractionDescriptionComponent; @@ -122,15 +122,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(FractionElement != null) dest.FractionElement = (Hl7.Fhir.Model.FhirString)FractionElement.DeepCopy(); - if(MaterialType != null) dest.MaterialType = (Hl7.Fhir.Model.CodeableConcept)MaterialType.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(FractionElement != null) dest.FractionElement = (Hl7.Fhir.Model.FhirString)FractionElement.DeepCopyInternal(); + if(MaterialType != null) dest.MaterialType = (Hl7.Fhir.Model.CodeableConcept)MaterialType.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FractionDescriptionComponent()); + var instance = new FractionDescriptionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -322,7 +323,7 @@ public Hl7.Fhir.Model.SubstanceSourceMaterial.OrganismGeneralComponent OrganismG private Hl7.Fhir.Model.SubstanceSourceMaterial.OrganismGeneralComponent _OrganismGeneral; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OrganismComponent; @@ -331,21 +332,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Family != null) dest.Family = (Hl7.Fhir.Model.CodeableConcept)Family.DeepCopy(); - if(Genus != null) dest.Genus = (Hl7.Fhir.Model.CodeableConcept)Genus.DeepCopy(); - if(Species != null) dest.Species = (Hl7.Fhir.Model.CodeableConcept)Species.DeepCopy(); - if(IntraspecificType != null) dest.IntraspecificType = (Hl7.Fhir.Model.CodeableConcept)IntraspecificType.DeepCopy(); - if(IntraspecificDescriptionElement != null) dest.IntraspecificDescriptionElement = (Hl7.Fhir.Model.FhirString)IntraspecificDescriptionElement.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Hybrid != null) dest.Hybrid = (Hl7.Fhir.Model.SubstanceSourceMaterial.HybridComponent)Hybrid.DeepCopy(); - if(OrganismGeneral != null) dest.OrganismGeneral = (Hl7.Fhir.Model.SubstanceSourceMaterial.OrganismGeneralComponent)OrganismGeneral.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Family != null) dest.Family = (Hl7.Fhir.Model.CodeableConcept)Family.DeepCopyInternal(); + if(Genus != null) dest.Genus = (Hl7.Fhir.Model.CodeableConcept)Genus.DeepCopyInternal(); + if(Species != null) dest.Species = (Hl7.Fhir.Model.CodeableConcept)Species.DeepCopyInternal(); + if(IntraspecificType != null) dest.IntraspecificType = (Hl7.Fhir.Model.CodeableConcept)IntraspecificType.DeepCopyInternal(); + if(IntraspecificDescriptionElement != null) dest.IntraspecificDescriptionElement = (Hl7.Fhir.Model.FhirString)IntraspecificDescriptionElement.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Hybrid != null) dest.Hybrid = (Hl7.Fhir.Model.SubstanceSourceMaterial.HybridComponent)Hybrid.DeepCopyInternal(); + if(OrganismGeneral != null) dest.OrganismGeneral = (Hl7.Fhir.Model.SubstanceSourceMaterial.OrganismGeneralComponent)OrganismGeneral.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OrganismComponent()); + var instance = new OrganismComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -506,7 +508,7 @@ public string AuthorDescription } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AuthorComponent; @@ -515,15 +517,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AuthorType != null) dest.AuthorType = (Hl7.Fhir.Model.CodeableConcept)AuthorType.DeepCopy(); - if(AuthorDescriptionElement != null) dest.AuthorDescriptionElement = (Hl7.Fhir.Model.FhirString)AuthorDescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AuthorType != null) dest.AuthorType = (Hl7.Fhir.Model.CodeableConcept)AuthorType.DeepCopyInternal(); + if(AuthorDescriptionElement != null) dest.AuthorDescriptionElement = (Hl7.Fhir.Model.FhirString)AuthorDescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AuthorComponent()); + var instance = new AuthorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -729,7 +732,7 @@ public Hl7.Fhir.Model.CodeableConcept HybridType private Hl7.Fhir.Model.CodeableConcept _HybridType; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HybridComponent; @@ -738,18 +741,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MaternalOrganismIdElement != null) dest.MaternalOrganismIdElement = (Hl7.Fhir.Model.FhirString)MaternalOrganismIdElement.DeepCopy(); - if(MaternalOrganismNameElement != null) dest.MaternalOrganismNameElement = (Hl7.Fhir.Model.FhirString)MaternalOrganismNameElement.DeepCopy(); - if(PaternalOrganismIdElement != null) dest.PaternalOrganismIdElement = (Hl7.Fhir.Model.FhirString)PaternalOrganismIdElement.DeepCopy(); - if(PaternalOrganismNameElement != null) dest.PaternalOrganismNameElement = (Hl7.Fhir.Model.FhirString)PaternalOrganismNameElement.DeepCopy(); - if(HybridType != null) dest.HybridType = (Hl7.Fhir.Model.CodeableConcept)HybridType.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MaternalOrganismIdElement != null) dest.MaternalOrganismIdElement = (Hl7.Fhir.Model.FhirString)MaternalOrganismIdElement.DeepCopyInternal(); + if(MaternalOrganismNameElement != null) dest.MaternalOrganismNameElement = (Hl7.Fhir.Model.FhirString)MaternalOrganismNameElement.DeepCopyInternal(); + if(PaternalOrganismIdElement != null) dest.PaternalOrganismIdElement = (Hl7.Fhir.Model.FhirString)PaternalOrganismIdElement.DeepCopyInternal(); + if(PaternalOrganismNameElement != null) dest.PaternalOrganismNameElement = (Hl7.Fhir.Model.FhirString)PaternalOrganismNameElement.DeepCopyInternal(); + if(HybridType != null) dest.HybridType = (Hl7.Fhir.Model.CodeableConcept)HybridType.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HybridComponent()); + var instance = new HybridComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -894,7 +898,7 @@ public Hl7.Fhir.Model.CodeableConcept Order private Hl7.Fhir.Model.CodeableConcept _Order; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OrganismGeneralComponent; @@ -903,17 +907,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Kingdom != null) dest.Kingdom = (Hl7.Fhir.Model.CodeableConcept)Kingdom.DeepCopy(); - if(Phylum != null) dest.Phylum = (Hl7.Fhir.Model.CodeableConcept)Phylum.DeepCopy(); - if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy(); - if(Order != null) dest.Order = (Hl7.Fhir.Model.CodeableConcept)Order.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Kingdom != null) dest.Kingdom = (Hl7.Fhir.Model.CodeableConcept)Kingdom.DeepCopyInternal(); + if(Phylum != null) dest.Phylum = (Hl7.Fhir.Model.CodeableConcept)Phylum.DeepCopyInternal(); + if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopyInternal(); + if(Order != null) dest.Order = (Hl7.Fhir.Model.CodeableConcept)Order.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OrganismGeneralComponent()); + var instance = new OrganismGeneralComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1024,7 +1029,7 @@ public Hl7.Fhir.Model.CodeableConcept PartLocation private Hl7.Fhir.Model.CodeableConcept _PartLocation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PartDescriptionComponent; @@ -1033,15 +1038,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Part != null) dest.Part = (Hl7.Fhir.Model.CodeableConcept)Part.DeepCopy(); - if(PartLocation != null) dest.PartLocation = (Hl7.Fhir.Model.CodeableConcept)PartLocation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Part != null) dest.Part = (Hl7.Fhir.Model.CodeableConcept)Part.DeepCopyInternal(); + if(PartLocation != null) dest.PartLocation = (Hl7.Fhir.Model.CodeableConcept)PartLocation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PartDescriptionComponent()); + var instance = new PartDescriptionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1326,7 +1332,7 @@ public List Par private List _PartDescription; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceSourceMaterial; @@ -1335,26 +1341,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SourceMaterialClass != null) dest.SourceMaterialClass = (Hl7.Fhir.Model.CodeableConcept)SourceMaterialClass.DeepCopy(); - if(SourceMaterialType != null) dest.SourceMaterialType = (Hl7.Fhir.Model.CodeableConcept)SourceMaterialType.DeepCopy(); - if(SourceMaterialState != null) dest.SourceMaterialState = (Hl7.Fhir.Model.CodeableConcept)SourceMaterialState.DeepCopy(); - if(OrganismId != null) dest.OrganismId = (Hl7.Fhir.Model.Identifier)OrganismId.DeepCopy(); - if(OrganismNameElement != null) dest.OrganismNameElement = (Hl7.Fhir.Model.FhirString)OrganismNameElement.DeepCopy(); - if(ParentSubstanceId.Any()) dest.ParentSubstanceId = new List(ParentSubstanceId.DeepCopy()); - if(ParentSubstanceNameElement.Any()) dest.ParentSubstanceNameElement = new List(ParentSubstanceNameElement.DeepCopy()); - if(CountryOfOrigin.Any()) dest.CountryOfOrigin = new List(CountryOfOrigin.DeepCopy()); - if(GeographicalLocationElement.Any()) dest.GeographicalLocationElement = new List(GeographicalLocationElement.DeepCopy()); - if(DevelopmentStage != null) dest.DevelopmentStage = (Hl7.Fhir.Model.CodeableConcept)DevelopmentStage.DeepCopy(); - if(FractionDescription.Any()) dest.FractionDescription = new List(FractionDescription.DeepCopy()); - if(Organism != null) dest.Organism = (Hl7.Fhir.Model.SubstanceSourceMaterial.OrganismComponent)Organism.DeepCopy(); - if(PartDescription.Any()) dest.PartDescription = new List(PartDescription.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SourceMaterialClass != null) dest.SourceMaterialClass = (Hl7.Fhir.Model.CodeableConcept)SourceMaterialClass.DeepCopyInternal(); + if(SourceMaterialType != null) dest.SourceMaterialType = (Hl7.Fhir.Model.CodeableConcept)SourceMaterialType.DeepCopyInternal(); + if(SourceMaterialState != null) dest.SourceMaterialState = (Hl7.Fhir.Model.CodeableConcept)SourceMaterialState.DeepCopyInternal(); + if(OrganismId != null) dest.OrganismId = (Hl7.Fhir.Model.Identifier)OrganismId.DeepCopyInternal(); + if(OrganismNameElement != null) dest.OrganismNameElement = (Hl7.Fhir.Model.FhirString)OrganismNameElement.DeepCopyInternal(); + if(ParentSubstanceId.Any()) dest.ParentSubstanceId = new List(ParentSubstanceId.DeepCopyInternal()); + if(ParentSubstanceNameElement.Any()) dest.ParentSubstanceNameElement = new List(ParentSubstanceNameElement.DeepCopyInternal()); + if(CountryOfOrigin.Any()) dest.CountryOfOrigin = new List(CountryOfOrigin.DeepCopyInternal()); + if(GeographicalLocationElement.Any()) dest.GeographicalLocationElement = new List(GeographicalLocationElement.DeepCopyInternal()); + if(DevelopmentStage != null) dest.DevelopmentStage = (Hl7.Fhir.Model.CodeableConcept)DevelopmentStage.DeepCopyInternal(); + if(FractionDescription.Any()) dest.FractionDescription = new List(FractionDescription.DeepCopyInternal()); + if(Organism != null) dest.Organism = (Hl7.Fhir.Model.SubstanceSourceMaterial.OrganismComponent)Organism.DeepCopyInternal(); + if(PartDescription.Any()) dest.PartDescription = new List(PartDescription.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceSourceMaterial()); + var instance = new SubstanceSourceMaterial(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/SubstanceSpecification.cs b/src/Hl7.Fhir.R4/Model/Generated/SubstanceSpecification.cs index 9dcfe48a8a..22235c491e 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/SubstanceSpecification.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/SubstanceSpecification.cs @@ -198,7 +198,7 @@ public Hl7.Fhir.Model.DataType Amount private Hl7.Fhir.Model.DataType _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MoietyComponent; @@ -207,20 +207,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Stereochemistry != null) dest.Stereochemistry = (Hl7.Fhir.Model.CodeableConcept)Stereochemistry.DeepCopy(); - if(OpticalActivity != null) dest.OpticalActivity = (Hl7.Fhir.Model.CodeableConcept)OpticalActivity.DeepCopy(); - if(MolecularFormulaElement != null) dest.MolecularFormulaElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Stereochemistry != null) dest.Stereochemistry = (Hl7.Fhir.Model.CodeableConcept)Stereochemistry.DeepCopyInternal(); + if(OpticalActivity != null) dest.OpticalActivity = (Hl7.Fhir.Model.CodeableConcept)OpticalActivity.DeepCopyInternal(); + if(MolecularFormulaElement != null) dest.MolecularFormulaElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MoietyComponent()); + var instance = new MoietyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -417,7 +418,7 @@ public Hl7.Fhir.Model.DataType Amount private Hl7.Fhir.Model.DataType _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -426,18 +427,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(ParametersElement != null) dest.ParametersElement = (Hl7.Fhir.Model.FhirString)ParametersElement.DeepCopy(); - if(DefiningSubstance != null) dest.DefiningSubstance = (Hl7.Fhir.Model.DataType)DefiningSubstance.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(ParametersElement != null) dest.ParametersElement = (Hl7.Fhir.Model.FhirString)ParametersElement.DeepCopyInternal(); + if(DefiningSubstance != null) dest.DefiningSubstance = (Hl7.Fhir.Model.DataType)DefiningSubstance.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -675,7 +677,7 @@ public List Repre private List _Representation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureComponent; @@ -684,21 +686,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Stereochemistry != null) dest.Stereochemistry = (Hl7.Fhir.Model.CodeableConcept)Stereochemistry.DeepCopy(); - if(OpticalActivity != null) dest.OpticalActivity = (Hl7.Fhir.Model.CodeableConcept)OpticalActivity.DeepCopy(); - if(MolecularFormulaElement != null) dest.MolecularFormulaElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaElement.DeepCopy(); - if(MolecularFormulaByMoietyElement != null) dest.MolecularFormulaByMoietyElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaByMoietyElement.DeepCopy(); - if(Isotope.Any()) dest.Isotope = new List(Isotope.DeepCopy()); - if(MolecularWeight != null) dest.MolecularWeight = (Hl7.Fhir.Model.SubstanceSpecification.MolecularWeightComponent)MolecularWeight.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - if(Representation.Any()) dest.Representation = new List(Representation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Stereochemistry != null) dest.Stereochemistry = (Hl7.Fhir.Model.CodeableConcept)Stereochemistry.DeepCopyInternal(); + if(OpticalActivity != null) dest.OpticalActivity = (Hl7.Fhir.Model.CodeableConcept)OpticalActivity.DeepCopyInternal(); + if(MolecularFormulaElement != null) dest.MolecularFormulaElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaElement.DeepCopyInternal(); + if(MolecularFormulaByMoietyElement != null) dest.MolecularFormulaByMoietyElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaByMoietyElement.DeepCopyInternal(); + if(Isotope.Any()) dest.Isotope = new List(Isotope.DeepCopyInternal()); + if(MolecularWeight != null) dest.MolecularWeight = (Hl7.Fhir.Model.SubstanceSpecification.MolecularWeightComponent)MolecularWeight.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); + if(Representation.Any()) dest.Representation = new List(Representation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureComponent()); + var instance = new StructureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -880,7 +883,7 @@ public Hl7.Fhir.Model.SubstanceSpecification.MolecularWeightComponent MolecularW private Hl7.Fhir.Model.SubstanceSpecification.MolecularWeightComponent _MolecularWeight; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IsotopeComponent; @@ -889,18 +892,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Name != null) dest.Name = (Hl7.Fhir.Model.CodeableConcept)Name.DeepCopy(); - if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.CodeableConcept)Substitution.DeepCopy(); - if(HalfLife != null) dest.HalfLife = (Hl7.Fhir.Model.Quantity)HalfLife.DeepCopy(); - if(MolecularWeight != null) dest.MolecularWeight = (Hl7.Fhir.Model.SubstanceSpecification.MolecularWeightComponent)MolecularWeight.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Name != null) dest.Name = (Hl7.Fhir.Model.CodeableConcept)Name.DeepCopyInternal(); + if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.CodeableConcept)Substitution.DeepCopyInternal(); + if(HalfLife != null) dest.HalfLife = (Hl7.Fhir.Model.Quantity)HalfLife.DeepCopyInternal(); + if(MolecularWeight != null) dest.MolecularWeight = (Hl7.Fhir.Model.SubstanceSpecification.MolecularWeightComponent)MolecularWeight.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IsotopeComponent()); + var instance = new IsotopeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1032,7 +1036,7 @@ public Hl7.Fhir.Model.Quantity Amount private Hl7.Fhir.Model.Quantity _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MolecularWeightComponent; @@ -1041,16 +1045,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MolecularWeightComponent()); + var instance = new MolecularWeightComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1184,7 +1189,7 @@ public Hl7.Fhir.Model.Attachment Attachment private Hl7.Fhir.Model.Attachment _Attachment; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepresentationComponent; @@ -1193,16 +1198,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(RepresentationElement != null) dest.RepresentationElement = (Hl7.Fhir.Model.FhirString)RepresentationElement.DeepCopy(); - if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(RepresentationElement != null) dest.RepresentationElement = (Hl7.Fhir.Model.FhirString)RepresentationElement.DeepCopyInternal(); + if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepresentationComponent()); + var instance = new RepresentationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1383,7 +1389,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeComponent; @@ -1392,18 +1398,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CodeComponent()); + var instance = new CodeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1685,7 +1692,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NameComponent; @@ -1694,24 +1701,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - if(Language.Any()) dest.Language = new List(Language.DeepCopy()); - if(Domain.Any()) dest.Domain = new List(Domain.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(Synonym.Any()) dest.Synonym = new List(Synonym.DeepCopy()); - if(Translation.Any()) dest.Translation = new List(Translation.DeepCopy()); - if(Official.Any()) dest.Official = new List(Official.DeepCopy()); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); + if(Language.Any()) dest.Language = new List(Language.DeepCopyInternal()); + if(Domain.Any()) dest.Domain = new List(Domain.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(Synonym.Any()) dest.Synonym = new List(Synonym.DeepCopyInternal()); + if(Translation.Any()) dest.Translation = new List(Translation.DeepCopyInternal()); + if(Official.Any()) dest.Official = new List(Official.DeepCopyInternal()); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NameComponent()); + var instance = new NameComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1909,7 +1917,7 @@ public string Date } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OfficialComponent; @@ -1918,16 +1926,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Authority != null) dest.Authority = (Hl7.Fhir.Model.CodeableConcept)Authority.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.CodeableConcept)Authority.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OfficialComponent()); + var instance = new OfficialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2121,7 +2130,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelationshipComponent; @@ -2130,20 +2139,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.DataType)Substance.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(IsDefiningElement != null) dest.IsDefiningElement = (Hl7.Fhir.Model.FhirBoolean)IsDefiningElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopy(); - if(AmountRatioLowLimit != null) dest.AmountRatioLowLimit = (Hl7.Fhir.Model.Ratio)AmountRatioLowLimit.DeepCopy(); - if(AmountType != null) dest.AmountType = (Hl7.Fhir.Model.CodeableConcept)AmountType.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.DataType)Substance.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(IsDefiningElement != null) dest.IsDefiningElement = (Hl7.Fhir.Model.FhirBoolean)IsDefiningElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopyInternal(); + if(AmountRatioLowLimit != null) dest.AmountRatioLowLimit = (Hl7.Fhir.Model.Ratio)AmountRatioLowLimit.DeepCopyInternal(); + if(AmountType != null) dest.AmountType = (Hl7.Fhir.Model.CodeableConcept)AmountType.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelationshipComponent()); + var instance = new RelationshipComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2543,7 +2553,7 @@ public Hl7.Fhir.Model.ResourceReference SourceMaterial Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceSpecification; @@ -2552,32 +2562,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(Domain != null) dest.Domain = (Hl7.Fhir.Model.CodeableConcept)Domain.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Moiety.Any()) dest.Moiety = new List(Moiety.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(ReferenceInformation != null) dest.ReferenceInformation = (Hl7.Fhir.Model.ResourceReference)ReferenceInformation.DeepCopy(); - if(Structure != null) dest.Structure = (Hl7.Fhir.Model.SubstanceSpecification.StructureComponent)Structure.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(MolecularWeight.Any()) dest.MolecularWeight = new List(MolecularWeight.DeepCopy()); - if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopy()); - if(NucleicAcid != null) dest.NucleicAcid = (Hl7.Fhir.Model.ResourceReference)NucleicAcid.DeepCopy(); - if(Polymer != null) dest.Polymer = (Hl7.Fhir.Model.ResourceReference)Polymer.DeepCopy(); - if(Protein != null) dest.Protein = (Hl7.Fhir.Model.ResourceReference)Protein.DeepCopy(); - if(SourceMaterial != null) dest.SourceMaterial = (Hl7.Fhir.Model.ResourceReference)SourceMaterial.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(Domain != null) dest.Domain = (Hl7.Fhir.Model.CodeableConcept)Domain.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Moiety.Any()) dest.Moiety = new List(Moiety.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(ReferenceInformation != null) dest.ReferenceInformation = (Hl7.Fhir.Model.ResourceReference)ReferenceInformation.DeepCopyInternal(); + if(Structure != null) dest.Structure = (Hl7.Fhir.Model.SubstanceSpecification.StructureComponent)Structure.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(MolecularWeight.Any()) dest.MolecularWeight = new List(MolecularWeight.DeepCopyInternal()); + if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopyInternal()); + if(NucleicAcid != null) dest.NucleicAcid = (Hl7.Fhir.Model.ResourceReference)NucleicAcid.DeepCopyInternal(); + if(Polymer != null) dest.Polymer = (Hl7.Fhir.Model.ResourceReference)Polymer.DeepCopyInternal(); + if(Protein != null) dest.Protein = (Hl7.Fhir.Model.ResourceReference)Protein.DeepCopyInternal(); + if(SourceMaterial != null) dest.SourceMaterial = (Hl7.Fhir.Model.ResourceReference)SourceMaterial.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceSpecification()); + var instance = new SubstanceSpecification(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/SupplyDelivery.cs b/src/Hl7.Fhir.R4/Model/Generated/SupplyDelivery.cs index e2357c8fc6..ee048f60b4 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/SupplyDelivery.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/SupplyDelivery.cs @@ -161,7 +161,7 @@ public Hl7.Fhir.Model.DataType Item private Hl7.Fhir.Model.DataType _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SuppliedItemComponent; @@ -170,15 +170,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SuppliedItemComponent()); + var instance = new SuppliedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -421,7 +422,7 @@ public List Receiver Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Type; set => Type = value; } IEnumerable ICoded.ToCodings() => Type.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplyDelivery; @@ -430,24 +431,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SuppliedItem != null) dest.SuppliedItem = (Hl7.Fhir.Model.SupplyDelivery.SuppliedItemComponent)SuppliedItem.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Supplier != null) dest.Supplier = (Hl7.Fhir.Model.ResourceReference)Supplier.DeepCopy(); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SuppliedItem != null) dest.SuppliedItem = (Hl7.Fhir.Model.SupplyDelivery.SuppliedItemComponent)SuppliedItem.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Supplier != null) dest.Supplier = (Hl7.Fhir.Model.ResourceReference)Supplier.DeepCopyInternal(); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplyDelivery()); + var instance = new SupplyDelivery(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/SupplyRequest.cs b/src/Hl7.Fhir.R4/Model/Generated/SupplyRequest.cs index 16608883a9..af64debd08 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/SupplyRequest.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/SupplyRequest.cs @@ -156,7 +156,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -165,15 +165,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -512,7 +513,7 @@ public Hl7.Fhir.Model.ResourceReference DeliverTo Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Category; set => Category = value; } IEnumerable ICoded.ToCodings() => Category.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplyRequest; @@ -521,28 +522,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(Supplier.Any()) dest.Supplier = new List(Supplier.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(DeliverFrom != null) dest.DeliverFrom = (Hl7.Fhir.Model.ResourceReference)DeliverFrom.DeepCopy(); - if(DeliverTo != null) dest.DeliverTo = (Hl7.Fhir.Model.ResourceReference)DeliverTo.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(Supplier.Any()) dest.Supplier = new List(Supplier.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(DeliverFrom != null) dest.DeliverFrom = (Hl7.Fhir.Model.ResourceReference)DeliverFrom.DeepCopyInternal(); + if(DeliverTo != null) dest.DeliverTo = (Hl7.Fhir.Model.ResourceReference)DeliverTo.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplyRequest()); + var instance = new SupplyRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Task.cs b/src/Hl7.Fhir.R4/Model/Generated/Task.cs index f4e21b863b..50729cef8f 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Task.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Task.cs @@ -278,7 +278,7 @@ public List Recipient private List _Recipient; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RestrictionComponent; @@ -287,16 +287,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RepetitionsElement != null) dest.RepetitionsElement = (Hl7.Fhir.Model.PositiveInt)RepetitionsElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RepetitionsElement != null) dest.RepetitionsElement = (Hl7.Fhir.Model.PositiveInt)RepetitionsElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RestrictionComponent()); + var instance = new RestrictionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -407,7 +408,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -416,15 +417,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -527,7 +529,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OutputComponent; @@ -536,15 +538,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OutputComponent()); + var instance = new OutputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1196,7 +1199,7 @@ public List Output Hl7.Fhir.Model.CodeableConcept ICoded.Code { get => Code; set => Code = value; } IEnumerable ICoded.ToCodings() => Code.ToCodings(); - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Task; @@ -1205,44 +1208,45 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement != null) dest.InstantiatesCanonicalElement = (Hl7.Fhir.Model.Canonical)InstantiatesCanonicalElement.DeepCopy(); - if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(BusinessStatus != null) dest.BusinessStatus = (Hl7.Fhir.Model.CodeableConcept)BusinessStatus.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopy(); - if(For != null) dest.For = (Hl7.Fhir.Model.ResourceReference)For.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(ExecutionPeriod != null) dest.ExecutionPeriod = (Hl7.Fhir.Model.Period)ExecutionPeriod.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(LastModifiedElement != null) dest.LastModifiedElement = (Hl7.Fhir.Model.FhirDateTime)LastModifiedElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopy()); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(ReasonCode != null) dest.ReasonCode = (Hl7.Fhir.Model.CodeableConcept)ReasonCode.DeepCopy(); - if(ReasonReference != null) dest.ReasonReference = (Hl7.Fhir.Model.ResourceReference)ReasonReference.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - if(Restriction != null) dest.Restriction = (Hl7.Fhir.Model.Task.RestrictionComponent)Restriction.DeepCopy(); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Output.Any()) dest.Output = new List(Output.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement != null) dest.InstantiatesCanonicalElement = (Hl7.Fhir.Model.Canonical)InstantiatesCanonicalElement.DeepCopyInternal(); + if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(BusinessStatus != null) dest.BusinessStatus = (Hl7.Fhir.Model.CodeableConcept)BusinessStatus.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopyInternal(); + if(For != null) dest.For = (Hl7.Fhir.Model.ResourceReference)For.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(ExecutionPeriod != null) dest.ExecutionPeriod = (Hl7.Fhir.Model.Period)ExecutionPeriod.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(LastModifiedElement != null) dest.LastModifiedElement = (Hl7.Fhir.Model.FhirDateTime)LastModifiedElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopyInternal()); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(ReasonCode != null) dest.ReasonCode = (Hl7.Fhir.Model.CodeableConcept)ReasonCode.DeepCopyInternal(); + if(ReasonReference != null) dest.ReasonReference = (Hl7.Fhir.Model.ResourceReference)ReasonReference.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); + if(Restriction != null) dest.Restriction = (Hl7.Fhir.Model.Task.RestrictionComponent)Restriction.DeepCopyInternal(); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Output.Any()) dest.Output = new List(Output.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Task()); + var instance = new Task(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/TerminologyCapabilities.cs b/src/Hl7.Fhir.R4/Model/Generated/TerminologyCapabilities.cs index a00d31b980..d29190b758 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/TerminologyCapabilities.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/TerminologyCapabilities.cs @@ -160,7 +160,7 @@ public string Version } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SoftwareComponent; @@ -169,15 +169,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SoftwareComponent()); + var instance = new SoftwareComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -312,7 +313,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImplementationComponent; @@ -321,15 +322,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImplementationComponent()); + var instance = new ImplementationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -478,7 +480,7 @@ public bool? Subsumption } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeSystemComponent; @@ -487,16 +489,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.Canonical)UriElement.DeepCopy(); - if(Version.Any()) dest.Version = new List(Version.DeepCopy()); - if(SubsumptionElement != null) dest.SubsumptionElement = (Hl7.Fhir.Model.FhirBoolean)SubsumptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.Canonical)UriElement.DeepCopyInternal(); + if(Version.Any()) dest.Version = new List(Version.DeepCopyInternal()); + if(SubsumptionElement != null) dest.SubsumptionElement = (Hl7.Fhir.Model.FhirBoolean)SubsumptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CodeSystemComponent()); + var instance = new CodeSystemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -748,7 +751,7 @@ public IEnumerable Property } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VersionComponent; @@ -757,19 +760,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.FhirString)CodeElement.DeepCopy(); - if(IsDefaultElement != null) dest.IsDefaultElement = (Hl7.Fhir.Model.FhirBoolean)IsDefaultElement.DeepCopy(); - if(CompositionalElement != null) dest.CompositionalElement = (Hl7.Fhir.Model.FhirBoolean)CompositionalElement.DeepCopy(); - if(LanguageElement.Any()) dest.LanguageElement = new List(LanguageElement.DeepCopy()); - if(Filter.Any()) dest.Filter = new List(Filter.DeepCopy()); - if(PropertyElement.Any()) dest.PropertyElement = new List(PropertyElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.FhirString)CodeElement.DeepCopyInternal(); + if(IsDefaultElement != null) dest.IsDefaultElement = (Hl7.Fhir.Model.FhirBoolean)IsDefaultElement.DeepCopyInternal(); + if(CompositionalElement != null) dest.CompositionalElement = (Hl7.Fhir.Model.FhirBoolean)CompositionalElement.DeepCopyInternal(); + if(LanguageElement.Any()) dest.LanguageElement = new List(LanguageElement.DeepCopyInternal()); + if(Filter.Any()) dest.Filter = new List(Filter.DeepCopyInternal()); + if(PropertyElement.Any()) dest.PropertyElement = new List(PropertyElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VersionComponent()); + var instance = new VersionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -934,7 +938,7 @@ public IEnumerable Op } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FilterComponent; @@ -943,15 +947,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(OpElement.Any()) dest.OpElement = new List(OpElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(OpElement.Any()) dest.OpElement = new List(OpElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FilterComponent()); + var instance = new FilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1158,7 +1163,7 @@ public string TextFilter } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExpansionComponent; @@ -1167,18 +1172,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(HierarchicalElement != null) dest.HierarchicalElement = (Hl7.Fhir.Model.FhirBoolean)HierarchicalElement.DeepCopy(); - if(PagingElement != null) dest.PagingElement = (Hl7.Fhir.Model.FhirBoolean)PagingElement.DeepCopy(); - if(IncompleteElement != null) dest.IncompleteElement = (Hl7.Fhir.Model.FhirBoolean)IncompleteElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(TextFilterElement != null) dest.TextFilterElement = (Hl7.Fhir.Model.Markdown)TextFilterElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(HierarchicalElement != null) dest.HierarchicalElement = (Hl7.Fhir.Model.FhirBoolean)HierarchicalElement.DeepCopyInternal(); + if(PagingElement != null) dest.PagingElement = (Hl7.Fhir.Model.FhirBoolean)PagingElement.DeepCopyInternal(); + if(IncompleteElement != null) dest.IncompleteElement = (Hl7.Fhir.Model.FhirBoolean)IncompleteElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(TextFilterElement != null) dest.TextFilterElement = (Hl7.Fhir.Model.Markdown)TextFilterElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExpansionComponent()); + var instance = new ExpansionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1334,7 +1340,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -1343,15 +1349,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1452,7 +1459,7 @@ public bool? Translations } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ValidateCodeComponent; @@ -1461,14 +1468,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TranslationsElement != null) dest.TranslationsElement = (Hl7.Fhir.Model.FhirBoolean)TranslationsElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TranslationsElement != null) dest.TranslationsElement = (Hl7.Fhir.Model.FhirBoolean)TranslationsElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ValidateCodeComponent()); + var instance = new ValidateCodeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1561,7 +1569,7 @@ public bool? NeedsMap } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TranslationComponent; @@ -1570,14 +1578,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NeedsMapElement != null) dest.NeedsMapElement = (Hl7.Fhir.Model.FhirBoolean)NeedsMapElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NeedsMapElement != null) dest.NeedsMapElement = (Hl7.Fhir.Model.FhirBoolean)NeedsMapElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TranslationComponent()); + var instance = new TranslationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1672,7 +1681,7 @@ public bool? Translation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClosureComponent; @@ -1681,14 +1690,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TranslationElement != null) dest.TranslationElement = (Hl7.Fhir.Model.FhirBoolean)TranslationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TranslationElement != null) dest.TranslationElement = (Hl7.Fhir.Model.FhirBoolean)TranslationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClosureComponent()); + var instance = new ClosureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2314,7 +2324,7 @@ public Hl7.Fhir.Model.TerminologyCapabilities.ClosureComponent Closure private Hl7.Fhir.Model.TerminologyCapabilities.ClosureComponent _Closure; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TerminologyCapabilities; @@ -2323,37 +2333,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(Software != null) dest.Software = (Hl7.Fhir.Model.TerminologyCapabilities.SoftwareComponent)Software.DeepCopy(); - if(Implementation != null) dest.Implementation = (Hl7.Fhir.Model.TerminologyCapabilities.ImplementationComponent)Implementation.DeepCopy(); - if(LockedDateElement != null) dest.LockedDateElement = (Hl7.Fhir.Model.FhirBoolean)LockedDateElement.DeepCopy(); - if(CodeSystem.Any()) dest.CodeSystem = new List(CodeSystem.DeepCopy()); - if(Expansion != null) dest.Expansion = (Hl7.Fhir.Model.TerminologyCapabilities.ExpansionComponent)Expansion.DeepCopy(); - if(CodeSearchElement != null) dest.CodeSearchElement = (Code)CodeSearchElement.DeepCopy(); - if(ValidateCode != null) dest.ValidateCode = (Hl7.Fhir.Model.TerminologyCapabilities.ValidateCodeComponent)ValidateCode.DeepCopy(); - if(Translation != null) dest.Translation = (Hl7.Fhir.Model.TerminologyCapabilities.TranslationComponent)Translation.DeepCopy(); - if(Closure != null) dest.Closure = (Hl7.Fhir.Model.TerminologyCapabilities.ClosureComponent)Closure.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(Software != null) dest.Software = (Hl7.Fhir.Model.TerminologyCapabilities.SoftwareComponent)Software.DeepCopyInternal(); + if(Implementation != null) dest.Implementation = (Hl7.Fhir.Model.TerminologyCapabilities.ImplementationComponent)Implementation.DeepCopyInternal(); + if(LockedDateElement != null) dest.LockedDateElement = (Hl7.Fhir.Model.FhirBoolean)LockedDateElement.DeepCopyInternal(); + if(CodeSystem.Any()) dest.CodeSystem = new List(CodeSystem.DeepCopyInternal()); + if(Expansion != null) dest.Expansion = (Hl7.Fhir.Model.TerminologyCapabilities.ExpansionComponent)Expansion.DeepCopyInternal(); + if(CodeSearchElement != null) dest.CodeSearchElement = (Code)CodeSearchElement.DeepCopyInternal(); + if(ValidateCode != null) dest.ValidateCode = (Hl7.Fhir.Model.TerminologyCapabilities.ValidateCodeComponent)ValidateCode.DeepCopyInternal(); + if(Translation != null) dest.Translation = (Hl7.Fhir.Model.TerminologyCapabilities.TranslationComponent)Translation.DeepCopyInternal(); + if(Closure != null) dest.Closure = (Hl7.Fhir.Model.TerminologyCapabilities.ClosureComponent)Closure.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TerminologyCapabilities()); + var instance = new TerminologyCapabilities(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/TestReport.cs b/src/Hl7.Fhir.R4/Model/Generated/TestReport.cs index abbfa6885e..cb39b7f04b 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/TestReport.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/TestReport.cs @@ -305,7 +305,7 @@ public string Display } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -314,16 +314,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -414,7 +415,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupComponent; @@ -423,14 +424,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupComponent()); + var instance = new SetupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -521,7 +523,7 @@ public Hl7.Fhir.Model.TestReport.AssertComponent Assert private Hl7.Fhir.Model.TestReport.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupActionComponent; @@ -530,15 +532,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupActionComponent()); + var instance = new SetupActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -706,7 +709,7 @@ public string Detail } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -715,16 +718,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopy(); - if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopy(); - if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirUri)DetailElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopyInternal(); + if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopyInternal(); + if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirUri)DetailElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationComponent()); + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -900,7 +904,7 @@ public string Detail } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssertComponent; @@ -909,16 +913,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopy(); - if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopy(); - if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopyInternal(); + if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopyInternal(); + if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AssertComponent()); + var instance = new AssertComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1071,7 +1076,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestComponent; @@ -1080,16 +1085,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestComponent()); + var instance = new TestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1196,7 +1202,7 @@ public Hl7.Fhir.Model.TestReport.AssertComponent Assert private Hl7.Fhir.Model.TestReport.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestActionComponent; @@ -1205,15 +1211,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestActionComponent()); + var instance = new TestActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1299,7 +1306,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownComponent; @@ -1308,14 +1315,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownComponent()); + var instance = new TeardownComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1394,7 +1402,7 @@ public Hl7.Fhir.Model.TestReport.OperationComponent Operation private Hl7.Fhir.Model.TestReport.OperationComponent _Operation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownActionComponent; @@ -1403,14 +1411,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownActionComponent()); + var instance = new TeardownActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1735,7 +1744,7 @@ public Hl7.Fhir.Model.TestReport.TeardownComponent Teardown Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestReport; @@ -1744,25 +1753,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(TestScript != null) dest.TestScript = (Hl7.Fhir.Model.ResourceReference)TestScript.DeepCopy(); - if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopy(); - if(ScoreElement != null) dest.ScoreElement = (Hl7.Fhir.Model.FhirDecimal)ScoreElement.DeepCopy(); - if(TesterElement != null) dest.TesterElement = (Hl7.Fhir.Model.FhirString)TesterElement.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestReport.SetupComponent)Setup.DeepCopy(); - if(Test.Any()) dest.Test = new List(Test.DeepCopy()); - if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestReport.TeardownComponent)Teardown.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(TestScript != null) dest.TestScript = (Hl7.Fhir.Model.ResourceReference)TestScript.DeepCopyInternal(); + if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopyInternal(); + if(ScoreElement != null) dest.ScoreElement = (Hl7.Fhir.Model.FhirDecimal)ScoreElement.DeepCopyInternal(); + if(TesterElement != null) dest.TesterElement = (Hl7.Fhir.Model.FhirString)TesterElement.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestReport.SetupComponent)Setup.DeepCopyInternal(); + if(Test.Any()) dest.Test = new List(Test.DeepCopyInternal()); + if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestReport.TeardownComponent)Teardown.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestReport()); + var instance = new TestReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/TestScript.cs b/src/Hl7.Fhir.R4/Model/Generated/TestScript.cs index 7566d99aae..ad7fed3746 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/TestScript.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/TestScript.cs @@ -355,7 +355,7 @@ public Hl7.Fhir.Model.Coding Profile private Hl7.Fhir.Model.Coding _Profile; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OriginComponent; @@ -364,15 +364,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OriginComponent()); + var instance = new OriginComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -492,7 +493,7 @@ public Hl7.Fhir.Model.Coding Profile private Hl7.Fhir.Model.Coding _Profile; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DestinationComponent; @@ -501,15 +502,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DestinationComponent()); + var instance = new DestinationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -609,7 +611,7 @@ public List Capability private List _Capability; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MetadataComponent; @@ -618,15 +620,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - if(Capability.Any()) dest.Capability = new List(Capability.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); + if(Capability.Any()) dest.Capability = new List(Capability.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MetadataComponent()); + var instance = new MetadataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -761,7 +764,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -770,15 +773,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1073,7 +1077,7 @@ public string Capabilities } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CapabilityComponent; @@ -1082,20 +1086,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopy(); - if(ValidatedElement != null) dest.ValidatedElement = (Hl7.Fhir.Model.FhirBoolean)ValidatedElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(OriginElement.Any()) dest.OriginElement = new List(OriginElement.DeepCopy()); - if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopy(); - if(LinkElement.Any()) dest.LinkElement = new List(LinkElement.DeepCopy()); - if(CapabilitiesElement != null) dest.CapabilitiesElement = (Hl7.Fhir.Model.Canonical)CapabilitiesElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopyInternal(); + if(ValidatedElement != null) dest.ValidatedElement = (Hl7.Fhir.Model.FhirBoolean)ValidatedElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(OriginElement.Any()) dest.OriginElement = new List(OriginElement.DeepCopyInternal()); + if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopyInternal(); + if(LinkElement.Any()) dest.LinkElement = new List(LinkElement.DeepCopyInternal()); + if(CapabilitiesElement != null) dest.CapabilitiesElement = (Hl7.Fhir.Model.Canonical)CapabilitiesElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CapabilityComponent()); + var instance = new CapabilityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1286,7 +1291,7 @@ public Hl7.Fhir.Model.ResourceReference Resource private Hl7.Fhir.Model.ResourceReference _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FixtureComponent; @@ -1295,16 +1300,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AutocreateElement != null) dest.AutocreateElement = (Hl7.Fhir.Model.FhirBoolean)AutocreateElement.DeepCopy(); - if(AutodeleteElement != null) dest.AutodeleteElement = (Hl7.Fhir.Model.FhirBoolean)AutodeleteElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AutocreateElement != null) dest.AutocreateElement = (Hl7.Fhir.Model.FhirBoolean)AutocreateElement.DeepCopyInternal(); + if(AutodeleteElement != null) dest.AutodeleteElement = (Hl7.Fhir.Model.FhirBoolean)AutodeleteElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FixtureComponent()); + var instance = new FixtureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1634,7 +1640,7 @@ public string SourceId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VariableComponent; @@ -1643,21 +1649,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DefaultValueElement != null) dest.DefaultValueElement = (Hl7.Fhir.Model.FhirString)DefaultValueElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopy(); - if(HintElement != null) dest.HintElement = (Hl7.Fhir.Model.FhirString)HintElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DefaultValueElement != null) dest.DefaultValueElement = (Hl7.Fhir.Model.FhirString)DefaultValueElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopyInternal(); + if(HintElement != null) dest.HintElement = (Hl7.Fhir.Model.FhirString)HintElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VariableComponent()); + var instance = new VariableComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1788,7 +1795,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupComponent; @@ -1797,14 +1804,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupComponent()); + var instance = new SetupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1895,7 +1903,7 @@ public Hl7.Fhir.Model.TestScript.AssertComponent Assert private Hl7.Fhir.Model.TestScript.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupActionComponent; @@ -1904,15 +1912,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupActionComponent()); + var instance = new SetupActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2484,7 +2493,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -2493,30 +2502,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Code)ResourceElement.DeepCopy(); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(AcceptElement != null) dest.AcceptElement = (Hl7.Fhir.Model.Code)AcceptElement.DeepCopy(); - if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopy(); - if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopy(); - if(EncodeRequestUrlElement != null) dest.EncodeRequestUrlElement = (Hl7.Fhir.Model.FhirBoolean)EncodeRequestUrlElement.DeepCopy(); - if(MethodElement != null) dest.MethodElement = (Code)MethodElement.DeepCopy(); - if(OriginElement != null) dest.OriginElement = (Hl7.Fhir.Model.Integer)OriginElement.DeepCopy(); - if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopy(); - if(RequestHeader.Any()) dest.RequestHeader = new List(RequestHeader.DeepCopy()); - if(RequestIdElement != null) dest.RequestIdElement = (Hl7.Fhir.Model.Id)RequestIdElement.DeepCopy(); - if(ResponseIdElement != null) dest.ResponseIdElement = (Hl7.Fhir.Model.Id)ResponseIdElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopy(); - if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirString)UrlElement.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new OperationComponent()); + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Code)ResourceElement.DeepCopyInternal(); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(AcceptElement != null) dest.AcceptElement = (Hl7.Fhir.Model.Code)AcceptElement.DeepCopyInternal(); + if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopyInternal(); + if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopyInternal(); + if(EncodeRequestUrlElement != null) dest.EncodeRequestUrlElement = (Hl7.Fhir.Model.FhirBoolean)EncodeRequestUrlElement.DeepCopyInternal(); + if(MethodElement != null) dest.MethodElement = (Code)MethodElement.DeepCopyInternal(); + if(OriginElement != null) dest.OriginElement = (Hl7.Fhir.Model.Integer)OriginElement.DeepCopyInternal(); + if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopyInternal(); + if(RequestHeader.Any()) dest.RequestHeader = new List(RequestHeader.DeepCopyInternal()); + if(RequestIdElement != null) dest.RequestIdElement = (Hl7.Fhir.Model.Id)RequestIdElement.DeepCopyInternal(); + if(ResponseIdElement != null) dest.ResponseIdElement = (Hl7.Fhir.Model.Id)ResponseIdElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopyInternal(); + if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirString)UrlElement.DeepCopyInternal(); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2773,7 +2783,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequestHeaderComponent; @@ -2782,15 +2792,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(FieldElement != null) dest.FieldElement = (Hl7.Fhir.Model.FhirString)FieldElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(FieldElement != null) dest.FieldElement = (Hl7.Fhir.Model.FhirString)FieldElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequestHeaderComponent()); + var instance = new RequestHeaderComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3557,7 +3568,7 @@ public bool? WarningOnly } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssertComponent; @@ -3566,35 +3577,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopy(); - if(CompareToSourceIdElement != null) dest.CompareToSourceIdElement = (Hl7.Fhir.Model.FhirString)CompareToSourceIdElement.DeepCopy(); - if(CompareToSourceExpressionElement != null) dest.CompareToSourceExpressionElement = (Hl7.Fhir.Model.FhirString)CompareToSourceExpressionElement.DeepCopy(); - if(CompareToSourcePathElement != null) dest.CompareToSourcePathElement = (Hl7.Fhir.Model.FhirString)CompareToSourcePathElement.DeepCopy(); - if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopy(); - if(MinimumIdElement != null) dest.MinimumIdElement = (Hl7.Fhir.Model.FhirString)MinimumIdElement.DeepCopy(); - if(NavigationLinksElement != null) dest.NavigationLinksElement = (Hl7.Fhir.Model.FhirBoolean)NavigationLinksElement.DeepCopy(); - if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(RequestMethodElement != null) dest.RequestMethodElement = (Code)RequestMethodElement.DeepCopy(); - if(RequestURLElement != null) dest.RequestURLElement = (Hl7.Fhir.Model.FhirString)RequestURLElement.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Code)ResourceElement.DeepCopy(); - if(ResponseElement != null) dest.ResponseElement = (Code)ResponseElement.DeepCopy(); - if(ResponseCodeElement != null) dest.ResponseCodeElement = (Hl7.Fhir.Model.FhirString)ResponseCodeElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopy(); - if(ValidateProfileIdElement != null) dest.ValidateProfileIdElement = (Hl7.Fhir.Model.Id)ValidateProfileIdElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(WarningOnlyElement != null) dest.WarningOnlyElement = (Hl7.Fhir.Model.FhirBoolean)WarningOnlyElement.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new AssertComponent()); + base.CopyToInternal(dest); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopyInternal(); + if(CompareToSourceIdElement != null) dest.CompareToSourceIdElement = (Hl7.Fhir.Model.FhirString)CompareToSourceIdElement.DeepCopyInternal(); + if(CompareToSourceExpressionElement != null) dest.CompareToSourceExpressionElement = (Hl7.Fhir.Model.FhirString)CompareToSourceExpressionElement.DeepCopyInternal(); + if(CompareToSourcePathElement != null) dest.CompareToSourcePathElement = (Hl7.Fhir.Model.FhirString)CompareToSourcePathElement.DeepCopyInternal(); + if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopyInternal(); + if(MinimumIdElement != null) dest.MinimumIdElement = (Hl7.Fhir.Model.FhirString)MinimumIdElement.DeepCopyInternal(); + if(NavigationLinksElement != null) dest.NavigationLinksElement = (Hl7.Fhir.Model.FhirBoolean)NavigationLinksElement.DeepCopyInternal(); + if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(RequestMethodElement != null) dest.RequestMethodElement = (Code)RequestMethodElement.DeepCopyInternal(); + if(RequestURLElement != null) dest.RequestURLElement = (Hl7.Fhir.Model.FhirString)RequestURLElement.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Code)ResourceElement.DeepCopyInternal(); + if(ResponseElement != null) dest.ResponseElement = (Code)ResponseElement.DeepCopyInternal(); + if(ResponseCodeElement != null) dest.ResponseCodeElement = (Hl7.Fhir.Model.FhirString)ResponseCodeElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopyInternal(); + if(ValidateProfileIdElement != null) dest.ValidateProfileIdElement = (Hl7.Fhir.Model.Id)ValidateProfileIdElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(WarningOnlyElement != null) dest.WarningOnlyElement = (Hl7.Fhir.Model.FhirBoolean)WarningOnlyElement.DeepCopyInternal(); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new AssertComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3899,7 +3911,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestComponent; @@ -3908,16 +3920,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestComponent()); + var instance = new TestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4024,7 +4037,7 @@ public Hl7.Fhir.Model.TestScript.AssertComponent Assert private Hl7.Fhir.Model.TestScript.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestActionComponent; @@ -4033,15 +4046,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestActionComponent()); + var instance = new TestActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4127,7 +4141,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownComponent; @@ -4136,14 +4150,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownComponent()); + var instance = new TeardownComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4222,7 +4237,7 @@ public Hl7.Fhir.Model.TestScript.OperationComponent Operation private Hl7.Fhir.Model.TestScript.OperationComponent _Operation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownActionComponent; @@ -4231,14 +4246,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownActionComponent()); + var instance = new TeardownActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4815,7 +4831,7 @@ public Hl7.Fhir.Model.TestScript.TeardownComponent Teardown Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestScript; @@ -4824,37 +4840,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(Origin.Any()) dest.Origin = new List(Origin.DeepCopy()); - if(Destination.Any()) dest.Destination = new List(Destination.DeepCopy()); - if(Metadata != null) dest.Metadata = (Hl7.Fhir.Model.TestScript.MetadataComponent)Metadata.DeepCopy(); - if(Fixture.Any()) dest.Fixture = new List(Fixture.DeepCopy()); - if(Profile.Any()) dest.Profile = new List(Profile.DeepCopy()); - if(Variable.Any()) dest.Variable = new List(Variable.DeepCopy()); - if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestScript.SetupComponent)Setup.DeepCopy(); - if(Test.Any()) dest.Test = new List(Test.DeepCopy()); - if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestScript.TeardownComponent)Teardown.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(Origin.Any()) dest.Origin = new List(Origin.DeepCopyInternal()); + if(Destination.Any()) dest.Destination = new List(Destination.DeepCopyInternal()); + if(Metadata != null) dest.Metadata = (Hl7.Fhir.Model.TestScript.MetadataComponent)Metadata.DeepCopyInternal(); + if(Fixture.Any()) dest.Fixture = new List(Fixture.DeepCopyInternal()); + if(Profile.Any()) dest.Profile = new List(Profile.DeepCopyInternal()); + if(Variable.Any()) dest.Variable = new List(Variable.DeepCopyInternal()); + if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestScript.SetupComponent)Setup.DeepCopyInternal(); + if(Test.Any()) dest.Test = new List(Test.DeepCopyInternal()); + if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestScript.TeardownComponent)Teardown.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestScript()); + var instance = new TestScript(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/Timing.cs b/src/Hl7.Fhir.R4/Model/Generated/Timing.cs index 593afd89cf..c005394a4b 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/Timing.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/Timing.cs @@ -759,7 +759,7 @@ public int? Offset } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepeatComponent; @@ -768,28 +768,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Bounds != null) dest.Bounds = (Hl7.Fhir.Model.DataType)Bounds.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.PositiveInt)CountElement.DeepCopy(); - if(CountMaxElement != null) dest.CountMaxElement = (Hl7.Fhir.Model.PositiveInt)CountMaxElement.DeepCopy(); - if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopy(); - if(DurationMaxElement != null) dest.DurationMaxElement = (Hl7.Fhir.Model.FhirDecimal)DurationMaxElement.DeepCopy(); - if(DurationUnitElement != null) dest.DurationUnitElement = (Code)DurationUnitElement.DeepCopy(); - if(FrequencyElement != null) dest.FrequencyElement = (Hl7.Fhir.Model.PositiveInt)FrequencyElement.DeepCopy(); - if(FrequencyMaxElement != null) dest.FrequencyMaxElement = (Hl7.Fhir.Model.PositiveInt)FrequencyMaxElement.DeepCopy(); - if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopy(); - if(PeriodMaxElement != null) dest.PeriodMaxElement = (Hl7.Fhir.Model.FhirDecimal)PeriodMaxElement.DeepCopy(); - if(PeriodUnitElement != null) dest.PeriodUnitElement = (Code)PeriodUnitElement.DeepCopy(); - if(DayOfWeekElement.Any()) dest.DayOfWeekElement = new List>(DayOfWeekElement.DeepCopy()); - if(TimeOfDayElement.Any()) dest.TimeOfDayElement = new List(TimeOfDayElement.DeepCopy()); - if(WhenElement.Any()) dest.WhenElement = new List>(WhenElement.DeepCopy()); - if(OffsetElement != null) dest.OffsetElement = (Hl7.Fhir.Model.UnsignedInt)OffsetElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Bounds != null) dest.Bounds = (Hl7.Fhir.Model.DataType)Bounds.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.PositiveInt)CountElement.DeepCopyInternal(); + if(CountMaxElement != null) dest.CountMaxElement = (Hl7.Fhir.Model.PositiveInt)CountMaxElement.DeepCopyInternal(); + if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopyInternal(); + if(DurationMaxElement != null) dest.DurationMaxElement = (Hl7.Fhir.Model.FhirDecimal)DurationMaxElement.DeepCopyInternal(); + if(DurationUnitElement != null) dest.DurationUnitElement = (Code)DurationUnitElement.DeepCopyInternal(); + if(FrequencyElement != null) dest.FrequencyElement = (Hl7.Fhir.Model.PositiveInt)FrequencyElement.DeepCopyInternal(); + if(FrequencyMaxElement != null) dest.FrequencyMaxElement = (Hl7.Fhir.Model.PositiveInt)FrequencyMaxElement.DeepCopyInternal(); + if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopyInternal(); + if(PeriodMaxElement != null) dest.PeriodMaxElement = (Hl7.Fhir.Model.FhirDecimal)PeriodMaxElement.DeepCopyInternal(); + if(PeriodUnitElement != null) dest.PeriodUnitElement = (Code)PeriodUnitElement.DeepCopyInternal(); + if(DayOfWeekElement.Any()) dest.DayOfWeekElement = new List>(DayOfWeekElement.DeepCopyInternal()); + if(TimeOfDayElement.Any()) dest.TimeOfDayElement = new List(TimeOfDayElement.DeepCopyInternal()); + if(WhenElement.Any()) dest.WhenElement = new List>(WhenElement.DeepCopyInternal()); + if(OffsetElement != null) dest.OffsetElement = (Hl7.Fhir.Model.UnsignedInt)OffsetElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepeatComponent()); + var instance = new RepeatComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1008,7 +1009,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Timing; @@ -1017,16 +1018,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(EventElement.Any()) dest.EventElement = new List(EventElement.DeepCopy()); - if(Repeat != null) dest.Repeat = (Hl7.Fhir.Model.Timing.RepeatComponent)Repeat.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(EventElement.Any()) dest.EventElement = new List(EventElement.DeepCopyInternal()); + if(Repeat != null) dest.Repeat = (Hl7.Fhir.Model.Timing.RepeatComponent)Repeat.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Timing()); + var instance = new Timing(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/TriggerDefinition.cs b/src/Hl7.Fhir.R4/Model/Generated/TriggerDefinition.cs index 48f0f7869f..76d20d0121 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/TriggerDefinition.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/TriggerDefinition.cs @@ -226,7 +226,7 @@ public Hl7.Fhir.Model.Expression Condition private Hl7.Fhir.Model.Expression _Condition; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TriggerDefinition; @@ -235,18 +235,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Data.Any()) dest.Data = new List(Data.DeepCopy()); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.Expression)Condition.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Data.Any()) dest.Data = new List(Data.DeepCopyInternal()); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.Expression)Condition.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TriggerDefinition()); + var instance = new TriggerDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/VerificationResult.cs b/src/Hl7.Fhir.R4/Model/Generated/VerificationResult.cs index 3367c4b2d7..cad587ef72 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/VerificationResult.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/VerificationResult.cs @@ -234,7 +234,7 @@ public List PushTypeAvailable private List _PushTypeAvailable; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PrimarySourceComponent; @@ -243,20 +243,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(CommunicationMethod.Any()) dest.CommunicationMethod = new List(CommunicationMethod.DeepCopy()); - if(ValidationStatus != null) dest.ValidationStatus = (Hl7.Fhir.Model.CodeableConcept)ValidationStatus.DeepCopy(); - if(ValidationDateElement != null) dest.ValidationDateElement = (Hl7.Fhir.Model.FhirDateTime)ValidationDateElement.DeepCopy(); - if(CanPushUpdates != null) dest.CanPushUpdates = (Hl7.Fhir.Model.CodeableConcept)CanPushUpdates.DeepCopy(); - if(PushTypeAvailable.Any()) dest.PushTypeAvailable = new List(PushTypeAvailable.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(CommunicationMethod.Any()) dest.CommunicationMethod = new List(CommunicationMethod.DeepCopyInternal()); + if(ValidationStatus != null) dest.ValidationStatus = (Hl7.Fhir.Model.CodeableConcept)ValidationStatus.DeepCopyInternal(); + if(ValidationDateElement != null) dest.ValidationDateElement = (Hl7.Fhir.Model.FhirDateTime)ValidationDateElement.DeepCopyInternal(); + if(CanPushUpdates != null) dest.CanPushUpdates = (Hl7.Fhir.Model.CodeableConcept)CanPushUpdates.DeepCopyInternal(); + if(PushTypeAvailable.Any()) dest.PushTypeAvailable = new List(PushTypeAvailable.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PrimarySourceComponent()); + var instance = new PrimarySourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -528,7 +529,7 @@ public Hl7.Fhir.Model.Signature SourceSignature private Hl7.Fhir.Model.Signature _SourceSignature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AttestationComponent; @@ -537,21 +538,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - if(CommunicationMethod != null) dest.CommunicationMethod = (Hl7.Fhir.Model.CodeableConcept)CommunicationMethod.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(SourceIdentityCertificateElement != null) dest.SourceIdentityCertificateElement = (Hl7.Fhir.Model.FhirString)SourceIdentityCertificateElement.DeepCopy(); - if(ProxyIdentityCertificateElement != null) dest.ProxyIdentityCertificateElement = (Hl7.Fhir.Model.FhirString)ProxyIdentityCertificateElement.DeepCopy(); - if(ProxySignature != null) dest.ProxySignature = (Hl7.Fhir.Model.Signature)ProxySignature.DeepCopy(); - if(SourceSignature != null) dest.SourceSignature = (Hl7.Fhir.Model.Signature)SourceSignature.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); + if(CommunicationMethod != null) dest.CommunicationMethod = (Hl7.Fhir.Model.CodeableConcept)CommunicationMethod.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(SourceIdentityCertificateElement != null) dest.SourceIdentityCertificateElement = (Hl7.Fhir.Model.FhirString)SourceIdentityCertificateElement.DeepCopyInternal(); + if(ProxyIdentityCertificateElement != null) dest.ProxyIdentityCertificateElement = (Hl7.Fhir.Model.FhirString)ProxyIdentityCertificateElement.DeepCopyInternal(); + if(ProxySignature != null) dest.ProxySignature = (Hl7.Fhir.Model.Signature)ProxySignature.DeepCopyInternal(); + if(SourceSignature != null) dest.SourceSignature = (Hl7.Fhir.Model.Signature)SourceSignature.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AttestationComponent()); + var instance = new AttestationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -728,7 +730,7 @@ public Hl7.Fhir.Model.Signature AttestationSignature private Hl7.Fhir.Model.Signature _AttestationSignature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ValidatorComponent; @@ -737,16 +739,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(IdentityCertificateElement != null) dest.IdentityCertificateElement = (Hl7.Fhir.Model.FhirString)IdentityCertificateElement.DeepCopy(); - if(AttestationSignature != null) dest.AttestationSignature = (Hl7.Fhir.Model.Signature)AttestationSignature.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(IdentityCertificateElement != null) dest.IdentityCertificateElement = (Hl7.Fhir.Model.FhirString)IdentityCertificateElement.DeepCopyInternal(); + if(AttestationSignature != null) dest.AttestationSignature = (Hl7.Fhir.Model.Signature)AttestationSignature.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ValidatorComponent()); + var instance = new ValidatorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1096,7 +1099,7 @@ public List Validator private List _Validator; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VerificationResult; @@ -1105,27 +1108,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(TargetLocationElement.Any()) dest.TargetLocationElement = new List(TargetLocationElement.DeepCopy()); - if(Need != null) dest.Need = (Hl7.Fhir.Model.CodeableConcept)Need.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopy(); - if(ValidationType != null) dest.ValidationType = (Hl7.Fhir.Model.CodeableConcept)ValidationType.DeepCopy(); - if(ValidationProcess.Any()) dest.ValidationProcess = new List(ValidationProcess.DeepCopy()); - if(Frequency != null) dest.Frequency = (Hl7.Fhir.Model.Timing)Frequency.DeepCopy(); - if(LastPerformedElement != null) dest.LastPerformedElement = (Hl7.Fhir.Model.FhirDateTime)LastPerformedElement.DeepCopy(); - if(NextScheduledElement != null) dest.NextScheduledElement = (Hl7.Fhir.Model.Date)NextScheduledElement.DeepCopy(); - if(FailureAction != null) dest.FailureAction = (Hl7.Fhir.Model.CodeableConcept)FailureAction.DeepCopy(); - if(PrimarySource.Any()) dest.PrimarySource = new List(PrimarySource.DeepCopy()); - if(Attestation != null) dest.Attestation = (Hl7.Fhir.Model.VerificationResult.AttestationComponent)Attestation.DeepCopy(); - if(Validator.Any()) dest.Validator = new List(Validator.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(TargetLocationElement.Any()) dest.TargetLocationElement = new List(TargetLocationElement.DeepCopyInternal()); + if(Need != null) dest.Need = (Hl7.Fhir.Model.CodeableConcept)Need.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopyInternal(); + if(ValidationType != null) dest.ValidationType = (Hl7.Fhir.Model.CodeableConcept)ValidationType.DeepCopyInternal(); + if(ValidationProcess.Any()) dest.ValidationProcess = new List(ValidationProcess.DeepCopyInternal()); + if(Frequency != null) dest.Frequency = (Hl7.Fhir.Model.Timing)Frequency.DeepCopyInternal(); + if(LastPerformedElement != null) dest.LastPerformedElement = (Hl7.Fhir.Model.FhirDateTime)LastPerformedElement.DeepCopyInternal(); + if(NextScheduledElement != null) dest.NextScheduledElement = (Hl7.Fhir.Model.Date)NextScheduledElement.DeepCopyInternal(); + if(FailureAction != null) dest.FailureAction = (Hl7.Fhir.Model.CodeableConcept)FailureAction.DeepCopyInternal(); + if(PrimarySource.Any()) dest.PrimarySource = new List(PrimarySource.DeepCopyInternal()); + if(Attestation != null) dest.Attestation = (Hl7.Fhir.Model.VerificationResult.AttestationComponent)Attestation.DeepCopyInternal(); + if(Validator.Any()) dest.Validator = new List(Validator.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VerificationResult()); + var instance = new VerificationResult(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4/Model/Generated/VisionPrescription.cs b/src/Hl7.Fhir.R4/Model/Generated/VisionPrescription.cs index 9473b498ae..daea37968d 100644 --- a/src/Hl7.Fhir.R4/Model/Generated/VisionPrescription.cs +++ b/src/Hl7.Fhir.R4/Model/Generated/VisionPrescription.cs @@ -500,7 +500,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LensSpecificationComponent; @@ -509,27 +509,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Product != null) dest.Product = (Hl7.Fhir.Model.CodeableConcept)Product.DeepCopy(); - if(EyeElement != null) dest.EyeElement = (Code)EyeElement.DeepCopy(); - if(SphereElement != null) dest.SphereElement = (Hl7.Fhir.Model.FhirDecimal)SphereElement.DeepCopy(); - if(CylinderElement != null) dest.CylinderElement = (Hl7.Fhir.Model.FhirDecimal)CylinderElement.DeepCopy(); - if(AxisElement != null) dest.AxisElement = (Hl7.Fhir.Model.Integer)AxisElement.DeepCopy(); - if(Prism.Any()) dest.Prism = new List(Prism.DeepCopy()); - if(AddElement != null) dest.AddElement = (Hl7.Fhir.Model.FhirDecimal)AddElement.DeepCopy(); - if(PowerElement != null) dest.PowerElement = (Hl7.Fhir.Model.FhirDecimal)PowerElement.DeepCopy(); - if(BackCurveElement != null) dest.BackCurveElement = (Hl7.Fhir.Model.FhirDecimal)BackCurveElement.DeepCopy(); - if(DiameterElement != null) dest.DiameterElement = (Hl7.Fhir.Model.FhirDecimal)DiameterElement.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Quantity)Duration.DeepCopy(); - if(ColorElement != null) dest.ColorElement = (Hl7.Fhir.Model.FhirString)ColorElement.DeepCopy(); - if(BrandElement != null) dest.BrandElement = (Hl7.Fhir.Model.FhirString)BrandElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Product != null) dest.Product = (Hl7.Fhir.Model.CodeableConcept)Product.DeepCopyInternal(); + if(EyeElement != null) dest.EyeElement = (Code)EyeElement.DeepCopyInternal(); + if(SphereElement != null) dest.SphereElement = (Hl7.Fhir.Model.FhirDecimal)SphereElement.DeepCopyInternal(); + if(CylinderElement != null) dest.CylinderElement = (Hl7.Fhir.Model.FhirDecimal)CylinderElement.DeepCopyInternal(); + if(AxisElement != null) dest.AxisElement = (Hl7.Fhir.Model.Integer)AxisElement.DeepCopyInternal(); + if(Prism.Any()) dest.Prism = new List(Prism.DeepCopyInternal()); + if(AddElement != null) dest.AddElement = (Hl7.Fhir.Model.FhirDecimal)AddElement.DeepCopyInternal(); + if(PowerElement != null) dest.PowerElement = (Hl7.Fhir.Model.FhirDecimal)PowerElement.DeepCopyInternal(); + if(BackCurveElement != null) dest.BackCurveElement = (Hl7.Fhir.Model.FhirDecimal)BackCurveElement.DeepCopyInternal(); + if(DiameterElement != null) dest.DiameterElement = (Hl7.Fhir.Model.FhirDecimal)DiameterElement.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Quantity)Duration.DeepCopyInternal(); + if(ColorElement != null) dest.ColorElement = (Hl7.Fhir.Model.FhirString)ColorElement.DeepCopyInternal(); + if(BrandElement != null) dest.BrandElement = (Hl7.Fhir.Model.FhirString)BrandElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LensSpecificationComponent()); + var instance = new LensSpecificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -763,7 +764,7 @@ public Hl7.Fhir.Model.VisionPrescription.VisionBase? Base } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PrismComponent; @@ -772,15 +773,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AmountElement != null) dest.AmountElement = (Hl7.Fhir.Model.FhirDecimal)AmountElement.DeepCopy(); - if(BaseElement != null) dest.BaseElement = (Code)BaseElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AmountElement != null) dest.AmountElement = (Hl7.Fhir.Model.FhirDecimal)AmountElement.DeepCopyInternal(); + if(BaseElement != null) dest.BaseElement = (Code)BaseElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PrismComponent()); + var instance = new PrismComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1011,7 +1013,7 @@ public List LensSp List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VisionPrescription; @@ -1020,21 +1022,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateWrittenElement != null) dest.DateWrittenElement = (Hl7.Fhir.Model.FhirDateTime)DateWrittenElement.DeepCopy(); - if(Prescriber != null) dest.Prescriber = (Hl7.Fhir.Model.ResourceReference)Prescriber.DeepCopy(); - if(LensSpecification.Any()) dest.LensSpecification = new List(LensSpecification.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateWrittenElement != null) dest.DateWrittenElement = (Hl7.Fhir.Model.FhirDateTime)DateWrittenElement.DeepCopyInternal(); + if(Prescriber != null) dest.Prescriber = (Hl7.Fhir.Model.ResourceReference)Prescriber.DeepCopyInternal(); + if(LensSpecification.Any()) dest.LensSpecification = new List(LensSpecification.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VisionPrescription()); + var instance = new VisionPrescription(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Account.cs b/src/Hl7.Fhir.R4B/Model/Generated/Account.cs index 31a3e9484d..31e373c463 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Account.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Account.cs @@ -164,7 +164,7 @@ public int? Priority } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageComponent; @@ -173,15 +173,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.PositiveInt)PriorityElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.PositiveInt)PriorityElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageComponent()); + var instance = new CoverageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -313,7 +314,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GuarantorComponent; @@ -322,16 +323,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - if(OnHoldElement != null) dest.OnHoldElement = (Hl7.Fhir.Model.FhirBoolean)OnHoldElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); + if(OnHoldElement != null) dest.OnHoldElement = (Hl7.Fhir.Model.FhirBoolean)OnHoldElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GuarantorComponent()); + var instance = new GuarantorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -608,7 +610,7 @@ public Hl7.Fhir.Model.ResourceReference PartOf List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Account; @@ -617,24 +619,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(ServicePeriod != null) dest.ServicePeriod = (Hl7.Fhir.Model.Period)ServicePeriod.DeepCopy(); - if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopy()); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Guarantor.Any()) dest.Guarantor = new List(Guarantor.DeepCopy()); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(ServicePeriod != null) dest.ServicePeriod = (Hl7.Fhir.Model.Period)ServicePeriod.DeepCopyInternal(); + if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopyInternal()); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Guarantor.Any()) dest.Guarantor = new List(Guarantor.DeepCopyInternal()); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Account()); + var instance = new Account(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ActivityDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/ActivityDefinition.cs index b10a8cdd54..5878af21c1 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ActivityDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ActivityDefinition.cs @@ -223,7 +223,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -232,15 +232,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -359,7 +360,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DynamicValueComponent; @@ -368,15 +369,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DynamicValueComponent()); + var instance = new DynamicValueComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1477,7 +1479,7 @@ public List DynamicValu List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActivityDefinition; @@ -1486,59 +1488,60 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(SpecimenRequirement.Any()) dest.SpecimenRequirement = new List(SpecimenRequirement.DeepCopy()); - if(ObservationRequirement.Any()) dest.ObservationRequirement = new List(ObservationRequirement.DeepCopy()); - if(ObservationResultRequirement.Any()) dest.ObservationResultRequirement = new List(ObservationResultRequirement.DeepCopy()); - if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopy(); - if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActivityDefinition()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(SpecimenRequirement.Any()) dest.SpecimenRequirement = new List(SpecimenRequirement.DeepCopyInternal()); + if(ObservationRequirement.Any()) dest.ObservationRequirement = new List(ObservationRequirement.DeepCopyInternal()); + if(ObservationResultRequirement.Any()) dest.ObservationResultRequirement = new List(ObservationResultRequirement.DeepCopyInternal()); + if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopyInternal(); + if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActivityDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Address.cs b/src/Hl7.Fhir.R4B/Model/Generated/Address.cs index 9ee85071d3..f122e6221a 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Address.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Address.cs @@ -425,7 +425,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Address; @@ -434,23 +434,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(LineElement.Any()) dest.LineElement = new List(LineElement.DeepCopy()); - if(CityElement != null) dest.CityElement = (Hl7.Fhir.Model.FhirString)CityElement.DeepCopy(); - if(DistrictElement != null) dest.DistrictElement = (Hl7.Fhir.Model.FhirString)DistrictElement.DeepCopy(); - if(StateElement != null) dest.StateElement = (Hl7.Fhir.Model.FhirString)StateElement.DeepCopy(); - if(PostalCodeElement != null) dest.PostalCodeElement = (Hl7.Fhir.Model.FhirString)PostalCodeElement.DeepCopy(); - if(CountryElement != null) dest.CountryElement = (Hl7.Fhir.Model.FhirString)CountryElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(LineElement.Any()) dest.LineElement = new List(LineElement.DeepCopyInternal()); + if(CityElement != null) dest.CityElement = (Hl7.Fhir.Model.FhirString)CityElement.DeepCopyInternal(); + if(DistrictElement != null) dest.DistrictElement = (Hl7.Fhir.Model.FhirString)DistrictElement.DeepCopyInternal(); + if(StateElement != null) dest.StateElement = (Hl7.Fhir.Model.FhirString)StateElement.DeepCopyInternal(); + if(PostalCodeElement != null) dest.PostalCodeElement = (Hl7.Fhir.Model.FhirString)PostalCodeElement.DeepCopyInternal(); + if(CountryElement != null) dest.CountryElement = (Hl7.Fhir.Model.FhirString)CountryElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Address()); + var instance = new Address(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/AdministrableProductDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/AdministrableProductDefinition.cs index 2332f845e7..9b7c93d9e5 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/AdministrableProductDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/AdministrableProductDefinition.cs @@ -116,7 +116,7 @@ public Hl7.Fhir.Model.CodeableConcept Status private Hl7.Fhir.Model.CodeableConcept _Status; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -125,16 +125,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -308,7 +309,7 @@ public List _TargetSpecies; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RouteOfAdministrationComponent; @@ -317,20 +318,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(FirstDose != null) dest.FirstDose = (Hl7.Fhir.Model.Quantity)FirstDose.DeepCopy(); - if(MaxSingleDose != null) dest.MaxSingleDose = (Hl7.Fhir.Model.Quantity)MaxSingleDose.DeepCopy(); - if(MaxDosePerDay != null) dest.MaxDosePerDay = (Hl7.Fhir.Model.Quantity)MaxDosePerDay.DeepCopy(); - if(MaxDosePerTreatmentPeriod != null) dest.MaxDosePerTreatmentPeriod = (Hl7.Fhir.Model.Ratio)MaxDosePerTreatmentPeriod.DeepCopy(); - if(MaxTreatmentPeriod != null) dest.MaxTreatmentPeriod = (Hl7.Fhir.Model.Duration)MaxTreatmentPeriod.DeepCopy(); - if(TargetSpecies.Any()) dest.TargetSpecies = new List(TargetSpecies.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(FirstDose != null) dest.FirstDose = (Hl7.Fhir.Model.Quantity)FirstDose.DeepCopyInternal(); + if(MaxSingleDose != null) dest.MaxSingleDose = (Hl7.Fhir.Model.Quantity)MaxSingleDose.DeepCopyInternal(); + if(MaxDosePerDay != null) dest.MaxDosePerDay = (Hl7.Fhir.Model.Quantity)MaxDosePerDay.DeepCopyInternal(); + if(MaxDosePerTreatmentPeriod != null) dest.MaxDosePerTreatmentPeriod = (Hl7.Fhir.Model.Ratio)MaxDosePerTreatmentPeriod.DeepCopyInternal(); + if(MaxTreatmentPeriod != null) dest.MaxTreatmentPeriod = (Hl7.Fhir.Model.Duration)MaxTreatmentPeriod.DeepCopyInternal(); + if(TargetSpecies.Any()) dest.TargetSpecies = new List(TargetSpecies.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RouteOfAdministrationComponent()); + var instance = new RouteOfAdministrationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -468,7 +470,7 @@ public List _WithdrawalPeriod; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetSpeciesComponent; @@ -477,15 +479,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(WithdrawalPeriod.Any()) dest.WithdrawalPeriod = new List(WithdrawalPeriod.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(WithdrawalPeriod.Any()) dest.WithdrawalPeriod = new List(WithdrawalPeriod.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetSpeciesComponent()); + var instance = new TargetSpeciesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -614,7 +617,7 @@ public string SupportingInformation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as WithdrawalPeriodComponent; @@ -623,16 +626,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Tissue != null) dest.Tissue = (Hl7.Fhir.Model.CodeableConcept)Tissue.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopy(); - if(SupportingInformationElement != null) dest.SupportingInformationElement = (Hl7.Fhir.Model.FhirString)SupportingInformationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Tissue != null) dest.Tissue = (Hl7.Fhir.Model.CodeableConcept)Tissue.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopyInternal(); + if(SupportingInformationElement != null) dest.SupportingInformationElement = (Hl7.Fhir.Model.FhirString)SupportingInformationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new WithdrawalPeriodComponent()); + var instance = new WithdrawalPeriodComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -864,7 +868,7 @@ public List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdministrableProductDefinition; @@ -873,23 +877,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(FormOf.Any()) dest.FormOf = new List(FormOf.DeepCopy()); - if(AdministrableDoseForm != null) dest.AdministrableDoseForm = (Hl7.Fhir.Model.CodeableConcept)AdministrableDoseForm.DeepCopy(); - if(UnitOfPresentation != null) dest.UnitOfPresentation = (Hl7.Fhir.Model.CodeableConcept)UnitOfPresentation.DeepCopy(); - if(ProducedFrom.Any()) dest.ProducedFrom = new List(ProducedFrom.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(RouteOfAdministration.Any()) dest.RouteOfAdministration = new List(RouteOfAdministration.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(FormOf.Any()) dest.FormOf = new List(FormOf.DeepCopyInternal()); + if(AdministrableDoseForm != null) dest.AdministrableDoseForm = (Hl7.Fhir.Model.CodeableConcept)AdministrableDoseForm.DeepCopyInternal(); + if(UnitOfPresentation != null) dest.UnitOfPresentation = (Hl7.Fhir.Model.CodeableConcept)UnitOfPresentation.DeepCopyInternal(); + if(ProducedFrom.Any()) dest.ProducedFrom = new List(ProducedFrom.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(RouteOfAdministration.Any()) dest.RouteOfAdministration = new List(RouteOfAdministration.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdministrableProductDefinition()); + var instance = new AdministrableProductDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/AdverseEvent.cs b/src/Hl7.Fhir.R4B/Model/Generated/AdverseEvent.cs index 8b93681bb5..7c866d35df 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/AdverseEvent.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/AdverseEvent.cs @@ -201,7 +201,7 @@ public List Causality private List _Causality; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SuspectEntityComponent; @@ -210,15 +210,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Instance != null) dest.Instance = (Hl7.Fhir.Model.ResourceReference)Instance.DeepCopy(); - if(Causality.Any()) dest.Causality = new List(Causality.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Instance != null) dest.Instance = (Hl7.Fhir.Model.ResourceReference)Instance.DeepCopyInternal(); + if(Causality.Any()) dest.Causality = new List(Causality.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SuspectEntityComponent()); + var instance = new SuspectEntityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -361,7 +362,7 @@ public Hl7.Fhir.Model.CodeableConcept Method private Hl7.Fhir.Model.CodeableConcept _Method; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CausalityComponent; @@ -370,17 +371,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Assessment != null) dest.Assessment = (Hl7.Fhir.Model.CodeableConcept)Assessment.DeepCopy(); - if(ProductRelatednessElement != null) dest.ProductRelatednessElement = (Hl7.Fhir.Model.FhirString)ProductRelatednessElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Assessment != null) dest.Assessment = (Hl7.Fhir.Model.CodeableConcept)Assessment.DeepCopyInternal(); + if(ProductRelatednessElement != null) dest.ProductRelatednessElement = (Hl7.Fhir.Model.FhirString)ProductRelatednessElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CausalityComponent()); + var instance = new CausalityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -820,7 +822,7 @@ public List Study Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdverseEvent; @@ -829,33 +831,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(ActualityElement != null) dest.ActualityElement = (Code)ActualityElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Event != null) dest.Event = (Hl7.Fhir.Model.CodeableConcept)Event.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(DetectedElement != null) dest.DetectedElement = (Hl7.Fhir.Model.FhirDateTime)DetectedElement.DeepCopy(); - if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopy(); - if(ResultingCondition.Any()) dest.ResultingCondition = new List(ResultingCondition.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Seriousness != null) dest.Seriousness = (Hl7.Fhir.Model.CodeableConcept)Seriousness.DeepCopy(); - if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopy()); - if(SuspectEntity.Any()) dest.SuspectEntity = new List(SuspectEntity.DeepCopy()); - if(SubjectMedicalHistory.Any()) dest.SubjectMedicalHistory = new List(SubjectMedicalHistory.DeepCopy()); - if(ReferenceDocument.Any()) dest.ReferenceDocument = new List(ReferenceDocument.DeepCopy()); - if(Study.Any()) dest.Study = new List(Study.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(ActualityElement != null) dest.ActualityElement = (Code)ActualityElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Event != null) dest.Event = (Hl7.Fhir.Model.CodeableConcept)Event.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(DetectedElement != null) dest.DetectedElement = (Hl7.Fhir.Model.FhirDateTime)DetectedElement.DeepCopyInternal(); + if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopyInternal(); + if(ResultingCondition.Any()) dest.ResultingCondition = new List(ResultingCondition.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Seriousness != null) dest.Seriousness = (Hl7.Fhir.Model.CodeableConcept)Seriousness.DeepCopyInternal(); + if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopyInternal()); + if(SuspectEntity.Any()) dest.SuspectEntity = new List(SuspectEntity.DeepCopyInternal()); + if(SubjectMedicalHistory.Any()) dest.SubjectMedicalHistory = new List(SubjectMedicalHistory.DeepCopyInternal()); + if(ReferenceDocument.Any()) dest.ReferenceDocument = new List(ReferenceDocument.DeepCopyInternal()); + if(Study.Any()) dest.Study = new List(Study.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdverseEvent()); + var instance = new AdverseEvent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Age.cs b/src/Hl7.Fhir.R4B/Model/Generated/Age.cs index a5cb574a20..c69caa740a 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Age.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Age.cs @@ -59,9 +59,11 @@ public partial class Age : Quantity /// public override string TypeName { get { return "Age"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Age()); + var instance = new Age(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.R4B/Model/Generated/AllergyIntolerance.cs b/src/Hl7.Fhir.R4B/Model/Generated/AllergyIntolerance.cs index 99a04c5dac..812a1e2c81 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/AllergyIntolerance.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/AllergyIntolerance.cs @@ -402,7 +402,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReactionComponent; @@ -411,20 +411,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopy(); - if(Manifestation.Any()) dest.Manifestation = new List(Manifestation.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(OnsetElement != null) dest.OnsetElement = (Hl7.Fhir.Model.FhirDateTime)OnsetElement.DeepCopy(); - if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopy(); - if(ExposureRoute != null) dest.ExposureRoute = (Hl7.Fhir.Model.CodeableConcept)ExposureRoute.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopyInternal(); + if(Manifestation.Any()) dest.Manifestation = new List(Manifestation.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(OnsetElement != null) dest.OnsetElement = (Hl7.Fhir.Model.FhirDateTime)OnsetElement.DeepCopyInternal(); + if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopyInternal(); + if(ExposureRoute != null) dest.ExposureRoute = (Hl7.Fhir.Model.CodeableConcept)ExposureRoute.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReactionComponent()); + var instance = new ReactionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -844,7 +845,7 @@ public List Reaction List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AllergyIntolerance; @@ -853,29 +854,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ClinicalStatus != null) dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopy(); - if(VerificationStatus != null) dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(CategoryElement.Any()) dest.CategoryElement = new List>(CategoryElement.DeepCopy()); - if(CriticalityElement != null) dest.CriticalityElement = (Code)CriticalityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy(); - if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy(); - if(LastOccurrenceElement != null) dest.LastOccurrenceElement = (Hl7.Fhir.Model.FhirDateTime)LastOccurrenceElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ClinicalStatus != null) dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopyInternal(); + if(VerificationStatus != null) dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(CategoryElement.Any()) dest.CategoryElement = new List>(CategoryElement.DeepCopyInternal()); + if(CriticalityElement != null) dest.CriticalityElement = (Code)CriticalityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopyInternal(); + if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopyInternal(); + if(LastOccurrenceElement != null) dest.LastOccurrenceElement = (Hl7.Fhir.Model.FhirDateTime)LastOccurrenceElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AllergyIntolerance()); + var instance = new AllergyIntolerance(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Annotation.cs b/src/Hl7.Fhir.R4B/Model/Generated/Annotation.cs index 7a559dbf5b..daad2fc9df 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Annotation.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Annotation.cs @@ -139,7 +139,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Annotation; @@ -148,16 +148,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Author != null) dest.Author = (Hl7.Fhir.Model.DataType)Author.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Author != null) dest.Author = (Hl7.Fhir.Model.DataType)Author.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Annotation()); + var instance = new Annotation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Appointment.cs b/src/Hl7.Fhir.R4B/Model/Generated/Appointment.cs index 5134d3ed1e..c3bf1c2d3d 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Appointment.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Appointment.cs @@ -280,7 +280,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -289,18 +289,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(RequiredElement != null) dest.RequiredElement = (Code)RequiredElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(RequiredElement != null) dest.RequiredElement = (Code)RequiredElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -858,7 +859,7 @@ public List RequestedPeriod List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Appointment; @@ -867,35 +868,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CancelationReason != null) dest.CancelationReason = (Hl7.Fhir.Model.CodeableConcept)CancelationReason.DeepCopy(); - if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopy()); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.UnsignedInt)PriorityElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(MinutesDurationElement != null) dest.MinutesDurationElement = (Hl7.Fhir.Model.PositiveInt)MinutesDurationElement.DeepCopy(); - if(Slot.Any()) dest.Slot = new List(Slot.DeepCopy()); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(RequestedPeriod.Any()) dest.RequestedPeriod = new List(RequestedPeriod.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CancelationReason != null) dest.CancelationReason = (Hl7.Fhir.Model.CodeableConcept)CancelationReason.DeepCopyInternal(); + if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopyInternal()); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.UnsignedInt)PriorityElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(MinutesDurationElement != null) dest.MinutesDurationElement = (Hl7.Fhir.Model.PositiveInt)MinutesDurationElement.DeepCopyInternal(); + if(Slot.Any()) dest.Slot = new List(Slot.DeepCopyInternal()); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(RequestedPeriod.Any()) dest.RequestedPeriod = new List(RequestedPeriod.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Appointment()); + var instance = new Appointment(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/AppointmentResponse.cs b/src/Hl7.Fhir.R4B/Model/Generated/AppointmentResponse.cs index 4b0100bed3..d94c48c906 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/AppointmentResponse.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/AppointmentResponse.cs @@ -245,7 +245,7 @@ public string Comment List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AppointmentResponse; @@ -254,21 +254,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Appointment != null) dest.Appointment = (Hl7.Fhir.Model.ResourceReference)Appointment.DeepCopy(); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(ParticipantType.Any()) dest.ParticipantType = new List(ParticipantType.DeepCopy()); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(ParticipantStatusElement != null) dest.ParticipantStatusElement = (Code)ParticipantStatusElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Appointment != null) dest.Appointment = (Hl7.Fhir.Model.ResourceReference)Appointment.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(ParticipantType.Any()) dest.ParticipantType = new List(ParticipantType.DeepCopyInternal()); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(ParticipantStatusElement != null) dest.ParticipantStatusElement = (Code)ParticipantStatusElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AppointmentResponse()); + var instance = new AppointmentResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/AuditEvent.cs b/src/Hl7.Fhir.R4B/Model/Generated/AuditEvent.cs index 19bcbc8e48..7aa82bf5f0 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/AuditEvent.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/AuditEvent.cs @@ -419,7 +419,7 @@ public List PurposeOfUse private List _PurposeOfUse; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AgentComponent; @@ -428,24 +428,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Role.Any()) dest.Role = new List(Role.DeepCopy()); - if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopy(); - if(AltIdElement != null) dest.AltIdElement = (Hl7.Fhir.Model.FhirString)AltIdElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(RequestorElement != null) dest.RequestorElement = (Hl7.Fhir.Model.FhirBoolean)RequestorElement.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopy()); - if(Media != null) dest.Media = (Hl7.Fhir.Model.Coding)Media.DeepCopy(); - if(Network != null) dest.Network = (Hl7.Fhir.Model.AuditEvent.NetworkComponent)Network.DeepCopy(); - if(PurposeOfUse.Any()) dest.PurposeOfUse = new List(PurposeOfUse.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Role.Any()) dest.Role = new List(Role.DeepCopyInternal()); + if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopyInternal(); + if(AltIdElement != null) dest.AltIdElement = (Hl7.Fhir.Model.FhirString)AltIdElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(RequestorElement != null) dest.RequestorElement = (Hl7.Fhir.Model.FhirBoolean)RequestorElement.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopyInternal()); + if(Media != null) dest.Media = (Hl7.Fhir.Model.Coding)Media.DeepCopyInternal(); + if(Network != null) dest.Network = (Hl7.Fhir.Model.AuditEvent.NetworkComponent)Network.DeepCopyInternal(); + if(PurposeOfUse.Any()) dest.PurposeOfUse = new List(PurposeOfUse.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AgentComponent()); + var instance = new AgentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -653,7 +654,7 @@ public Hl7.Fhir.Model.AuditEvent.AuditEventAgentNetworkType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NetworkComponent; @@ -662,15 +663,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirString)AddressElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirString)AddressElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NetworkComponent()); + var instance = new NetworkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -805,7 +807,7 @@ public List Type private List _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceComponent; @@ -814,16 +816,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SiteElement != null) dest.SiteElement = (Hl7.Fhir.Model.FhirString)SiteElement.DeepCopy(); - if(Observer != null) dest.Observer = (Hl7.Fhir.Model.ResourceReference)Observer.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SiteElement != null) dest.SiteElement = (Hl7.Fhir.Model.FhirString)SiteElement.DeepCopyInternal(); + if(Observer != null) dest.Observer = (Hl7.Fhir.Model.ResourceReference)Observer.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceComponent()); + var instance = new SourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1083,7 +1086,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EntityComponent; @@ -1092,22 +1095,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(What != null) dest.What = (Hl7.Fhir.Model.ResourceReference)What.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.Coding)Role.DeepCopy(); - if(Lifecycle != null) dest.Lifecycle = (Hl7.Fhir.Model.Coding)Lifecycle.DeepCopy(); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(QueryElement != null) dest.QueryElement = (Hl7.Fhir.Model.Base64Binary)QueryElement.DeepCopy(); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(What != null) dest.What = (Hl7.Fhir.Model.ResourceReference)What.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.Coding)Role.DeepCopyInternal(); + if(Lifecycle != null) dest.Lifecycle = (Hl7.Fhir.Model.Coding)Lifecycle.DeepCopyInternal(); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(QueryElement != null) dest.QueryElement = (Hl7.Fhir.Model.Base64Binary)QueryElement.DeepCopyInternal(); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EntityComponent()); + var instance = new EntityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1283,7 +1287,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -1292,15 +1296,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1585,7 +1590,7 @@ public List Entity private List _Entity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AuditEvent; @@ -1594,24 +1599,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopy()); - if(ActionElement != null) dest.ActionElement = (Code)ActionElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(OutcomeDescElement != null) dest.OutcomeDescElement = (Hl7.Fhir.Model.FhirString)OutcomeDescElement.DeepCopy(); - if(PurposeOfEvent.Any()) dest.PurposeOfEvent = new List(PurposeOfEvent.DeepCopy()); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - if(Source != null) dest.Source = (Hl7.Fhir.Model.AuditEvent.SourceComponent)Source.DeepCopy(); - if(Entity.Any()) dest.Entity = new List(Entity.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopyInternal()); + if(ActionElement != null) dest.ActionElement = (Code)ActionElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(OutcomeDescElement != null) dest.OutcomeDescElement = (Hl7.Fhir.Model.FhirString)OutcomeDescElement.DeepCopyInternal(); + if(PurposeOfEvent.Any()) dest.PurposeOfEvent = new List(PurposeOfEvent.DeepCopyInternal()); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); + if(Source != null) dest.Source = (Hl7.Fhir.Model.AuditEvent.SourceComponent)Source.DeepCopyInternal(); + if(Entity.Any()) dest.Entity = new List(Entity.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AuditEvent()); + var instance = new AuditEvent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Basic.cs b/src/Hl7.Fhir.R4B/Model/Generated/Basic.cs index 36ac98aa9b..2bceac56aa 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Basic.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Basic.cs @@ -151,7 +151,7 @@ public Hl7.Fhir.Model.ResourceReference Author List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Basic; @@ -160,18 +160,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.Date)CreatedElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.Date)CreatedElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Basic()); + var instance = new Basic(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/BiologicallyDerivedProduct.cs b/src/Hl7.Fhir.R4B/Model/Generated/BiologicallyDerivedProduct.cs index ef7fcc74f3..f500dfbc5e 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/BiologicallyDerivedProduct.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/BiologicallyDerivedProduct.cs @@ -209,7 +209,7 @@ public Hl7.Fhir.Model.DataType Collected private Hl7.Fhir.Model.DataType _Collected; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CollectionComponent; @@ -218,16 +218,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CollectionComponent()); + var instance = new CollectionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -382,7 +383,7 @@ public Hl7.Fhir.Model.DataType Time private Hl7.Fhir.Model.DataType _Time; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcessingComponent; @@ -391,17 +392,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.CodeableConcept)Procedure.DeepCopy(); - if(Additive != null) dest.Additive = (Hl7.Fhir.Model.ResourceReference)Additive.DeepCopy(); - if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.CodeableConcept)Procedure.DeepCopyInternal(); + if(Additive != null) dest.Additive = (Hl7.Fhir.Model.ResourceReference)Additive.DeepCopyInternal(); + if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcessingComponent()); + var instance = new ProcessingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -535,7 +537,7 @@ public Hl7.Fhir.Model.DataType Time private Hl7.Fhir.Model.DataType _Time; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManipulationComponent; @@ -544,15 +546,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManipulationComponent()); + var instance = new ManipulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -729,7 +732,7 @@ public Hl7.Fhir.Model.Period Duration private Hl7.Fhir.Model.Period _Duration; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StorageComponent; @@ -738,17 +741,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(TemperatureElement != null) dest.TemperatureElement = (Hl7.Fhir.Model.FhirDecimal)TemperatureElement.DeepCopy(); - if(ScaleElement != null) dest.ScaleElement = (Code)ScaleElement.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Period)Duration.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(TemperatureElement != null) dest.TemperatureElement = (Hl7.Fhir.Model.FhirDecimal)TemperatureElement.DeepCopyInternal(); + if(ScaleElement != null) dest.ScaleElement = (Code)ScaleElement.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Period)Duration.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StorageComponent()); + var instance = new StorageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1033,7 +1037,7 @@ public List Storage List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BiologicallyDerivedProduct; @@ -1042,24 +1046,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ProductCategoryElement != null) dest.ProductCategoryElement = (Code)ProductCategoryElement.DeepCopy(); - if(ProductCode != null) dest.ProductCode = (Hl7.Fhir.Model.CodeableConcept)ProductCode.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Request.Any()) dest.Request = new List(Request.DeepCopy()); - if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.Integer)QuantityElement.DeepCopy(); - if(Parent.Any()) dest.Parent = new List(Parent.DeepCopy()); - if(Collection != null) dest.Collection = (Hl7.Fhir.Model.BiologicallyDerivedProduct.CollectionComponent)Collection.DeepCopy(); - if(Processing.Any()) dest.Processing = new List(Processing.DeepCopy()); - if(Manipulation != null) dest.Manipulation = (Hl7.Fhir.Model.BiologicallyDerivedProduct.ManipulationComponent)Manipulation.DeepCopy(); - if(Storage.Any()) dest.Storage = new List(Storage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ProductCategoryElement != null) dest.ProductCategoryElement = (Code)ProductCategoryElement.DeepCopyInternal(); + if(ProductCode != null) dest.ProductCode = (Hl7.Fhir.Model.CodeableConcept)ProductCode.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Request.Any()) dest.Request = new List(Request.DeepCopyInternal()); + if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.Integer)QuantityElement.DeepCopyInternal(); + if(Parent.Any()) dest.Parent = new List(Parent.DeepCopyInternal()); + if(Collection != null) dest.Collection = (Hl7.Fhir.Model.BiologicallyDerivedProduct.CollectionComponent)Collection.DeepCopyInternal(); + if(Processing.Any()) dest.Processing = new List(Processing.DeepCopyInternal()); + if(Manipulation != null) dest.Manipulation = (Hl7.Fhir.Model.BiologicallyDerivedProduct.ManipulationComponent)Manipulation.DeepCopyInternal(); + if(Storage.Any()) dest.Storage = new List(Storage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BiologicallyDerivedProduct()); + var instance = new BiologicallyDerivedProduct(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/BodyStructure.cs b/src/Hl7.Fhir.R4B/Model/Generated/BodyStructure.cs index ede164b257..a275479547 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/BodyStructure.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/BodyStructure.cs @@ -210,7 +210,7 @@ public Hl7.Fhir.Model.ResourceReference Patient List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BodyStructure; @@ -219,21 +219,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Morphology != null) dest.Morphology = (Hl7.Fhir.Model.CodeableConcept)Morphology.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.CodeableConcept)Location.DeepCopy(); - if(LocationQualifier.Any()) dest.LocationQualifier = new List(LocationQualifier.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Image.Any()) dest.Image = new List(Image.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Morphology != null) dest.Morphology = (Hl7.Fhir.Model.CodeableConcept)Morphology.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.CodeableConcept)Location.DeepCopyInternal(); + if(LocationQualifier.Any()) dest.LocationQualifier = new List(LocationQualifier.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Image.Any()) dest.Image = new List(Image.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BodyStructure()); + var instance = new BodyStructure(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/CarePlan.cs b/src/Hl7.Fhir.R4B/Model/Generated/CarePlan.cs index 40872f18da..9667de6b77 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/CarePlan.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/CarePlan.cs @@ -304,7 +304,7 @@ public Hl7.Fhir.Model.CarePlan.DetailComponent Detail private Hl7.Fhir.Model.CarePlan.DetailComponent _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActivityComponent; @@ -313,18 +313,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(OutcomeCodeableConcept.Any()) dest.OutcomeCodeableConcept = new List(OutcomeCodeableConcept.DeepCopy()); - if(OutcomeReference.Any()) dest.OutcomeReference = new List(OutcomeReference.DeepCopy()); - if(Progress.Any()) dest.Progress = new List(Progress.DeepCopy()); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.CarePlan.DetailComponent)Detail.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(OutcomeCodeableConcept.Any()) dest.OutcomeCodeableConcept = new List(OutcomeCodeableConcept.DeepCopyInternal()); + if(OutcomeReference.Any()) dest.OutcomeReference = new List(OutcomeReference.DeepCopyInternal()); + if(Progress.Any()) dest.Progress = new List(Progress.DeepCopyInternal()); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.CarePlan.DetailComponent)Detail.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActivityComponent()); + var instance = new ActivityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -776,7 +777,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -785,30 +786,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Goal.Any()) dest.Goal = new List(Goal.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Scheduled != null) dest.Scheduled = (Hl7.Fhir.Model.DataType)Scheduled.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopy(); - if(DailyAmount != null) dest.DailyAmount = (Hl7.Fhir.Model.Quantity)DailyAmount.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Goal.Any()) dest.Goal = new List(Goal.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Scheduled != null) dest.Scheduled = (Hl7.Fhir.Model.DataType)Scheduled.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopyInternal(); + if(DailyAmount != null) dest.DailyAmount = (Hl7.Fhir.Model.Quantity)DailyAmount.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1455,7 +1457,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CarePlan; @@ -1464,36 +1466,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopy()); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Goal.Any()) dest.Goal = new List(Goal.DeepCopy()); - if(Activity.Any()) dest.Activity = new List(Activity.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopyInternal()); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Goal.Any()) dest.Goal = new List(Goal.DeepCopyInternal()); + if(Activity.Any()) dest.Activity = new List(Activity.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CarePlan()); + var instance = new CarePlan(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/CareTeam.cs b/src/Hl7.Fhir.R4B/Model/Generated/CareTeam.cs index 25b79d66cc..1d6f827ac4 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/CareTeam.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/CareTeam.cs @@ -173,7 +173,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -182,17 +182,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role.Any()) dest.Role = new List(Role.DeepCopy()); - if(Member != null) dest.Member = (Hl7.Fhir.Model.ResourceReference)Member.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role.Any()) dest.Role = new List(Role.DeepCopyInternal()); + if(Member != null) dest.Member = (Hl7.Fhir.Model.ResourceReference)Member.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -491,7 +492,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CareTeam; @@ -500,26 +501,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(ManagingOrganization.Any()) dest.ManagingOrganization = new List(ManagingOrganization.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(ManagingOrganization.Any()) dest.ManagingOrganization = new List(ManagingOrganization.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CareTeam()); + var instance = new CareTeam(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/CatalogEntry.cs b/src/Hl7.Fhir.R4B/Model/Generated/CatalogEntry.cs index 54216ea72c..d5b35ea660 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/CatalogEntry.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/CatalogEntry.cs @@ -147,7 +147,7 @@ public Hl7.Fhir.Model.ResourceReference Item private Hl7.Fhir.Model.ResourceReference _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedEntryComponent; @@ -156,15 +156,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RelationtypeElement != null) dest.RelationtypeElement = (Code)RelationtypeElement.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.ResourceReference)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RelationtypeElement != null) dest.RelationtypeElement = (Code)RelationtypeElement.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.ResourceReference)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedEntryComponent()); + var instance = new RelatedEntryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -475,7 +476,7 @@ public List RelatedEntry List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CatalogEntry; @@ -484,26 +485,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(OrderableElement != null) dest.OrderableElement = (Hl7.Fhir.Model.FhirBoolean)OrderableElement.DeepCopy(); - if(ReferencedItem != null) dest.ReferencedItem = (Hl7.Fhir.Model.ResourceReference)ReferencedItem.DeepCopy(); - if(AdditionalIdentifier.Any()) dest.AdditionalIdentifier = new List(AdditionalIdentifier.DeepCopy()); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopy(); - if(ValidToElement != null) dest.ValidToElement = (Hl7.Fhir.Model.FhirDateTime)ValidToElement.DeepCopy(); - if(LastUpdatedElement != null) dest.LastUpdatedElement = (Hl7.Fhir.Model.FhirDateTime)LastUpdatedElement.DeepCopy(); - if(AdditionalCharacteristic.Any()) dest.AdditionalCharacteristic = new List(AdditionalCharacteristic.DeepCopy()); - if(AdditionalClassification.Any()) dest.AdditionalClassification = new List(AdditionalClassification.DeepCopy()); - if(RelatedEntry.Any()) dest.RelatedEntry = new List(RelatedEntry.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(OrderableElement != null) dest.OrderableElement = (Hl7.Fhir.Model.FhirBoolean)OrderableElement.DeepCopyInternal(); + if(ReferencedItem != null) dest.ReferencedItem = (Hl7.Fhir.Model.ResourceReference)ReferencedItem.DeepCopyInternal(); + if(AdditionalIdentifier.Any()) dest.AdditionalIdentifier = new List(AdditionalIdentifier.DeepCopyInternal()); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopyInternal(); + if(ValidToElement != null) dest.ValidToElement = (Hl7.Fhir.Model.FhirDateTime)ValidToElement.DeepCopyInternal(); + if(LastUpdatedElement != null) dest.LastUpdatedElement = (Hl7.Fhir.Model.FhirDateTime)LastUpdatedElement.DeepCopyInternal(); + if(AdditionalCharacteristic.Any()) dest.AdditionalCharacteristic = new List(AdditionalCharacteristic.DeepCopyInternal()); + if(AdditionalClassification.Any()) dest.AdditionalClassification = new List(AdditionalClassification.DeepCopyInternal()); + if(RelatedEntry.Any()) dest.RelatedEntry = new List(RelatedEntry.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CatalogEntry()); + var instance = new CatalogEntry(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ChargeItem.cs b/src/Hl7.Fhir.R4B/Model/Generated/ChargeItem.cs index 31a4df2844..95512cb7e5 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ChargeItem.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ChargeItem.cs @@ -157,7 +157,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -166,15 +166,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -723,7 +724,7 @@ public List SupportingInformation List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ChargeItem; @@ -732,39 +733,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(DefinitionUriElement.Any()) dest.DefinitionUriElement = new List(DefinitionUriElement.DeepCopy()); - if(DefinitionCanonicalElement.Any()) dest.DefinitionCanonicalElement = new List(DefinitionCanonicalElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(PerformingOrganization != null) dest.PerformingOrganization = (Hl7.Fhir.Model.ResourceReference)PerformingOrganization.DeepCopy(); - if(RequestingOrganization != null) dest.RequestingOrganization = (Hl7.Fhir.Model.ResourceReference)RequestingOrganization.DeepCopy(); - if(CostCenter != null) dest.CostCenter = (Hl7.Fhir.Model.ResourceReference)CostCenter.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Bodysite.Any()) dest.Bodysite = new List(Bodysite.DeepCopy()); - if(FactorOverrideElement != null) dest.FactorOverrideElement = (Hl7.Fhir.Model.FhirDecimal)FactorOverrideElement.DeepCopy(); - if(PriceOverride != null) dest.PriceOverride = (Hl7.Fhir.Model.Money)PriceOverride.DeepCopy(); - if(OverrideReasonElement != null) dest.OverrideReasonElement = (Hl7.Fhir.Model.FhirString)OverrideReasonElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(EnteredDateElement != null) dest.EnteredDateElement = (Hl7.Fhir.Model.FhirDateTime)EnteredDateElement.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Service.Any()) dest.Service = new List(Service.DeepCopy()); - if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopy(); - if(Account.Any()) dest.Account = new List(Account.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ChargeItem()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(DefinitionUriElement.Any()) dest.DefinitionUriElement = new List(DefinitionUriElement.DeepCopyInternal()); + if(DefinitionCanonicalElement.Any()) dest.DefinitionCanonicalElement = new List(DefinitionCanonicalElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(PerformingOrganization != null) dest.PerformingOrganization = (Hl7.Fhir.Model.ResourceReference)PerformingOrganization.DeepCopyInternal(); + if(RequestingOrganization != null) dest.RequestingOrganization = (Hl7.Fhir.Model.ResourceReference)RequestingOrganization.DeepCopyInternal(); + if(CostCenter != null) dest.CostCenter = (Hl7.Fhir.Model.ResourceReference)CostCenter.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Bodysite.Any()) dest.Bodysite = new List(Bodysite.DeepCopyInternal()); + if(FactorOverrideElement != null) dest.FactorOverrideElement = (Hl7.Fhir.Model.FhirDecimal)FactorOverrideElement.DeepCopyInternal(); + if(PriceOverride != null) dest.PriceOverride = (Hl7.Fhir.Model.Money)PriceOverride.DeepCopyInternal(); + if(OverrideReasonElement != null) dest.OverrideReasonElement = (Hl7.Fhir.Model.FhirString)OverrideReasonElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(EnteredDateElement != null) dest.EnteredDateElement = (Hl7.Fhir.Model.FhirDateTime)EnteredDateElement.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Service.Any()) dest.Service = new List(Service.DeepCopyInternal()); + if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopyInternal(); + if(Account.Any()) dest.Account = new List(Account.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ChargeItem(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ChargeItemDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/ChargeItemDefinition.cs index 11bdda4e9f..925be1f783 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ChargeItemDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ChargeItemDefinition.cs @@ -169,7 +169,7 @@ public string Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ApplicabilityComponent; @@ -178,16 +178,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.FhirString)LanguageElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.FhirString)LanguageElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ApplicabilityComponent()); + var instance = new ApplicabilityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -295,7 +296,7 @@ public List PriceCo private List _PriceComponent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyGroupComponent; @@ -304,15 +305,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Applicability.Any()) dest.Applicability = new List(Applicability.DeepCopy()); - if(PriceComponent.Any()) dest.PriceComponent = new List(PriceComponent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Applicability.Any()) dest.Applicability = new List(Applicability.DeepCopyInternal()); + if(PriceComponent.Any()) dest.PriceComponent = new List(PriceComponent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyGroupComponent()); + var instance = new PropertyGroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -475,7 +477,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PriceComponentComponent; @@ -484,17 +486,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PriceComponentComponent()); + var instance = new PriceComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1137,7 +1140,7 @@ public List Property List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ChargeItemDefinition; @@ -1146,36 +1149,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DerivedFromUriElement.Any()) dest.DerivedFromUriElement = new List(DerivedFromUriElement.DeepCopy()); - if(PartOfElement.Any()) dest.PartOfElement = new List(PartOfElement.DeepCopy()); - if(ReplacesElement.Any()) dest.ReplacesElement = new List(ReplacesElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - if(Applicability.Any()) dest.Applicability = new List(Applicability.DeepCopy()); - if(PropertyGroup.Any()) dest.PropertyGroup = new List(PropertyGroup.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DerivedFromUriElement.Any()) dest.DerivedFromUriElement = new List(DerivedFromUriElement.DeepCopyInternal()); + if(PartOfElement.Any()) dest.PartOfElement = new List(PartOfElement.DeepCopyInternal()); + if(ReplacesElement.Any()) dest.ReplacesElement = new List(ReplacesElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); + if(Applicability.Any()) dest.Applicability = new List(Applicability.DeepCopyInternal()); + if(PropertyGroup.Any()) dest.PropertyGroup = new List(PropertyGroup.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ChargeItemDefinition()); + var instance = new ChargeItemDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Citation.cs b/src/Hl7.Fhir.R4B/Model/Generated/Citation.cs index 0ee2bcaedb..6c8ff623aa 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Citation.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Citation.cs @@ -118,7 +118,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SummaryComponent; @@ -127,15 +127,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Style != null) dest.Style = (Hl7.Fhir.Model.CodeableConcept)Style.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Style != null) dest.Style = (Hl7.Fhir.Model.CodeableConcept)Style.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SummaryComponent()); + var instance = new SummaryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -233,7 +234,7 @@ public List Classifier private List _Classifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClassificationComponent; @@ -242,15 +243,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClassificationComponent()); + var instance = new ClassificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -379,7 +381,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StatusDateComponent; @@ -388,16 +390,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopy(); - if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopyInternal(); + if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StatusDateComponent()); + var instance = new StatusDateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -521,7 +524,7 @@ public Hl7.Fhir.Model.DataType Target private Hl7.Fhir.Model.DataType _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatesToComponent; @@ -530,16 +533,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RelationshipType != null) dest.RelationshipType = (Hl7.Fhir.Model.CodeableConcept)RelationshipType.DeepCopy(); - if(TargetClassifier.Any()) dest.TargetClassifier = new List(TargetClassifier.DeepCopy()); - if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RelationshipType != null) dest.RelationshipType = (Hl7.Fhir.Model.CodeableConcept)RelationshipType.DeepCopyInternal(); + if(TargetClassifier.Any()) dest.TargetClassifier = new List(TargetClassifier.DeepCopyInternal()); + if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatesToComponent()); + var instance = new RelatesToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -841,7 +845,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactComponent; @@ -850,28 +854,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(RelatedIdentifier.Any()) dest.RelatedIdentifier = new List(RelatedIdentifier.DeepCopy()); - if(DateAccessedElement != null) dest.DateAccessedElement = (Hl7.Fhir.Model.FhirDateTime)DateAccessedElement.DeepCopy(); - if(Version != null) dest.Version = (Hl7.Fhir.Model.Citation.CitedArtifactVersionComponent)Version.DeepCopy(); - if(CurrentState.Any()) dest.CurrentState = new List(CurrentState.DeepCopy()); - if(StatusDate.Any()) dest.StatusDate = new List(StatusDate.DeepCopy()); - if(Title.Any()) dest.Title = new List(Title.DeepCopy()); - if(Abstract.Any()) dest.Abstract = new List(Abstract.DeepCopy()); - if(Part != null) dest.Part = (Hl7.Fhir.Model.Citation.CitedArtifactPartComponent)Part.DeepCopy(); - if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopy()); - if(PublicationForm.Any()) dest.PublicationForm = new List(PublicationForm.DeepCopy()); - if(WebLocation.Any()) dest.WebLocation = new List(WebLocation.DeepCopy()); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - if(Contributorship != null) dest.Contributorship = (Hl7.Fhir.Model.Citation.CitedArtifactContributorshipComponent)Contributorship.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(RelatedIdentifier.Any()) dest.RelatedIdentifier = new List(RelatedIdentifier.DeepCopyInternal()); + if(DateAccessedElement != null) dest.DateAccessedElement = (Hl7.Fhir.Model.FhirDateTime)DateAccessedElement.DeepCopyInternal(); + if(Version != null) dest.Version = (Hl7.Fhir.Model.Citation.CitedArtifactVersionComponent)Version.DeepCopyInternal(); + if(CurrentState.Any()) dest.CurrentState = new List(CurrentState.DeepCopyInternal()); + if(StatusDate.Any()) dest.StatusDate = new List(StatusDate.DeepCopyInternal()); + if(Title.Any()) dest.Title = new List(Title.DeepCopyInternal()); + if(Abstract.Any()) dest.Abstract = new List(Abstract.DeepCopyInternal()); + if(Part != null) dest.Part = (Hl7.Fhir.Model.Citation.CitedArtifactPartComponent)Part.DeepCopyInternal(); + if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopyInternal()); + if(PublicationForm.Any()) dest.PublicationForm = new List(PublicationForm.DeepCopyInternal()); + if(WebLocation.Any()) dest.WebLocation = new List(WebLocation.DeepCopyInternal()); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); + if(Contributorship != null) dest.Contributorship = (Hl7.Fhir.Model.Citation.CitedArtifactContributorshipComponent)Contributorship.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactComponent()); + var instance = new CitedArtifactComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1091,7 +1096,7 @@ public Hl7.Fhir.Model.ResourceReference BaseCitation private Hl7.Fhir.Model.ResourceReference _BaseCitation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactVersionComponent; @@ -1100,15 +1105,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(BaseCitation != null) dest.BaseCitation = (Hl7.Fhir.Model.ResourceReference)BaseCitation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(BaseCitation != null) dest.BaseCitation = (Hl7.Fhir.Model.ResourceReference)BaseCitation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactVersionComponent()); + var instance = new CitedArtifactVersionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1237,7 +1243,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactStatusDateComponent; @@ -1246,16 +1252,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopy(); - if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopyInternal(); + if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactStatusDateComponent()); + var instance = new CitedArtifactStatusDateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1393,7 +1400,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactTitleComponent; @@ -1402,16 +1409,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactTitleComponent()); + var instance = new CitedArtifactTitleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1579,7 +1587,7 @@ public string Copyright } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactAbstractComponent; @@ -1588,17 +1596,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactAbstractComponent()); + var instance = new CitedArtifactAbstractComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1743,7 +1752,7 @@ public Hl7.Fhir.Model.ResourceReference BaseCitation private Hl7.Fhir.Model.ResourceReference _BaseCitation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactPartComponent; @@ -1752,16 +1761,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(BaseCitation != null) dest.BaseCitation = (Hl7.Fhir.Model.ResourceReference)BaseCitation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(BaseCitation != null) dest.BaseCitation = (Hl7.Fhir.Model.ResourceReference)BaseCitation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactPartComponent()); + var instance = new CitedArtifactPartComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1885,7 +1895,7 @@ public Hl7.Fhir.Model.DataType Target private Hl7.Fhir.Model.DataType _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactRelatesToComponent; @@ -1894,16 +1904,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RelationshipType != null) dest.RelationshipType = (Hl7.Fhir.Model.CodeableConcept)RelationshipType.DeepCopy(); - if(TargetClassifier.Any()) dest.TargetClassifier = new List(TargetClassifier.DeepCopy()); - if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RelationshipType != null) dest.RelationshipType = (Hl7.Fhir.Model.CodeableConcept)RelationshipType.DeepCopyInternal(); + if(TargetClassifier.Any()) dest.TargetClassifier = new List(TargetClassifier.DeepCopyInternal()); + if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactRelatesToComponent()); + var instance = new CitedArtifactRelatesToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2272,7 +2283,7 @@ public string Copyright } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactPublicationFormComponent; @@ -2281,24 +2292,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PublishedIn != null) dest.PublishedIn = (Hl7.Fhir.Model.Citation.CitedArtifactPublicationFormPublishedInComponent)PublishedIn.DeepCopy(); - if(PeriodicRelease != null) dest.PeriodicRelease = (Hl7.Fhir.Model.Citation.CitedArtifactPublicationFormPeriodicReleaseComponent)PeriodicRelease.DeepCopy(); - if(ArticleDateElement != null) dest.ArticleDateElement = (Hl7.Fhir.Model.FhirDateTime)ArticleDateElement.DeepCopy(); - if(LastRevisionDateElement != null) dest.LastRevisionDateElement = (Hl7.Fhir.Model.FhirDateTime)LastRevisionDateElement.DeepCopy(); - if(Language.Any()) dest.Language = new List(Language.DeepCopy()); - if(AccessionNumberElement != null) dest.AccessionNumberElement = (Hl7.Fhir.Model.FhirString)AccessionNumberElement.DeepCopy(); - if(PageStringElement != null) dest.PageStringElement = (Hl7.Fhir.Model.FhirString)PageStringElement.DeepCopy(); - if(FirstPageElement != null) dest.FirstPageElement = (Hl7.Fhir.Model.FhirString)FirstPageElement.DeepCopy(); - if(LastPageElement != null) dest.LastPageElement = (Hl7.Fhir.Model.FhirString)LastPageElement.DeepCopy(); - if(PageCountElement != null) dest.PageCountElement = (Hl7.Fhir.Model.FhirString)PageCountElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PublishedIn != null) dest.PublishedIn = (Hl7.Fhir.Model.Citation.CitedArtifactPublicationFormPublishedInComponent)PublishedIn.DeepCopyInternal(); + if(PeriodicRelease != null) dest.PeriodicRelease = (Hl7.Fhir.Model.Citation.CitedArtifactPublicationFormPeriodicReleaseComponent)PeriodicRelease.DeepCopyInternal(); + if(ArticleDateElement != null) dest.ArticleDateElement = (Hl7.Fhir.Model.FhirDateTime)ArticleDateElement.DeepCopyInternal(); + if(LastRevisionDateElement != null) dest.LastRevisionDateElement = (Hl7.Fhir.Model.FhirDateTime)LastRevisionDateElement.DeepCopyInternal(); + if(Language.Any()) dest.Language = new List(Language.DeepCopyInternal()); + if(AccessionNumberElement != null) dest.AccessionNumberElement = (Hl7.Fhir.Model.FhirString)AccessionNumberElement.DeepCopyInternal(); + if(PageStringElement != null) dest.PageStringElement = (Hl7.Fhir.Model.FhirString)PageStringElement.DeepCopyInternal(); + if(FirstPageElement != null) dest.FirstPageElement = (Hl7.Fhir.Model.FhirString)FirstPageElement.DeepCopyInternal(); + if(LastPageElement != null) dest.LastPageElement = (Hl7.Fhir.Model.FhirString)LastPageElement.DeepCopyInternal(); + if(PageCountElement != null) dest.PageCountElement = (Hl7.Fhir.Model.FhirString)PageCountElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactPublicationFormComponent()); + var instance = new CitedArtifactPublicationFormComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2544,7 +2556,7 @@ public string PublisherLocation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactPublicationFormPublishedInComponent; @@ -2553,18 +2565,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Publisher != null) dest.Publisher = (Hl7.Fhir.Model.ResourceReference)Publisher.DeepCopy(); - if(PublisherLocationElement != null) dest.PublisherLocationElement = (Hl7.Fhir.Model.FhirString)PublisherLocationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Publisher != null) dest.Publisher = (Hl7.Fhir.Model.ResourceReference)Publisher.DeepCopyInternal(); + if(PublisherLocationElement != null) dest.PublisherLocationElement = (Hl7.Fhir.Model.FhirString)PublisherLocationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactPublicationFormPublishedInComponent()); + var instance = new CitedArtifactPublicationFormPublishedInComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2746,7 +2759,7 @@ public Hl7.Fhir.Model.Citation.CitedArtifactPublicationFormPeriodicReleaseDateOf private Hl7.Fhir.Model.Citation.CitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent _DateOfPublication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactPublicationFormPeriodicReleaseComponent; @@ -2755,17 +2768,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CitedMedium != null) dest.CitedMedium = (Hl7.Fhir.Model.CodeableConcept)CitedMedium.DeepCopy(); - if(VolumeElement != null) dest.VolumeElement = (Hl7.Fhir.Model.FhirString)VolumeElement.DeepCopy(); - if(IssueElement != null) dest.IssueElement = (Hl7.Fhir.Model.FhirString)IssueElement.DeepCopy(); - if(DateOfPublication != null) dest.DateOfPublication = (Hl7.Fhir.Model.Citation.CitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent)DateOfPublication.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CitedMedium != null) dest.CitedMedium = (Hl7.Fhir.Model.CodeableConcept)CitedMedium.DeepCopyInternal(); + if(VolumeElement != null) dest.VolumeElement = (Hl7.Fhir.Model.FhirString)VolumeElement.DeepCopyInternal(); + if(IssueElement != null) dest.IssueElement = (Hl7.Fhir.Model.FhirString)IssueElement.DeepCopyInternal(); + if(DateOfPublication != null) dest.DateOfPublication = (Hl7.Fhir.Model.Citation.CitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent)DateOfPublication.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactPublicationFormPeriodicReleaseComponent()); + var instance = new CitedArtifactPublicationFormPeriodicReleaseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3036,7 +3050,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent; @@ -3045,19 +3059,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(YearElement != null) dest.YearElement = (Hl7.Fhir.Model.FhirString)YearElement.DeepCopy(); - if(MonthElement != null) dest.MonthElement = (Hl7.Fhir.Model.FhirString)MonthElement.DeepCopy(); - if(DayElement != null) dest.DayElement = (Hl7.Fhir.Model.FhirString)DayElement.DeepCopy(); - if(SeasonElement != null) dest.SeasonElement = (Hl7.Fhir.Model.FhirString)SeasonElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(YearElement != null) dest.YearElement = (Hl7.Fhir.Model.FhirString)YearElement.DeepCopyInternal(); + if(MonthElement != null) dest.MonthElement = (Hl7.Fhir.Model.FhirString)MonthElement.DeepCopyInternal(); + if(DayElement != null) dest.DayElement = (Hl7.Fhir.Model.FhirString)DayElement.DeepCopyInternal(); + if(SeasonElement != null) dest.SeasonElement = (Hl7.Fhir.Model.FhirString)SeasonElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent()); + var instance = new CitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3203,7 +3218,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactWebLocationComponent; @@ -3212,15 +3227,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactWebLocationComponent()); + var instance = new CitedArtifactWebLocationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3331,7 +3347,7 @@ public Hl7.Fhir.Model.Citation.CitedArtifactClassificationWhoClassifiedComponent private Hl7.Fhir.Model.Citation.CitedArtifactClassificationWhoClassifiedComponent _WhoClassified; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactClassificationComponent; @@ -3340,16 +3356,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopy()); - if(WhoClassified != null) dest.WhoClassified = (Hl7.Fhir.Model.Citation.CitedArtifactClassificationWhoClassifiedComponent)WhoClassified.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopyInternal()); + if(WhoClassified != null) dest.WhoClassified = (Hl7.Fhir.Model.Citation.CitedArtifactClassificationWhoClassifiedComponent)WhoClassified.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactClassificationComponent()); + var instance = new CitedArtifactClassificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3533,7 +3550,7 @@ public bool? FreeToShare } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactClassificationWhoClassifiedComponent; @@ -3542,18 +3559,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Person != null) dest.Person = (Hl7.Fhir.Model.ResourceReference)Person.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Publisher != null) dest.Publisher = (Hl7.Fhir.Model.ResourceReference)Publisher.DeepCopy(); - if(ClassifierCopyrightElement != null) dest.ClassifierCopyrightElement = (Hl7.Fhir.Model.FhirString)ClassifierCopyrightElement.DeepCopy(); - if(FreeToShareElement != null) dest.FreeToShareElement = (Hl7.Fhir.Model.FhirBoolean)FreeToShareElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Person != null) dest.Person = (Hl7.Fhir.Model.ResourceReference)Person.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Publisher != null) dest.Publisher = (Hl7.Fhir.Model.ResourceReference)Publisher.DeepCopyInternal(); + if(ClassifierCopyrightElement != null) dest.ClassifierCopyrightElement = (Hl7.Fhir.Model.FhirString)ClassifierCopyrightElement.DeepCopyInternal(); + if(FreeToShareElement != null) dest.FreeToShareElement = (Hl7.Fhir.Model.FhirBoolean)FreeToShareElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactClassificationWhoClassifiedComponent()); + var instance = new CitedArtifactClassificationWhoClassifiedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3708,7 +3726,7 @@ public List Summary private List _Summary; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactContributorshipComponent; @@ -3717,16 +3735,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CompleteElement != null) dest.CompleteElement = (Hl7.Fhir.Model.FhirBoolean)CompleteElement.DeepCopy(); - if(Entry.Any()) dest.Entry = new List(Entry.DeepCopy()); - if(Summary.Any()) dest.Summary = new List(Summary.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CompleteElement != null) dest.CompleteElement = (Hl7.Fhir.Model.FhirBoolean)CompleteElement.DeepCopyInternal(); + if(Entry.Any()) dest.Entry = new List(Entry.DeepCopyInternal()); + if(Summary.Any()) dest.Summary = new List(Summary.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactContributorshipComponent()); + var instance = new CitedArtifactContributorshipComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4043,7 +4062,7 @@ public int? ListOrder } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactContributorshipEntryComponent; @@ -4052,25 +4071,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy(); - if(InitialsElement != null) dest.InitialsElement = (Hl7.Fhir.Model.FhirString)InitialsElement.DeepCopy(); - if(CollectiveNameElement != null) dest.CollectiveNameElement = (Hl7.Fhir.Model.FhirString)CollectiveNameElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(AffiliationInfo.Any()) dest.AffiliationInfo = new List(AffiliationInfo.DeepCopy()); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(ContributionType.Any()) dest.ContributionType = new List(ContributionType.DeepCopy()); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(ContributionInstance.Any()) dest.ContributionInstance = new List(ContributionInstance.DeepCopy()); - if(CorrespondingContactElement != null) dest.CorrespondingContactElement = (Hl7.Fhir.Model.FhirBoolean)CorrespondingContactElement.DeepCopy(); - if(ListOrderElement != null) dest.ListOrderElement = (Hl7.Fhir.Model.PositiveInt)ListOrderElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopyInternal(); + if(InitialsElement != null) dest.InitialsElement = (Hl7.Fhir.Model.FhirString)InitialsElement.DeepCopyInternal(); + if(CollectiveNameElement != null) dest.CollectiveNameElement = (Hl7.Fhir.Model.FhirString)CollectiveNameElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(AffiliationInfo.Any()) dest.AffiliationInfo = new List(AffiliationInfo.DeepCopyInternal()); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(ContributionType.Any()) dest.ContributionType = new List(ContributionType.DeepCopyInternal()); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(ContributionInstance.Any()) dest.ContributionInstance = new List(ContributionInstance.DeepCopyInternal()); + if(CorrespondingContactElement != null) dest.CorrespondingContactElement = (Hl7.Fhir.Model.FhirBoolean)CorrespondingContactElement.DeepCopyInternal(); + if(ListOrderElement != null) dest.ListOrderElement = (Hl7.Fhir.Model.PositiveInt)ListOrderElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactContributorshipEntryComponent()); + var instance = new CitedArtifactContributorshipEntryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4298,7 +4318,7 @@ public List Identifier private List _Identifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactContributorshipEntryAffiliationInfoComponent; @@ -4307,16 +4327,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AffiliationElement != null) dest.AffiliationElement = (Hl7.Fhir.Model.FhirString)AffiliationElement.DeepCopy(); - if(RoleElement != null) dest.RoleElement = (Hl7.Fhir.Model.FhirString)RoleElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(AffiliationElement != null) dest.AffiliationElement = (Hl7.Fhir.Model.FhirString)AffiliationElement.DeepCopyInternal(); + if(RoleElement != null) dest.RoleElement = (Hl7.Fhir.Model.FhirString)RoleElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactContributorshipEntryAffiliationInfoComponent()); + var instance = new CitedArtifactContributorshipEntryAffiliationInfoComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4439,7 +4460,7 @@ public string Time } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactContributorshipEntryContributionInstanceComponent; @@ -4448,15 +4469,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactContributorshipEntryContributionInstanceComponent()); + var instance = new CitedArtifactContributorshipEntryContributionInstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4599,7 +4621,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContributorshipSummaryComponent; @@ -4608,17 +4630,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Style != null) dest.Style = (Hl7.Fhir.Model.CodeableConcept)Style.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.CodeableConcept)Source.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.Markdown)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Style != null) dest.Style = (Hl7.Fhir.Model.CodeableConcept)Style.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.CodeableConcept)Source.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.Markdown)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContributorshipSummaryComponent()); + var instance = new ContributorshipSummaryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5322,7 +5345,7 @@ public Hl7.Fhir.Model.Citation.CitedArtifactComponent CitedArtifact List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Citation; @@ -5331,42 +5354,43 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(Summary.Any()) dest.Summary = new List(Summary.DeepCopy()); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(CurrentState.Any()) dest.CurrentState = new List(CurrentState.DeepCopy()); - if(StatusDate.Any()) dest.StatusDate = new List(StatusDate.DeepCopy()); - if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopy()); - if(CitedArtifact != null) dest.CitedArtifact = (Hl7.Fhir.Model.Citation.CitedArtifactComponent)CitedArtifact.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(Summary.Any()) dest.Summary = new List(Summary.DeepCopyInternal()); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(CurrentState.Any()) dest.CurrentState = new List(CurrentState.DeepCopyInternal()); + if(StatusDate.Any()) dest.StatusDate = new List(StatusDate.DeepCopyInternal()); + if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopyInternal()); + if(CitedArtifact != null) dest.CitedArtifact = (Hl7.Fhir.Model.Citation.CitedArtifactComponent)CitedArtifact.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Citation()); + var instance = new Citation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Claim.cs b/src/Hl7.Fhir.R4B/Model/Generated/Claim.cs index bf62163a93..de36812cf2 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Claim.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Claim.cs @@ -119,7 +119,7 @@ public Hl7.Fhir.Model.Identifier Reference private Hl7.Fhir.Model.Identifier _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedClaimComponent; @@ -128,16 +128,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedClaimComponent()); + var instance = new RelatedClaimComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -248,7 +249,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayeeComponent; @@ -257,15 +258,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayeeComponent()); + var instance = new PayeeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -444,7 +446,7 @@ public Hl7.Fhir.Model.CodeableConcept Qualification private Hl7.Fhir.Model.CodeableConcept _Qualification; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CareTeamComponent; @@ -453,18 +455,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Qualification != null) dest.Qualification = (Hl7.Fhir.Model.CodeableConcept)Qualification.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Qualification != null) dest.Qualification = (Hl7.Fhir.Model.CodeableConcept)Qualification.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CareTeamComponent()); + var instance = new CareTeamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -667,7 +670,7 @@ public Hl7.Fhir.Model.CodeableConcept Reason private Hl7.Fhir.Model.CodeableConcept _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportingInformationComponent; @@ -676,19 +679,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportingInformationComponent()); + var instance = new SupportingInformationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -885,7 +889,7 @@ public Hl7.Fhir.Model.CodeableConcept PackageCode private Hl7.Fhir.Model.CodeableConcept _PackageCode; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -894,18 +898,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(OnAdmission != null) dest.OnAdmission = (Hl7.Fhir.Model.CodeableConcept)OnAdmission.DeepCopy(); - if(PackageCode != null) dest.PackageCode = (Hl7.Fhir.Model.CodeableConcept)PackageCode.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(OnAdmission != null) dest.OnAdmission = (Hl7.Fhir.Model.CodeableConcept)OnAdmission.DeepCopyInternal(); + if(PackageCode != null) dest.PackageCode = (Hl7.Fhir.Model.CodeableConcept)PackageCode.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1113,7 +1118,7 @@ public List Udi private List _Udi; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcedureComponent; @@ -1122,18 +1127,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcedureComponent()); + var instance = new ProcedureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1401,7 +1407,7 @@ public Hl7.Fhir.Model.ResourceReference ClaimResponse private Hl7.Fhir.Model.ResourceReference _ClaimResponse; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -1410,20 +1416,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopy(); - if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopy()); - if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopyInternal(); + if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopyInternal()); + if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1597,7 +1604,7 @@ public Hl7.Fhir.Model.DataType Location private Hl7.Fhir.Model.DataType _Location; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AccidentComponent; @@ -1606,16 +1613,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AccidentComponent()); + var instance = new AccidentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2105,7 +2113,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -2114,34 +2122,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(CareTeamSequenceElement.Any()) dest.CareTeamSequenceElement = new List(CareTeamSequenceElement.DeepCopy()); - if(DiagnosisSequenceElement.Any()) dest.DiagnosisSequenceElement = new List(DiagnosisSequenceElement.DeepCopy()); - if(ProcedureSequenceElement.Any()) dest.ProcedureSequenceElement = new List(ProcedureSequenceElement.DeepCopy()); - if(InformationSequenceElement.Any()) dest.InformationSequenceElement = new List(InformationSequenceElement.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ItemComponent()); + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(CareTeamSequenceElement.Any()) dest.CareTeamSequenceElement = new List(CareTeamSequenceElement.DeepCopyInternal()); + if(DiagnosisSequenceElement.Any()) dest.DiagnosisSequenceElement = new List(DiagnosisSequenceElement.DeepCopyInternal()); + if(ProcedureSequenceElement.Any()) dest.ProcedureSequenceElement = new List(ProcedureSequenceElement.DeepCopyInternal()); + if(InformationSequenceElement.Any()) dest.InformationSequenceElement = new List(InformationSequenceElement.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); + if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2570,7 +2579,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -2579,25 +2588,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2940,7 +2950,7 @@ public List Udi private List _Udi; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubDetailComponent; @@ -2949,24 +2959,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubDetailComponent()); + var instance = new SubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3540,7 +3551,7 @@ public Hl7.Fhir.Model.Money Total List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Claim; @@ -3549,40 +3560,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopy(); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopy(); - if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.Claim.PayeeComponent)Payee.DeepCopy(); - if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopy(); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Accident != null) dest.Accident = (Hl7.Fhir.Model.Claim.AccidentComponent)Accident.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - if(Total != null) dest.Total = (Hl7.Fhir.Model.Money)Total.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopyInternal(); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); + if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopyInternal(); + if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.Claim.PayeeComponent)Payee.DeepCopyInternal(); + if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopyInternal(); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Accident != null) dest.Accident = (Hl7.Fhir.Model.Claim.AccidentComponent)Accident.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + if(Total != null) dest.Total = (Hl7.Fhir.Model.Money)Total.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Claim()); + var instance = new Claim(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ClaimResponse.cs b/src/Hl7.Fhir.R4B/Model/Generated/ClaimResponse.cs index 9a95b17903..9a2118cdf6 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ClaimResponse.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ClaimResponse.cs @@ -167,7 +167,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -176,17 +176,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemSequenceElement != null) dest.ItemSequenceElement = (Hl7.Fhir.Model.PositiveInt)ItemSequenceElement.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ItemSequenceElement != null) dest.ItemSequenceElement = (Hl7.Fhir.Model.PositiveInt)ItemSequenceElement.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -347,7 +348,7 @@ public decimal? Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdjudicationComponent; @@ -356,17 +357,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdjudicationComponent()); + var instance = new AdjudicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -546,7 +548,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemDetailComponent; @@ -555,17 +557,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DetailSequenceElement != null) dest.DetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceElement.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DetailSequenceElement != null) dest.DetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceElement.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemDetailComponent()); + var instance = new ItemDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -731,7 +734,7 @@ public List Adjudication private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubDetailComponent; @@ -740,16 +743,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SubDetailSequenceElement != null) dest.SubDetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)SubDetailSequenceElement.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SubDetailSequenceElement != null) dest.SubDetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)SubDetailSequenceElement.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubDetailComponent()); + var instance = new SubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1177,7 +1181,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemComponent; @@ -1186,31 +1190,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemSequenceElement.Any()) dest.ItemSequenceElement = new List(ItemSequenceElement.DeepCopy()); - if(DetailSequenceElement.Any()) dest.DetailSequenceElement = new List(DetailSequenceElement.DeepCopy()); - if(SubdetailSequenceElement.Any()) dest.SubdetailSequenceElement = new List(SubdetailSequenceElement.DeepCopy()); - if(Provider.Any()) dest.Provider = new List(Provider.DeepCopy()); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new AddedItemComponent()); + base.CopyToInternal(dest); + if(ItemSequenceElement.Any()) dest.ItemSequenceElement = new List(ItemSequenceElement.DeepCopyInternal()); + if(DetailSequenceElement.Any()) dest.DetailSequenceElement = new List(DetailSequenceElement.DeepCopyInternal()); + if(SubdetailSequenceElement.Any()) dest.SubdetailSequenceElement = new List(SubdetailSequenceElement.DeepCopyInternal()); + if(Provider.Any()) dest.Provider = new List(Provider.DeepCopyInternal()); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new AddedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1570,7 +1575,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemDetailComponent; @@ -1579,22 +1584,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemDetailComponent()); + var instance = new AddedItemDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1868,7 +1874,7 @@ public List Adjudication private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemSubDetailComponent; @@ -1877,21 +1883,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemSubDetailComponent()); + var instance = new AddedItemSubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2041,7 +2048,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TotalComponent; @@ -2050,15 +2057,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TotalComponent()); + var instance = new TotalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2230,7 +2238,7 @@ public Hl7.Fhir.Model.Identifier Identifier private Hl7.Fhir.Model.Identifier _Identifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentComponent; @@ -2239,19 +2247,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopy(); - if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopyInternal(); + if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentComponent()); + var instance = new PaymentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2465,7 +2474,7 @@ public Hl7.Fhir.Model.CodeableConcept Language private Hl7.Fhir.Model.CodeableConcept _Language; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NoteComponent; @@ -2474,17 +2483,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NoteComponent()); + var instance = new NoteComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2699,7 +2709,7 @@ public Hl7.Fhir.Model.ResourceReference ClaimResponse private Hl7.Fhir.Model.ResourceReference _ClaimResponse; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -2708,18 +2718,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopy(); - if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopyInternal(); + if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2924,7 +2935,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ErrorComponent; @@ -2933,17 +2944,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemSequenceElement != null) dest.ItemSequenceElement = (Hl7.Fhir.Model.PositiveInt)ItemSequenceElement.DeepCopy(); - if(DetailSequenceElement != null) dest.DetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceElement.DeepCopy(); - if(SubDetailSequenceElement != null) dest.SubDetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)SubDetailSequenceElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ItemSequenceElement != null) dest.ItemSequenceElement = (Hl7.Fhir.Model.PositiveInt)ItemSequenceElement.DeepCopyInternal(); + if(DetailSequenceElement != null) dest.DetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceElement.DeepCopyInternal(); + if(SubDetailSequenceElement != null) dest.SubDetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)SubDetailSequenceElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ErrorComponent()); + var instance = new ErrorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3513,7 +3525,7 @@ public List Error List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClaimResponse; @@ -3522,40 +3534,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopy(); - if(PreAuthPeriod != null) dest.PreAuthPeriod = (Hl7.Fhir.Model.Period)PreAuthPeriod.DeepCopy(); - if(PayeeType != null) dest.PayeeType = (Hl7.Fhir.Model.CodeableConcept)PayeeType.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Total.Any()) dest.Total = new List(Total.DeepCopy()); - if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ClaimResponse.PaymentComponent)Payment.DeepCopy(); - if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopy(); - if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.Attachment)Form.DeepCopy(); - if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopy()); - if(CommunicationRequest.Any()) dest.CommunicationRequest = new List(CommunicationRequest.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Error.Any()) dest.Error = new List(Error.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopyInternal(); + if(PreAuthPeriod != null) dest.PreAuthPeriod = (Hl7.Fhir.Model.Period)PreAuthPeriod.DeepCopyInternal(); + if(PayeeType != null) dest.PayeeType = (Hl7.Fhir.Model.CodeableConcept)PayeeType.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Total.Any()) dest.Total = new List(Total.DeepCopyInternal()); + if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ClaimResponse.PaymentComponent)Payment.DeepCopyInternal(); + if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopyInternal(); + if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.Attachment)Form.DeepCopyInternal(); + if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopyInternal()); + if(CommunicationRequest.Any()) dest.CommunicationRequest = new List(CommunicationRequest.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Error.Any()) dest.Error = new List(Error.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClaimResponse()); + var instance = new ClaimResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ClinicalImpression.cs b/src/Hl7.Fhir.R4B/Model/Generated/ClinicalImpression.cs index ffe3141b04..bf4d65bddc 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ClinicalImpression.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ClinicalImpression.cs @@ -134,7 +134,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InvestigationComponent; @@ -143,15 +143,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InvestigationComponent()); + var instance = new InvestigationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -283,7 +284,7 @@ public string Basis } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FindingComponent; @@ -292,16 +293,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemCodeableConcept != null) dest.ItemCodeableConcept = (Hl7.Fhir.Model.CodeableConcept)ItemCodeableConcept.DeepCopy(); - if(ItemReference != null) dest.ItemReference = (Hl7.Fhir.Model.ResourceReference)ItemReference.DeepCopy(); - if(BasisElement != null) dest.BasisElement = (Hl7.Fhir.Model.FhirString)BasisElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ItemCodeableConcept != null) dest.ItemCodeableConcept = (Hl7.Fhir.Model.CodeableConcept)ItemCodeableConcept.DeepCopyInternal(); + if(ItemReference != null) dest.ItemReference = (Hl7.Fhir.Model.ResourceReference)ItemReference.DeepCopyInternal(); + if(BasisElement != null) dest.BasisElement = (Hl7.Fhir.Model.FhirString)BasisElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FindingComponent()); + var instance = new FindingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -749,7 +751,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClinicalImpression; @@ -758,33 +760,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Assessor != null) dest.Assessor = (Hl7.Fhir.Model.ResourceReference)Assessor.DeepCopy(); - if(Previous != null) dest.Previous = (Hl7.Fhir.Model.ResourceReference)Previous.DeepCopy(); - if(Problem.Any()) dest.Problem = new List(Problem.DeepCopy()); - if(Investigation.Any()) dest.Investigation = new List(Investigation.DeepCopy()); - if(ProtocolElement.Any()) dest.ProtocolElement = new List(ProtocolElement.DeepCopy()); - if(SummaryElement != null) dest.SummaryElement = (Hl7.Fhir.Model.FhirString)SummaryElement.DeepCopy(); - if(Finding.Any()) dest.Finding = new List(Finding.DeepCopy()); - if(PrognosisCodeableConcept.Any()) dest.PrognosisCodeableConcept = new List(PrognosisCodeableConcept.DeepCopy()); - if(PrognosisReference.Any()) dest.PrognosisReference = new List(PrognosisReference.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ClinicalImpression()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Assessor != null) dest.Assessor = (Hl7.Fhir.Model.ResourceReference)Assessor.DeepCopyInternal(); + if(Previous != null) dest.Previous = (Hl7.Fhir.Model.ResourceReference)Previous.DeepCopyInternal(); + if(Problem.Any()) dest.Problem = new List(Problem.DeepCopyInternal()); + if(Investigation.Any()) dest.Investigation = new List(Investigation.DeepCopyInternal()); + if(ProtocolElement.Any()) dest.ProtocolElement = new List(ProtocolElement.DeepCopyInternal()); + if(SummaryElement != null) dest.SummaryElement = (Hl7.Fhir.Model.FhirString)SummaryElement.DeepCopyInternal(); + if(Finding.Any()) dest.Finding = new List(Finding.DeepCopyInternal()); + if(PrognosisCodeableConcept.Any()) dest.PrognosisCodeableConcept = new List(PrognosisCodeableConcept.DeepCopyInternal()); + if(PrognosisReference.Any()) dest.PrognosisReference = new List(PrognosisReference.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ClinicalImpression(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ClinicalUseDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/ClinicalUseDefinition.cs index 12dfcf6bc6..9d7d5aba25 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ClinicalUseDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ClinicalUseDefinition.cs @@ -182,7 +182,7 @@ public List OtherThe private List _OtherTherapy; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContraindicationComponent; @@ -191,18 +191,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DiseaseSymptomProcedure != null) dest.DiseaseSymptomProcedure = (Hl7.Fhir.Model.CodeableReference)DiseaseSymptomProcedure.DeepCopy(); - if(DiseaseStatus != null) dest.DiseaseStatus = (Hl7.Fhir.Model.CodeableReference)DiseaseStatus.DeepCopy(); - if(Comorbidity.Any()) dest.Comorbidity = new List(Comorbidity.DeepCopy()); - if(Indication.Any()) dest.Indication = new List(Indication.DeepCopy()); - if(OtherTherapy.Any()) dest.OtherTherapy = new List(OtherTherapy.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DiseaseSymptomProcedure != null) dest.DiseaseSymptomProcedure = (Hl7.Fhir.Model.CodeableReference)DiseaseSymptomProcedure.DeepCopyInternal(); + if(DiseaseStatus != null) dest.DiseaseStatus = (Hl7.Fhir.Model.CodeableReference)DiseaseStatus.DeepCopyInternal(); + if(Comorbidity.Any()) dest.Comorbidity = new List(Comorbidity.DeepCopyInternal()); + if(Indication.Any()) dest.Indication = new List(Indication.DeepCopyInternal()); + if(OtherTherapy.Any()) dest.OtherTherapy = new List(OtherTherapy.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContraindicationComponent()); + var instance = new ContraindicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -328,7 +329,7 @@ public Hl7.Fhir.Model.CodeableReference Therapy private Hl7.Fhir.Model.CodeableReference _Therapy; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OtherTherapyComponent; @@ -337,15 +338,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RelationshipType != null) dest.RelationshipType = (Hl7.Fhir.Model.CodeableConcept)RelationshipType.DeepCopy(); - if(Therapy != null) dest.Therapy = (Hl7.Fhir.Model.CodeableReference)Therapy.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RelationshipType != null) dest.RelationshipType = (Hl7.Fhir.Model.CodeableConcept)RelationshipType.DeepCopyInternal(); + if(Therapy != null) dest.Therapy = (Hl7.Fhir.Model.CodeableReference)Therapy.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OtherTherapyComponent()); + var instance = new OtherTherapyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -516,7 +518,7 @@ public List OtherThe private List _OtherTherapy; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IndicationComponent; @@ -525,20 +527,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DiseaseSymptomProcedure != null) dest.DiseaseSymptomProcedure = (Hl7.Fhir.Model.CodeableReference)DiseaseSymptomProcedure.DeepCopy(); - if(DiseaseStatus != null) dest.DiseaseStatus = (Hl7.Fhir.Model.CodeableReference)DiseaseStatus.DeepCopy(); - if(Comorbidity.Any()) dest.Comorbidity = new List(Comorbidity.DeepCopy()); - if(IntendedEffect != null) dest.IntendedEffect = (Hl7.Fhir.Model.CodeableReference)IntendedEffect.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.DataType)Duration.DeepCopy(); - if(UndesirableEffect.Any()) dest.UndesirableEffect = new List(UndesirableEffect.DeepCopy()); - if(OtherTherapy.Any()) dest.OtherTherapy = new List(OtherTherapy.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DiseaseSymptomProcedure != null) dest.DiseaseSymptomProcedure = (Hl7.Fhir.Model.CodeableReference)DiseaseSymptomProcedure.DeepCopyInternal(); + if(DiseaseStatus != null) dest.DiseaseStatus = (Hl7.Fhir.Model.CodeableReference)DiseaseStatus.DeepCopyInternal(); + if(Comorbidity.Any()) dest.Comorbidity = new List(Comorbidity.DeepCopyInternal()); + if(IntendedEffect != null) dest.IntendedEffect = (Hl7.Fhir.Model.CodeableReference)IntendedEffect.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.DataType)Duration.DeepCopyInternal(); + if(UndesirableEffect.Any()) dest.UndesirableEffect = new List(UndesirableEffect.DeepCopyInternal()); + if(OtherTherapy.Any()) dest.OtherTherapy = new List(OtherTherapy.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IndicationComponent()); + var instance = new IndicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -718,7 +721,7 @@ public List Management private List _Management; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InteractionComponent; @@ -727,18 +730,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Interactant.Any()) dest.Interactant = new List(Interactant.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Effect != null) dest.Effect = (Hl7.Fhir.Model.CodeableReference)Effect.DeepCopy(); - if(Incidence != null) dest.Incidence = (Hl7.Fhir.Model.CodeableConcept)Incidence.DeepCopy(); - if(Management.Any()) dest.Management = new List(Management.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Interactant.Any()) dest.Interactant = new List(Interactant.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Effect != null) dest.Effect = (Hl7.Fhir.Model.CodeableReference)Effect.DeepCopyInternal(); + if(Incidence != null) dest.Incidence = (Hl7.Fhir.Model.CodeableConcept)Incidence.DeepCopyInternal(); + if(Management.Any()) dest.Management = new List(Management.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InteractionComponent()); + var instance = new InteractionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -849,7 +853,7 @@ public Hl7.Fhir.Model.DataType Item private Hl7.Fhir.Model.DataType _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InteractantComponent; @@ -858,14 +862,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InteractantComponent()); + var instance = new InteractantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -971,7 +976,7 @@ public Hl7.Fhir.Model.CodeableConcept FrequencyOfOccurrence private Hl7.Fhir.Model.CodeableConcept _FrequencyOfOccurrence; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UndesirableEffectComponent; @@ -980,16 +985,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SymptomConditionEffect != null) dest.SymptomConditionEffect = (Hl7.Fhir.Model.CodeableReference)SymptomConditionEffect.DeepCopy(); - if(Classification != null) dest.Classification = (Hl7.Fhir.Model.CodeableConcept)Classification.DeepCopy(); - if(FrequencyOfOccurrence != null) dest.FrequencyOfOccurrence = (Hl7.Fhir.Model.CodeableConcept)FrequencyOfOccurrence.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SymptomConditionEffect != null) dest.SymptomConditionEffect = (Hl7.Fhir.Model.CodeableReference)SymptomConditionEffect.DeepCopyInternal(); + if(Classification != null) dest.Classification = (Hl7.Fhir.Model.CodeableConcept)Classification.DeepCopyInternal(); + if(FrequencyOfOccurrence != null) dest.FrequencyOfOccurrence = (Hl7.Fhir.Model.CodeableConcept)FrequencyOfOccurrence.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UndesirableEffectComponent()); + var instance = new UndesirableEffectComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1114,7 +1120,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as WarningComponent; @@ -1123,15 +1129,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new WarningComponent()); + var instance = new WarningComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1363,7 +1370,7 @@ public Hl7.Fhir.Model.ClinicalUseDefinition.WarningComponent Warning List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClinicalUseDefinition; @@ -1372,24 +1379,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(Contraindication != null) dest.Contraindication = (Hl7.Fhir.Model.ClinicalUseDefinition.ContraindicationComponent)Contraindication.DeepCopy(); - if(Indication != null) dest.Indication = (Hl7.Fhir.Model.ClinicalUseDefinition.IndicationComponent)Indication.DeepCopy(); - if(Interaction != null) dest.Interaction = (Hl7.Fhir.Model.ClinicalUseDefinition.InteractionComponent)Interaction.DeepCopy(); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(UndesirableEffect != null) dest.UndesirableEffect = (Hl7.Fhir.Model.ClinicalUseDefinition.UndesirableEffectComponent)UndesirableEffect.DeepCopy(); - if(Warning != null) dest.Warning = (Hl7.Fhir.Model.ClinicalUseDefinition.WarningComponent)Warning.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(Contraindication != null) dest.Contraindication = (Hl7.Fhir.Model.ClinicalUseDefinition.ContraindicationComponent)Contraindication.DeepCopyInternal(); + if(Indication != null) dest.Indication = (Hl7.Fhir.Model.ClinicalUseDefinition.IndicationComponent)Indication.DeepCopyInternal(); + if(Interaction != null) dest.Interaction = (Hl7.Fhir.Model.ClinicalUseDefinition.InteractionComponent)Interaction.DeepCopyInternal(); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(UndesirableEffect != null) dest.UndesirableEffect = (Hl7.Fhir.Model.ClinicalUseDefinition.UndesirableEffectComponent)UndesirableEffect.DeepCopyInternal(); + if(Warning != null) dest.Warning = (Hl7.Fhir.Model.ClinicalUseDefinition.WarningComponent)Warning.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClinicalUseDefinition()); + var instance = new ClinicalUseDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Communication.cs b/src/Hl7.Fhir.R4B/Model/Generated/Communication.cs index 2b4cf67be5..de286df31d 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Communication.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Communication.cs @@ -92,7 +92,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayloadComponent; @@ -101,14 +101,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayloadComponent()); + var instance = new PayloadComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -607,7 +608,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Communication; @@ -616,36 +617,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(InResponseTo.Any()) dest.InResponseTo = new List(InResponseTo.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Medium.Any()) dest.Medium = new List(Medium.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Topic != null) dest.Topic = (Hl7.Fhir.Model.CodeableConcept)Topic.DeepCopy(); - if(About.Any()) dest.About = new List(About.DeepCopy()); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(SentElement != null) dest.SentElement = (Hl7.Fhir.Model.FhirDateTime)SentElement.DeepCopy(); - if(ReceivedElement != null) dest.ReceivedElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedElement.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Payload.Any()) dest.Payload = new List(Payload.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Communication()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(InResponseTo.Any()) dest.InResponseTo = new List(InResponseTo.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Medium.Any()) dest.Medium = new List(Medium.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Topic != null) dest.Topic = (Hl7.Fhir.Model.CodeableConcept)Topic.DeepCopyInternal(); + if(About.Any()) dest.About = new List(About.DeepCopyInternal()); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(SentElement != null) dest.SentElement = (Hl7.Fhir.Model.FhirDateTime)SentElement.DeepCopyInternal(); + if(ReceivedElement != null) dest.ReceivedElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedElement.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); + if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Payload.Any()) dest.Payload = new List(Payload.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Communication(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/CommunicationRequest.cs b/src/Hl7.Fhir.R4B/Model/Generated/CommunicationRequest.cs index df96f3e789..9983e5f171 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/CommunicationRequest.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/CommunicationRequest.cs @@ -92,7 +92,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayloadComponent; @@ -101,14 +101,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayloadComponent()); + var instance = new PayloadComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -556,7 +557,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CommunicationRequest; @@ -565,35 +566,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Medium.Any()) dest.Medium = new List(Medium.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(About.Any()) dest.About = new List(About.DeepCopy()); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Payload.Any()) dest.Payload = new List(Payload.DeepCopy()); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new CommunicationRequest()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Medium.Any()) dest.Medium = new List(Medium.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(About.Any()) dest.About = new List(About.DeepCopyInternal()); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Payload.Any()) dest.Payload = new List(Payload.DeepCopyInternal()); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); + if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new CommunicationRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/CompartmentDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/CompartmentDefinition.cs index 3c72aff2fb..c14f10248d 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/CompartmentDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/CompartmentDefinition.cs @@ -173,7 +173,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceComponent; @@ -182,16 +182,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(ParamElement.Any()) dest.ParamElement = new List(ParamElement.DeepCopy()); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(ParamElement.Any()) dest.ParamElement = new List(ParamElement.DeepCopyInternal()); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceComponent()); + var instance = new ResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -647,7 +648,7 @@ public List Resource private List _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CompartmentDefinition; @@ -656,27 +657,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(SearchElement != null) dest.SearchElement = (Hl7.Fhir.Model.FhirBoolean)SearchElement.DeepCopy(); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new CompartmentDefinition()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(SearchElement != null) dest.SearchElement = (Hl7.Fhir.Model.FhirBoolean)SearchElement.DeepCopyInternal(); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new CompartmentDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Composition.cs b/src/Hl7.Fhir.R4B/Model/Generated/Composition.cs index fc21eb1a9e..772c146e5e 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Composition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Composition.cs @@ -237,7 +237,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AttesterComponent; @@ -246,16 +246,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AttesterComponent()); + var instance = new AttesterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -387,7 +388,7 @@ public Hl7.Fhir.Model.DataType Target private Hl7.Fhir.Model.DataType _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatesToComponent; @@ -396,15 +397,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatesToComponent()); + var instance = new RelatesToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -521,7 +523,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventComponent; @@ -530,16 +532,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventComponent()); + var instance = new EventComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -799,7 +802,7 @@ public List Section private List _Section; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SectionComponent; @@ -808,23 +811,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopy(); - if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopy(); - if(Entry.Any()) dest.Entry = new List(Entry.DeepCopy()); - if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopy(); - if(Section.Any()) dest.Section = new List(Section.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopyInternal(); + if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopyInternal(); + if(Entry.Any()) dest.Entry = new List(Entry.DeepCopyInternal()); + if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopyInternal(); + if(Section.Any()) dest.Section = new List(Section.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SectionComponent()); + var instance = new SectionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1237,7 +1241,7 @@ public List Section Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Composition; @@ -1246,28 +1250,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ConfidentialityElement != null) dest.ConfidentialityElement = (Code)ConfidentialityElement.DeepCopy(); - if(Attester.Any()) dest.Attester = new List(Attester.DeepCopy()); - if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy(); - if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopy()); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - if(Section.Any()) dest.Section = new List(Section.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ConfidentialityElement != null) dest.ConfidentialityElement = (Code)ConfidentialityElement.DeepCopyInternal(); + if(Attester.Any()) dest.Attester = new List(Attester.DeepCopyInternal()); + if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopyInternal(); + if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopyInternal()); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); + if(Section.Any()) dest.Section = new List(Section.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Composition()); + var instance = new Composition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ConceptMap.cs b/src/Hl7.Fhir.R4B/Model/Generated/ConceptMap.cs index e6da011b18..2009883aea 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ConceptMap.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ConceptMap.cs @@ -254,7 +254,7 @@ public Hl7.Fhir.Model.ConceptMap.UnmappedComponent Unmapped private Hl7.Fhir.Model.ConceptMap.UnmappedComponent _Unmapped; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -263,19 +263,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopy(); - if(SourceVersionElement != null) dest.SourceVersionElement = (Hl7.Fhir.Model.FhirString)SourceVersionElement.DeepCopy(); - if(TargetElement != null) dest.TargetElement = (Hl7.Fhir.Model.FhirUri)TargetElement.DeepCopy(); - if(TargetVersionElement != null) dest.TargetVersionElement = (Hl7.Fhir.Model.FhirString)TargetVersionElement.DeepCopy(); - if(Element.Any()) dest.Element = new List(Element.DeepCopy()); - if(Unmapped != null) dest.Unmapped = (Hl7.Fhir.Model.ConceptMap.UnmappedComponent)Unmapped.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopyInternal(); + if(SourceVersionElement != null) dest.SourceVersionElement = (Hl7.Fhir.Model.FhirString)SourceVersionElement.DeepCopyInternal(); + if(TargetElement != null) dest.TargetElement = (Hl7.Fhir.Model.FhirUri)TargetElement.DeepCopyInternal(); + if(TargetVersionElement != null) dest.TargetVersionElement = (Hl7.Fhir.Model.FhirString)TargetVersionElement.DeepCopyInternal(); + if(Element.Any()) dest.Element = new List(Element.DeepCopyInternal()); + if(Unmapped != null) dest.Unmapped = (Hl7.Fhir.Model.ConceptMap.UnmappedComponent)Unmapped.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -456,7 +457,7 @@ public List Target private List _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceElementComponent; @@ -465,16 +466,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceElementComponent()); + var instance = new SourceElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -710,7 +712,7 @@ public List Product private List _Product; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetElementComponent; @@ -719,19 +721,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(EquivalenceElement != null) dest.EquivalenceElement = (Code)EquivalenceElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopy()); - if(Product.Any()) dest.Product = new List(Product.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(EquivalenceElement != null) dest.EquivalenceElement = (Code)EquivalenceElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopyInternal()); + if(Product.Any()) dest.Product = new List(Product.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetElementComponent()); + var instance = new TargetElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -961,7 +964,7 @@ public string Display } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OtherElementComponent; @@ -970,17 +973,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PropertyElement != null) dest.PropertyElement = (Hl7.Fhir.Model.FhirUri)PropertyElement.DeepCopy(); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.Canonical)SystemElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PropertyElement != null) dest.PropertyElement = (Hl7.Fhir.Model.FhirUri)PropertyElement.DeepCopyInternal(); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.Canonical)SystemElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OtherElementComponent()); + var instance = new OtherElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1196,7 +1200,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UnmappedComponent; @@ -1205,17 +1209,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.Canonical)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.Canonical)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UnmappedComponent()); + var instance = new UnmappedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1733,7 +1738,7 @@ public List Group Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptMap; @@ -1742,31 +1747,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopy(); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopyInternal(); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptMap()); + var instance = new ConceptMap(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Condition.cs b/src/Hl7.Fhir.R4B/Model/Generated/Condition.cs index 9ad2d5a944..438638c483 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Condition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Condition.cs @@ -211,7 +211,7 @@ public Hl7.Fhir.Model.CodeableConcept Type private Hl7.Fhir.Model.CodeableConcept _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StageComponent; @@ -220,16 +220,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Summary != null) dest.Summary = (Hl7.Fhir.Model.CodeableConcept)Summary.DeepCopy(); - if(Assessment.Any()) dest.Assessment = new List(Assessment.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Summary != null) dest.Summary = (Hl7.Fhir.Model.CodeableConcept)Summary.DeepCopyInternal(); + if(Assessment.Any()) dest.Assessment = new List(Assessment.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StageComponent()); + var instance = new StageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -341,7 +342,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EvidenceComponent; @@ -350,15 +351,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EvidenceComponent()); + var instance = new EvidenceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -680,7 +682,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Condition; @@ -689,30 +691,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ClinicalStatus != null) dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopy(); - if(VerificationStatus != null) dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy(); - if(Abatement != null) dest.Abatement = (Hl7.Fhir.Model.DataType)Abatement.DeepCopy(); - if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy(); - if(Stage.Any()) dest.Stage = new List(Stage.DeepCopy()); - if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ClinicalStatus != null) dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopyInternal(); + if(VerificationStatus != null) dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopyInternal(); + if(Abatement != null) dest.Abatement = (Hl7.Fhir.Model.DataType)Abatement.DeepCopyInternal(); + if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopyInternal(); + if(Stage.Any()) dest.Stage = new List(Stage.DeepCopyInternal()); + if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Condition()); + var instance = new Condition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Consent.cs b/src/Hl7.Fhir.R4B/Model/Generated/Consent.cs index 0897e7849c..e3392b8a82 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Consent.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Consent.cs @@ -240,7 +240,7 @@ public string Uri } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PolicyComponent; @@ -249,15 +249,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AuthorityElement != null) dest.AuthorityElement = (Hl7.Fhir.Model.FhirUri)AuthorityElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AuthorityElement != null) dest.AuthorityElement = (Hl7.Fhir.Model.FhirUri)AuthorityElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PolicyComponent()); + var instance = new PolicyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -407,7 +408,7 @@ public string VerificationDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VerificationComponent; @@ -416,16 +417,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(VerifiedElement != null) dest.VerifiedElement = (Hl7.Fhir.Model.FhirBoolean)VerifiedElement.DeepCopy(); - if(VerifiedWith != null) dest.VerifiedWith = (Hl7.Fhir.Model.ResourceReference)VerifiedWith.DeepCopy(); - if(VerificationDateElement != null) dest.VerificationDateElement = (Hl7.Fhir.Model.FhirDateTime)VerificationDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(VerifiedElement != null) dest.VerifiedElement = (Hl7.Fhir.Model.FhirBoolean)VerifiedElement.DeepCopyInternal(); + if(VerifiedWith != null) dest.VerifiedWith = (Hl7.Fhir.Model.ResourceReference)VerifiedWith.DeepCopyInternal(); + if(VerificationDateElement != null) dest.VerificationDateElement = (Hl7.Fhir.Model.FhirDateTime)VerificationDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VerificationComponent()); + var instance = new VerificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -681,7 +683,7 @@ public List Provision private List _Provision; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as provisionComponent; @@ -690,24 +692,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Purpose.Any()) dest.Purpose = new List(Purpose.DeepCopy()); - if(Class.Any()) dest.Class = new List(Class.DeepCopy()); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(DataPeriod != null) dest.DataPeriod = (Hl7.Fhir.Model.Period)DataPeriod.DeepCopy(); - if(Data.Any()) dest.Data = new List(Data.DeepCopy()); - if(Provision.Any()) dest.Provision = new List(Provision.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Purpose.Any()) dest.Purpose = new List(Purpose.DeepCopyInternal()); + if(Class.Any()) dest.Class = new List(Class.DeepCopyInternal()); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(DataPeriod != null) dest.DataPeriod = (Hl7.Fhir.Model.Period)DataPeriod.DeepCopyInternal(); + if(Data.Any()) dest.Data = new List(Data.DeepCopyInternal()); + if(Provision.Any()) dest.Provision = new List(Provision.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new provisionComponent()); + var instance = new provisionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -882,7 +885,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as provisionActorComponent; @@ -891,15 +894,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new provisionActorComponent()); + var instance = new provisionActorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1021,7 +1025,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as provisionDataComponent; @@ -1030,15 +1034,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MeaningElement != null) dest.MeaningElement = (Code)MeaningElement.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MeaningElement != null) dest.MeaningElement = (Code)MeaningElement.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new provisionDataComponent()); + var instance = new provisionDataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1323,7 +1328,7 @@ public Hl7.Fhir.Model.Consent.provisionComponent Provision List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Consent; @@ -1332,26 +1337,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Organization.Any()) dest.Organization = new List(Organization.DeepCopy()); - if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopy(); - if(Policy.Any()) dest.Policy = new List(Policy.DeepCopy()); - if(PolicyRule != null) dest.PolicyRule = (Hl7.Fhir.Model.CodeableConcept)PolicyRule.DeepCopy(); - if(Verification.Any()) dest.Verification = new List(Verification.DeepCopy()); - if(Provision != null) dest.Provision = (Hl7.Fhir.Model.Consent.provisionComponent)Provision.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Organization.Any()) dest.Organization = new List(Organization.DeepCopyInternal()); + if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopyInternal(); + if(Policy.Any()) dest.Policy = new List(Policy.DeepCopyInternal()); + if(PolicyRule != null) dest.PolicyRule = (Hl7.Fhir.Model.CodeableConcept)PolicyRule.DeepCopyInternal(); + if(Verification.Any()) dest.Verification = new List(Verification.DeepCopyInternal()); + if(Provision != null) dest.Provision = (Hl7.Fhir.Model.Consent.provisionComponent)Provision.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Consent()); + var instance = new Consent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Contract.cs b/src/Hl7.Fhir.R4B/Model/Generated/Contract.cs index 9824bd43d2..79bebc836f 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Contract.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Contract.cs @@ -415,7 +415,7 @@ public string Copyright } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContentDefinitionComponent; @@ -424,19 +424,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(Publisher != null) dest.Publisher = (Hl7.Fhir.Model.ResourceReference)Publisher.DeepCopy(); - if(PublicationDateElement != null) dest.PublicationDateElement = (Hl7.Fhir.Model.FhirDateTime)PublicationDateElement.DeepCopy(); - if(PublicationStatusElement != null) dest.PublicationStatusElement = (Code)PublicationStatusElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(Publisher != null) dest.Publisher = (Hl7.Fhir.Model.ResourceReference)Publisher.DeepCopyInternal(); + if(PublicationDateElement != null) dest.PublicationDateElement = (Hl7.Fhir.Model.FhirDateTime)PublicationDateElement.DeepCopyInternal(); + if(PublicationStatusElement != null) dest.PublicationStatusElement = (Code)PublicationStatusElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContentDefinitionComponent()); + var instance = new ContentDefinitionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -742,7 +743,7 @@ public List Group private List _Group; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TermComponent; @@ -751,25 +752,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopy(); - if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopy(); - if(Topic != null) dest.Topic = (Hl7.Fhir.Model.DataType)Topic.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Offer != null) dest.Offer = (Hl7.Fhir.Model.Contract.ContractOfferComponent)Offer.DeepCopy(); - if(Asset.Any()) dest.Asset = new List(Asset.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopyInternal(); + if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopyInternal(); + if(Topic != null) dest.Topic = (Hl7.Fhir.Model.DataType)Topic.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Offer != null) dest.Offer = (Hl7.Fhir.Model.Contract.ContractOfferComponent)Offer.DeepCopyInternal(); + if(Asset.Any()) dest.Asset = new List(Asset.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TermComponent()); + var instance = new TermComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -998,7 +1000,7 @@ public List Control private List _Control; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SecurityLabelComponent; @@ -1007,17 +1009,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement.Any()) dest.NumberElement = new List(NumberElement.DeepCopy()); - if(Classification != null) dest.Classification = (Hl7.Fhir.Model.Coding)Classification.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Control.Any()) dest.Control = new List(Control.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NumberElement.Any()) dest.NumberElement = new List(NumberElement.DeepCopyInternal()); + if(Classification != null) dest.Classification = (Hl7.Fhir.Model.Coding)Classification.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Control.Any()) dest.Control = new List(Control.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SecurityLabelComponent()); + var instance = new SecurityLabelComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1300,7 +1303,7 @@ public IEnumerable SecurityLabelNumber } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContractOfferComponent; @@ -1309,23 +1312,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Party.Any()) dest.Party = new List(Party.DeepCopy()); - if(Topic != null) dest.Topic = (Hl7.Fhir.Model.ResourceReference)Topic.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopy(); - if(DecisionMode.Any()) dest.DecisionMode = new List(DecisionMode.DeepCopy()); - if(Answer.Any()) dest.Answer = new List(Answer.DeepCopy()); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopy()); - if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Party.Any()) dest.Party = new List(Party.DeepCopyInternal()); + if(Topic != null) dest.Topic = (Hl7.Fhir.Model.ResourceReference)Topic.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopyInternal(); + if(DecisionMode.Any()) dest.DecisionMode = new List(DecisionMode.DeepCopyInternal()); + if(Answer.Any()) dest.Answer = new List(Answer.DeepCopyInternal()); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopyInternal()); + if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContractOfferComponent()); + var instance = new ContractOfferComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1489,7 +1493,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContractPartyComponent; @@ -1498,15 +1502,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference.Any()) dest.Reference = new List(Reference.DeepCopy()); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference.Any()) dest.Reference = new List(Reference.DeepCopyInternal()); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContractPartyComponent()); + var instance = new ContractPartyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1592,7 +1597,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AnswerComponent; @@ -1601,14 +1606,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AnswerComponent()); + var instance = new AnswerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1954,7 +1960,7 @@ public List ValuedItem private List _ValuedItem; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContractAssetComponent; @@ -1963,28 +1969,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(TypeReference.Any()) dest.TypeReference = new List(TypeReference.DeepCopy()); - if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopy()); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.Coding)Relationship.DeepCopy(); - if(Context.Any()) dest.Context = new List(Context.DeepCopy()); - if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopy(); - if(PeriodType.Any()) dest.PeriodType = new List(PeriodType.DeepCopy()); - if(Period.Any()) dest.Period = new List(Period.DeepCopy()); - if(UsePeriod.Any()) dest.UsePeriod = new List(UsePeriod.DeepCopy()); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopy()); - if(Answer.Any()) dest.Answer = new List(Answer.DeepCopy()); - if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopy()); - if(ValuedItem.Any()) dest.ValuedItem = new List(ValuedItem.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(TypeReference.Any()) dest.TypeReference = new List(TypeReference.DeepCopyInternal()); + if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopyInternal()); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.Coding)Relationship.DeepCopyInternal(); + if(Context.Any()) dest.Context = new List(Context.DeepCopyInternal()); + if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopyInternal(); + if(PeriodType.Any()) dest.PeriodType = new List(PeriodType.DeepCopyInternal()); + if(Period.Any()) dest.Period = new List(Period.DeepCopyInternal()); + if(UsePeriod.Any()) dest.UsePeriod = new List(UsePeriod.DeepCopyInternal()); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopyInternal()); + if(Answer.Any()) dest.Answer = new List(Answer.DeepCopyInternal()); + if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopyInternal()); + if(ValuedItem.Any()) dest.ValuedItem = new List(ValuedItem.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContractAssetComponent()); + var instance = new ContractAssetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2218,7 +2225,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssetContextComponent; @@ -2227,16 +2234,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AssetContextComponent()); + var instance = new AssetContextComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2630,7 +2638,7 @@ public IEnumerable SecurityLabelNumber } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ValuedItemComponent; @@ -2639,27 +2647,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Entity != null) dest.Entity = (Hl7.Fhir.Model.DataType)Entity.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(EffectiveTimeElement != null) dest.EffectiveTimeElement = (Hl7.Fhir.Model.FhirDateTime)EffectiveTimeElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(PointsElement != null) dest.PointsElement = (Hl7.Fhir.Model.FhirDecimal)PointsElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(PaymentElement != null) dest.PaymentElement = (Hl7.Fhir.Model.FhirString)PaymentElement.DeepCopy(); - if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.FhirDateTime)PaymentDateElement.DeepCopy(); - if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy(); - if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopy(); - if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopy()); - if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Entity != null) dest.Entity = (Hl7.Fhir.Model.DataType)Entity.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(EffectiveTimeElement != null) dest.EffectiveTimeElement = (Hl7.Fhir.Model.FhirDateTime)EffectiveTimeElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(PointsElement != null) dest.PointsElement = (Hl7.Fhir.Model.FhirDecimal)PointsElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(PaymentElement != null) dest.PaymentElement = (Hl7.Fhir.Model.FhirString)PaymentElement.DeepCopyInternal(); + if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.FhirDateTime)PaymentDateElement.DeepCopyInternal(); + if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopyInternal(); + if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopyInternal(); + if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopyInternal()); + if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ValuedItemComponent()); + var instance = new ValuedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3278,7 +3287,7 @@ public IEnumerable SecurityLabelNumber } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionComponent; @@ -3287,34 +3296,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Intent != null) dest.Intent = (Hl7.Fhir.Model.CodeableConcept)Intent.DeepCopy(); - if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopy()); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(ContextLinkIdElement.Any()) dest.ContextLinkIdElement = new List(ContextLinkIdElement.DeepCopy()); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Requester.Any()) dest.Requester = new List(Requester.DeepCopy()); - if(RequesterLinkIdElement.Any()) dest.RequesterLinkIdElement = new List(RequesterLinkIdElement.DeepCopy()); - if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopy()); - if(PerformerRole != null) dest.PerformerRole = (Hl7.Fhir.Model.CodeableConcept)PerformerRole.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(PerformerLinkIdElement.Any()) dest.PerformerLinkIdElement = new List(PerformerLinkIdElement.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(ReasonElement.Any()) dest.ReasonElement = new List(ReasonElement.DeepCopy()); - if(ReasonLinkIdElement.Any()) dest.ReasonLinkIdElement = new List(ReasonLinkIdElement.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActionComponent()); + base.CopyToInternal(dest); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Intent != null) dest.Intent = (Hl7.Fhir.Model.CodeableConcept)Intent.DeepCopyInternal(); + if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopyInternal()); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(ContextLinkIdElement.Any()) dest.ContextLinkIdElement = new List(ContextLinkIdElement.DeepCopyInternal()); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Requester.Any()) dest.Requester = new List(Requester.DeepCopyInternal()); + if(RequesterLinkIdElement.Any()) dest.RequesterLinkIdElement = new List(RequesterLinkIdElement.DeepCopyInternal()); + if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopyInternal()); + if(PerformerRole != null) dest.PerformerRole = (Hl7.Fhir.Model.CodeableConcept)PerformerRole.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(PerformerLinkIdElement.Any()) dest.PerformerLinkIdElement = new List(PerformerLinkIdElement.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(ReasonElement.Any()) dest.ReasonElement = new List(ReasonElement.DeepCopyInternal()); + if(ReasonLinkIdElement.Any()) dest.ReasonLinkIdElement = new List(ReasonLinkIdElement.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3565,7 +3575,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionSubjectComponent; @@ -3574,15 +3584,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference.Any()) dest.Reference = new List(Reference.DeepCopy()); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference.Any()) dest.Reference = new List(Reference.DeepCopyInternal()); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActionSubjectComponent()); + var instance = new ActionSubjectComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3701,7 +3712,7 @@ public List Signature private List _Signature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SignatoryComponent; @@ -3710,16 +3721,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - if(Signature.Any()) dest.Signature = new List(Signature.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); + if(Signature.Any()) dest.Signature = new List(Signature.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SignatoryComponent()); + var instance = new SignatoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3816,7 +3828,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FriendlyLanguageComponent; @@ -3825,14 +3837,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FriendlyLanguageComponent()); + var instance = new FriendlyLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3913,7 +3926,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LegalLanguageComponent; @@ -3922,14 +3935,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LegalLanguageComponent()); + var instance = new LegalLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4010,7 +4024,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComputableLanguageComponent; @@ -4019,14 +4033,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComputableLanguageComponent()); + var instance = new ComputableLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4711,7 +4726,7 @@ public Hl7.Fhir.Model.DataType LegallyBinding List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Contract; @@ -4720,46 +4735,47 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(LegalState != null) dest.LegalState = (Hl7.Fhir.Model.CodeableConcept)LegalState.DeepCopy(); - if(InstantiatesCanonical != null) dest.InstantiatesCanonical = (Hl7.Fhir.Model.ResourceReference)InstantiatesCanonical.DeepCopy(); - if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopy(); - if(ContentDerivative != null) dest.ContentDerivative = (Hl7.Fhir.Model.CodeableConcept)ContentDerivative.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopy(); - if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopy(); - if(ExpirationType != null) dest.ExpirationType = (Hl7.Fhir.Model.CodeableConcept)ExpirationType.DeepCopy(); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Authority.Any()) dest.Authority = new List(Authority.DeepCopy()); - if(Domain.Any()) dest.Domain = new List(Domain.DeepCopy()); - if(Site.Any()) dest.Site = new List(Site.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopy(); - if(Topic != null) dest.Topic = (Hl7.Fhir.Model.DataType)Topic.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType.Any()) dest.SubType = new List(SubType.DeepCopy()); - if(ContentDefinition != null) dest.ContentDefinition = (Hl7.Fhir.Model.Contract.ContentDefinitionComponent)ContentDefinition.DeepCopy(); - if(Term.Any()) dest.Term = new List(Term.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - if(Signer.Any()) dest.Signer = new List(Signer.DeepCopy()); - if(Friendly.Any()) dest.Friendly = new List(Friendly.DeepCopy()); - if(Legal.Any()) dest.Legal = new List(Legal.DeepCopy()); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - if(LegallyBinding != null) dest.LegallyBinding = (Hl7.Fhir.Model.DataType)LegallyBinding.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(LegalState != null) dest.LegalState = (Hl7.Fhir.Model.CodeableConcept)LegalState.DeepCopyInternal(); + if(InstantiatesCanonical != null) dest.InstantiatesCanonical = (Hl7.Fhir.Model.ResourceReference)InstantiatesCanonical.DeepCopyInternal(); + if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopyInternal(); + if(ContentDerivative != null) dest.ContentDerivative = (Hl7.Fhir.Model.CodeableConcept)ContentDerivative.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopyInternal(); + if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopyInternal(); + if(ExpirationType != null) dest.ExpirationType = (Hl7.Fhir.Model.CodeableConcept)ExpirationType.DeepCopyInternal(); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Authority.Any()) dest.Authority = new List(Authority.DeepCopyInternal()); + if(Domain.Any()) dest.Domain = new List(Domain.DeepCopyInternal()); + if(Site.Any()) dest.Site = new List(Site.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopyInternal(); + if(Topic != null) dest.Topic = (Hl7.Fhir.Model.DataType)Topic.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType.Any()) dest.SubType = new List(SubType.DeepCopyInternal()); + if(ContentDefinition != null) dest.ContentDefinition = (Hl7.Fhir.Model.Contract.ContentDefinitionComponent)ContentDefinition.DeepCopyInternal(); + if(Term.Any()) dest.Term = new List(Term.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); + if(Signer.Any()) dest.Signer = new List(Signer.DeepCopyInternal()); + if(Friendly.Any()) dest.Friendly = new List(Friendly.DeepCopyInternal()); + if(Legal.Any()) dest.Legal = new List(Legal.DeepCopyInternal()); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); + if(LegallyBinding != null) dest.LegallyBinding = (Hl7.Fhir.Model.DataType)LegallyBinding.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Contract()); + var instance = new Contract(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Contributor.cs b/src/Hl7.Fhir.R4B/Model/Generated/Contributor.cs index 9ed423b2c9..a802457669 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Contributor.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Contributor.cs @@ -173,7 +173,7 @@ public List Contact private List _Contact; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Contributor; @@ -182,16 +182,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Contributor()); + var instance = new Contributor(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Count.cs b/src/Hl7.Fhir.R4B/Model/Generated/Count.cs index 1fb5e18f17..7e8f72eb13 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Count.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Count.cs @@ -60,9 +60,11 @@ public partial class Count : Quantity /// public override string TypeName { get { return "Count"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Count()); + var instance = new Count(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Coverage.cs b/src/Hl7.Fhir.R4B/Model/Generated/Coverage.cs index 23b4e3acb0..9f712bf839 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Coverage.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Coverage.cs @@ -155,7 +155,7 @@ public string Name } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClassComponent; @@ -164,16 +164,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClassComponent()); + var instance = new ClassComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -298,7 +299,7 @@ public List Exception private List _Exception; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CostToBeneficiaryComponent; @@ -307,16 +308,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Exception.Any()) dest.Exception = new List(Exception.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Exception.Any()) dest.Exception = new List(Exception.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CostToBeneficiaryComponent()); + var instance = new CostToBeneficiaryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -424,7 +426,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExemptionComponent; @@ -433,15 +435,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExemptionComponent()); + var instance = new ExemptionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -849,7 +852,7 @@ public List Contract List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Coverage; @@ -858,30 +861,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(PolicyHolder != null) dest.PolicyHolder = (Hl7.Fhir.Model.ResourceReference)PolicyHolder.DeepCopy(); - if(Subscriber != null) dest.Subscriber = (Hl7.Fhir.Model.ResourceReference)Subscriber.DeepCopy(); - if(SubscriberIdElement != null) dest.SubscriberIdElement = (Hl7.Fhir.Model.FhirString)SubscriberIdElement.DeepCopy(); - if(Beneficiary != null) dest.Beneficiary = (Hl7.Fhir.Model.ResourceReference)Beneficiary.DeepCopy(); - if(DependentElement != null) dest.DependentElement = (Hl7.Fhir.Model.FhirString)DependentElement.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Payor.Any()) dest.Payor = new List(Payor.DeepCopy()); - if(Class.Any()) dest.Class = new List(Class.DeepCopy()); - if(OrderElement != null) dest.OrderElement = (Hl7.Fhir.Model.PositiveInt)OrderElement.DeepCopy(); - if(NetworkElement != null) dest.NetworkElement = (Hl7.Fhir.Model.FhirString)NetworkElement.DeepCopy(); - if(CostToBeneficiary.Any()) dest.CostToBeneficiary = new List(CostToBeneficiary.DeepCopy()); - if(SubrogationElement != null) dest.SubrogationElement = (Hl7.Fhir.Model.FhirBoolean)SubrogationElement.DeepCopy(); - if(Contract.Any()) dest.Contract = new List(Contract.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(PolicyHolder != null) dest.PolicyHolder = (Hl7.Fhir.Model.ResourceReference)PolicyHolder.DeepCopyInternal(); + if(Subscriber != null) dest.Subscriber = (Hl7.Fhir.Model.ResourceReference)Subscriber.DeepCopyInternal(); + if(SubscriberIdElement != null) dest.SubscriberIdElement = (Hl7.Fhir.Model.FhirString)SubscriberIdElement.DeepCopyInternal(); + if(Beneficiary != null) dest.Beneficiary = (Hl7.Fhir.Model.ResourceReference)Beneficiary.DeepCopyInternal(); + if(DependentElement != null) dest.DependentElement = (Hl7.Fhir.Model.FhirString)DependentElement.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Payor.Any()) dest.Payor = new List(Payor.DeepCopyInternal()); + if(Class.Any()) dest.Class = new List(Class.DeepCopyInternal()); + if(OrderElement != null) dest.OrderElement = (Hl7.Fhir.Model.PositiveInt)OrderElement.DeepCopyInternal(); + if(NetworkElement != null) dest.NetworkElement = (Hl7.Fhir.Model.FhirString)NetworkElement.DeepCopyInternal(); + if(CostToBeneficiary.Any()) dest.CostToBeneficiary = new List(CostToBeneficiary.DeepCopyInternal()); + if(SubrogationElement != null) dest.SubrogationElement = (Hl7.Fhir.Model.FhirBoolean)SubrogationElement.DeepCopyInternal(); + if(Contract.Any()) dest.Contract = new List(Contract.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Coverage()); + var instance = new Coverage(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/CoverageEligibilityRequest.cs b/src/Hl7.Fhir.R4B/Model/Generated/CoverageEligibilityRequest.cs index 391ca9b221..5fcd5d535f 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/CoverageEligibilityRequest.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/CoverageEligibilityRequest.cs @@ -189,7 +189,7 @@ public bool? AppliesToAll } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportingInformationComponent; @@ -198,16 +198,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Information != null) dest.Information = (Hl7.Fhir.Model.ResourceReference)Information.DeepCopy(); - if(AppliesToAllElement != null) dest.AppliesToAllElement = (Hl7.Fhir.Model.FhirBoolean)AppliesToAllElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Information != null) dest.Information = (Hl7.Fhir.Model.ResourceReference)Information.DeepCopyInternal(); + if(AppliesToAllElement != null) dest.AppliesToAllElement = (Hl7.Fhir.Model.FhirBoolean)AppliesToAllElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportingInformationComponent()); + var instance = new SupportingInformationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -366,7 +367,7 @@ public string BusinessArrangement } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -375,16 +376,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -625,7 +627,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailsComponent; @@ -634,23 +636,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SupportingInfoSequenceElement.Any()) dest.SupportingInfoSequenceElement = new List(SupportingInfoSequenceElement.DeepCopy()); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SupportingInfoSequenceElement.Any()) dest.SupportingInfoSequenceElement = new List(SupportingInfoSequenceElement.DeepCopyInternal()); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailsComponent()); + var instance = new DetailsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -803,7 +806,7 @@ public Hl7.Fhir.Model.DataType Diagnosis private Hl7.Fhir.Model.DataType _Diagnosis; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -812,14 +815,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1131,7 +1135,7 @@ public List Item List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageEligibilityRequest; @@ -1140,27 +1144,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(PurposeElement.Any()) dest.PurposeElement = new List>(PurposeElement.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(PurposeElement.Any()) dest.PurposeElement = new List>(PurposeElement.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageEligibilityRequest()); + var instance = new CoverageEligibilityRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/CoverageEligibilityResponse.cs b/src/Hl7.Fhir.R4B/Model/Generated/CoverageEligibilityResponse.cs index fb9e3fa311..f942ac3ce8 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/CoverageEligibilityResponse.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/CoverageEligibilityResponse.cs @@ -184,7 +184,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -193,17 +193,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(InforceElement != null) dest.InforceElement = (Hl7.Fhir.Model.FhirBoolean)InforceElement.DeepCopy(); - if(BenefitPeriod != null) dest.BenefitPeriod = (Hl7.Fhir.Model.Period)BenefitPeriod.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(InforceElement != null) dest.InforceElement = (Hl7.Fhir.Model.FhirBoolean)InforceElement.DeepCopyInternal(); + if(BenefitPeriod != null) dest.BenefitPeriod = (Hl7.Fhir.Model.Period)BenefitPeriod.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -575,7 +576,7 @@ public string AuthorizationUrl } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemsComponent; @@ -584,27 +585,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopy(); - if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopy()); - if(AuthorizationRequiredElement != null) dest.AuthorizationRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AuthorizationRequiredElement.DeepCopy(); - if(AuthorizationSupporting.Any()) dest.AuthorizationSupporting = new List(AuthorizationSupporting.DeepCopy()); - if(AuthorizationUrlElement != null) dest.AuthorizationUrlElement = (Hl7.Fhir.Model.FhirUri)AuthorizationUrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopyInternal(); + if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopyInternal()); + if(AuthorizationRequiredElement != null) dest.AuthorizationRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AuthorizationRequiredElement.DeepCopyInternal(); + if(AuthorizationSupporting.Any()) dest.AuthorizationSupporting = new List(AuthorizationSupporting.DeepCopyInternal()); + if(AuthorizationUrlElement != null) dest.AuthorizationUrlElement = (Hl7.Fhir.Model.FhirUri)AuthorizationUrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemsComponent()); + var instance = new ItemsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -817,7 +819,7 @@ public Hl7.Fhir.Model.DataType Used private Hl7.Fhir.Model.DataType _Used; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BenefitComponent; @@ -826,16 +828,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopy(); - if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopyInternal(); + if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BenefitComponent()); + var instance = new BenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -930,7 +933,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ErrorsComponent; @@ -939,14 +942,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ErrorsComponent()); + var instance = new ErrorsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1326,7 +1330,7 @@ public List Error List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageEligibilityResponse; @@ -1335,28 +1339,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(PurposeElement.Any()) dest.PurposeElement = new List>(PurposeElement.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(Error.Any()) dest.Error = new List(Error.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(PurposeElement.Any()) dest.PurposeElement = new List>(PurposeElement.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(Error.Any()) dest.Error = new List(Error.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageEligibilityResponse()); + var instance = new CoverageEligibilityResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/DataRequirement.cs b/src/Hl7.Fhir.R4B/Model/Generated/DataRequirement.cs index 339459816d..1e97b19128 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/DataRequirement.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/DataRequirement.cs @@ -204,7 +204,7 @@ public List Code private List _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeFilterComponent; @@ -213,17 +213,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CodeFilterComponent()); + var instance = new CodeFilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -388,7 +389,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DateFilterComponent; @@ -397,16 +398,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DateFilterComponent()); + var instance = new DateFilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -553,7 +555,7 @@ public Hl7.Fhir.Model.DataRequirement.SortDirection? Direction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SortComponent; @@ -562,15 +564,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SortComponent()); + var instance = new SortComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -814,7 +817,7 @@ public List Sort private List _Sort; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DataRequirement; @@ -823,21 +826,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(MustSupportElement.Any()) dest.MustSupportElement = new List(MustSupportElement.DeepCopy()); - if(CodeFilter.Any()) dest.CodeFilter = new List(CodeFilter.DeepCopy()); - if(DateFilter.Any()) dest.DateFilter = new List(DateFilter.DeepCopy()); - if(LimitElement != null) dest.LimitElement = (Hl7.Fhir.Model.PositiveInt)LimitElement.DeepCopy(); - if(Sort.Any()) dest.Sort = new List(Sort.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(MustSupportElement.Any()) dest.MustSupportElement = new List(MustSupportElement.DeepCopyInternal()); + if(CodeFilter.Any()) dest.CodeFilter = new List(CodeFilter.DeepCopyInternal()); + if(DateFilter.Any()) dest.DateFilter = new List(DateFilter.DeepCopyInternal()); + if(LimitElement != null) dest.LimitElement = (Hl7.Fhir.Model.PositiveInt)LimitElement.DeepCopyInternal(); + if(Sort.Any()) dest.Sort = new List(Sort.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DataRequirement()); + var instance = new DataRequirement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/DetectedIssue.cs b/src/Hl7.Fhir.R4B/Model/Generated/DetectedIssue.cs index c1e47e8820..d52b7f25de 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/DetectedIssue.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/DetectedIssue.cs @@ -134,7 +134,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EvidenceComponent; @@ -143,15 +143,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EvidenceComponent()); + var instance = new EvidenceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -284,7 +285,7 @@ public Hl7.Fhir.Model.ResourceReference Author private Hl7.Fhir.Model.ResourceReference _Author; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MitigationComponent; @@ -293,16 +294,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MitigationComponent()); + var instance = new MitigationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -614,7 +616,7 @@ public List Mitigation List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetectedIssue; @@ -623,25 +625,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Identified != null) dest.Identified = (Hl7.Fhir.Model.DataType)Identified.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Implicated.Any()) dest.Implicated = new List(Implicated.DeepCopy()); - if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopy()); - if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopy(); - if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopy(); - if(Mitigation.Any()) dest.Mitigation = new List(Mitigation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Identified != null) dest.Identified = (Hl7.Fhir.Model.DataType)Identified.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Implicated.Any()) dest.Implicated = new List(Implicated.DeepCopyInternal()); + if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopyInternal()); + if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopyInternal(); + if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopyInternal(); + if(Mitigation.Any()) dest.Mitigation = new List(Mitigation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetectedIssue()); + var instance = new DetectedIssue(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Device.cs b/src/Hl7.Fhir.R4B/Model/Generated/Device.cs index cbf12b02c6..632aecb0db 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Device.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Device.cs @@ -344,7 +344,7 @@ public Hl7.Fhir.Model.Device.UDIEntryType? EntryType } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UdiCarrierComponent; @@ -353,19 +353,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopy(); - if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopy(); - if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopy(); - if(CarrierAIDCElement != null) dest.CarrierAIDCElement = (Hl7.Fhir.Model.Base64Binary)CarrierAIDCElement.DeepCopy(); - if(CarrierHRFElement != null) dest.CarrierHRFElement = (Hl7.Fhir.Model.FhirString)CarrierHRFElement.DeepCopy(); - if(EntryTypeElement != null) dest.EntryTypeElement = (Code)EntryTypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopyInternal(); + if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopyInternal(); + if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopyInternal(); + if(CarrierAIDCElement != null) dest.CarrierAIDCElement = (Hl7.Fhir.Model.Base64Binary)CarrierAIDCElement.DeepCopyInternal(); + if(CarrierHRFElement != null) dest.CarrierHRFElement = (Hl7.Fhir.Model.FhirString)CarrierHRFElement.DeepCopyInternal(); + if(EntryTypeElement != null) dest.EntryTypeElement = (Code)EntryTypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UdiCarrierComponent()); + var instance = new UdiCarrierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -535,7 +536,7 @@ public Hl7.Fhir.Model.DeviceNameType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceNameComponent; @@ -544,15 +545,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceNameComponent()); + var instance = new DeviceNameComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -666,7 +668,7 @@ public string Version } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SpecializationComponent; @@ -675,15 +677,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SystemType != null) dest.SystemType = (Hl7.Fhir.Model.CodeableConcept)SystemType.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SystemType != null) dest.SystemType = (Hl7.Fhir.Model.CodeableConcept)SystemType.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SpecializationComponent()); + var instance = new SpecializationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -810,7 +813,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VersionComponent; @@ -819,16 +822,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Component != null) dest.Component = (Hl7.Fhir.Model.Identifier)Component.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Component != null) dest.Component = (Hl7.Fhir.Model.Identifier)Component.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VersionComponent()); + var instance = new VersionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -947,7 +951,7 @@ public List ValueCode private List _ValueCode; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -956,16 +960,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ValueQuantity.Any()) dest.ValueQuantity = new List(ValueQuantity.DeepCopy()); - if(ValueCode.Any()) dest.ValueCode = new List(ValueCode.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ValueQuantity.Any()) dest.ValueQuantity = new List(ValueQuantity.DeepCopyInternal()); + if(ValueCode.Any()) dest.ValueCode = new List(ValueCode.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1573,7 +1578,7 @@ public Hl7.Fhir.Model.ResourceReference Parent List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Device; @@ -1582,39 +1587,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopy(); - if(UdiCarrier.Any()) dest.UdiCarrier = new List(UdiCarrier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopy()); - if(DistinctIdentifierElement != null) dest.DistinctIdentifierElement = (Hl7.Fhir.Model.FhirString)DistinctIdentifierElement.DeepCopy(); - if(ManufacturerElement != null) dest.ManufacturerElement = (Hl7.Fhir.Model.FhirString)ManufacturerElement.DeepCopy(); - if(ManufactureDateElement != null) dest.ManufactureDateElement = (Hl7.Fhir.Model.FhirDateTime)ManufactureDateElement.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopy(); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(SerialNumberElement != null) dest.SerialNumberElement = (Hl7.Fhir.Model.FhirString)SerialNumberElement.DeepCopy(); - if(DeviceName.Any()) dest.DeviceName = new List(DeviceName.DeepCopy()); - if(ModelNumberElement != null) dest.ModelNumberElement = (Hl7.Fhir.Model.FhirString)ModelNumberElement.DeepCopy(); - if(PartNumberElement != null) dest.PartNumberElement = (Hl7.Fhir.Model.FhirString)PartNumberElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Specialization.Any()) dest.Specialization = new List(Specialization.DeepCopy()); - if(Version.Any()) dest.Version = new List(Version.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Safety.Any()) dest.Safety = new List(Safety.DeepCopy()); - if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopyInternal(); + if(UdiCarrier.Any()) dest.UdiCarrier = new List(UdiCarrier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopyInternal()); + if(DistinctIdentifierElement != null) dest.DistinctIdentifierElement = (Hl7.Fhir.Model.FhirString)DistinctIdentifierElement.DeepCopyInternal(); + if(ManufacturerElement != null) dest.ManufacturerElement = (Hl7.Fhir.Model.FhirString)ManufacturerElement.DeepCopyInternal(); + if(ManufactureDateElement != null) dest.ManufactureDateElement = (Hl7.Fhir.Model.FhirDateTime)ManufactureDateElement.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopyInternal(); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(SerialNumberElement != null) dest.SerialNumberElement = (Hl7.Fhir.Model.FhirString)SerialNumberElement.DeepCopyInternal(); + if(DeviceName.Any()) dest.DeviceName = new List(DeviceName.DeepCopyInternal()); + if(ModelNumberElement != null) dest.ModelNumberElement = (Hl7.Fhir.Model.FhirString)ModelNumberElement.DeepCopyInternal(); + if(PartNumberElement != null) dest.PartNumberElement = (Hl7.Fhir.Model.FhirString)PartNumberElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Specialization.Any()) dest.Specialization = new List(Specialization.DeepCopyInternal()); + if(Version.Any()) dest.Version = new List(Version.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Safety.Any()) dest.Safety = new List(Safety.DeepCopyInternal()); + if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Device()); + var instance = new Device(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/DeviceDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/DeviceDefinition.cs index 9631347677..bdf3912fc8 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/DeviceDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/DeviceDefinition.cs @@ -172,7 +172,7 @@ public string Jurisdiction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UdiDeviceIdentifierComponent; @@ -181,16 +181,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopy(); - if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopy(); - if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopyInternal(); + if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopyInternal(); + if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UdiDeviceIdentifierComponent()); + var instance = new UdiDeviceIdentifierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -333,7 +334,7 @@ public Hl7.Fhir.Model.DeviceNameType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceNameComponent; @@ -342,15 +343,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceNameComponent()); + var instance = new DeviceNameComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -482,7 +484,7 @@ public string Version } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SpecializationComponent; @@ -491,15 +493,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SystemTypeElement != null) dest.SystemTypeElement = (Hl7.Fhir.Model.FhirString)SystemTypeElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SystemTypeElement != null) dest.SystemTypeElement = (Hl7.Fhir.Model.FhirString)SystemTypeElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SpecializationComponent()); + var instance = new SpecializationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -596,7 +599,7 @@ public List Description private List _Description; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CapabilityComponent; @@ -605,15 +608,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Description.Any()) dest.Description = new List(Description.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Description.Any()) dest.Description = new List(Description.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CapabilityComponent()); + var instance = new CapabilityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -724,7 +728,7 @@ public List ValueCode private List _ValueCode; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -733,16 +737,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ValueQuantity.Any()) dest.ValueQuantity = new List(ValueQuantity.DeepCopy()); - if(ValueCode.Any()) dest.ValueCode = new List(ValueCode.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ValueQuantity.Any()) dest.ValueQuantity = new List(ValueQuantity.DeepCopyInternal()); + if(ValueCode.Any()) dest.ValueCode = new List(ValueCode.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -895,7 +900,7 @@ public bool? AllergenicIndicator } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MaterialComponent; @@ -904,16 +909,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopy(); - if(AlternateElement != null) dest.AlternateElement = (Hl7.Fhir.Model.FhirBoolean)AlternateElement.DeepCopy(); - if(AllergenicIndicatorElement != null) dest.AllergenicIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)AllergenicIndicatorElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopyInternal(); + if(AlternateElement != null) dest.AlternateElement = (Hl7.Fhir.Model.FhirBoolean)AlternateElement.DeepCopyInternal(); + if(AllergenicIndicatorElement != null) dest.AllergenicIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)AllergenicIndicatorElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MaterialComponent()); + var instance = new MaterialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1359,7 +1365,7 @@ public List Material List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceDefinition; @@ -1368,35 +1374,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(UdiDeviceIdentifier.Any()) dest.UdiDeviceIdentifier = new List(UdiDeviceIdentifier.DeepCopy()); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.DataType)Manufacturer.DeepCopy(); - if(DeviceName.Any()) dest.DeviceName = new List(DeviceName.DeepCopy()); - if(ModelNumberElement != null) dest.ModelNumberElement = (Hl7.Fhir.Model.FhirString)ModelNumberElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Specialization.Any()) dest.Specialization = new List(Specialization.DeepCopy()); - if(VersionElement.Any()) dest.VersionElement = new List(VersionElement.DeepCopy()); - if(Safety.Any()) dest.Safety = new List(Safety.DeepCopy()); - if(ShelfLifeStorage.Any()) dest.ShelfLifeStorage = new List(ShelfLifeStorage.DeepCopy()); - if(PhysicalCharacteristics != null) dest.PhysicalCharacteristics = (Hl7.Fhir.Model.ProdCharacteristic)PhysicalCharacteristics.DeepCopy(); - if(LanguageCode.Any()) dest.LanguageCode = new List(LanguageCode.DeepCopy()); - if(Capability.Any()) dest.Capability = new List(Capability.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(OnlineInformationElement != null) dest.OnlineInformationElement = (Hl7.Fhir.Model.FhirUri)OnlineInformationElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(ParentDevice != null) dest.ParentDevice = (Hl7.Fhir.Model.ResourceReference)ParentDevice.DeepCopy(); - if(Material.Any()) dest.Material = new List(Material.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(UdiDeviceIdentifier.Any()) dest.UdiDeviceIdentifier = new List(UdiDeviceIdentifier.DeepCopyInternal()); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.DataType)Manufacturer.DeepCopyInternal(); + if(DeviceName.Any()) dest.DeviceName = new List(DeviceName.DeepCopyInternal()); + if(ModelNumberElement != null) dest.ModelNumberElement = (Hl7.Fhir.Model.FhirString)ModelNumberElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Specialization.Any()) dest.Specialization = new List(Specialization.DeepCopyInternal()); + if(VersionElement.Any()) dest.VersionElement = new List(VersionElement.DeepCopyInternal()); + if(Safety.Any()) dest.Safety = new List(Safety.DeepCopyInternal()); + if(ShelfLifeStorage.Any()) dest.ShelfLifeStorage = new List(ShelfLifeStorage.DeepCopyInternal()); + if(PhysicalCharacteristics != null) dest.PhysicalCharacteristics = (Hl7.Fhir.Model.ProdCharacteristic)PhysicalCharacteristics.DeepCopyInternal(); + if(LanguageCode.Any()) dest.LanguageCode = new List(LanguageCode.DeepCopyInternal()); + if(Capability.Any()) dest.Capability = new List(Capability.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(OnlineInformationElement != null) dest.OnlineInformationElement = (Hl7.Fhir.Model.FhirUri)OnlineInformationElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(ParentDevice != null) dest.ParentDevice = (Hl7.Fhir.Model.ResourceReference)ParentDevice.DeepCopyInternal(); + if(Material.Any()) dest.Material = new List(Material.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceDefinition()); + var instance = new DeviceDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/DeviceMetric.cs b/src/Hl7.Fhir.R4B/Model/Generated/DeviceMetric.cs index 9e4ff8eaf7..e9f2251221 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/DeviceMetric.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/DeviceMetric.cs @@ -364,7 +364,7 @@ public DateTimeOffset? Time } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CalibrationComponent; @@ -373,16 +373,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(StateElement != null) dest.StateElement = (Code)StateElement.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.Instant)TimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(StateElement != null) dest.StateElement = (Code)StateElement.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.Instant)TimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CalibrationComponent()); + var instance = new CalibrationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -648,7 +649,7 @@ public List Calibration List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceMetric; @@ -657,23 +658,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopy(); - if(OperationalStatusElement != null) dest.OperationalStatusElement = (Code)OperationalStatusElement.DeepCopy(); - if(ColorElement != null) dest.ColorElement = (Code)ColorElement.DeepCopy(); - if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopy(); - if(MeasurementPeriod != null) dest.MeasurementPeriod = (Hl7.Fhir.Model.Timing)MeasurementPeriod.DeepCopy(); - if(Calibration.Any()) dest.Calibration = new List(Calibration.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopyInternal(); + if(OperationalStatusElement != null) dest.OperationalStatusElement = (Code)OperationalStatusElement.DeepCopyInternal(); + if(ColorElement != null) dest.ColorElement = (Code)ColorElement.DeepCopyInternal(); + if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopyInternal(); + if(MeasurementPeriod != null) dest.MeasurementPeriod = (Hl7.Fhir.Model.Timing)MeasurementPeriod.DeepCopyInternal(); + if(Calibration.Any()) dest.Calibration = new List(Calibration.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceMetric()); + var instance = new DeviceMetric(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/DeviceRequest.cs b/src/Hl7.Fhir.R4B/Model/Generated/DeviceRequest.cs index 4be05f3888..037b4c4494 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/DeviceRequest.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/DeviceRequest.cs @@ -104,7 +104,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -113,15 +113,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -648,7 +649,7 @@ public List RelevantHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceRequest; @@ -657,37 +658,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PriorRequest.Any()) dest.PriorRequest = new List(PriorRequest.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.DataType)Code.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new DeviceRequest()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PriorRequest.Any()) dest.PriorRequest = new List(PriorRequest.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.DataType)Code.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new DeviceRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/DeviceUseStatement.cs b/src/Hl7.Fhir.R4B/Model/Generated/DeviceUseStatement.cs index 5aebdadb6c..a3a0562116 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/DeviceUseStatement.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/DeviceUseStatement.cs @@ -338,7 +338,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceUseStatement; @@ -347,26 +347,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopy()); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(RecordedOnElement != null) dest.RecordedOnElement = (Hl7.Fhir.Model.FhirDateTime)RecordedOnElement.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopyInternal()); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(RecordedOnElement != null) dest.RecordedOnElement = (Hl7.Fhir.Model.FhirDateTime)RecordedOnElement.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceUseStatement()); + var instance = new DeviceUseStatement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/DiagnosticReport.cs b/src/Hl7.Fhir.R4B/Model/Generated/DiagnosticReport.cs index f7266e6aad..cc0abb221a 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/DiagnosticReport.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/DiagnosticReport.cs @@ -193,7 +193,7 @@ public Hl7.Fhir.Model.ResourceReference Link private Hl7.Fhir.Model.ResourceReference _Link; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MediaComponent; @@ -202,15 +202,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Link != null) dest.Link = (Hl7.Fhir.Model.ResourceReference)Link.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Link != null) dest.Link = (Hl7.Fhir.Model.ResourceReference)Link.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MediaComponent()); + var instance = new MediaComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -592,7 +593,7 @@ public List PresentedForm List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosticReport; @@ -601,31 +602,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(ResultsInterpreter.Any()) dest.ResultsInterpreter = new List(ResultsInterpreter.DeepCopy()); - if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopy()); - if(Result.Any()) dest.Result = new List(Result.DeepCopy()); - if(ImagingStudy.Any()) dest.ImagingStudy = new List(ImagingStudy.DeepCopy()); - if(Media.Any()) dest.Media = new List(Media.DeepCopy()); - if(ConclusionElement != null) dest.ConclusionElement = (Hl7.Fhir.Model.FhirString)ConclusionElement.DeepCopy(); - if(ConclusionCode.Any()) dest.ConclusionCode = new List(ConclusionCode.DeepCopy()); - if(PresentedForm.Any()) dest.PresentedForm = new List(PresentedForm.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(ResultsInterpreter.Any()) dest.ResultsInterpreter = new List(ResultsInterpreter.DeepCopyInternal()); + if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopyInternal()); + if(Result.Any()) dest.Result = new List(Result.DeepCopyInternal()); + if(ImagingStudy.Any()) dest.ImagingStudy = new List(ImagingStudy.DeepCopyInternal()); + if(Media.Any()) dest.Media = new List(Media.DeepCopyInternal()); + if(ConclusionElement != null) dest.ConclusionElement = (Hl7.Fhir.Model.FhirString)ConclusionElement.DeepCopyInternal(); + if(ConclusionCode.Any()) dest.ConclusionCode = new List(ConclusionCode.DeepCopyInternal()); + if(PresentedForm.Any()) dest.PresentedForm = new List(PresentedForm.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosticReport()); + var instance = new DiagnosticReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Distance.cs b/src/Hl7.Fhir.R4B/Model/Generated/Distance.cs index a3997c96b1..1a74fdf6fd 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Distance.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Distance.cs @@ -59,9 +59,11 @@ public partial class Distance : Quantity /// public override string TypeName { get { return "Distance"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Distance()); + var instance = new Distance(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.R4B/Model/Generated/DocumentManifest.cs b/src/Hl7.Fhir.R4B/Model/Generated/DocumentManifest.cs index 43d83b990d..d49d8fbc57 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/DocumentManifest.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/DocumentManifest.cs @@ -104,7 +104,7 @@ public Hl7.Fhir.Model.ResourceReference Ref private Hl7.Fhir.Model.ResourceReference _Ref; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedComponent; @@ -113,15 +113,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Ref != null) dest.Ref = (Hl7.Fhir.Model.ResourceReference)Ref.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Ref != null) dest.Ref = (Hl7.Fhir.Model.ResourceReference)Ref.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedComponent()); + var instance = new RelatedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -424,7 +425,7 @@ public List Related List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DocumentManifest; @@ -433,25 +434,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MasterIdentifier != null) dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Content.Any()) dest.Content = new List(Content.DeepCopy()); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(MasterIdentifier != null) dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Content.Any()) dest.Content = new List(Content.DeepCopyInternal()); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DocumentManifest()); + var instance = new DocumentManifest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/DocumentReference.cs b/src/Hl7.Fhir.R4B/Model/Generated/DocumentReference.cs index efb5983673..6fc7c4fb29 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/DocumentReference.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/DocumentReference.cs @@ -127,7 +127,7 @@ public Hl7.Fhir.Model.ResourceReference Target private Hl7.Fhir.Model.ResourceReference _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatesToComponent; @@ -136,15 +136,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatesToComponent()); + var instance = new RelatesToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -244,7 +245,7 @@ public Hl7.Fhir.Model.Coding Format private Hl7.Fhir.Model.Coding _Format; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContentComponent; @@ -253,15 +254,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopy(); - if(Format != null) dest.Format = (Hl7.Fhir.Model.Coding)Format.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopyInternal(); + if(Format != null) dest.Format = (Hl7.Fhir.Model.Coding)Format.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContentComponent()); + var instance = new ContentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -437,7 +439,7 @@ public List Related private List _Related; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContextComponent; @@ -446,20 +448,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopy()); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(FacilityType != null) dest.FacilityType = (Hl7.Fhir.Model.CodeableConcept)FacilityType.DeepCopy(); - if(PracticeSetting != null) dest.PracticeSetting = (Hl7.Fhir.Model.CodeableConcept)PracticeSetting.DeepCopy(); - if(SourcePatientInfo != null) dest.SourcePatientInfo = (Hl7.Fhir.Model.ResourceReference)SourcePatientInfo.DeepCopy(); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopyInternal()); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(FacilityType != null) dest.FacilityType = (Hl7.Fhir.Model.CodeableConcept)FacilityType.DeepCopyInternal(); + if(PracticeSetting != null) dest.PracticeSetting = (Hl7.Fhir.Model.CodeableConcept)PracticeSetting.DeepCopyInternal(); + if(SourcePatientInfo != null) dest.SourcePatientInfo = (Hl7.Fhir.Model.ResourceReference)SourcePatientInfo.DeepCopyInternal(); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContextComponent()); + var instance = new ContextComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -859,7 +862,7 @@ public Hl7.Fhir.Model.DocumentReference.ContextComponent Context List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DocumentReference; @@ -868,29 +871,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MasterIdentifier != null) dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DocStatusElement != null) dest.DocStatusElement = (Code)DocStatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Instant)DateElement.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Authenticator != null) dest.Authenticator = (Hl7.Fhir.Model.ResourceReference)Authenticator.DeepCopy(); - if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy(); - if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Content.Any()) dest.Content = new List(Content.DeepCopy()); - if(Context != null) dest.Context = (Hl7.Fhir.Model.DocumentReference.ContextComponent)Context.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MasterIdentifier != null) dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DocStatusElement != null) dest.DocStatusElement = (Code)DocStatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Instant)DateElement.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Authenticator != null) dest.Authenticator = (Hl7.Fhir.Model.ResourceReference)Authenticator.DeepCopyInternal(); + if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopyInternal(); + if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Content.Any()) dest.Content = new List(Content.DeepCopyInternal()); + if(Context != null) dest.Context = (Hl7.Fhir.Model.DocumentReference.ContextComponent)Context.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DocumentReference()); + var instance = new DocumentReference(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Dosage.cs b/src/Hl7.Fhir.R4B/Model/Generated/Dosage.cs index 78b61c9e89..c8d3db6211 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Dosage.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Dosage.cs @@ -119,7 +119,7 @@ public Hl7.Fhir.Model.DataType Rate private Hl7.Fhir.Model.DataType _Rate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DoseAndRateComponent; @@ -128,16 +128,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Dose != null) dest.Dose = (Hl7.Fhir.Model.DataType)Dose.DeepCopy(); - if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Dose != null) dest.Dose = (Hl7.Fhir.Model.DataType)Dose.DeepCopyInternal(); + if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DoseAndRateComponent()); + var instance = new DoseAndRateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -433,7 +434,7 @@ public Hl7.Fhir.Model.Quantity MaxDosePerLifetime private Hl7.Fhir.Model.Quantity _MaxDosePerLifetime; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Dosage; @@ -442,26 +443,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.Integer)SequenceElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(AdditionalInstruction.Any()) dest.AdditionalInstruction = new List(AdditionalInstruction.DeepCopy()); - if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.Timing)Timing.DeepCopy(); - if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopy(); - if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy(); - if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(DoseAndRate.Any()) dest.DoseAndRate = new List(DoseAndRate.DeepCopy()); - if(MaxDosePerPeriod != null) dest.MaxDosePerPeriod = (Hl7.Fhir.Model.Ratio)MaxDosePerPeriod.DeepCopy(); - if(MaxDosePerAdministration != null) dest.MaxDosePerAdministration = (Hl7.Fhir.Model.Quantity)MaxDosePerAdministration.DeepCopy(); - if(MaxDosePerLifetime != null) dest.MaxDosePerLifetime = (Hl7.Fhir.Model.Quantity)MaxDosePerLifetime.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.Integer)SequenceElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(AdditionalInstruction.Any()) dest.AdditionalInstruction = new List(AdditionalInstruction.DeepCopyInternal()); + if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.Timing)Timing.DeepCopyInternal(); + if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopyInternal(); + if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopyInternal(); + if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(DoseAndRate.Any()) dest.DoseAndRate = new List(DoseAndRate.DeepCopyInternal()); + if(MaxDosePerPeriod != null) dest.MaxDosePerPeriod = (Hl7.Fhir.Model.Ratio)MaxDosePerPeriod.DeepCopyInternal(); + if(MaxDosePerAdministration != null) dest.MaxDosePerAdministration = (Hl7.Fhir.Model.Quantity)MaxDosePerAdministration.DeepCopyInternal(); + if(MaxDosePerLifetime != null) dest.MaxDosePerLifetime = (Hl7.Fhir.Model.Quantity)MaxDosePerLifetime.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Dosage()); + var instance = new Dosage(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Duration.cs b/src/Hl7.Fhir.R4B/Model/Generated/Duration.cs index 4da217c14c..2d9d3d9ae0 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Duration.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Duration.cs @@ -59,9 +59,11 @@ public partial class Duration : Quantity /// public override string TypeName { get { return "Duration"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Duration()); + var instance = new Duration(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Encounter.cs b/src/Hl7.Fhir.R4B/Model/Generated/Encounter.cs index 257c5aa4bc..d147c4bae2 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Encounter.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Encounter.cs @@ -224,7 +224,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StatusHistoryComponent; @@ -233,15 +233,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StatusHistoryComponent()); + var instance = new StatusHistoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -342,7 +343,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClassHistoryComponent; @@ -351,15 +352,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Class != null) dest.Class = (Hl7.Fhir.Model.Coding)Class.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Class != null) dest.Class = (Hl7.Fhir.Model.Coding)Class.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClassHistoryComponent()); + var instance = new ClassHistoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -474,7 +476,7 @@ public Hl7.Fhir.Model.ResourceReference Individual private Hl7.Fhir.Model.ResourceReference _Individual; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -483,16 +485,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Individual != null) dest.Individual = (Hl7.Fhir.Model.ResourceReference)Individual.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Individual != null) dest.Individual = (Hl7.Fhir.Model.ResourceReference)Individual.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -630,7 +633,7 @@ public int? Rank } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -639,16 +642,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopy(); - if(Use != null) dest.Use = (Hl7.Fhir.Model.CodeableConcept)Use.DeepCopy(); - if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopyInternal(); + if(Use != null) dest.Use = (Hl7.Fhir.Model.CodeableConcept)Use.DeepCopyInternal(); + if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -859,7 +863,7 @@ public Hl7.Fhir.Model.CodeableConcept DischargeDisposition private Hl7.Fhir.Model.CodeableConcept _DischargeDisposition; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HospitalizationComponent; @@ -868,22 +872,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PreAdmissionIdentifier != null) dest.PreAdmissionIdentifier = (Hl7.Fhir.Model.Identifier)PreAdmissionIdentifier.DeepCopy(); - if(Origin != null) dest.Origin = (Hl7.Fhir.Model.ResourceReference)Origin.DeepCopy(); - if(AdmitSource != null) dest.AdmitSource = (Hl7.Fhir.Model.CodeableConcept)AdmitSource.DeepCopy(); - if(ReAdmission != null) dest.ReAdmission = (Hl7.Fhir.Model.CodeableConcept)ReAdmission.DeepCopy(); - if(DietPreference.Any()) dest.DietPreference = new List(DietPreference.DeepCopy()); - if(SpecialCourtesy.Any()) dest.SpecialCourtesy = new List(SpecialCourtesy.DeepCopy()); - if(SpecialArrangement.Any()) dest.SpecialArrangement = new List(SpecialArrangement.DeepCopy()); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(DischargeDisposition != null) dest.DischargeDisposition = (Hl7.Fhir.Model.CodeableConcept)DischargeDisposition.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PreAdmissionIdentifier != null) dest.PreAdmissionIdentifier = (Hl7.Fhir.Model.Identifier)PreAdmissionIdentifier.DeepCopyInternal(); + if(Origin != null) dest.Origin = (Hl7.Fhir.Model.ResourceReference)Origin.DeepCopyInternal(); + if(AdmitSource != null) dest.AdmitSource = (Hl7.Fhir.Model.CodeableConcept)AdmitSource.DeepCopyInternal(); + if(ReAdmission != null) dest.ReAdmission = (Hl7.Fhir.Model.CodeableConcept)ReAdmission.DeepCopyInternal(); + if(DietPreference.Any()) dest.DietPreference = new List(DietPreference.DeepCopyInternal()); + if(SpecialCourtesy.Any()) dest.SpecialCourtesy = new List(SpecialCourtesy.DeepCopyInternal()); + if(SpecialArrangement.Any()) dest.SpecialArrangement = new List(SpecialArrangement.DeepCopyInternal()); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(DischargeDisposition != null) dest.DischargeDisposition = (Hl7.Fhir.Model.CodeableConcept)DischargeDisposition.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HospitalizationComponent()); + var instance = new HospitalizationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1088,7 +1093,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LocationComponent; @@ -1097,17 +1102,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(PhysicalType != null) dest.PhysicalType = (Hl7.Fhir.Model.CodeableConcept)PhysicalType.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(PhysicalType != null) dest.PhysicalType = (Hl7.Fhir.Model.CodeableConcept)PhysicalType.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LocationComponent()); + var instance = new LocationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1536,7 +1542,7 @@ public Hl7.Fhir.Model.ResourceReference PartOf List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Encounter; @@ -1545,36 +1551,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopy()); - if(Class != null) dest.Class = (Hl7.Fhir.Model.Coding)Class.DeepCopy(); - if(ClassHistory.Any()) dest.ClassHistory = new List(ClassHistory.DeepCopy()); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(ServiceType != null) dest.ServiceType = (Hl7.Fhir.Model.CodeableConcept)ServiceType.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(EpisodeOfCare.Any()) dest.EpisodeOfCare = new List(EpisodeOfCare.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Appointment.Any()) dest.Appointment = new List(Appointment.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Length != null) dest.Length = (Hl7.Fhir.Model.Duration)Length.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Account.Any()) dest.Account = new List(Account.DeepCopy()); - if(Hospitalization != null) dest.Hospitalization = (Hl7.Fhir.Model.Encounter.HospitalizationComponent)Hospitalization.DeepCopy(); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(ServiceProvider != null) dest.ServiceProvider = (Hl7.Fhir.Model.ResourceReference)ServiceProvider.DeepCopy(); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopyInternal()); + if(Class != null) dest.Class = (Hl7.Fhir.Model.Coding)Class.DeepCopyInternal(); + if(ClassHistory.Any()) dest.ClassHistory = new List(ClassHistory.DeepCopyInternal()); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(ServiceType != null) dest.ServiceType = (Hl7.Fhir.Model.CodeableConcept)ServiceType.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(EpisodeOfCare.Any()) dest.EpisodeOfCare = new List(EpisodeOfCare.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Appointment.Any()) dest.Appointment = new List(Appointment.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Length != null) dest.Length = (Hl7.Fhir.Model.Duration)Length.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Account.Any()) dest.Account = new List(Account.DeepCopyInternal()); + if(Hospitalization != null) dest.Hospitalization = (Hl7.Fhir.Model.Encounter.HospitalizationComponent)Hospitalization.DeepCopyInternal(); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(ServiceProvider != null) dest.ServiceProvider = (Hl7.Fhir.Model.ResourceReference)ServiceProvider.DeepCopyInternal(); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Encounter()); + var instance = new Encounter(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Endpoint.cs b/src/Hl7.Fhir.R4B/Model/Generated/Endpoint.cs index 363cabbcab..c6d303f59f 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Endpoint.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Endpoint.cs @@ -355,7 +355,7 @@ public IEnumerable Header List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Endpoint; @@ -364,24 +364,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ConnectionType != null) dest.ConnectionType = (Hl7.Fhir.Model.Coding)ConnectionType.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(PayloadType.Any()) dest.PayloadType = new List(PayloadType.DeepCopy()); - if(PayloadMimeTypeElement.Any()) dest.PayloadMimeTypeElement = new List(PayloadMimeTypeElement.DeepCopy()); - if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirUrl)AddressElement.DeepCopy(); - if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ConnectionType != null) dest.ConnectionType = (Hl7.Fhir.Model.Coding)ConnectionType.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(PayloadType.Any()) dest.PayloadType = new List(PayloadType.DeepCopyInternal()); + if(PayloadMimeTypeElement.Any()) dest.PayloadMimeTypeElement = new List(PayloadMimeTypeElement.DeepCopyInternal()); + if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirUrl)AddressElement.DeepCopyInternal(); + if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Endpoint()); + var instance = new Endpoint(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/EnrollmentRequest.cs b/src/Hl7.Fhir.R4B/Model/Generated/EnrollmentRequest.cs index a77b71d102..d00a3cdba5 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/EnrollmentRequest.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/EnrollmentRequest.cs @@ -199,7 +199,7 @@ public Hl7.Fhir.Model.ResourceReference Coverage List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnrollmentRequest; @@ -208,20 +208,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Candidate != null) dest.Candidate = (Hl7.Fhir.Model.ResourceReference)Candidate.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Candidate != null) dest.Candidate = (Hl7.Fhir.Model.ResourceReference)Candidate.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnrollmentRequest()); + var instance = new EnrollmentRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/EnrollmentResponse.cs b/src/Hl7.Fhir.R4B/Model/Generated/EnrollmentResponse.cs index a6bb2f1b70..e9dd710d2b 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/EnrollmentResponse.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/EnrollmentResponse.cs @@ -248,7 +248,7 @@ public Hl7.Fhir.Model.ResourceReference RequestProvider List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnrollmentResponse; @@ -257,21 +257,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnrollmentResponse()); + var instance = new EnrollmentResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/EpisodeOfCare.cs b/src/Hl7.Fhir.R4B/Model/Generated/EpisodeOfCare.cs index be80eeea7a..1acf9144c1 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/EpisodeOfCare.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/EpisodeOfCare.cs @@ -175,7 +175,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StatusHistoryComponent; @@ -184,15 +184,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StatusHistoryComponent()); + var instance = new StatusHistoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -322,7 +323,7 @@ public int? Rank } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -331,16 +332,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -604,7 +606,7 @@ public List Account List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EpisodeOfCare; @@ -613,25 +615,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopy()); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(ReferralRequest.Any()) dest.ReferralRequest = new List(ReferralRequest.DeepCopy()); - if(CareManager != null) dest.CareManager = (Hl7.Fhir.Model.ResourceReference)CareManager.DeepCopy(); - if(Team.Any()) dest.Team = new List(Team.DeepCopy()); - if(Account.Any()) dest.Account = new List(Account.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopyInternal()); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(ReferralRequest.Any()) dest.ReferralRequest = new List(ReferralRequest.DeepCopyInternal()); + if(CareManager != null) dest.CareManager = (Hl7.Fhir.Model.ResourceReference)CareManager.DeepCopyInternal(); + if(Team.Any()) dest.Team = new List(Team.DeepCopyInternal()); + if(Account.Any()) dest.Account = new List(Account.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EpisodeOfCare()); + var instance = new EpisodeOfCare(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/EventDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/EventDefinition.cs index ffd536ec3f..7b98bfeaac 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/EventDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/EventDefinition.cs @@ -715,7 +715,7 @@ public List Trigger List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventDefinition; @@ -724,41 +724,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventDefinition()); + var instance = new EventDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Evidence.cs b/src/Hl7.Fhir.R4B/Model/Generated/Evidence.cs index c0137e3048..a393983dc0 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Evidence.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Evidence.cs @@ -176,7 +176,7 @@ public Hl7.Fhir.Model.CodeableConcept DirectnessMatch private Hl7.Fhir.Model.CodeableConcept _DirectnessMatch; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VariableDefinitionComponent; @@ -185,19 +185,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(VariableRole != null) dest.VariableRole = (Hl7.Fhir.Model.CodeableConcept)VariableRole.DeepCopy(); - if(Observed != null) dest.Observed = (Hl7.Fhir.Model.ResourceReference)Observed.DeepCopy(); - if(Intended != null) dest.Intended = (Hl7.Fhir.Model.ResourceReference)Intended.DeepCopy(); - if(DirectnessMatch != null) dest.DirectnessMatch = (Hl7.Fhir.Model.CodeableConcept)DirectnessMatch.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(VariableRole != null) dest.VariableRole = (Hl7.Fhir.Model.CodeableConcept)VariableRole.DeepCopyInternal(); + if(Observed != null) dest.Observed = (Hl7.Fhir.Model.ResourceReference)Observed.DeepCopyInternal(); + if(Intended != null) dest.Intended = (Hl7.Fhir.Model.ResourceReference)Intended.DeepCopyInternal(); + if(DirectnessMatch != null) dest.DirectnessMatch = (Hl7.Fhir.Model.CodeableConcept)DirectnessMatch.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VariableDefinitionComponent()); + var instance = new VariableDefinitionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -486,7 +487,7 @@ public List ModelCharacter private List _ModelCharacteristic; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StatisticComponent; @@ -495,23 +496,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(StatisticType != null) dest.StatisticType = (Hl7.Fhir.Model.CodeableConcept)StatisticType.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(NumberOfEventsElement != null) dest.NumberOfEventsElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfEventsElement.DeepCopy(); - if(NumberAffectedElement != null) dest.NumberAffectedElement = (Hl7.Fhir.Model.UnsignedInt)NumberAffectedElement.DeepCopy(); - if(SampleSize != null) dest.SampleSize = (Hl7.Fhir.Model.Evidence.SampleSizeComponent)SampleSize.DeepCopy(); - if(AttributeEstimate.Any()) dest.AttributeEstimate = new List(AttributeEstimate.DeepCopy()); - if(ModelCharacteristic.Any()) dest.ModelCharacteristic = new List(ModelCharacteristic.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(StatisticType != null) dest.StatisticType = (Hl7.Fhir.Model.CodeableConcept)StatisticType.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(NumberOfEventsElement != null) dest.NumberOfEventsElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfEventsElement.DeepCopyInternal(); + if(NumberAffectedElement != null) dest.NumberAffectedElement = (Hl7.Fhir.Model.UnsignedInt)NumberAffectedElement.DeepCopyInternal(); + if(SampleSize != null) dest.SampleSize = (Hl7.Fhir.Model.Evidence.SampleSizeComponent)SampleSize.DeepCopyInternal(); + if(AttributeEstimate.Any()) dest.AttributeEstimate = new List(AttributeEstimate.DeepCopyInternal()); + if(ModelCharacteristic.Any()) dest.ModelCharacteristic = new List(ModelCharacteristic.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StatisticComponent()); + var instance = new StatisticComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -782,7 +784,7 @@ public int? KnownDataCount } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SampleSizeComponent; @@ -791,18 +793,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(NumberOfStudiesElement != null) dest.NumberOfStudiesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfStudiesElement.DeepCopy(); - if(NumberOfParticipantsElement != null) dest.NumberOfParticipantsElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfParticipantsElement.DeepCopy(); - if(KnownDataCountElement != null) dest.KnownDataCountElement = (Hl7.Fhir.Model.UnsignedInt)KnownDataCountElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(NumberOfStudiesElement != null) dest.NumberOfStudiesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfStudiesElement.DeepCopyInternal(); + if(NumberOfParticipantsElement != null) dest.NumberOfParticipantsElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfParticipantsElement.DeepCopyInternal(); + if(KnownDataCountElement != null) dest.KnownDataCountElement = (Hl7.Fhir.Model.UnsignedInt)KnownDataCountElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SampleSizeComponent()); + var instance = new SampleSizeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1028,7 +1031,7 @@ public List AttributeEstimat private List _AttributeEstimate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AttributeEstimateComponent; @@ -1037,20 +1040,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(LevelElement != null) dest.LevelElement = (Hl7.Fhir.Model.FhirDecimal)LevelElement.DeepCopy(); - if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopy(); - if(AttributeEstimate.Any()) dest.AttributeEstimate = new List(AttributeEstimate.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(LevelElement != null) dest.LevelElement = (Hl7.Fhir.Model.FhirDecimal)LevelElement.DeepCopyInternal(); + if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopyInternal(); + if(AttributeEstimate.Any()) dest.AttributeEstimate = new List(AttributeEstimate.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AttributeEstimateComponent()); + var instance = new AttributeEstimateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1218,7 +1222,7 @@ public List AttributeEstimat private List _AttributeEstimate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ModelCharacteristicComponent; @@ -1227,17 +1231,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopy(); - if(Variable.Any()) dest.Variable = new List(Variable.DeepCopy()); - if(AttributeEstimate.Any()) dest.AttributeEstimate = new List(AttributeEstimate.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopyInternal(); + if(Variable.Any()) dest.Variable = new List(Variable.DeepCopyInternal()); + if(AttributeEstimate.Any()) dest.AttributeEstimate = new List(AttributeEstimate.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ModelCharacteristicComponent()); + var instance = new ModelCharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1413,7 +1418,7 @@ public List ValueRange private List _ValueRange; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VariableComponent; @@ -1422,18 +1427,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(VariableDefinition != null) dest.VariableDefinition = (Hl7.Fhir.Model.ResourceReference)VariableDefinition.DeepCopy(); - if(HandlingElement != null) dest.HandlingElement = (Code)HandlingElement.DeepCopy(); - if(ValueCategory.Any()) dest.ValueCategory = new List(ValueCategory.DeepCopy()); - if(ValueQuantity.Any()) dest.ValueQuantity = new List(ValueQuantity.DeepCopy()); - if(ValueRange.Any()) dest.ValueRange = new List(ValueRange.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(VariableDefinition != null) dest.VariableDefinition = (Hl7.Fhir.Model.ResourceReference)VariableDefinition.DeepCopyInternal(); + if(HandlingElement != null) dest.HandlingElement = (Code)HandlingElement.DeepCopyInternal(); + if(ValueCategory.Any()) dest.ValueCategory = new List(ValueCategory.DeepCopyInternal()); + if(ValueQuantity.Any()) dest.ValueQuantity = new List(ValueQuantity.DeepCopyInternal()); + if(ValueRange.Any()) dest.ValueRange = new List(ValueRange.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VariableComponent()); + var instance = new VariableComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1647,7 +1653,7 @@ public List Subcomponent private List _Subcomponent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CertaintyComponent; @@ -1656,19 +1662,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Rating != null) dest.Rating = (Hl7.Fhir.Model.CodeableConcept)Rating.DeepCopy(); - if(RaterElement != null) dest.RaterElement = (Hl7.Fhir.Model.FhirString)RaterElement.DeepCopy(); - if(Subcomponent.Any()) dest.Subcomponent = new List(Subcomponent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Rating != null) dest.Rating = (Hl7.Fhir.Model.CodeableConcept)Rating.DeepCopyInternal(); + if(RaterElement != null) dest.RaterElement = (Hl7.Fhir.Model.FhirString)RaterElement.DeepCopyInternal(); + if(Subcomponent.Any()) dest.Subcomponent = new List(Subcomponent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CertaintyComponent()); + var instance = new CertaintyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2283,7 +2290,7 @@ public List Certainty List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Evidence; @@ -2292,38 +2299,39 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(CiteAs != null) dest.CiteAs = (Hl7.Fhir.Model.DataType)CiteAs.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(AssertionElement != null) dest.AssertionElement = (Hl7.Fhir.Model.Markdown)AssertionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(VariableDefinition.Any()) dest.VariableDefinition = new List(VariableDefinition.DeepCopy()); - if(SynthesisType != null) dest.SynthesisType = (Hl7.Fhir.Model.CodeableConcept)SynthesisType.DeepCopy(); - if(StudyType != null) dest.StudyType = (Hl7.Fhir.Model.CodeableConcept)StudyType.DeepCopy(); - if(Statistic.Any()) dest.Statistic = new List(Statistic.DeepCopy()); - if(Certainty.Any()) dest.Certainty = new List(Certainty.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(CiteAs != null) dest.CiteAs = (Hl7.Fhir.Model.DataType)CiteAs.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(AssertionElement != null) dest.AssertionElement = (Hl7.Fhir.Model.Markdown)AssertionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(VariableDefinition.Any()) dest.VariableDefinition = new List(VariableDefinition.DeepCopyInternal()); + if(SynthesisType != null) dest.SynthesisType = (Hl7.Fhir.Model.CodeableConcept)SynthesisType.DeepCopyInternal(); + if(StudyType != null) dest.StudyType = (Hl7.Fhir.Model.CodeableConcept)StudyType.DeepCopyInternal(); + if(Statistic.Any()) dest.Statistic = new List(Statistic.DeepCopyInternal()); + if(Certainty.Any()) dest.Certainty = new List(Certainty.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Evidence()); + var instance = new Evidence(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/EvidenceReport.cs b/src/Hl7.Fhir.R4B/Model/Generated/EvidenceReport.cs index 1374f83ad7..1c6ab5153a 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/EvidenceReport.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/EvidenceReport.cs @@ -162,7 +162,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubjectComponent; @@ -171,15 +171,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubjectComponent()); + var instance = new SubjectComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -324,7 +325,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -333,17 +334,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -483,7 +485,7 @@ public Hl7.Fhir.Model.DataType Target private Hl7.Fhir.Model.DataType _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatesToComponent; @@ -492,15 +494,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatesToComponent()); + var instance = new RelatesToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -781,7 +784,7 @@ public List Section private List _Section; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SectionComponent; @@ -790,25 +793,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Focus != null) dest.Focus = (Hl7.Fhir.Model.CodeableConcept)Focus.DeepCopy(); - if(FocusReference != null) dest.FocusReference = (Hl7.Fhir.Model.ResourceReference)FocusReference.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopy(); - if(EntryClassifier.Any()) dest.EntryClassifier = new List(EntryClassifier.DeepCopy()); - if(EntryReference.Any()) dest.EntryReference = new List(EntryReference.DeepCopy()); - if(EntryQuantity.Any()) dest.EntryQuantity = new List(EntryQuantity.DeepCopy()); - if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopy(); - if(Section.Any()) dest.Section = new List(Section.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Focus != null) dest.Focus = (Hl7.Fhir.Model.CodeableConcept)Focus.DeepCopyInternal(); + if(FocusReference != null) dest.FocusReference = (Hl7.Fhir.Model.ResourceReference)FocusReference.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopyInternal(); + if(EntryClassifier.Any()) dest.EntryClassifier = new List(EntryClassifier.DeepCopyInternal()); + if(EntryReference.Any()) dest.EntryReference = new List(EntryReference.DeepCopyInternal()); + if(EntryQuantity.Any()) dest.EntryQuantity = new List(EntryQuantity.DeepCopyInternal()); + if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopyInternal(); + if(Section.Any()) dest.Section = new List(Section.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SectionComponent()); + var instance = new SectionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1254,7 +1258,7 @@ public List Section List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EvidenceReport; @@ -1263,31 +1267,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(RelatedIdentifier.Any()) dest.RelatedIdentifier = new List(RelatedIdentifier.DeepCopy()); - if(CiteAs != null) dest.CiteAs = (Hl7.Fhir.Model.DataType)CiteAs.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.EvidenceReport.SubjectComponent)Subject.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopy()); - if(Section.Any()) dest.Section = new List(Section.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(RelatedIdentifier.Any()) dest.RelatedIdentifier = new List(RelatedIdentifier.DeepCopyInternal()); + if(CiteAs != null) dest.CiteAs = (Hl7.Fhir.Model.DataType)CiteAs.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.EvidenceReport.SubjectComponent)Subject.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopyInternal()); + if(Section.Any()) dest.Section = new List(Section.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EvidenceReport()); + var instance = new EvidenceReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/EvidenceVariable.cs b/src/Hl7.Fhir.R4B/Model/Generated/EvidenceVariable.cs index b13d709e38..bb4e7af1d5 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/EvidenceVariable.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/EvidenceVariable.cs @@ -253,7 +253,7 @@ public Hl7.Fhir.Model.GroupMeasureCode? GroupMeasure } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -262,20 +262,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopy(); - if(TimeFromStart != null) dest.TimeFromStart = (Hl7.Fhir.Model.EvidenceVariable.TimeFromStartComponent)TimeFromStart.DeepCopy(); - if(GroupMeasureElement != null) dest.GroupMeasureElement = (Code)GroupMeasureElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopyInternal(); + if(TimeFromStart != null) dest.TimeFromStart = (Hl7.Fhir.Model.EvidenceVariable.TimeFromStartComponent)TimeFromStart.DeepCopyInternal(); + if(GroupMeasureElement != null) dest.GroupMeasureElement = (Code)GroupMeasureElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -458,7 +459,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TimeFromStartComponent; @@ -467,17 +468,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TimeFromStartComponent()); + var instance = new TimeFromStartComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -611,7 +613,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CategoryComponent; @@ -620,15 +622,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CategoryComponent()); + var instance = new CategoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1250,7 +1253,7 @@ public List Category List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EvidenceVariable; @@ -1259,37 +1262,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopy(); - if(CharacteristicCombinationElement != null) dest.CharacteristicCombinationElement = (Code)CharacteristicCombinationElement.DeepCopy(); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(HandlingElement != null) dest.HandlingElement = (Code)HandlingElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopyInternal(); + if(CharacteristicCombinationElement != null) dest.CharacteristicCombinationElement = (Code)CharacteristicCombinationElement.DeepCopyInternal(); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(HandlingElement != null) dest.HandlingElement = (Code)HandlingElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EvidenceVariable()); + var instance = new EvidenceVariable(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ExampleScenario.cs b/src/Hl7.Fhir.R4B/Model/Generated/ExampleScenario.cs index bcf2b1b530..05e5b84d2d 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ExampleScenario.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ExampleScenario.cs @@ -219,7 +219,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActorComponent; @@ -228,17 +228,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ActorIdElement != null) dest.ActorIdElement = (Hl7.Fhir.Model.FhirString)ActorIdElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ActorIdElement != null) dest.ActorIdElement = (Hl7.Fhir.Model.FhirString)ActorIdElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActorComponent()); + var instance = new ActorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -479,7 +480,7 @@ public List Contained private List _ContainedInstance; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -488,19 +489,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResourceIdElement != null) dest.ResourceIdElement = (Hl7.Fhir.Model.FhirString)ResourceIdElement.DeepCopy(); - if(ResourceTypeElement != null) dest.ResourceTypeElement = (Code)ResourceTypeElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Version.Any()) dest.Version = new List(Version.DeepCopy()); - if(ContainedInstance.Any()) dest.ContainedInstance = new List(ContainedInstance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ResourceIdElement != null) dest.ResourceIdElement = (Hl7.Fhir.Model.FhirString)ResourceIdElement.DeepCopyInternal(); + if(ResourceTypeElement != null) dest.ResourceTypeElement = (Code)ResourceTypeElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Version.Any()) dest.Version = new List(Version.DeepCopyInternal()); + if(ContainedInstance.Any()) dest.ContainedInstance = new List(ContainedInstance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -665,7 +667,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VersionComponent; @@ -674,15 +676,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(VersionIdElement != null) dest.VersionIdElement = (Hl7.Fhir.Model.FhirString)VersionIdElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(VersionIdElement != null) dest.VersionIdElement = (Hl7.Fhir.Model.FhirString)VersionIdElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VersionComponent()); + var instance = new VersionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -817,7 +820,7 @@ public string VersionId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainedInstanceComponent; @@ -826,15 +829,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResourceIdElement != null) dest.ResourceIdElement = (Hl7.Fhir.Model.FhirString)ResourceIdElement.DeepCopy(); - if(VersionIdElement != null) dest.VersionIdElement = (Hl7.Fhir.Model.FhirString)VersionIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ResourceIdElement != null) dest.ResourceIdElement = (Hl7.Fhir.Model.FhirString)ResourceIdElement.DeepCopyInternal(); + if(VersionIdElement != null) dest.VersionIdElement = (Hl7.Fhir.Model.FhirString)VersionIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainedInstanceComponent()); + var instance = new ContainedInstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1042,7 +1046,7 @@ public List Step private List _Step; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcessComponent; @@ -1051,18 +1055,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(PreConditionsElement != null) dest.PreConditionsElement = (Hl7.Fhir.Model.Markdown)PreConditionsElement.DeepCopy(); - if(PostConditionsElement != null) dest.PostConditionsElement = (Hl7.Fhir.Model.Markdown)PostConditionsElement.DeepCopy(); - if(Step.Any()) dest.Step = new List(Step.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(PreConditionsElement != null) dest.PreConditionsElement = (Hl7.Fhir.Model.Markdown)PreConditionsElement.DeepCopyInternal(); + if(PostConditionsElement != null) dest.PostConditionsElement = (Hl7.Fhir.Model.Markdown)PostConditionsElement.DeepCopyInternal(); + if(Step.Any()) dest.Step = new List(Step.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcessComponent()); + var instance = new ProcessComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1227,7 +1232,7 @@ public List Alternative private List _Alternative; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StepComponent; @@ -1236,17 +1241,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Process.Any()) dest.Process = new List(Process.DeepCopy()); - if(PauseElement != null) dest.PauseElement = (Hl7.Fhir.Model.FhirBoolean)PauseElement.DeepCopy(); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.ExampleScenario.OperationComponent)Operation.DeepCopy(); - if(Alternative.Any()) dest.Alternative = new List(Alternative.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Process.Any()) dest.Process = new List(Process.DeepCopyInternal()); + if(PauseElement != null) dest.PauseElement = (Hl7.Fhir.Model.FhirBoolean)PauseElement.DeepCopyInternal(); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.ExampleScenario.OperationComponent)Operation.DeepCopyInternal(); + if(Alternative.Any()) dest.Alternative = new List(Alternative.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StepComponent()); + var instance = new StepComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1606,7 +1612,7 @@ public Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent Response private Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent _Response; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -1615,23 +1621,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.FhirString)NumberElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(InitiatorElement != null) dest.InitiatorElement = (Hl7.Fhir.Model.FhirString)InitiatorElement.DeepCopy(); - if(ReceiverElement != null) dest.ReceiverElement = (Hl7.Fhir.Model.FhirString)ReceiverElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(InitiatorActiveElement != null) dest.InitiatorActiveElement = (Hl7.Fhir.Model.FhirBoolean)InitiatorActiveElement.DeepCopy(); - if(ReceiverActiveElement != null) dest.ReceiverActiveElement = (Hl7.Fhir.Model.FhirBoolean)ReceiverActiveElement.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent)Request.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent)Response.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.FhirString)NumberElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(InitiatorElement != null) dest.InitiatorElement = (Hl7.Fhir.Model.FhirString)InitiatorElement.DeepCopyInternal(); + if(ReceiverElement != null) dest.ReceiverElement = (Hl7.Fhir.Model.FhirString)ReceiverElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(InitiatorActiveElement != null) dest.InitiatorActiveElement = (Hl7.Fhir.Model.FhirBoolean)InitiatorActiveElement.DeepCopyInternal(); + if(ReceiverActiveElement != null) dest.ReceiverActiveElement = (Hl7.Fhir.Model.FhirBoolean)ReceiverActiveElement.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent)Request.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent)Response.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationComponent()); + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1844,7 +1851,7 @@ public List Step private List _Step; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AlternativeComponent; @@ -1853,16 +1860,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Step.Any()) dest.Step = new List(Step.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Step.Any()) dest.Step = new List(Step.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AlternativeComponent()); + var instance = new AlternativeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2341,7 +2349,7 @@ public IEnumerable Workflow List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExampleScenario; @@ -2350,30 +2358,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - if(Process.Any()) dest.Process = new List(Process.DeepCopy()); - if(WorkflowElement.Any()) dest.WorkflowElement = new List(WorkflowElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); + if(Process.Any()) dest.Process = new List(Process.DeepCopyInternal()); + if(WorkflowElement.Any()) dest.WorkflowElement = new List(WorkflowElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExampleScenario()); + var instance = new ExampleScenario(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ExplanationOfBenefit.cs b/src/Hl7.Fhir.R4B/Model/Generated/ExplanationOfBenefit.cs index c11e0698cb..35d0c88bad 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ExplanationOfBenefit.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ExplanationOfBenefit.cs @@ -152,7 +152,7 @@ public Hl7.Fhir.Model.Identifier Reference private Hl7.Fhir.Model.Identifier _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedClaimComponent; @@ -161,16 +161,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedClaimComponent()); + var instance = new RelatedClaimComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -280,7 +281,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayeeComponent; @@ -289,15 +290,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayeeComponent()); + var instance = new PayeeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -476,7 +478,7 @@ public Hl7.Fhir.Model.CodeableConcept Qualification private Hl7.Fhir.Model.CodeableConcept _Qualification; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CareTeamComponent; @@ -485,18 +487,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Qualification != null) dest.Qualification = (Hl7.Fhir.Model.CodeableConcept)Qualification.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Qualification != null) dest.Qualification = (Hl7.Fhir.Model.CodeableConcept)Qualification.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CareTeamComponent()); + var instance = new CareTeamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -699,7 +702,7 @@ public Hl7.Fhir.Model.Coding Reason private Hl7.Fhir.Model.Coding _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportingInformationComponent; @@ -708,19 +711,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.Coding)Reason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.Coding)Reason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportingInformationComponent()); + var instance = new SupportingInformationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -917,7 +921,7 @@ public Hl7.Fhir.Model.CodeableConcept PackageCode private Hl7.Fhir.Model.CodeableConcept _PackageCode; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -926,18 +930,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(OnAdmission != null) dest.OnAdmission = (Hl7.Fhir.Model.CodeableConcept)OnAdmission.DeepCopy(); - if(PackageCode != null) dest.PackageCode = (Hl7.Fhir.Model.CodeableConcept)PackageCode.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(OnAdmission != null) dest.OnAdmission = (Hl7.Fhir.Model.CodeableConcept)OnAdmission.DeepCopyInternal(); + if(PackageCode != null) dest.PackageCode = (Hl7.Fhir.Model.CodeableConcept)PackageCode.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1145,7 +1150,7 @@ public List Udi private List _Udi; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcedureComponent; @@ -1154,18 +1159,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcedureComponent()); + var instance = new ProcedureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1342,7 +1348,7 @@ public IEnumerable PreAuthRef } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -1351,16 +1357,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1501,7 +1508,7 @@ public Hl7.Fhir.Model.DataType Location private Hl7.Fhir.Model.DataType _Location; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AccidentComponent; @@ -1510,16 +1517,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AccidentComponent()); + var instance = new AccidentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2055,7 +2063,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -2064,36 +2072,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(CareTeamSequenceElement.Any()) dest.CareTeamSequenceElement = new List(CareTeamSequenceElement.DeepCopy()); - if(DiagnosisSequenceElement.Any()) dest.DiagnosisSequenceElement = new List(DiagnosisSequenceElement.DeepCopy()); - if(ProcedureSequenceElement.Any()) dest.ProcedureSequenceElement = new List(ProcedureSequenceElement.DeepCopy()); - if(InformationSequenceElement.Any()) dest.InformationSequenceElement = new List(InformationSequenceElement.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ItemComponent()); + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(CareTeamSequenceElement.Any()) dest.CareTeamSequenceElement = new List(CareTeamSequenceElement.DeepCopyInternal()); + if(DiagnosisSequenceElement.Any()) dest.DiagnosisSequenceElement = new List(DiagnosisSequenceElement.DeepCopyInternal()); + if(ProcedureSequenceElement.Any()) dest.ProcedureSequenceElement = new List(ProcedureSequenceElement.DeepCopyInternal()); + if(InformationSequenceElement.Any()) dest.InformationSequenceElement = new List(InformationSequenceElement.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); + if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2406,7 +2415,7 @@ public decimal? Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdjudicationComponent; @@ -2415,17 +2424,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdjudicationComponent()); + var instance = new AdjudicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2764,7 +2774,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -2773,27 +2783,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3198,7 +3209,7 @@ public List Adjudicat private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubDetailComponent; @@ -3207,26 +3218,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubDetailComponent()); + var instance = new SubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3734,7 +3746,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemComponent; @@ -3743,31 +3755,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemSequenceElement.Any()) dest.ItemSequenceElement = new List(ItemSequenceElement.DeepCopy()); - if(DetailSequenceElement.Any()) dest.DetailSequenceElement = new List(DetailSequenceElement.DeepCopy()); - if(SubDetailSequenceElement.Any()) dest.SubDetailSequenceElement = new List(SubDetailSequenceElement.DeepCopy()); - if(Provider.Any()) dest.Provider = new List(Provider.DeepCopy()); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new AddedItemComponent()); + base.CopyToInternal(dest); + if(ItemSequenceElement.Any()) dest.ItemSequenceElement = new List(ItemSequenceElement.DeepCopyInternal()); + if(DetailSequenceElement.Any()) dest.DetailSequenceElement = new List(DetailSequenceElement.DeepCopyInternal()); + if(SubDetailSequenceElement.Any()) dest.SubDetailSequenceElement = new List(SubDetailSequenceElement.DeepCopyInternal()); + if(Provider.Any()) dest.Provider = new List(Provider.DeepCopyInternal()); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new AddedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4127,7 +4140,7 @@ public List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemDetailComponent; @@ -4136,22 +4149,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemDetailComponent()); + var instance = new AddedItemDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4425,7 +4439,7 @@ public List Adjudicat private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemDetailSubDetailComponent; @@ -4434,21 +4448,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemDetailSubDetailComponent()); + var instance = new AddedItemDetailSubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4598,7 +4613,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TotalComponent; @@ -4607,15 +4622,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TotalComponent()); + var instance = new TotalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4785,7 +4801,7 @@ public Hl7.Fhir.Model.Identifier Identifier private Hl7.Fhir.Model.Identifier _Identifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentComponent; @@ -4794,19 +4810,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopy(); - if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopyInternal(); + if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentComponent()); + var instance = new PaymentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5019,7 +5036,7 @@ public Hl7.Fhir.Model.CodeableConcept Language private Hl7.Fhir.Model.CodeableConcept _Language; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NoteComponent; @@ -5028,17 +5045,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NoteComponent()); + var instance = new NoteComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5287,7 +5305,7 @@ public List Financial private List _Financial; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BenefitBalanceComponent; @@ -5296,21 +5314,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopy(); - if(Financial.Any()) dest.Financial = new List(Financial.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopyInternal(); + if(Financial.Any()) dest.Financial = new List(Financial.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BenefitBalanceComponent()); + var instance = new BenefitBalanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5475,7 +5494,7 @@ public Hl7.Fhir.Model.DataType Used private Hl7.Fhir.Model.DataType _Used; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BenefitComponent; @@ -5484,16 +5503,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopy(); - if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopyInternal(); + if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BenefitComponent()); + var instance = new BenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -6299,7 +6319,7 @@ public List Benefit List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExplanationOfBenefit; @@ -6308,56 +6328,57 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(FundsReserveRequested != null) dest.FundsReserveRequested = (Hl7.Fhir.Model.CodeableConcept)FundsReserveRequested.DeepCopy(); - if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopy(); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopy(); - if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ExplanationOfBenefit.PayeeComponent)Payee.DeepCopy(); - if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopy(); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopy(); - if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopy()); - if(PreAuthRefPeriod.Any()) dest.PreAuthRefPeriod = new List(PreAuthRefPeriod.DeepCopy()); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopy()); - if(PrecedenceElement != null) dest.PrecedenceElement = (Hl7.Fhir.Model.PositiveInt)PrecedenceElement.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Accident != null) dest.Accident = (Hl7.Fhir.Model.ExplanationOfBenefit.AccidentComponent)Accident.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Total.Any()) dest.Total = new List(Total.DeepCopy()); - if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ExplanationOfBenefit.PaymentComponent)Payment.DeepCopy(); - if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.Attachment)Form.DeepCopy(); - if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopy()); - if(BenefitPeriod != null) dest.BenefitPeriod = (Hl7.Fhir.Model.Period)BenefitPeriod.DeepCopy(); - if(BenefitBalance.Any()) dest.BenefitBalance = new List(BenefitBalance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(FundsReserveRequested != null) dest.FundsReserveRequested = (Hl7.Fhir.Model.CodeableConcept)FundsReserveRequested.DeepCopyInternal(); + if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopyInternal(); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); + if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopyInternal(); + if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ExplanationOfBenefit.PayeeComponent)Payee.DeepCopyInternal(); + if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopyInternal(); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopyInternal(); + if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopyInternal()); + if(PreAuthRefPeriod.Any()) dest.PreAuthRefPeriod = new List(PreAuthRefPeriod.DeepCopyInternal()); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopyInternal()); + if(PrecedenceElement != null) dest.PrecedenceElement = (Hl7.Fhir.Model.PositiveInt)PrecedenceElement.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Accident != null) dest.Accident = (Hl7.Fhir.Model.ExplanationOfBenefit.AccidentComponent)Accident.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Total.Any()) dest.Total = new List(Total.DeepCopyInternal()); + if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ExplanationOfBenefit.PaymentComponent)Payment.DeepCopyInternal(); + if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.Attachment)Form.DeepCopyInternal(); + if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopyInternal()); + if(BenefitPeriod != null) dest.BenefitPeriod = (Hl7.Fhir.Model.Period)BenefitPeriod.DeepCopyInternal(); + if(BenefitBalance.Any()) dest.BenefitBalance = new List(BenefitBalance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExplanationOfBenefit()); + var instance = new ExplanationOfBenefit(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Expression.cs b/src/Hl7.Fhir.R4B/Model/Generated/Expression.cs index 333810697e..57120713b4 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Expression.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Expression.cs @@ -216,7 +216,7 @@ public string Reference } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Expression; @@ -225,18 +225,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Expression()); + var instance = new Expression(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/FamilyMemberHistory.cs b/src/Hl7.Fhir.R4B/Model/Generated/FamilyMemberHistory.cs index 38f5b59713..5358fd8164 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/FamilyMemberHistory.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/FamilyMemberHistory.cs @@ -198,7 +198,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConditionComponent; @@ -207,18 +207,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(ContributedToDeathElement != null) dest.ContributedToDeathElement = (Hl7.Fhir.Model.FhirBoolean)ContributedToDeathElement.DeepCopy(); - if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(ContributedToDeathElement != null) dest.ContributedToDeathElement = (Hl7.Fhir.Model.FhirBoolean)ContributedToDeathElement.DeepCopyInternal(); + if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConditionComponent()); + var instance = new ConditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -668,7 +669,7 @@ public List Condition List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FamilyMemberHistory; @@ -677,31 +678,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Sex != null) dest.Sex = (Hl7.Fhir.Model.CodeableConcept)Sex.DeepCopy(); - if(Born != null) dest.Born = (Hl7.Fhir.Model.DataType)Born.DeepCopy(); - if(Age != null) dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopy(); - if(EstimatedAgeElement != null) dest.EstimatedAgeElement = (Hl7.Fhir.Model.FhirBoolean)EstimatedAgeElement.DeepCopy(); - if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new FamilyMemberHistory()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Sex != null) dest.Sex = (Hl7.Fhir.Model.CodeableConcept)Sex.DeepCopyInternal(); + if(Born != null) dest.Born = (Hl7.Fhir.Model.DataType)Born.DeepCopyInternal(); + if(Age != null) dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopyInternal(); + if(EstimatedAgeElement != null) dest.EstimatedAgeElement = (Hl7.Fhir.Model.FhirBoolean)EstimatedAgeElement.DeepCopyInternal(); + if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new FamilyMemberHistory(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Flag.cs b/src/Hl7.Fhir.R4B/Model/Generated/Flag.cs index dfa9c94605..47c6ac682e 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Flag.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Flag.cs @@ -226,7 +226,7 @@ public Hl7.Fhir.Model.ResourceReference Author List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Flag; @@ -235,21 +235,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Flag()); + var instance = new Flag(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Goal.cs b/src/Hl7.Fhir.R4B/Model/Generated/Goal.cs index a1e620b610..740cc352fc 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Goal.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Goal.cs @@ -186,7 +186,7 @@ public Hl7.Fhir.Model.DataType Due private Hl7.Fhir.Model.DataType _Due; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -195,16 +195,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopy(); - if(Due != null) dest.Due = (Hl7.Fhir.Model.DataType)Due.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopyInternal(); + if(Due != null) dest.Due = (Hl7.Fhir.Model.DataType)Due.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -560,7 +561,7 @@ public List OutcomeReference List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Goal; @@ -569,29 +570,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(LifecycleStatusElement != null) dest.LifecycleStatusElement = (Code)LifecycleStatusElement.DeepCopy(); - if(AchievementStatus != null) dest.AchievementStatus = (Hl7.Fhir.Model.CodeableConcept)AchievementStatus.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Start != null) dest.Start = (Hl7.Fhir.Model.DataType)Start.DeepCopy(); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.Date)StatusDateElement.DeepCopy(); - if(StatusReasonElement != null) dest.StatusReasonElement = (Hl7.Fhir.Model.FhirString)StatusReasonElement.DeepCopy(); - if(ExpressedBy != null) dest.ExpressedBy = (Hl7.Fhir.Model.ResourceReference)ExpressedBy.DeepCopy(); - if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(OutcomeCode.Any()) dest.OutcomeCode = new List(OutcomeCode.DeepCopy()); - if(OutcomeReference.Any()) dest.OutcomeReference = new List(OutcomeReference.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(LifecycleStatusElement != null) dest.LifecycleStatusElement = (Code)LifecycleStatusElement.DeepCopyInternal(); + if(AchievementStatus != null) dest.AchievementStatus = (Hl7.Fhir.Model.CodeableConcept)AchievementStatus.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Start != null) dest.Start = (Hl7.Fhir.Model.DataType)Start.DeepCopyInternal(); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.Date)StatusDateElement.DeepCopyInternal(); + if(StatusReasonElement != null) dest.StatusReasonElement = (Hl7.Fhir.Model.FhirString)StatusReasonElement.DeepCopyInternal(); + if(ExpressedBy != null) dest.ExpressedBy = (Hl7.Fhir.Model.ResourceReference)ExpressedBy.DeepCopyInternal(); + if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(OutcomeCode.Any()) dest.OutcomeCode = new List(OutcomeCode.DeepCopyInternal()); + if(OutcomeReference.Any()) dest.OutcomeReference = new List(OutcomeReference.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Goal()); + var instance = new Goal(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/GraphDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/GraphDefinition.cs index b0b8d70cff..6287c40eb0 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/GraphDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/GraphDefinition.cs @@ -297,7 +297,7 @@ public List Target private List _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -306,19 +306,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SliceNameElement != null) dest.SliceNameElement = (Hl7.Fhir.Model.FhirString)SliceNameElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SliceNameElement != null) dest.SliceNameElement = (Hl7.Fhir.Model.FhirString)SliceNameElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -543,7 +544,7 @@ public List Link private List _Link; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -552,18 +553,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - if(Compartment.Any()) dest.Compartment = new List(Compartment.DeepCopy()); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); + if(Compartment.Any()) dest.Compartment = new List(Compartment.DeepCopyInternal()); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -820,7 +822,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CompartmentComponent; @@ -829,18 +831,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(RuleElement != null) dest.RuleElement = (Code)RuleElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(RuleElement != null) dest.RuleElement = (Code)RuleElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CompartmentComponent()); + var instance = new CompartmentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1325,7 +1328,7 @@ public List Link private List _Link; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GraphDefinition; @@ -1334,28 +1337,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(StartElement != null) dest.StartElement = (Code)StartElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Code)StartElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GraphDefinition()); + var instance = new GraphDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Group.cs b/src/Hl7.Fhir.R4B/Model/Generated/Group.cs index cc6375cc61..354fd3e80f 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Group.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Group.cs @@ -200,7 +200,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -209,17 +209,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -367,7 +368,7 @@ public bool? Inactive } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MemberComponent; @@ -376,16 +377,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Entity != null) dest.Entity = (Hl7.Fhir.Model.ResourceReference)Entity.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Entity != null) dest.Entity = (Hl7.Fhir.Model.ResourceReference)Entity.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MemberComponent()); + var instance = new MemberComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -681,7 +683,7 @@ public List Member List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Group; @@ -690,23 +692,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.UnsignedInt)QuantityElement.DeepCopy(); - if(ManagingEntity != null) dest.ManagingEntity = (Hl7.Fhir.Model.ResourceReference)ManagingEntity.DeepCopy(); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(Member.Any()) dest.Member = new List(Member.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.UnsignedInt)QuantityElement.DeepCopyInternal(); + if(ManagingEntity != null) dest.ManagingEntity = (Hl7.Fhir.Model.ResourceReference)ManagingEntity.DeepCopyInternal(); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(Member.Any()) dest.Member = new List(Member.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Group()); + var instance = new Group(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/GuidanceResponse.cs b/src/Hl7.Fhir.R4B/Model/Generated/GuidanceResponse.cs index 6586a9bcf0..0bd425fd60 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/GuidanceResponse.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/GuidanceResponse.cs @@ -364,7 +364,7 @@ public List DataRequirement List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GuidanceResponse; @@ -373,28 +373,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RequestIdentifier != null) dest.RequestIdentifier = (Hl7.Fhir.Model.Identifier)RequestIdentifier.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Module != null) dest.Module = (Hl7.Fhir.Model.DataType)Module.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(OccurrenceDateTimeElement != null) dest.OccurrenceDateTimeElement = (Hl7.Fhir.Model.FhirDateTime)OccurrenceDateTimeElement.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(EvaluationMessage.Any()) dest.EvaluationMessage = new List(EvaluationMessage.DeepCopy()); - if(OutputParameters != null) dest.OutputParameters = (Hl7.Fhir.Model.ResourceReference)OutputParameters.DeepCopy(); - if(Result != null) dest.Result = (Hl7.Fhir.Model.ResourceReference)Result.DeepCopy(); - if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RequestIdentifier != null) dest.RequestIdentifier = (Hl7.Fhir.Model.Identifier)RequestIdentifier.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Module != null) dest.Module = (Hl7.Fhir.Model.DataType)Module.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(OccurrenceDateTimeElement != null) dest.OccurrenceDateTimeElement = (Hl7.Fhir.Model.FhirDateTime)OccurrenceDateTimeElement.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(EvaluationMessage.Any()) dest.EvaluationMessage = new List(EvaluationMessage.DeepCopyInternal()); + if(OutputParameters != null) dest.OutputParameters = (Hl7.Fhir.Model.ResourceReference)OutputParameters.DeepCopyInternal(); + if(Result != null) dest.Result = (Hl7.Fhir.Model.ResourceReference)Result.DeepCopyInternal(); + if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GuidanceResponse()); + var instance = new GuidanceResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/HealthcareService.cs b/src/Hl7.Fhir.R4B/Model/Generated/HealthcareService.cs index 8296817d83..6191623824 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/HealthcareService.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/HealthcareService.cs @@ -117,7 +117,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EligibilityComponent; @@ -126,15 +126,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EligibilityComponent()); + var instance = new EligibilityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -334,7 +335,7 @@ public string AvailableEndTime } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AvailableTimeComponent; @@ -343,17 +344,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopy()); - if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopy(); - if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopy(); - if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopyInternal()); + if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopyInternal(); + if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopyInternal(); + if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AvailableTimeComponent()); + var instance = new AvailableTimeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -486,7 +488,7 @@ public Hl7.Fhir.Model.Period During private Hl7.Fhir.Model.Period _During; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotAvailableComponent; @@ -495,15 +497,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotAvailableComponent()); + var instance = new NotAvailableComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1013,7 +1016,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HealthcareService; @@ -1022,37 +1025,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(ProvidedBy != null) dest.ProvidedBy = (Hl7.Fhir.Model.ResourceReference)ProvidedBy.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(ExtraDetailsElement != null) dest.ExtraDetailsElement = (Hl7.Fhir.Model.Markdown)ExtraDetailsElement.DeepCopy(); - if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopy()); - if(ServiceProvisionCode.Any()) dest.ServiceProvisionCode = new List(ServiceProvisionCode.DeepCopy()); - if(Eligibility.Any()) dest.Eligibility = new List(Eligibility.DeepCopy()); - if(Program.Any()) dest.Program = new List(Program.DeepCopy()); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - if(ReferralMethod.Any()) dest.ReferralMethod = new List(ReferralMethod.DeepCopy()); - if(AppointmentRequiredElement != null) dest.AppointmentRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AppointmentRequiredElement.DeepCopy(); - if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopy()); - if(NotAvailable.Any()) dest.NotAvailable = new List(NotAvailable.DeepCopy()); - if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(ProvidedBy != null) dest.ProvidedBy = (Hl7.Fhir.Model.ResourceReference)ProvidedBy.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(ExtraDetailsElement != null) dest.ExtraDetailsElement = (Hl7.Fhir.Model.Markdown)ExtraDetailsElement.DeepCopyInternal(); + if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopyInternal()); + if(ServiceProvisionCode.Any()) dest.ServiceProvisionCode = new List(ServiceProvisionCode.DeepCopyInternal()); + if(Eligibility.Any()) dest.Eligibility = new List(Eligibility.DeepCopyInternal()); + if(Program.Any()) dest.Program = new List(Program.DeepCopyInternal()); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); + if(ReferralMethod.Any()) dest.ReferralMethod = new List(ReferralMethod.DeepCopyInternal()); + if(AppointmentRequiredElement != null) dest.AppointmentRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AppointmentRequiredElement.DeepCopyInternal(); + if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopyInternal()); + if(NotAvailable.Any()) dest.NotAvailable = new List(NotAvailable.DeepCopyInternal()); + if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HealthcareService()); + var instance = new HealthcareService(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/HumanName.cs b/src/Hl7.Fhir.R4B/Model/Generated/HumanName.cs index f4149b59a3..db075847e9 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/HumanName.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/HumanName.cs @@ -316,7 +316,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HumanName; @@ -325,20 +325,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(FamilyElement != null) dest.FamilyElement = (Hl7.Fhir.Model.FhirString)FamilyElement.DeepCopy(); - if(GivenElement.Any()) dest.GivenElement = new List(GivenElement.DeepCopy()); - if(PrefixElement.Any()) dest.PrefixElement = new List(PrefixElement.DeepCopy()); - if(SuffixElement.Any()) dest.SuffixElement = new List(SuffixElement.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(FamilyElement != null) dest.FamilyElement = (Hl7.Fhir.Model.FhirString)FamilyElement.DeepCopyInternal(); + if(GivenElement.Any()) dest.GivenElement = new List(GivenElement.DeepCopyInternal()); + if(PrefixElement.Any()) dest.PrefixElement = new List(PrefixElement.DeepCopyInternal()); + if(SuffixElement.Any()) dest.SuffixElement = new List(SuffixElement.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HumanName()); + var instance = new HumanName(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ImagingStudy.cs b/src/Hl7.Fhir.R4B/Model/Generated/ImagingStudy.cs index ece8c34354..3182e50162 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ImagingStudy.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ImagingStudy.cs @@ -374,7 +374,7 @@ public List Instance private List _Instance; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SeriesComponent; @@ -383,25 +383,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopy(); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopy(); - if(Modality != null) dest.Modality = (Hl7.Fhir.Model.Coding)Modality.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.Coding)BodySite.DeepCopy(); - if(Laterality != null) dest.Laterality = (Hl7.Fhir.Model.Coding)Laterality.DeepCopy(); - if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopy()); - if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopyInternal(); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopyInternal(); + if(Modality != null) dest.Modality = (Hl7.Fhir.Model.Coding)Modality.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.Coding)BodySite.DeepCopyInternal(); + if(Laterality != null) dest.Laterality = (Hl7.Fhir.Model.Coding)Laterality.DeepCopyInternal(); + if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopyInternal()); + if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SeriesComponent()); + var instance = new SeriesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -584,7 +585,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -593,15 +594,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -782,7 +784,7 @@ public string Title } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -791,17 +793,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopy(); - if(SopClass != null) dest.SopClass = (Hl7.Fhir.Model.Coding)SopClass.DeepCopy(); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopyInternal(); + if(SopClass != null) dest.SopClass = (Hl7.Fhir.Model.Coding)SopClass.DeepCopyInternal(); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1260,7 +1263,7 @@ public List Series List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImagingStudy; @@ -1269,33 +1272,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Modality.Any()) dest.Modality = new List(Modality.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Referrer != null) dest.Referrer = (Hl7.Fhir.Model.ResourceReference)Referrer.DeepCopy(); - if(Interpreter.Any()) dest.Interpreter = new List(Interpreter.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(NumberOfSeriesElement != null) dest.NumberOfSeriesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfSeriesElement.DeepCopy(); - if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopy(); - if(ProcedureReference != null) dest.ProcedureReference = (Hl7.Fhir.Model.ResourceReference)ProcedureReference.DeepCopy(); - if(ProcedureCode.Any()) dest.ProcedureCode = new List(ProcedureCode.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Series.Any()) dest.Series = new List(Series.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Modality.Any()) dest.Modality = new List(Modality.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Referrer != null) dest.Referrer = (Hl7.Fhir.Model.ResourceReference)Referrer.DeepCopyInternal(); + if(Interpreter.Any()) dest.Interpreter = new List(Interpreter.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(NumberOfSeriesElement != null) dest.NumberOfSeriesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfSeriesElement.DeepCopyInternal(); + if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopyInternal(); + if(ProcedureReference != null) dest.ProcedureReference = (Hl7.Fhir.Model.ResourceReference)ProcedureReference.DeepCopyInternal(); + if(ProcedureCode.Any()) dest.ProcedureCode = new List(ProcedureCode.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Series.Any()) dest.Series = new List(Series.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImagingStudy()); + var instance = new ImagingStudy(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Immunization.cs b/src/Hl7.Fhir.R4B/Model/Generated/Immunization.cs index 2d990d2b70..73142b135f 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Immunization.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Immunization.cs @@ -133,7 +133,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -142,15 +142,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -346,7 +347,7 @@ public string PresentationDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EducationComponent; @@ -355,17 +356,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DocumentTypeElement != null) dest.DocumentTypeElement = (Hl7.Fhir.Model.FhirString)DocumentTypeElement.DeepCopy(); - if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopy(); - if(PublicationDateElement != null) dest.PublicationDateElement = (Hl7.Fhir.Model.FhirDateTime)PublicationDateElement.DeepCopy(); - if(PresentationDateElement != null) dest.PresentationDateElement = (Hl7.Fhir.Model.FhirDateTime)PresentationDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DocumentTypeElement != null) dest.DocumentTypeElement = (Hl7.Fhir.Model.FhirString)DocumentTypeElement.DeepCopyInternal(); + if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopyInternal(); + if(PublicationDateElement != null) dest.PublicationDateElement = (Hl7.Fhir.Model.FhirDateTime)PublicationDateElement.DeepCopyInternal(); + if(PresentationDateElement != null) dest.PresentationDateElement = (Hl7.Fhir.Model.FhirDateTime)PresentationDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EducationComponent()); + var instance = new EducationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -531,7 +533,7 @@ public bool? Reported } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReactionComponent; @@ -540,16 +542,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.ResourceReference)Detail.DeepCopy(); - if(ReportedElement != null) dest.ReportedElement = (Hl7.Fhir.Model.FhirBoolean)ReportedElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.ResourceReference)Detail.DeepCopyInternal(); + if(ReportedElement != null) dest.ReportedElement = (Hl7.Fhir.Model.FhirBoolean)ReportedElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReactionComponent()); + var instance = new ReactionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -721,7 +724,7 @@ public Hl7.Fhir.Model.DataType SeriesDoses private Hl7.Fhir.Model.DataType _SeriesDoses; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProtocolAppliedComponent; @@ -730,18 +733,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopy(); - if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopy(); - if(TargetDisease.Any()) dest.TargetDisease = new List(TargetDisease.DeepCopy()); - if(DoseNumber != null) dest.DoseNumber = (Hl7.Fhir.Model.DataType)DoseNumber.DeepCopy(); - if(SeriesDoses != null) dest.SeriesDoses = (Hl7.Fhir.Model.DataType)SeriesDoses.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopyInternal(); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopyInternal(); + if(TargetDisease.Any()) dest.TargetDisease = new List(TargetDisease.DeepCopyInternal()); + if(DoseNumber != null) dest.DoseNumber = (Hl7.Fhir.Model.DataType)DoseNumber.DeepCopyInternal(); + if(SeriesDoses != null) dest.SeriesDoses = (Hl7.Fhir.Model.DataType)SeriesDoses.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProtocolAppliedComponent()); + var instance = new ProtocolAppliedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1332,7 +1336,7 @@ public List ProtocolApplie List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Immunization; @@ -1341,41 +1345,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(VaccineCode != null) dest.VaccineCode = (Hl7.Fhir.Model.CodeableConcept)VaccineCode.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.FhirDateTime)RecordedElement.DeepCopy(); - if(PrimarySourceElement != null) dest.PrimarySourceElement = (Hl7.Fhir.Model.FhirBoolean)PrimarySourceElement.DeepCopy(); - if(ReportOrigin != null) dest.ReportOrigin = (Hl7.Fhir.Model.CodeableConcept)ReportOrigin.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy(); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.Date)ExpirationDateElement.DeepCopy(); - if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy(); - if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy(); - if(DoseQuantity != null) dest.DoseQuantity = (Hl7.Fhir.Model.Quantity)DoseQuantity.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(IsSubpotentElement != null) dest.IsSubpotentElement = (Hl7.Fhir.Model.FhirBoolean)IsSubpotentElement.DeepCopy(); - if(SubpotentReason.Any()) dest.SubpotentReason = new List(SubpotentReason.DeepCopy()); - if(Education.Any()) dest.Education = new List(Education.DeepCopy()); - if(ProgramEligibility.Any()) dest.ProgramEligibility = new List(ProgramEligibility.DeepCopy()); - if(FundingSource != null) dest.FundingSource = (Hl7.Fhir.Model.CodeableConcept)FundingSource.DeepCopy(); - if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopy()); - if(ProtocolApplied.Any()) dest.ProtocolApplied = new List(ProtocolApplied.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(VaccineCode != null) dest.VaccineCode = (Hl7.Fhir.Model.CodeableConcept)VaccineCode.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.FhirDateTime)RecordedElement.DeepCopyInternal(); + if(PrimarySourceElement != null) dest.PrimarySourceElement = (Hl7.Fhir.Model.FhirBoolean)PrimarySourceElement.DeepCopyInternal(); + if(ReportOrigin != null) dest.ReportOrigin = (Hl7.Fhir.Model.CodeableConcept)ReportOrigin.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopyInternal(); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.Date)ExpirationDateElement.DeepCopyInternal(); + if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopyInternal(); + if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopyInternal(); + if(DoseQuantity != null) dest.DoseQuantity = (Hl7.Fhir.Model.Quantity)DoseQuantity.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(IsSubpotentElement != null) dest.IsSubpotentElement = (Hl7.Fhir.Model.FhirBoolean)IsSubpotentElement.DeepCopyInternal(); + if(SubpotentReason.Any()) dest.SubpotentReason = new List(SubpotentReason.DeepCopyInternal()); + if(Education.Any()) dest.Education = new List(Education.DeepCopyInternal()); + if(ProgramEligibility.Any()) dest.ProgramEligibility = new List(ProgramEligibility.DeepCopyInternal()); + if(FundingSource != null) dest.FundingSource = (Hl7.Fhir.Model.CodeableConcept)FundingSource.DeepCopyInternal(); + if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopyInternal()); + if(ProtocolApplied.Any()) dest.ProtocolApplied = new List(ProtocolApplied.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Immunization()); + var instance = new Immunization(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ImmunizationEvaluation.cs b/src/Hl7.Fhir.R4B/Model/Generated/ImmunizationEvaluation.cs index b86ed452b0..cb476c5de5 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ImmunizationEvaluation.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ImmunizationEvaluation.cs @@ -346,7 +346,7 @@ public Hl7.Fhir.Model.DataType SeriesDoses List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImmunizationEvaluation; @@ -355,26 +355,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)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.Any()) dest.DoseStatusReason = new List(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(DoseNumber != null) dest.DoseNumber = (Hl7.Fhir.Model.DataType)DoseNumber.DeepCopy(); - if(SeriesDoses != null) dest.SeriesDoses = (Hl7.Fhir.Model.DataType)SeriesDoses.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopyInternal(); + if(TargetDisease != null) dest.TargetDisease = (Hl7.Fhir.Model.CodeableConcept)TargetDisease.DeepCopyInternal(); + if(ImmunizationEvent != null) dest.ImmunizationEvent = (Hl7.Fhir.Model.ResourceReference)ImmunizationEvent.DeepCopyInternal(); + if(DoseStatus != null) dest.DoseStatus = (Hl7.Fhir.Model.CodeableConcept)DoseStatus.DeepCopyInternal(); + if(DoseStatusReason.Any()) dest.DoseStatusReason = new List(DoseStatusReason.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopyInternal(); + if(DoseNumber != null) dest.DoseNumber = (Hl7.Fhir.Model.DataType)DoseNumber.DeepCopyInternal(); + if(SeriesDoses != null) dest.SeriesDoses = (Hl7.Fhir.Model.DataType)SeriesDoses.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImmunizationEvaluation()); + var instance = new ImmunizationEvaluation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ImmunizationRecommendation.cs b/src/Hl7.Fhir.R4B/Model/Generated/ImmunizationRecommendation.cs index 58eda3b192..2d0858e36d 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ImmunizationRecommendation.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ImmunizationRecommendation.cs @@ -284,7 +284,7 @@ public List SupportingPatientInformation private List _SupportingPatientInformation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RecommendationComponent; @@ -293,25 +293,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(VaccineCode.Any()) dest.VaccineCode = new List(VaccineCode.DeepCopy()); - if(TargetDisease != null) dest.TargetDisease = (Hl7.Fhir.Model.CodeableConcept)TargetDisease.DeepCopy(); - if(ContraindicatedVaccineCode.Any()) dest.ContraindicatedVaccineCode = new List(ContraindicatedVaccineCode.DeepCopy()); - if(ForecastStatus != null) dest.ForecastStatus = (Hl7.Fhir.Model.CodeableConcept)ForecastStatus.DeepCopy(); - if(ForecastReason.Any()) dest.ForecastReason = new List(ForecastReason.DeepCopy()); - if(DateCriterion.Any()) dest.DateCriterion = new List(DateCriterion.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopy(); - if(DoseNumber != null) dest.DoseNumber = (Hl7.Fhir.Model.DataType)DoseNumber.DeepCopy(); - if(SeriesDoses != null) dest.SeriesDoses = (Hl7.Fhir.Model.DataType)SeriesDoses.DeepCopy(); - if(SupportingImmunization.Any()) dest.SupportingImmunization = new List(SupportingImmunization.DeepCopy()); - if(SupportingPatientInformation.Any()) dest.SupportingPatientInformation = new List(SupportingPatientInformation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(VaccineCode.Any()) dest.VaccineCode = new List(VaccineCode.DeepCopyInternal()); + if(TargetDisease != null) dest.TargetDisease = (Hl7.Fhir.Model.CodeableConcept)TargetDisease.DeepCopyInternal(); + if(ContraindicatedVaccineCode.Any()) dest.ContraindicatedVaccineCode = new List(ContraindicatedVaccineCode.DeepCopyInternal()); + if(ForecastStatus != null) dest.ForecastStatus = (Hl7.Fhir.Model.CodeableConcept)ForecastStatus.DeepCopyInternal(); + if(ForecastReason.Any()) dest.ForecastReason = new List(ForecastReason.DeepCopyInternal()); + if(DateCriterion.Any()) dest.DateCriterion = new List(DateCriterion.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopyInternal(); + if(DoseNumber != null) dest.DoseNumber = (Hl7.Fhir.Model.DataType)DoseNumber.DeepCopyInternal(); + if(SeriesDoses != null) dest.SeriesDoses = (Hl7.Fhir.Model.DataType)SeriesDoses.DeepCopyInternal(); + if(SupportingImmunization.Any()) dest.SupportingImmunization = new List(SupportingImmunization.DeepCopyInternal()); + if(SupportingPatientInformation.Any()) dest.SupportingPatientInformation = new List(SupportingPatientInformation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RecommendationComponent()); + var instance = new RecommendationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -510,7 +511,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DateCriterionComponent; @@ -519,15 +520,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDateTime)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDateTime)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DateCriterionComponent()); + var instance = new DateCriterionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -676,7 +678,7 @@ public List R List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImmunizationRecommendation; @@ -685,18 +687,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.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(Recommendation.Any()) dest.Recommendation = new List(Recommendation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopyInternal(); + if(Recommendation.Any()) dest.Recommendation = new List(Recommendation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImmunizationRecommendation()); + var instance = new ImmunizationRecommendation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ImplementationGuide.cs b/src/Hl7.Fhir.R4B/Model/Generated/ImplementationGuide.cs index f134bd31b3..db6579e532 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ImplementationGuide.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ImplementationGuide.cs @@ -2359,7 +2359,7 @@ public string Version } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DependsOnComponent; @@ -2368,16 +2368,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.Canonical)UriElement.DeepCopy(); - if(PackageIdElement != null) dest.PackageIdElement = (Hl7.Fhir.Model.Id)PackageIdElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.Canonical)UriElement.DeepCopyInternal(); + if(PackageIdElement != null) dest.PackageIdElement = (Hl7.Fhir.Model.Id)PackageIdElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DependsOnComponent()); + var instance = new DependsOnComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2524,7 +2525,7 @@ public string Profile } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GlobalComponent; @@ -2533,15 +2534,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GlobalComponent()); + var instance = new GlobalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2683,7 +2685,7 @@ public List Template private List _Template; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DefinitionComponent; @@ -2692,18 +2694,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Grouping.Any()) dest.Grouping = new List(Grouping.DeepCopy()); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - if(Page != null) dest.Page = (Hl7.Fhir.Model.ImplementationGuide.PageComponent)Page.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Template.Any()) dest.Template = new List(Template.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Grouping.Any()) dest.Grouping = new List(Grouping.DeepCopyInternal()); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); + if(Page != null) dest.Page = (Hl7.Fhir.Model.ImplementationGuide.PageComponent)Page.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Template.Any()) dest.Template = new List(Template.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DefinitionComponent()); + var instance = new DefinitionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2863,7 +2866,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupingComponent; @@ -2872,15 +2875,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupingComponent()); + var instance = new GroupingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3110,7 +3114,7 @@ public string GroupingId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceComponent; @@ -3119,19 +3123,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(FhirVersionElement.Any()) dest.FhirVersionElement = new List>(FhirVersionElement.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Example != null) dest.Example = (Hl7.Fhir.Model.DataType)Example.DeepCopy(); - if(GroupingIdElement != null) dest.GroupingIdElement = (Hl7.Fhir.Model.Id)GroupingIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(FhirVersionElement.Any()) dest.FhirVersionElement = new List>(FhirVersionElement.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Example != null) dest.Example = (Hl7.Fhir.Model.DataType)Example.DeepCopyInternal(); + if(GroupingIdElement != null) dest.GroupingIdElement = (Hl7.Fhir.Model.Id)GroupingIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceComponent()); + var instance = new ResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3333,7 +3338,7 @@ public List Page private List _Page; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PageComponent; @@ -3342,17 +3347,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Name != null) dest.Name = (Hl7.Fhir.Model.DataType)Name.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(GenerationElement != null) dest.GenerationElement = (Code)GenerationElement.DeepCopy(); - if(Page.Any()) dest.Page = new List(Page.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Name != null) dest.Name = (Hl7.Fhir.Model.DataType)Name.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(GenerationElement != null) dest.GenerationElement = (Code)GenerationElement.DeepCopyInternal(); + if(Page.Any()) dest.Page = new List(Page.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PageComponent()); + var instance = new PageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3503,7 +3509,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -3512,15 +3518,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3684,7 +3691,7 @@ public string Scope } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TemplateComponent; @@ -3693,16 +3700,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopy(); - if(ScopeElement != null) dest.ScopeElement = (Hl7.Fhir.Model.FhirString)ScopeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopyInternal(); + if(ScopeElement != null) dest.ScopeElement = (Hl7.Fhir.Model.FhirString)ScopeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TemplateComponent()); + var instance = new TemplateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3905,7 +3913,7 @@ public IEnumerable Other } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManifestComponent; @@ -3914,18 +3922,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RenderingElement != null) dest.RenderingElement = (Hl7.Fhir.Model.FhirUrl)RenderingElement.DeepCopy(); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - if(Page.Any()) dest.Page = new List(Page.DeepCopy()); - if(ImageElement.Any()) dest.ImageElement = new List(ImageElement.DeepCopy()); - if(OtherElement.Any()) dest.OtherElement = new List(OtherElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RenderingElement != null) dest.RenderingElement = (Hl7.Fhir.Model.FhirUrl)RenderingElement.DeepCopyInternal(); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); + if(Page.Any()) dest.Page = new List(Page.DeepCopyInternal()); + if(ImageElement.Any()) dest.ImageElement = new List(ImageElement.DeepCopyInternal()); + if(OtherElement.Any()) dest.OtherElement = new List(OtherElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManifestComponent()); + var instance = new ManifestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4083,7 +4092,7 @@ public string RelativePath } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManifestResourceComponent; @@ -4092,16 +4101,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(Example != null) dest.Example = (Hl7.Fhir.Model.DataType)Example.DeepCopy(); - if(RelativePathElement != null) dest.RelativePathElement = (Hl7.Fhir.Model.FhirUrl)RelativePathElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(Example != null) dest.Example = (Hl7.Fhir.Model.DataType)Example.DeepCopyInternal(); + if(RelativePathElement != null) dest.RelativePathElement = (Hl7.Fhir.Model.FhirUrl)RelativePathElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManifestResourceComponent()); + var instance = new ManifestResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4276,7 +4286,7 @@ public IEnumerable Anchor } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManifestPageComponent; @@ -4285,16 +4295,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(AnchorElement.Any()) dest.AnchorElement = new List(AnchorElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(AnchorElement.Any()) dest.AnchorElement = new List(AnchorElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManifestPageComponent()); + var instance = new ManifestPageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4869,7 +4880,7 @@ public Hl7.Fhir.Model.ImplementationGuide.ManifestComponent Manifest private Hl7.Fhir.Model.ImplementationGuide.ManifestComponent _Manifest; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImplementationGuide; @@ -4878,33 +4889,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(PackageIdElement != null) dest.PackageIdElement = (Hl7.Fhir.Model.Id)PackageIdElement.DeepCopy(); - if(LicenseElement != null) dest.LicenseElement = (Code)LicenseElement.DeepCopy(); - if(FhirVersionElement.Any()) dest.FhirVersionElement = new List>(FhirVersionElement.DeepCopy()); - if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopy()); - if(Global.Any()) dest.Global = new List(Global.DeepCopy()); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ImplementationGuide.DefinitionComponent)Definition.DeepCopy(); - if(Manifest != null) dest.Manifest = (Hl7.Fhir.Model.ImplementationGuide.ManifestComponent)Manifest.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(PackageIdElement != null) dest.PackageIdElement = (Hl7.Fhir.Model.Id)PackageIdElement.DeepCopyInternal(); + if(LicenseElement != null) dest.LicenseElement = (Code)LicenseElement.DeepCopyInternal(); + if(FhirVersionElement.Any()) dest.FhirVersionElement = new List>(FhirVersionElement.DeepCopyInternal()); + if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopyInternal()); + if(Global.Any()) dest.Global = new List(Global.DeepCopyInternal()); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ImplementationGuide.DefinitionComponent)Definition.DeepCopyInternal(); + if(Manifest != null) dest.Manifest = (Hl7.Fhir.Model.ImplementationGuide.ManifestComponent)Manifest.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImplementationGuide()); + var instance = new ImplementationGuide(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Ingredient.cs b/src/Hl7.Fhir.R4B/Model/Generated/Ingredient.cs index 62147d5ecf..40d7228c4e 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Ingredient.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Ingredient.cs @@ -149,7 +149,7 @@ public Hl7.Fhir.Model.ResourceReference Manufacturer private Hl7.Fhir.Model.ResourceReference _Manufacturer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManufacturerComponent; @@ -158,15 +158,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RoleElement != null) dest.RoleElement = (Code)RoleElement.DeepCopy(); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RoleElement != null) dest.RoleElement = (Code)RoleElement.DeepCopyInternal(); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManufacturerComponent()); + var instance = new ManufacturerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -264,7 +265,7 @@ public List Strength private List _Strength; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceComponent; @@ -273,15 +274,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableReference)Code.DeepCopy(); - if(Strength.Any()) dest.Strength = new List(Strength.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableReference)Code.DeepCopyInternal(); + if(Strength.Any()) dest.Strength = new List(Strength.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceComponent()); + var instance = new SubstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -505,7 +507,7 @@ public List ReferenceStren private List _ReferenceStrength; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StrengthComponent; @@ -514,20 +516,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Presentation != null) dest.Presentation = (Hl7.Fhir.Model.DataType)Presentation.DeepCopy(); - if(TextPresentationElement != null) dest.TextPresentationElement = (Hl7.Fhir.Model.FhirString)TextPresentationElement.DeepCopy(); - if(Concentration != null) dest.Concentration = (Hl7.Fhir.Model.DataType)Concentration.DeepCopy(); - if(TextConcentrationElement != null) dest.TextConcentrationElement = (Hl7.Fhir.Model.FhirString)TextConcentrationElement.DeepCopy(); - if(MeasurementPointElement != null) dest.MeasurementPointElement = (Hl7.Fhir.Model.FhirString)MeasurementPointElement.DeepCopy(); - if(Country.Any()) dest.Country = new List(Country.DeepCopy()); - if(ReferenceStrength.Any()) dest.ReferenceStrength = new List(ReferenceStrength.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Presentation != null) dest.Presentation = (Hl7.Fhir.Model.DataType)Presentation.DeepCopyInternal(); + if(TextPresentationElement != null) dest.TextPresentationElement = (Hl7.Fhir.Model.FhirString)TextPresentationElement.DeepCopyInternal(); + if(Concentration != null) dest.Concentration = (Hl7.Fhir.Model.DataType)Concentration.DeepCopyInternal(); + if(TextConcentrationElement != null) dest.TextConcentrationElement = (Hl7.Fhir.Model.FhirString)TextConcentrationElement.DeepCopyInternal(); + if(MeasurementPointElement != null) dest.MeasurementPointElement = (Hl7.Fhir.Model.FhirString)MeasurementPointElement.DeepCopyInternal(); + if(Country.Any()) dest.Country = new List(Country.DeepCopyInternal()); + if(ReferenceStrength.Any()) dest.ReferenceStrength = new List(ReferenceStrength.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StrengthComponent()); + var instance = new StrengthComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -715,7 +718,7 @@ public List Country private List _Country; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferenceStrengthComponent; @@ -724,17 +727,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableReference)Substance.DeepCopy(); - if(Strength != null) dest.Strength = (Hl7.Fhir.Model.DataType)Strength.DeepCopy(); - if(MeasurementPointElement != null) dest.MeasurementPointElement = (Hl7.Fhir.Model.FhirString)MeasurementPointElement.DeepCopy(); - if(Country.Any()) dest.Country = new List(Country.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableReference)Substance.DeepCopyInternal(); + if(Strength != null) dest.Strength = (Hl7.Fhir.Model.DataType)Strength.DeepCopyInternal(); + if(MeasurementPointElement != null) dest.MeasurementPointElement = (Hl7.Fhir.Model.FhirString)MeasurementPointElement.DeepCopyInternal(); + if(Country.Any()) dest.Country = new List(Country.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferenceStrengthComponent()); + var instance = new ReferenceStrengthComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -960,7 +964,7 @@ public Hl7.Fhir.Model.Ingredient.SubstanceComponent Substance Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Ingredient; @@ -969,21 +973,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(For.Any()) dest.For = new List(For.DeepCopy()); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Function.Any()) dest.Function = new List(Function.DeepCopy()); - if(AllergenicIndicatorElement != null) dest.AllergenicIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)AllergenicIndicatorElement.DeepCopy(); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.Ingredient.SubstanceComponent)Substance.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(For.Any()) dest.For = new List(For.DeepCopyInternal()); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Function.Any()) dest.Function = new List(Function.DeepCopyInternal()); + if(AllergenicIndicatorElement != null) dest.AllergenicIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)AllergenicIndicatorElement.DeepCopyInternal(); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.Ingredient.SubstanceComponent)Substance.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Ingredient()); + var instance = new Ingredient(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/InsurancePlan.cs b/src/Hl7.Fhir.R4B/Model/Generated/InsurancePlan.cs index 97bade607d..c0991c951d 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/InsurancePlan.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/InsurancePlan.cs @@ -155,7 +155,7 @@ public Hl7.Fhir.Model.Address Address private Hl7.Fhir.Model.Address _Address; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContactComponent; @@ -164,17 +164,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Purpose != null) dest.Purpose = (Hl7.Fhir.Model.CodeableConcept)Purpose.DeepCopy(); - if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Purpose != null) dest.Purpose = (Hl7.Fhir.Model.CodeableConcept)Purpose.DeepCopyInternal(); + if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContactComponent()); + var instance = new ContactComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -306,7 +307,7 @@ public List Benefit private List _Benefit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageComponent; @@ -315,16 +316,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Network.Any()) dest.Network = new List(Network.DeepCopy()); - if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Network.Any()) dest.Network = new List(Network.DeepCopyInternal()); + if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageComponent()); + var instance = new CoverageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -463,7 +465,7 @@ public List Limit private List _Limit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageBenefitComponent; @@ -472,16 +474,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.FhirString)RequirementElement.DeepCopy(); - if(Limit.Any()) dest.Limit = new List(Limit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.FhirString)RequirementElement.DeepCopyInternal(); + if(Limit.Any()) dest.Limit = new List(Limit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageBenefitComponent()); + var instance = new CoverageBenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -587,7 +590,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LimitComponent; @@ -596,15 +599,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LimitComponent()); + var instance = new LimitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -763,7 +767,7 @@ public List SpecificCost private List _SpecificCost; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PlanComponent; @@ -772,19 +776,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopy()); - if(Network.Any()) dest.Network = new List(Network.DeepCopy()); - if(GeneralCost.Any()) dest.GeneralCost = new List(GeneralCost.DeepCopy()); - if(SpecificCost.Any()) dest.SpecificCost = new List(SpecificCost.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopyInternal()); + if(Network.Any()) dest.Network = new List(Network.DeepCopyInternal()); + if(GeneralCost.Any()) dest.GeneralCost = new List(GeneralCost.DeepCopyInternal()); + if(SpecificCost.Any()) dest.SpecificCost = new List(SpecificCost.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PlanComponent()); + var instance = new PlanComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -976,7 +981,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GeneralCostComponent; @@ -985,17 +990,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(GroupSizeElement != null) dest.GroupSizeElement = (Hl7.Fhir.Model.PositiveInt)GroupSizeElement.DeepCopy(); - if(Cost != null) dest.Cost = (Hl7.Fhir.Model.Money)Cost.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(GroupSizeElement != null) dest.GroupSizeElement = (Hl7.Fhir.Model.PositiveInt)GroupSizeElement.DeepCopyInternal(); + if(Cost != null) dest.Cost = (Hl7.Fhir.Model.Money)Cost.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GeneralCostComponent()); + var instance = new GeneralCostComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1111,7 +1117,7 @@ public List Benefit private List _Benefit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SpecificCostComponent; @@ -1120,15 +1126,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SpecificCostComponent()); + var instance = new SpecificCostComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1228,7 +1235,7 @@ public List Cost private List _Cost; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PlanBenefitComponent; @@ -1237,15 +1244,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Cost.Any()) dest.Cost = new List(Cost.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Cost.Any()) dest.Cost = new List(Cost.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PlanBenefitComponent()); + var instance = new PlanBenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1372,7 +1380,7 @@ public Hl7.Fhir.Model.Quantity Value private Hl7.Fhir.Model.Quantity _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CostComponent; @@ -1381,17 +1389,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Applicability != null) dest.Applicability = (Hl7.Fhir.Model.CodeableConcept)Applicability.DeepCopy(); - if(Qualifiers.Any()) dest.Qualifiers = new List(Qualifiers.DeepCopy()); - if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Applicability != null) dest.Applicability = (Hl7.Fhir.Model.CodeableConcept)Applicability.DeepCopyInternal(); + if(Qualifiers.Any()) dest.Qualifiers = new List(Qualifiers.DeepCopyInternal()); + if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CostComponent()); + var instance = new CostComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1723,7 +1732,7 @@ public List Plan List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsurancePlan; @@ -1732,27 +1741,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(OwnedBy != null) dest.OwnedBy = (Hl7.Fhir.Model.ResourceReference)OwnedBy.DeepCopy(); - if(AdministeredBy != null) dest.AdministeredBy = (Hl7.Fhir.Model.ResourceReference)AdministeredBy.DeepCopy(); - if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(Network.Any()) dest.Network = new List(Network.DeepCopy()); - if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopy()); - if(Plan.Any()) dest.Plan = new List(Plan.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(OwnedBy != null) dest.OwnedBy = (Hl7.Fhir.Model.ResourceReference)OwnedBy.DeepCopyInternal(); + if(AdministeredBy != null) dest.AdministeredBy = (Hl7.Fhir.Model.ResourceReference)AdministeredBy.DeepCopyInternal(); + if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(Network.Any()) dest.Network = new List(Network.DeepCopyInternal()); + if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopyInternal()); + if(Plan.Any()) dest.Plan = new List(Plan.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsurancePlan()); + var instance = new InsurancePlan(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Invoice.cs b/src/Hl7.Fhir.R4B/Model/Generated/Invoice.cs index 857a94bb6b..1dd45437d9 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Invoice.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Invoice.cs @@ -144,7 +144,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -153,15 +153,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -295,7 +296,7 @@ public List PriceComponent private List _PriceComponent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LineItemComponent; @@ -304,16 +305,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(ChargeItem != null) dest.ChargeItem = (Hl7.Fhir.Model.DataType)ChargeItem.DeepCopy(); - if(PriceComponent.Any()) dest.PriceComponent = new List(PriceComponent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(ChargeItem != null) dest.ChargeItem = (Hl7.Fhir.Model.DataType)ChargeItem.DeepCopyInternal(); + if(PriceComponent.Any()) dest.PriceComponent = new List(PriceComponent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LineItemComponent()); + var instance = new LineItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -484,7 +486,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PriceComponentComponent; @@ -493,17 +495,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PriceComponentComponent()); + var instance = new PriceComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -873,7 +876,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Invoice; @@ -882,29 +885,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CancelledReasonElement != null) dest.CancelledReasonElement = (Hl7.Fhir.Model.FhirString)CancelledReasonElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopy(); - if(Account != null) dest.Account = (Hl7.Fhir.Model.ResourceReference)Account.DeepCopy(); - if(LineItem.Any()) dest.LineItem = new List(LineItem.DeepCopy()); - if(TotalPriceComponent.Any()) dest.TotalPriceComponent = new List(TotalPriceComponent.DeepCopy()); - if(TotalNet != null) dest.TotalNet = (Hl7.Fhir.Model.Money)TotalNet.DeepCopy(); - if(TotalGross != null) dest.TotalGross = (Hl7.Fhir.Model.Money)TotalGross.DeepCopy(); - if(PaymentTermsElement != null) dest.PaymentTermsElement = (Hl7.Fhir.Model.Markdown)PaymentTermsElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CancelledReasonElement != null) dest.CancelledReasonElement = (Hl7.Fhir.Model.FhirString)CancelledReasonElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopyInternal(); + if(Account != null) dest.Account = (Hl7.Fhir.Model.ResourceReference)Account.DeepCopyInternal(); + if(LineItem.Any()) dest.LineItem = new List(LineItem.DeepCopyInternal()); + if(TotalPriceComponent.Any()) dest.TotalPriceComponent = new List(TotalPriceComponent.DeepCopyInternal()); + if(TotalNet != null) dest.TotalNet = (Hl7.Fhir.Model.Money)TotalNet.DeepCopyInternal(); + if(TotalGross != null) dest.TotalGross = (Hl7.Fhir.Model.Money)TotalGross.DeepCopyInternal(); + if(PaymentTermsElement != null) dest.PaymentTermsElement = (Hl7.Fhir.Model.Markdown)PaymentTermsElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Invoice()); + var instance = new Invoice(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Library.cs b/src/Hl7.Fhir.R4B/Model/Generated/Library.cs index 6c37d7846c..22a4000a74 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Library.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Library.cs @@ -758,7 +758,7 @@ public List Content List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Library; @@ -767,44 +767,45 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopy()); - if(Content.Any()) dest.Content = new List(Content.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopyInternal()); + if(Content.Any()) dest.Content = new List(Content.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Library()); + var instance = new Library(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Linkage.cs b/src/Hl7.Fhir.R4B/Model/Generated/Linkage.cs index fd72622f96..3c849eb846 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Linkage.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Linkage.cs @@ -153,7 +153,7 @@ public Hl7.Fhir.Model.ResourceReference Resource private Hl7.Fhir.Model.ResourceReference _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -162,15 +162,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -286,7 +287,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Linkage; @@ -295,16 +296,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Linkage()); + var instance = new Linkage(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/List.cs b/src/Hl7.Fhir.R4B/Model/Generated/List.cs index c3d5216620..5dc9152faf 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/List.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/List.cs @@ -193,7 +193,7 @@ public Hl7.Fhir.Model.ResourceReference Item private Hl7.Fhir.Model.ResourceReference _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EntryComponent; @@ -202,17 +202,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Flag != null) dest.Flag = (Hl7.Fhir.Model.CodeableConcept)Flag.DeepCopy(); - if(DeletedElement != null) dest.DeletedElement = (Hl7.Fhir.Model.FhirBoolean)DeletedElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.ResourceReference)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Flag != null) dest.Flag = (Hl7.Fhir.Model.CodeableConcept)Flag.DeepCopyInternal(); + if(DeletedElement != null) dest.DeletedElement = (Hl7.Fhir.Model.FhirBoolean)DeletedElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.ResourceReference)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EntryComponent()); + var instance = new EntryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -545,7 +546,7 @@ public Hl7.Fhir.Model.CodeableConcept EmptyReason List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as List; @@ -554,26 +555,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Entry.Any()) dest.Entry = new List(Entry.DeepCopy()); - if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Entry.Any()) dest.Entry = new List(Entry.DeepCopyInternal()); + if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new List()); + var instance = new List(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Location.cs b/src/Hl7.Fhir.R4B/Model/Generated/Location.cs index 8a8771a0eb..399a6bd5ac 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Location.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Location.cs @@ -220,7 +220,7 @@ public decimal? Altitude } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PositionComponent; @@ -229,16 +229,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LongitudeElement != null) dest.LongitudeElement = (Hl7.Fhir.Model.FhirDecimal)LongitudeElement.DeepCopy(); - if(LatitudeElement != null) dest.LatitudeElement = (Hl7.Fhir.Model.FhirDecimal)LatitudeElement.DeepCopy(); - if(AltitudeElement != null) dest.AltitudeElement = (Hl7.Fhir.Model.FhirDecimal)AltitudeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LongitudeElement != null) dest.LongitudeElement = (Hl7.Fhir.Model.FhirDecimal)LongitudeElement.DeepCopyInternal(); + if(LatitudeElement != null) dest.LatitudeElement = (Hl7.Fhir.Model.FhirDecimal)LatitudeElement.DeepCopyInternal(); + if(AltitudeElement != null) dest.AltitudeElement = (Hl7.Fhir.Model.FhirDecimal)AltitudeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PositionComponent()); + var instance = new PositionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -446,7 +447,7 @@ public string ClosingTime } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HoursOfOperationComponent; @@ -455,17 +456,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopy()); - if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopy(); - if(OpeningTimeElement != null) dest.OpeningTimeElement = (Hl7.Fhir.Model.Time)OpeningTimeElement.DeepCopy(); - if(ClosingTimeElement != null) dest.ClosingTimeElement = (Hl7.Fhir.Model.Time)ClosingTimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopyInternal()); + if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopyInternal(); + if(OpeningTimeElement != null) dest.OpeningTimeElement = (Hl7.Fhir.Model.Time)OpeningTimeElement.DeepCopyInternal(); + if(ClosingTimeElement != null) dest.ClosingTimeElement = (Hl7.Fhir.Model.Time)ClosingTimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HoursOfOperationComponent()); + var instance = new HoursOfOperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -887,7 +889,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Location; @@ -896,30 +898,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(OperationalStatus != null) dest.OperationalStatus = (Hl7.Fhir.Model.Coding)OperationalStatus.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - if(PhysicalType != null) dest.PhysicalType = (Hl7.Fhir.Model.CodeableConcept)PhysicalType.DeepCopy(); - if(Position != null) dest.Position = (Hl7.Fhir.Model.Location.PositionComponent)Position.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - if(HoursOfOperation.Any()) dest.HoursOfOperation = new List(HoursOfOperation.DeepCopy()); - if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(OperationalStatus != null) dest.OperationalStatus = (Hl7.Fhir.Model.Coding)OperationalStatus.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); + if(PhysicalType != null) dest.PhysicalType = (Hl7.Fhir.Model.CodeableConcept)PhysicalType.DeepCopyInternal(); + if(Position != null) dest.Position = (Hl7.Fhir.Model.Location.PositionComponent)Position.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); + if(HoursOfOperation.Any()) dest.HoursOfOperation = new List(HoursOfOperation.DeepCopyInternal()); + if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Location()); + var instance = new Location(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ManufacturedItemDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/ManufacturedItemDefinition.cs index d5650aa8dc..fa5c81622e 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ManufacturedItemDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ManufacturedItemDefinition.cs @@ -99,7 +99,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -108,15 +108,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -296,7 +297,7 @@ public List Propert List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManufacturedItemDefinition; @@ -305,20 +306,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ManufacturedDoseForm != null) dest.ManufacturedDoseForm = (Hl7.Fhir.Model.CodeableConcept)ManufacturedDoseForm.DeepCopy(); - if(UnitOfPresentation != null) dest.UnitOfPresentation = (Hl7.Fhir.Model.CodeableConcept)UnitOfPresentation.DeepCopy(); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ManufacturedDoseForm != null) dest.ManufacturedDoseForm = (Hl7.Fhir.Model.CodeableConcept)ManufacturedDoseForm.DeepCopyInternal(); + if(UnitOfPresentation != null) dest.UnitOfPresentation = (Hl7.Fhir.Model.CodeableConcept)UnitOfPresentation.DeepCopyInternal(); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManufacturedItemDefinition()); + var instance = new ManufacturedItemDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/MarketingStatus.cs b/src/Hl7.Fhir.R4B/Model/Generated/MarketingStatus.cs index 251563f655..fa9afc166c 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/MarketingStatus.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/MarketingStatus.cs @@ -140,7 +140,7 @@ public string RestoreDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MarketingStatus; @@ -149,18 +149,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopy(); - if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(DateRange != null) dest.DateRange = (Hl7.Fhir.Model.Period)DateRange.DeepCopy(); - if(RestoreDateElement != null) dest.RestoreDateElement = (Hl7.Fhir.Model.FhirDateTime)RestoreDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopyInternal(); + if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(DateRange != null) dest.DateRange = (Hl7.Fhir.Model.Period)DateRange.DeepCopyInternal(); + if(RestoreDateElement != null) dest.RestoreDateElement = (Hl7.Fhir.Model.FhirDateTime)RestoreDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MarketingStatus()); + var instance = new MarketingStatus(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Measure.cs b/src/Hl7.Fhir.R4B/Model/Generated/Measure.cs index 915a45fdac..47237907d2 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Measure.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Measure.cs @@ -148,7 +148,7 @@ public List Stratifier private List _Stratifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -157,17 +157,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -314,7 +315,7 @@ public Hl7.Fhir.Model.Expression Criteria private Hl7.Fhir.Model.Expression _Criteria; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PopulationComponent; @@ -323,16 +324,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PopulationComponent()); + var instance = new PopulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -484,7 +486,7 @@ public List Component private List _Component; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierComponent; @@ -493,17 +495,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopy(); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopyInternal(); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierComponent()); + var instance = new StratifierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -651,7 +654,7 @@ public Hl7.Fhir.Model.Expression Criteria private Hl7.Fhir.Model.Expression _Criteria; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -660,16 +663,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -824,7 +828,7 @@ public Hl7.Fhir.Model.Expression Criteria private Hl7.Fhir.Model.Expression _Criteria; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplementalDataComponent; @@ -833,17 +837,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Usage.Any()) dest.Usage = new List(Usage.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Usage.Any()) dest.Usage = new List(Usage.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplementalDataComponent()); + var instance = new SupplementalDataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1892,7 +1897,7 @@ public List SupplementalData List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Measure; @@ -1901,54 +1906,55 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(DisclaimerElement != null) dest.DisclaimerElement = (Hl7.Fhir.Model.Markdown)DisclaimerElement.DeepCopy(); - if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopy(); - if(CompositeScoring != null) dest.CompositeScoring = (Hl7.Fhir.Model.CodeableConcept)CompositeScoring.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(RiskAdjustmentElement != null) dest.RiskAdjustmentElement = (Hl7.Fhir.Model.FhirString)RiskAdjustmentElement.DeepCopy(); - if(RateAggregationElement != null) dest.RateAggregationElement = (Hl7.Fhir.Model.FhirString)RateAggregationElement.DeepCopy(); - if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.Markdown)RationaleElement.DeepCopy(); - if(ClinicalRecommendationStatementElement != null) dest.ClinicalRecommendationStatementElement = (Hl7.Fhir.Model.Markdown)ClinicalRecommendationStatementElement.DeepCopy(); - if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopy(); - if(DefinitionElement.Any()) dest.DefinitionElement = new List(DefinitionElement.DeepCopy()); - if(GuidanceElement != null) dest.GuidanceElement = (Hl7.Fhir.Model.Markdown)GuidanceElement.DeepCopy(); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - if(SupplementalData.Any()) dest.SupplementalData = new List(SupplementalData.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Measure()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(DisclaimerElement != null) dest.DisclaimerElement = (Hl7.Fhir.Model.Markdown)DisclaimerElement.DeepCopyInternal(); + if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopyInternal(); + if(CompositeScoring != null) dest.CompositeScoring = (Hl7.Fhir.Model.CodeableConcept)CompositeScoring.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(RiskAdjustmentElement != null) dest.RiskAdjustmentElement = (Hl7.Fhir.Model.FhirString)RiskAdjustmentElement.DeepCopyInternal(); + if(RateAggregationElement != null) dest.RateAggregationElement = (Hl7.Fhir.Model.FhirString)RateAggregationElement.DeepCopyInternal(); + if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.Markdown)RationaleElement.DeepCopyInternal(); + if(ClinicalRecommendationStatementElement != null) dest.ClinicalRecommendationStatementElement = (Hl7.Fhir.Model.Markdown)ClinicalRecommendationStatementElement.DeepCopyInternal(); + if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopyInternal(); + if(DefinitionElement.Any()) dest.DefinitionElement = new List(DefinitionElement.DeepCopyInternal()); + if(GuidanceElement != null) dest.GuidanceElement = (Hl7.Fhir.Model.Markdown)GuidanceElement.DeepCopyInternal(); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); + if(SupplementalData.Any()) dest.SupplementalData = new List(SupplementalData.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Measure(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/MeasureReport.cs b/src/Hl7.Fhir.R4B/Model/Generated/MeasureReport.cs index 8636cee05b..e1f650631a 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/MeasureReport.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/MeasureReport.cs @@ -192,7 +192,7 @@ public List Stratifier private List _Stratifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -201,17 +201,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(MeasureScore != null) dest.MeasureScore = (Hl7.Fhir.Model.Quantity)MeasureScore.DeepCopy(); - if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(MeasureScore != null) dest.MeasureScore = (Hl7.Fhir.Model.Quantity)MeasureScore.DeepCopyInternal(); + if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -359,7 +360,7 @@ public Hl7.Fhir.Model.ResourceReference SubjectResults private Hl7.Fhir.Model.ResourceReference _SubjectResults; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PopulationComponent; @@ -368,16 +369,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy(); - if(SubjectResults != null) dest.SubjectResults = (Hl7.Fhir.Model.ResourceReference)SubjectResults.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopyInternal(); + if(SubjectResults != null) dest.SubjectResults = (Hl7.Fhir.Model.ResourceReference)SubjectResults.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PopulationComponent()); + var instance = new PopulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -486,7 +488,7 @@ public List Stratum private List _Stratum; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierComponent; @@ -495,15 +497,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Stratum.Any()) dest.Stratum = new List(Stratum.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Stratum.Any()) dest.Stratum = new List(Stratum.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierComponent()); + var instance = new StratifierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -630,7 +633,7 @@ public Hl7.Fhir.Model.Quantity MeasureScore private Hl7.Fhir.Model.Quantity _MeasureScore; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierGroupComponent; @@ -639,17 +642,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.CodeableConcept)Value.DeepCopy(); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(MeasureScore != null) dest.MeasureScore = (Hl7.Fhir.Model.Quantity)MeasureScore.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.CodeableConcept)Value.DeepCopyInternal(); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(MeasureScore != null) dest.MeasureScore = (Hl7.Fhir.Model.Quantity)MeasureScore.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierGroupComponent()); + var instance = new StratifierGroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -767,7 +771,7 @@ public Hl7.Fhir.Model.CodeableConcept Value private Hl7.Fhir.Model.CodeableConcept _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -776,15 +780,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.CodeableConcept)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.CodeableConcept)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -916,7 +921,7 @@ public Hl7.Fhir.Model.ResourceReference SubjectResults private Hl7.Fhir.Model.ResourceReference _SubjectResults; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierGroupPopulationComponent; @@ -925,16 +930,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy(); - if(SubjectResults != null) dest.SubjectResults = (Hl7.Fhir.Model.ResourceReference)SubjectResults.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopyInternal(); + if(SubjectResults != null) dest.SubjectResults = (Hl7.Fhir.Model.ResourceReference)SubjectResults.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierGroupPopulationComponent()); + var instance = new StratifierGroupPopulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1233,7 +1239,7 @@ public List EvaluatedResource List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MeasureReport; @@ -1242,24 +1248,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(MeasureElement != null) dest.MeasureElement = (Hl7.Fhir.Model.Canonical)MeasureElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Reporter != null) dest.Reporter = (Hl7.Fhir.Model.ResourceReference)Reporter.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopy(); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - if(EvaluatedResource.Any()) dest.EvaluatedResource = new List(EvaluatedResource.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(MeasureElement != null) dest.MeasureElement = (Hl7.Fhir.Model.Canonical)MeasureElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Reporter != null) dest.Reporter = (Hl7.Fhir.Model.ResourceReference)Reporter.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopyInternal(); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); + if(EvaluatedResource.Any()) dest.EvaluatedResource = new List(EvaluatedResource.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MeasureReport()); + var instance = new MeasureReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Media.cs b/src/Hl7.Fhir.R4B/Model/Generated/Media.cs index 345a049897..8084a600aa 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Media.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Media.cs @@ -498,7 +498,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Media; @@ -507,35 +507,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Modality != null) dest.Modality = (Hl7.Fhir.Model.CodeableConcept)Modality.DeepCopy(); - if(View != null) dest.View = (Hl7.Fhir.Model.CodeableConcept)View.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Created != null) dest.Created = (Hl7.Fhir.Model.DataType)Created.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy(); - if(Operator != null) dest.Operator = (Hl7.Fhir.Model.ResourceReference)Operator.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(DeviceNameElement != null) dest.DeviceNameElement = (Hl7.Fhir.Model.FhirString)DeviceNameElement.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(HeightElement != null) dest.HeightElement = (Hl7.Fhir.Model.PositiveInt)HeightElement.DeepCopy(); - if(WidthElement != null) dest.WidthElement = (Hl7.Fhir.Model.PositiveInt)WidthElement.DeepCopy(); - if(FramesElement != null) dest.FramesElement = (Hl7.Fhir.Model.PositiveInt)FramesElement.DeepCopy(); - if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopy(); - if(Content != null) dest.Content = (Hl7.Fhir.Model.Attachment)Content.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Media()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Modality != null) dest.Modality = (Hl7.Fhir.Model.CodeableConcept)Modality.DeepCopyInternal(); + if(View != null) dest.View = (Hl7.Fhir.Model.CodeableConcept)View.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Created != null) dest.Created = (Hl7.Fhir.Model.DataType)Created.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopyInternal(); + if(Operator != null) dest.Operator = (Hl7.Fhir.Model.ResourceReference)Operator.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(DeviceNameElement != null) dest.DeviceNameElement = (Hl7.Fhir.Model.FhirString)DeviceNameElement.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(HeightElement != null) dest.HeightElement = (Hl7.Fhir.Model.PositiveInt)HeightElement.DeepCopyInternal(); + if(WidthElement != null) dest.WidthElement = (Hl7.Fhir.Model.PositiveInt)WidthElement.DeepCopyInternal(); + if(FramesElement != null) dest.FramesElement = (Hl7.Fhir.Model.PositiveInt)FramesElement.DeepCopyInternal(); + if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopyInternal(); + if(Content != null) dest.Content = (Hl7.Fhir.Model.Attachment)Content.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Media(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Medication.cs b/src/Hl7.Fhir.R4B/Model/Generated/Medication.cs index a40c244540..f0c10794bf 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Medication.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Medication.cs @@ -165,7 +165,7 @@ public Hl7.Fhir.Model.Ratio Strength private Hl7.Fhir.Model.Ratio _Strength; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientComponent; @@ -174,16 +174,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - if(IsActiveElement != null) dest.IsActiveElement = (Hl7.Fhir.Model.FhirBoolean)IsActiveElement.DeepCopy(); - if(Strength != null) dest.Strength = (Hl7.Fhir.Model.Ratio)Strength.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); + if(IsActiveElement != null) dest.IsActiveElement = (Hl7.Fhir.Model.FhirBoolean)IsActiveElement.DeepCopyInternal(); + if(Strength != null) dest.Strength = (Hl7.Fhir.Model.Ratio)Strength.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientComponent()); + var instance = new IngredientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -325,7 +326,7 @@ public string ExpirationDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BatchComponent; @@ -334,15 +335,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BatchComponent()); + var instance = new BatchComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -530,7 +532,7 @@ public Hl7.Fhir.Model.Medication.BatchComponent Batch List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Medication; @@ -539,21 +541,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Ratio)Amount.DeepCopy(); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(Batch != null) dest.Batch = (Hl7.Fhir.Model.Medication.BatchComponent)Batch.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Ratio)Amount.DeepCopyInternal(); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(Batch != null) dest.Batch = (Hl7.Fhir.Model.Medication.BatchComponent)Batch.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Medication()); + var instance = new Medication(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/MedicationAdministration.cs b/src/Hl7.Fhir.R4B/Model/Generated/MedicationAdministration.cs index a14ff1564c..3fb215b293 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/MedicationAdministration.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/MedicationAdministration.cs @@ -157,7 +157,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -166,15 +166,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -347,7 +348,7 @@ public Hl7.Fhir.Model.DataType Rate private Hl7.Fhir.Model.DataType _Rate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DosageComponent; @@ -356,19 +357,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy(); - if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Dose != null) dest.Dose = (Hl7.Fhir.Model.Quantity)Dose.DeepCopy(); - if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopyInternal(); + if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Dose != null) dest.Dose = (Hl7.Fhir.Model.Quantity)Dose.DeepCopyInternal(); + if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DosageComponent()); + var instance = new DosageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -783,7 +785,7 @@ public List EventHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationAdministration; @@ -792,32 +794,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopy()); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Device.Any()) dest.Device = new List(Device.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Dosage != null) dest.Dosage = (Hl7.Fhir.Model.MedicationAdministration.DosageComponent)Dosage.DeepCopy(); - if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopyInternal()); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Device.Any()) dest.Device = new List(Device.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Dosage != null) dest.Dosage = (Hl7.Fhir.Model.MedicationAdministration.DosageComponent)Dosage.DeepCopyInternal(); + if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationAdministration()); + var instance = new MedicationAdministration(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/MedicationDispense.cs b/src/Hl7.Fhir.R4B/Model/Generated/MedicationDispense.cs index 80a7dae7d1..8830424f58 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/MedicationDispense.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/MedicationDispense.cs @@ -169,7 +169,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -178,15 +178,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -335,7 +336,7 @@ public List ResponsibleParty private List _ResponsibleParty; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstitutionComponent; @@ -344,17 +345,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(WasSubstitutedElement != null) dest.WasSubstitutedElement = (Hl7.Fhir.Model.FhirBoolean)WasSubstitutedElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(ResponsibleParty.Any()) dest.ResponsibleParty = new List(ResponsibleParty.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(WasSubstitutedElement != null) dest.WasSubstitutedElement = (Hl7.Fhir.Model.FhirBoolean)WasSubstitutedElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(ResponsibleParty.Any()) dest.ResponsibleParty = new List(ResponsibleParty.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstitutionComponent()); + var instance = new SubstitutionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -838,7 +840,7 @@ public List EventHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationDispense; @@ -847,37 +849,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.DataType)StatusReason.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(AuthorizingPrescription.Any()) dest.AuthorizingPrescription = new List(AuthorizingPrescription.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(DaysSupply != null) dest.DaysSupply = (Hl7.Fhir.Model.Quantity)DaysSupply.DeepCopy(); - if(WhenPreparedElement != null) dest.WhenPreparedElement = (Hl7.Fhir.Model.FhirDateTime)WhenPreparedElement.DeepCopy(); - if(WhenHandedOverElement != null) dest.WhenHandedOverElement = (Hl7.Fhir.Model.FhirDateTime)WhenHandedOverElement.DeepCopy(); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopy()); - if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationDispense.SubstitutionComponent)Substitution.DeepCopy(); - if(DetectedIssue.Any()) dest.DetectedIssue = new List(DetectedIssue.DeepCopy()); - if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.DataType)StatusReason.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(AuthorizingPrescription.Any()) dest.AuthorizingPrescription = new List(AuthorizingPrescription.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(DaysSupply != null) dest.DaysSupply = (Hl7.Fhir.Model.Quantity)DaysSupply.DeepCopyInternal(); + if(WhenPreparedElement != null) dest.WhenPreparedElement = (Hl7.Fhir.Model.FhirDateTime)WhenPreparedElement.DeepCopyInternal(); + if(WhenHandedOverElement != null) dest.WhenHandedOverElement = (Hl7.Fhir.Model.FhirDateTime)WhenHandedOverElement.DeepCopyInternal(); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopyInternal()); + if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationDispense.SubstitutionComponent)Substitution.DeepCopyInternal(); + if(DetectedIssue.Any()) dest.DetectedIssue = new List(DetectedIssue.DeepCopyInternal()); + if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationDispense()); + var instance = new MedicationDispense(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/MedicationKnowledge.cs b/src/Hl7.Fhir.R4B/Model/Generated/MedicationKnowledge.cs index 638a15cdfb..43649e70de 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/MedicationKnowledge.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/MedicationKnowledge.cs @@ -133,7 +133,7 @@ public List Reference private List _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedMedicationKnowledgeComponent; @@ -142,15 +142,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Reference.Any()) dest.Reference = new List(Reference.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Reference.Any()) dest.Reference = new List(Reference.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedMedicationKnowledgeComponent()); + var instance = new RelatedMedicationKnowledgeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -247,7 +248,7 @@ public Hl7.Fhir.Model.ResourceReference Source private Hl7.Fhir.Model.ResourceReference _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MonographComponent; @@ -256,15 +257,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MonographComponent()); + var instance = new MonographComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -397,7 +399,7 @@ public Hl7.Fhir.Model.Ratio Strength private Hl7.Fhir.Model.Ratio _Strength; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientComponent; @@ -406,16 +408,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - if(IsActiveElement != null) dest.IsActiveElement = (Hl7.Fhir.Model.FhirBoolean)IsActiveElement.DeepCopy(); - if(Strength != null) dest.Strength = (Hl7.Fhir.Model.Ratio)Strength.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); + if(IsActiveElement != null) dest.IsActiveElement = (Hl7.Fhir.Model.FhirBoolean)IsActiveElement.DeepCopyInternal(); + if(Strength != null) dest.Strength = (Hl7.Fhir.Model.Ratio)Strength.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientComponent()); + var instance = new IngredientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -554,7 +557,7 @@ public Hl7.Fhir.Model.Money Cost private Hl7.Fhir.Model.Money _Cost; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CostComponent; @@ -563,16 +566,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopy(); - if(Cost != null) dest.Cost = (Hl7.Fhir.Model.Money)Cost.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopyInternal(); + if(Cost != null) dest.Cost = (Hl7.Fhir.Model.Money)Cost.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CostComponent()); + var instance = new CostComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -696,7 +700,7 @@ public string Name } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MonitoringProgramComponent; @@ -705,15 +709,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MonitoringProgramComponent()); + var instance = new MonitoringProgramComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -829,7 +834,7 @@ public List private List _PatientCharacteristics; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdministrationGuidelinesComponent; @@ -838,16 +843,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - if(Indication != null) dest.Indication = (Hl7.Fhir.Model.DataType)Indication.DeepCopy(); - if(PatientCharacteristics.Any()) dest.PatientCharacteristics = new List(PatientCharacteristics.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); + if(Indication != null) dest.Indication = (Hl7.Fhir.Model.DataType)Indication.DeepCopyInternal(); + if(PatientCharacteristics.Any()) dest.PatientCharacteristics = new List(PatientCharacteristics.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdministrationGuidelinesComponent()); + var instance = new AdministrationGuidelinesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -952,7 +958,7 @@ public List Dosage private List _Dosage; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DosageComponent; @@ -961,15 +967,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DosageComponent()); + var instance = new DosageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1089,7 +1096,7 @@ public IEnumerable Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PatientCharacteristicsComponent; @@ -1098,15 +1105,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Characteristic != null) dest.Characteristic = (Hl7.Fhir.Model.DataType)Characteristic.DeepCopy(); - if(ValueElement.Any()) dest.ValueElement = new List(ValueElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Characteristic != null) dest.Characteristic = (Hl7.Fhir.Model.DataType)Characteristic.DeepCopyInternal(); + if(ValueElement.Any()) dest.ValueElement = new List(ValueElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PatientCharacteristicsComponent()); + var instance = new PatientCharacteristicsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1203,7 +1211,7 @@ public List Classification private List _Classification; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicineClassificationComponent; @@ -1212,15 +1220,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicineClassificationComponent()); + var instance = new MedicineClassificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1319,7 +1328,7 @@ public Hl7.Fhir.Model.Quantity Quantity private Hl7.Fhir.Model.Quantity _Quantity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PackagingComponent; @@ -1328,15 +1337,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PackagingComponent()); + var instance = new PackagingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1437,7 +1447,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DrugCharacteristicComponent; @@ -1446,15 +1456,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DrugCharacteristicComponent()); + var instance = new DrugCharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1580,7 +1591,7 @@ public Hl7.Fhir.Model.MedicationKnowledge.MaxDispenseComponent MaxDispense private Hl7.Fhir.Model.MedicationKnowledge.MaxDispenseComponent _MaxDispense; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RegulatoryComponent; @@ -1589,17 +1600,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RegulatoryAuthority != null) dest.RegulatoryAuthority = (Hl7.Fhir.Model.ResourceReference)RegulatoryAuthority.DeepCopy(); - if(Substitution.Any()) dest.Substitution = new List(Substitution.DeepCopy()); - if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopy()); - if(MaxDispense != null) dest.MaxDispense = (Hl7.Fhir.Model.MedicationKnowledge.MaxDispenseComponent)MaxDispense.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RegulatoryAuthority != null) dest.RegulatoryAuthority = (Hl7.Fhir.Model.ResourceReference)RegulatoryAuthority.DeepCopyInternal(); + if(Substitution.Any()) dest.Substitution = new List(Substitution.DeepCopyInternal()); + if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopyInternal()); + if(MaxDispense != null) dest.MaxDispense = (Hl7.Fhir.Model.MedicationKnowledge.MaxDispenseComponent)MaxDispense.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RegulatoryComponent()); + var instance = new RegulatoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1730,7 +1742,7 @@ public bool? Allowed } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstitutionComponent; @@ -1739,15 +1751,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(AllowedElement != null) dest.AllowedElement = (Hl7.Fhir.Model.FhirBoolean)AllowedElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(AllowedElement != null) dest.AllowedElement = (Hl7.Fhir.Model.FhirBoolean)AllowedElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstitutionComponent()); + var instance = new SubstitutionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1830,7 +1843,7 @@ public Hl7.Fhir.Model.CodeableConcept Schedule private Hl7.Fhir.Model.CodeableConcept _Schedule; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ScheduleComponent; @@ -1839,14 +1852,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.CodeableConcept)Schedule.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.CodeableConcept)Schedule.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ScheduleComponent()); + var instance = new ScheduleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1934,7 +1948,7 @@ public Hl7.Fhir.Model.Duration Period private Hl7.Fhir.Model.Duration _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MaxDispenseComponent; @@ -1943,15 +1957,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Duration)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Duration)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MaxDispenseComponent()); + var instance = new MaxDispenseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2061,7 +2076,7 @@ public Hl7.Fhir.Model.Duration HalfLifePeriod private Hl7.Fhir.Model.Duration _HalfLifePeriod; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as KineticsComponent; @@ -2070,16 +2085,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AreaUnderCurve.Any()) dest.AreaUnderCurve = new List(AreaUnderCurve.DeepCopy()); - if(LethalDose50.Any()) dest.LethalDose50 = new List(LethalDose50.DeepCopy()); - if(HalfLifePeriod != null) dest.HalfLifePeriod = (Hl7.Fhir.Model.Duration)HalfLifePeriod.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AreaUnderCurve.Any()) dest.AreaUnderCurve = new List(AreaUnderCurve.DeepCopyInternal()); + if(LethalDose50.Any()) dest.LethalDose50 = new List(LethalDose50.DeepCopyInternal()); + if(HalfLifePeriod != null) dest.HalfLifePeriod = (Hl7.Fhir.Model.Duration)HalfLifePeriod.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new KineticsComponent()); + var instance = new KineticsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2509,7 +2525,7 @@ public List Kinetics private List _Kinetics; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationKnowledge; @@ -2518,35 +2534,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy(); - if(DoseForm != null) dest.DoseForm = (Hl7.Fhir.Model.CodeableConcept)DoseForm.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - if(SynonymElement.Any()) dest.SynonymElement = new List(SynonymElement.DeepCopy()); - if(RelatedMedicationKnowledge.Any()) dest.RelatedMedicationKnowledge = new List(RelatedMedicationKnowledge.DeepCopy()); - if(AssociatedMedication.Any()) dest.AssociatedMedication = new List(AssociatedMedication.DeepCopy()); - if(ProductType.Any()) dest.ProductType = new List(ProductType.DeepCopy()); - if(Monograph.Any()) dest.Monograph = new List(Monograph.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(PreparationInstructionElement != null) dest.PreparationInstructionElement = (Hl7.Fhir.Model.Markdown)PreparationInstructionElement.DeepCopy(); - if(IntendedRoute.Any()) dest.IntendedRoute = new List(IntendedRoute.DeepCopy()); - if(Cost.Any()) dest.Cost = new List(Cost.DeepCopy()); - if(MonitoringProgram.Any()) dest.MonitoringProgram = new List(MonitoringProgram.DeepCopy()); - if(AdministrationGuidelines.Any()) dest.AdministrationGuidelines = new List(AdministrationGuidelines.DeepCopy()); - if(MedicineClassification.Any()) dest.MedicineClassification = new List(MedicineClassification.DeepCopy()); - if(Packaging != null) dest.Packaging = (Hl7.Fhir.Model.MedicationKnowledge.PackagingComponent)Packaging.DeepCopy(); - if(DrugCharacteristic.Any()) dest.DrugCharacteristic = new List(DrugCharacteristic.DeepCopy()); - if(Contraindication.Any()) dest.Contraindication = new List(Contraindication.DeepCopy()); - if(Regulatory.Any()) dest.Regulatory = new List(Regulatory.DeepCopy()); - if(Kinetics.Any()) dest.Kinetics = new List(Kinetics.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopyInternal(); + if(DoseForm != null) dest.DoseForm = (Hl7.Fhir.Model.CodeableConcept)DoseForm.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); + if(SynonymElement.Any()) dest.SynonymElement = new List(SynonymElement.DeepCopyInternal()); + if(RelatedMedicationKnowledge.Any()) dest.RelatedMedicationKnowledge = new List(RelatedMedicationKnowledge.DeepCopyInternal()); + if(AssociatedMedication.Any()) dest.AssociatedMedication = new List(AssociatedMedication.DeepCopyInternal()); + if(ProductType.Any()) dest.ProductType = new List(ProductType.DeepCopyInternal()); + if(Monograph.Any()) dest.Monograph = new List(Monograph.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(PreparationInstructionElement != null) dest.PreparationInstructionElement = (Hl7.Fhir.Model.Markdown)PreparationInstructionElement.DeepCopyInternal(); + if(IntendedRoute.Any()) dest.IntendedRoute = new List(IntendedRoute.DeepCopyInternal()); + if(Cost.Any()) dest.Cost = new List(Cost.DeepCopyInternal()); + if(MonitoringProgram.Any()) dest.MonitoringProgram = new List(MonitoringProgram.DeepCopyInternal()); + if(AdministrationGuidelines.Any()) dest.AdministrationGuidelines = new List(AdministrationGuidelines.DeepCopyInternal()); + if(MedicineClassification.Any()) dest.MedicineClassification = new List(MedicineClassification.DeepCopyInternal()); + if(Packaging != null) dest.Packaging = (Hl7.Fhir.Model.MedicationKnowledge.PackagingComponent)Packaging.DeepCopyInternal(); + if(DrugCharacteristic.Any()) dest.DrugCharacteristic = new List(DrugCharacteristic.DeepCopyInternal()); + if(Contraindication.Any()) dest.Contraindication = new List(Contraindication.DeepCopyInternal()); + if(Regulatory.Any()) dest.Regulatory = new List(Regulatory.DeepCopyInternal()); + if(Kinetics.Any()) dest.Kinetics = new List(Kinetics.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationKnowledge()); + var instance = new MedicationKnowledge(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/MedicationRequest.cs b/src/Hl7.Fhir.R4B/Model/Generated/MedicationRequest.cs index 7470da324c..cebc842797 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/MedicationRequest.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/MedicationRequest.cs @@ -302,7 +302,7 @@ public Hl7.Fhir.Model.ResourceReference Performer private Hl7.Fhir.Model.ResourceReference _Performer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DispenseRequestComponent; @@ -311,20 +311,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(InitialFill != null) dest.InitialFill = (Hl7.Fhir.Model.MedicationRequest.InitialFillComponent)InitialFill.DeepCopy(); - if(DispenseInterval != null) dest.DispenseInterval = (Hl7.Fhir.Model.Duration)DispenseInterval.DeepCopy(); - if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopy(); - if(NumberOfRepeatsAllowedElement != null) dest.NumberOfRepeatsAllowedElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfRepeatsAllowedElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(ExpectedSupplyDuration != null) dest.ExpectedSupplyDuration = (Hl7.Fhir.Model.Duration)ExpectedSupplyDuration.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(InitialFill != null) dest.InitialFill = (Hl7.Fhir.Model.MedicationRequest.InitialFillComponent)InitialFill.DeepCopyInternal(); + if(DispenseInterval != null) dest.DispenseInterval = (Hl7.Fhir.Model.Duration)DispenseInterval.DeepCopyInternal(); + if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopyInternal(); + if(NumberOfRepeatsAllowedElement != null) dest.NumberOfRepeatsAllowedElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfRepeatsAllowedElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(ExpectedSupplyDuration != null) dest.ExpectedSupplyDuration = (Hl7.Fhir.Model.Duration)ExpectedSupplyDuration.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DispenseRequestComponent()); + var instance = new DispenseRequestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -463,7 +464,7 @@ public Hl7.Fhir.Model.Duration Duration private Hl7.Fhir.Model.Duration _Duration; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InitialFillComponent; @@ -472,15 +473,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InitialFillComponent()); + var instance = new InitialFillComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -583,7 +585,7 @@ public Hl7.Fhir.Model.CodeableConcept Reason private Hl7.Fhir.Model.CodeableConcept _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstitutionComponent; @@ -592,15 +594,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstitutionComponent()); + var instance = new SubstitutionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1259,7 +1262,7 @@ public List EventHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationRequest; @@ -1268,45 +1271,46 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Reported != null) dest.Reported = (Hl7.Fhir.Model.DataType)Reported.DeepCopy(); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(CourseOfTherapyType != null) dest.CourseOfTherapyType = (Hl7.Fhir.Model.CodeableConcept)CourseOfTherapyType.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopy()); - if(DispenseRequest != null) dest.DispenseRequest = (Hl7.Fhir.Model.MedicationRequest.DispenseRequestComponent)DispenseRequest.DeepCopy(); - if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationRequest.SubstitutionComponent)Substitution.DeepCopy(); - if(PriorPrescription != null) dest.PriorPrescription = (Hl7.Fhir.Model.ResourceReference)PriorPrescription.DeepCopy(); - if(DetectedIssue.Any()) dest.DetectedIssue = new List(DetectedIssue.DeepCopy()); - if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Reported != null) dest.Reported = (Hl7.Fhir.Model.DataType)Reported.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(CourseOfTherapyType != null) dest.CourseOfTherapyType = (Hl7.Fhir.Model.CodeableConcept)CourseOfTherapyType.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopyInternal()); + if(DispenseRequest != null) dest.DispenseRequest = (Hl7.Fhir.Model.MedicationRequest.DispenseRequestComponent)DispenseRequest.DeepCopyInternal(); + if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationRequest.SubstitutionComponent)Substitution.DeepCopyInternal(); + if(PriorPrescription != null) dest.PriorPrescription = (Hl7.Fhir.Model.ResourceReference)PriorPrescription.DeepCopyInternal(); + if(DetectedIssue.Any()) dest.DetectedIssue = new List(DetectedIssue.DeepCopyInternal()); + if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationRequest()); + var instance = new MedicationRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/MedicationStatement.cs b/src/Hl7.Fhir.R4B/Model/Generated/MedicationStatement.cs index 2d2763eff1..d05f167a99 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/MedicationStatement.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/MedicationStatement.cs @@ -424,7 +424,7 @@ public List Dosage List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationStatement; @@ -433,30 +433,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopy()); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.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(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopyInternal()); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(DateAssertedElement != null) dest.DateAssertedElement = (Hl7.Fhir.Model.FhirDateTime)DateAssertedElement.DeepCopyInternal(); + if(InformationSource != null) dest.InformationSource = (Hl7.Fhir.Model.ResourceReference)InformationSource.DeepCopyInternal(); + if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationStatement()); + var instance = new MedicationStatement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/MedicinalProductDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/MedicinalProductDefinition.cs index 1553be64f6..7293a42b2a 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/MedicinalProductDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/MedicinalProductDefinition.cs @@ -102,7 +102,7 @@ public Hl7.Fhir.Model.ResourceReference Contact private Hl7.Fhir.Model.ResourceReference _Contact; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContactComponent; @@ -111,15 +111,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Contact != null) dest.Contact = (Hl7.Fhir.Model.ResourceReference)Contact.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Contact != null) dest.Contact = (Hl7.Fhir.Model.ResourceReference)Contact.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContactComponent()); + var instance = new ContactComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -262,7 +263,7 @@ public List private List _CountryLanguage; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NameComponent; @@ -271,17 +272,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(NamePart.Any()) dest.NamePart = new List(NamePart.DeepCopy()); - if(CountryLanguage.Any()) dest.CountryLanguage = new List(CountryLanguage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(NamePart.Any()) dest.NamePart = new List(NamePart.DeepCopyInternal()); + if(CountryLanguage.Any()) dest.CountryLanguage = new List(CountryLanguage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NameComponent()); + var instance = new NameComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -413,7 +415,7 @@ public Hl7.Fhir.Model.CodeableConcept Type private Hl7.Fhir.Model.CodeableConcept _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NamePartComponent; @@ -422,15 +424,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PartElement != null) dest.PartElement = (Hl7.Fhir.Model.FhirString)PartElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PartElement != null) dest.PartElement = (Hl7.Fhir.Model.FhirString)PartElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NamePartComponent()); + var instance = new NamePartComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -546,7 +549,7 @@ public Hl7.Fhir.Model.CodeableConcept Language private Hl7.Fhir.Model.CodeableConcept _Language; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CountryLanguageComponent; @@ -555,16 +558,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopy(); - if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopy(); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopyInternal(); + if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopyInternal(); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CountryLanguageComponent()); + var instance = new CountryLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -672,7 +676,7 @@ public Hl7.Fhir.Model.CodeableConcept Type private Hl7.Fhir.Model.CodeableConcept _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CrossReferenceComponent; @@ -681,15 +685,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Product != null) dest.Product = (Hl7.Fhir.Model.CodeableReference)Product.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Product != null) dest.Product = (Hl7.Fhir.Model.CodeableReference)Product.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CrossReferenceComponent()); + var instance = new CrossReferenceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -817,7 +822,7 @@ public Hl7.Fhir.Model.CodeableConcept ConfidentialityIndicator private Hl7.Fhir.Model.CodeableConcept _ConfidentialityIndicator; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -826,17 +831,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableReference)Type.DeepCopy(); - if(EffectiveDate != null) dest.EffectiveDate = (Hl7.Fhir.Model.Period)EffectiveDate.DeepCopy(); - if(Organization.Any()) dest.Organization = new List(Organization.DeepCopy()); - if(ConfidentialityIndicator != null) dest.ConfidentialityIndicator = (Hl7.Fhir.Model.CodeableConcept)ConfidentialityIndicator.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableReference)Type.DeepCopyInternal(); + if(EffectiveDate != null) dest.EffectiveDate = (Hl7.Fhir.Model.Period)EffectiveDate.DeepCopyInternal(); + if(Organization.Any()) dest.Organization = new List(Organization.DeepCopyInternal()); + if(ConfidentialityIndicator != null) dest.ConfidentialityIndicator = (Hl7.Fhir.Model.CodeableConcept)ConfidentialityIndicator.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationComponent()); + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -954,7 +960,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -963,15 +969,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1502,7 +1509,7 @@ public List C List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicinalProductDefinition; @@ -1511,41 +1518,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Domain != null) dest.Domain = (Hl7.Fhir.Model.CodeableConcept)Domain.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(CombinedPharmaceuticalDoseForm != null) dest.CombinedPharmaceuticalDoseForm = (Hl7.Fhir.Model.CodeableConcept)CombinedPharmaceuticalDoseForm.DeepCopy(); - if(Route.Any()) dest.Route = new List(Route.DeepCopy()); - if(IndicationElement != null) dest.IndicationElement = (Hl7.Fhir.Model.Markdown)IndicationElement.DeepCopy(); - if(LegalStatusOfSupply != null) dest.LegalStatusOfSupply = (Hl7.Fhir.Model.CodeableConcept)LegalStatusOfSupply.DeepCopy(); - if(AdditionalMonitoringIndicator != null) dest.AdditionalMonitoringIndicator = (Hl7.Fhir.Model.CodeableConcept)AdditionalMonitoringIndicator.DeepCopy(); - if(SpecialMeasures.Any()) dest.SpecialMeasures = new List(SpecialMeasures.DeepCopy()); - if(PediatricUseIndicator != null) dest.PediatricUseIndicator = (Hl7.Fhir.Model.CodeableConcept)PediatricUseIndicator.DeepCopy(); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopy()); - if(PackagedMedicinalProduct.Any()) dest.PackagedMedicinalProduct = new List(PackagedMedicinalProduct.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(Impurity.Any()) dest.Impurity = new List(Impurity.DeepCopy()); - if(AttachedDocument.Any()) dest.AttachedDocument = new List(AttachedDocument.DeepCopy()); - if(MasterFile.Any()) dest.MasterFile = new List(MasterFile.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(ClinicalTrial.Any()) dest.ClinicalTrial = new List(ClinicalTrial.DeepCopy()); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(CrossReference.Any()) dest.CrossReference = new List(CrossReference.DeepCopy()); - if(Operation.Any()) dest.Operation = new List(Operation.DeepCopy()); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Domain != null) dest.Domain = (Hl7.Fhir.Model.CodeableConcept)Domain.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(CombinedPharmaceuticalDoseForm != null) dest.CombinedPharmaceuticalDoseForm = (Hl7.Fhir.Model.CodeableConcept)CombinedPharmaceuticalDoseForm.DeepCopyInternal(); + if(Route.Any()) dest.Route = new List(Route.DeepCopyInternal()); + if(IndicationElement != null) dest.IndicationElement = (Hl7.Fhir.Model.Markdown)IndicationElement.DeepCopyInternal(); + if(LegalStatusOfSupply != null) dest.LegalStatusOfSupply = (Hl7.Fhir.Model.CodeableConcept)LegalStatusOfSupply.DeepCopyInternal(); + if(AdditionalMonitoringIndicator != null) dest.AdditionalMonitoringIndicator = (Hl7.Fhir.Model.CodeableConcept)AdditionalMonitoringIndicator.DeepCopyInternal(); + if(SpecialMeasures.Any()) dest.SpecialMeasures = new List(SpecialMeasures.DeepCopyInternal()); + if(PediatricUseIndicator != null) dest.PediatricUseIndicator = (Hl7.Fhir.Model.CodeableConcept)PediatricUseIndicator.DeepCopyInternal(); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); + if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopyInternal()); + if(PackagedMedicinalProduct.Any()) dest.PackagedMedicinalProduct = new List(PackagedMedicinalProduct.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(Impurity.Any()) dest.Impurity = new List(Impurity.DeepCopyInternal()); + if(AttachedDocument.Any()) dest.AttachedDocument = new List(AttachedDocument.DeepCopyInternal()); + if(MasterFile.Any()) dest.MasterFile = new List(MasterFile.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(ClinicalTrial.Any()) dest.ClinicalTrial = new List(ClinicalTrial.DeepCopyInternal()); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(CrossReference.Any()) dest.CrossReference = new List(CrossReference.DeepCopyInternal()); + if(Operation.Any()) dest.Operation = new List(Operation.DeepCopyInternal()); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicinalProductDefinition()); + var instance = new MedicinalProductDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/MessageDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/MessageDefinition.cs index 9a11db1633..315341bb6c 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/MessageDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/MessageDefinition.cs @@ -232,7 +232,7 @@ public string Max } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FocusComponent; @@ -241,17 +241,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FocusComponent()); + var instance = new FocusComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -403,7 +404,7 @@ public string Situation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AllowedResponseComponent; @@ -412,15 +413,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Canonical)MessageElement.DeepCopy(); - if(SituationElement != null) dest.SituationElement = (Hl7.Fhir.Model.Markdown)SituationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Canonical)MessageElement.DeepCopyInternal(); + if(SituationElement != null) dest.SituationElement = (Hl7.Fhir.Model.Markdown)SituationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AllowedResponseComponent()); + var instance = new AllowedResponseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1118,7 +1120,7 @@ public IEnumerable Graph List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageDefinition; @@ -1127,37 +1129,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ReplacesElement.Any()) dest.ReplacesElement = new List(ReplacesElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(BaseElement != null) dest.BaseElement = (Hl7.Fhir.Model.Canonical)BaseElement.DeepCopy(); - if(ParentElement.Any()) dest.ParentElement = new List(ParentElement.DeepCopy()); - if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopy(); - if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(ResponseRequiredElement != null) dest.ResponseRequiredElement = (Code)ResponseRequiredElement.DeepCopy(); - if(AllowedResponse.Any()) dest.AllowedResponse = new List(AllowedResponse.DeepCopy()); - if(GraphElement.Any()) dest.GraphElement = new List(GraphElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ReplacesElement.Any()) dest.ReplacesElement = new List(ReplacesElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(BaseElement != null) dest.BaseElement = (Hl7.Fhir.Model.Canonical)BaseElement.DeepCopyInternal(); + if(ParentElement.Any()) dest.ParentElement = new List(ParentElement.DeepCopyInternal()); + if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopyInternal(); + if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(ResponseRequiredElement != null) dest.ResponseRequiredElement = (Code)ResponseRequiredElement.DeepCopyInternal(); + if(AllowedResponse.Any()) dest.AllowedResponse = new List(AllowedResponse.DeepCopyInternal()); + if(GraphElement.Any()) dest.GraphElement = new List(GraphElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageDefinition()); + var instance = new MessageDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/MessageHeader.cs b/src/Hl7.Fhir.R4B/Model/Generated/MessageHeader.cs index f797285e3f..c36392f5e1 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/MessageHeader.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/MessageHeader.cs @@ -197,7 +197,7 @@ public Hl7.Fhir.Model.ResourceReference Receiver private Hl7.Fhir.Model.ResourceReference _Receiver; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageDestinationComponent; @@ -206,17 +206,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopy(); - if(Receiver != null) dest.Receiver = (Hl7.Fhir.Model.ResourceReference)Receiver.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); + if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopyInternal(); + if(Receiver != null) dest.Receiver = (Hl7.Fhir.Model.ResourceReference)Receiver.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageDestinationComponent()); + var instance = new MessageDestinationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -442,7 +443,7 @@ public string Endpoint } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageSourceComponent; @@ -451,18 +452,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(SoftwareElement != null) dest.SoftwareElement = (Hl7.Fhir.Model.FhirString)SoftwareElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(Contact != null) dest.Contact = (Hl7.Fhir.Model.ContactPoint)Contact.DeepCopy(); - if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(SoftwareElement != null) dest.SoftwareElement = (Hl7.Fhir.Model.FhirString)SoftwareElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(Contact != null) dest.Contact = (Hl7.Fhir.Model.ContactPoint)Contact.DeepCopyInternal(); + if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageSourceComponent()); + var instance = new MessageSourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -639,7 +641,7 @@ public Hl7.Fhir.Model.ResourceReference Details private Hl7.Fhir.Model.ResourceReference _Details; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResponseComponent; @@ -648,16 +650,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IdentifierElement != null) dest.IdentifierElement = (Hl7.Fhir.Model.Id)IdentifierElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Details != null) dest.Details = (Hl7.Fhir.Model.ResourceReference)Details.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IdentifierElement != null) dest.IdentifierElement = (Hl7.Fhir.Model.Id)IdentifierElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Details != null) dest.Details = (Hl7.Fhir.Model.ResourceReference)Details.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResponseComponent()); + var instance = new ResponseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -900,7 +903,7 @@ public string Definition } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageHeader; @@ -909,24 +912,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopy(); - if(Destination.Any()) dest.Destination = new List(Destination.DeepCopy()); - if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.MessageHeader.MessageSourceComponent)Source.DeepCopy(); - if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.MessageHeader.ResponseComponent)Response.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopyInternal(); + if(Destination.Any()) dest.Destination = new List(Destination.DeepCopyInternal()); + if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.MessageHeader.MessageSourceComponent)Source.DeepCopyInternal(); + if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.MessageHeader.ResponseComponent)Response.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageHeader()); + var instance = new MessageHeader(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/MolecularSequence.cs b/src/Hl7.Fhir.R4B/Model/Generated/MolecularSequence.cs index b42cdb8b42..9b397d157a 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/MolecularSequence.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/MolecularSequence.cs @@ -448,7 +448,7 @@ public int? WindowEnd } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferenceSeqComponent; @@ -457,22 +457,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Chromosome != null) dest.Chromosome = (Hl7.Fhir.Model.CodeableConcept)Chromosome.DeepCopy(); - if(GenomeBuildElement != null) dest.GenomeBuildElement = (Hl7.Fhir.Model.FhirString)GenomeBuildElement.DeepCopy(); - if(OrientationElement != null) dest.OrientationElement = (Code)OrientationElement.DeepCopy(); - if(ReferenceSeqId != null) dest.ReferenceSeqId = (Hl7.Fhir.Model.CodeableConcept)ReferenceSeqId.DeepCopy(); - if(ReferenceSeqPointer != null) dest.ReferenceSeqPointer = (Hl7.Fhir.Model.ResourceReference)ReferenceSeqPointer.DeepCopy(); - if(ReferenceSeqStringElement != null) dest.ReferenceSeqStringElement = (Hl7.Fhir.Model.FhirString)ReferenceSeqStringElement.DeepCopy(); - if(StrandElement != null) dest.StrandElement = (Code)StrandElement.DeepCopy(); - if(WindowStartElement != null) dest.WindowStartElement = (Hl7.Fhir.Model.Integer)WindowStartElement.DeepCopy(); - if(WindowEndElement != null) dest.WindowEndElement = (Hl7.Fhir.Model.Integer)WindowEndElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Chromosome != null) dest.Chromosome = (Hl7.Fhir.Model.CodeableConcept)Chromosome.DeepCopyInternal(); + if(GenomeBuildElement != null) dest.GenomeBuildElement = (Hl7.Fhir.Model.FhirString)GenomeBuildElement.DeepCopyInternal(); + if(OrientationElement != null) dest.OrientationElement = (Code)OrientationElement.DeepCopyInternal(); + if(ReferenceSeqId != null) dest.ReferenceSeqId = (Hl7.Fhir.Model.CodeableConcept)ReferenceSeqId.DeepCopyInternal(); + if(ReferenceSeqPointer != null) dest.ReferenceSeqPointer = (Hl7.Fhir.Model.ResourceReference)ReferenceSeqPointer.DeepCopyInternal(); + if(ReferenceSeqStringElement != null) dest.ReferenceSeqStringElement = (Hl7.Fhir.Model.FhirString)ReferenceSeqStringElement.DeepCopyInternal(); + if(StrandElement != null) dest.StrandElement = (Code)StrandElement.DeepCopyInternal(); + if(WindowStartElement != null) dest.WindowStartElement = (Hl7.Fhir.Model.Integer)WindowStartElement.DeepCopyInternal(); + if(WindowEndElement != null) dest.WindowEndElement = (Hl7.Fhir.Model.Integer)WindowEndElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferenceSeqComponent()); + var instance = new ReferenceSeqComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -770,7 +771,7 @@ public Hl7.Fhir.Model.ResourceReference VariantPointer private Hl7.Fhir.Model.ResourceReference _VariantPointer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VariantComponent; @@ -779,19 +780,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopy(); - if(ObservedAlleleElement != null) dest.ObservedAlleleElement = (Hl7.Fhir.Model.FhirString)ObservedAlleleElement.DeepCopy(); - if(ReferenceAlleleElement != null) dest.ReferenceAlleleElement = (Hl7.Fhir.Model.FhirString)ReferenceAlleleElement.DeepCopy(); - if(CigarElement != null) dest.CigarElement = (Hl7.Fhir.Model.FhirString)CigarElement.DeepCopy(); - if(VariantPointer != null) dest.VariantPointer = (Hl7.Fhir.Model.ResourceReference)VariantPointer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopyInternal(); + if(ObservedAlleleElement != null) dest.ObservedAlleleElement = (Hl7.Fhir.Model.FhirString)ObservedAlleleElement.DeepCopyInternal(); + if(ReferenceAlleleElement != null) dest.ReferenceAlleleElement = (Hl7.Fhir.Model.FhirString)ReferenceAlleleElement.DeepCopyInternal(); + if(CigarElement != null) dest.CigarElement = (Hl7.Fhir.Model.FhirString)CigarElement.DeepCopyInternal(); + if(VariantPointer != null) dest.VariantPointer = (Hl7.Fhir.Model.ResourceReference)VariantPointer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VariantComponent()); + var instance = new VariantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1293,7 +1295,7 @@ public Hl7.Fhir.Model.MolecularSequence.RocComponent Roc private Hl7.Fhir.Model.MolecularSequence.RocComponent _Roc; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QualityComponent; @@ -1302,28 +1304,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(StandardSequence != null) dest.StandardSequence = (Hl7.Fhir.Model.CodeableConcept)StandardSequence.DeepCopy(); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopy(); - if(Score != null) dest.Score = (Hl7.Fhir.Model.Quantity)Score.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(TruthTPElement != null) dest.TruthTPElement = (Hl7.Fhir.Model.FhirDecimal)TruthTPElement.DeepCopy(); - if(QueryTPElement != null) dest.QueryTPElement = (Hl7.Fhir.Model.FhirDecimal)QueryTPElement.DeepCopy(); - if(TruthFNElement != null) dest.TruthFNElement = (Hl7.Fhir.Model.FhirDecimal)TruthFNElement.DeepCopy(); - if(QueryFPElement != null) dest.QueryFPElement = (Hl7.Fhir.Model.FhirDecimal)QueryFPElement.DeepCopy(); - if(GtFPElement != null) dest.GtFPElement = (Hl7.Fhir.Model.FhirDecimal)GtFPElement.DeepCopy(); - if(PrecisionElement != null) dest.PrecisionElement = (Hl7.Fhir.Model.FhirDecimal)PrecisionElement.DeepCopy(); - if(RecallElement != null) dest.RecallElement = (Hl7.Fhir.Model.FhirDecimal)RecallElement.DeepCopy(); - if(FScoreElement != null) dest.FScoreElement = (Hl7.Fhir.Model.FhirDecimal)FScoreElement.DeepCopy(); - if(Roc != null) dest.Roc = (Hl7.Fhir.Model.MolecularSequence.RocComponent)Roc.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(StandardSequence != null) dest.StandardSequence = (Hl7.Fhir.Model.CodeableConcept)StandardSequence.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopyInternal(); + if(Score != null) dest.Score = (Hl7.Fhir.Model.Quantity)Score.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(TruthTPElement != null) dest.TruthTPElement = (Hl7.Fhir.Model.FhirDecimal)TruthTPElement.DeepCopyInternal(); + if(QueryTPElement != null) dest.QueryTPElement = (Hl7.Fhir.Model.FhirDecimal)QueryTPElement.DeepCopyInternal(); + if(TruthFNElement != null) dest.TruthFNElement = (Hl7.Fhir.Model.FhirDecimal)TruthFNElement.DeepCopyInternal(); + if(QueryFPElement != null) dest.QueryFPElement = (Hl7.Fhir.Model.FhirDecimal)QueryFPElement.DeepCopyInternal(); + if(GtFPElement != null) dest.GtFPElement = (Hl7.Fhir.Model.FhirDecimal)GtFPElement.DeepCopyInternal(); + if(PrecisionElement != null) dest.PrecisionElement = (Hl7.Fhir.Model.FhirDecimal)PrecisionElement.DeepCopyInternal(); + if(RecallElement != null) dest.RecallElement = (Hl7.Fhir.Model.FhirDecimal)RecallElement.DeepCopyInternal(); + if(FScoreElement != null) dest.FScoreElement = (Hl7.Fhir.Model.FhirDecimal)FScoreElement.DeepCopyInternal(); + if(Roc != null) dest.Roc = (Hl7.Fhir.Model.MolecularSequence.RocComponent)Roc.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QualityComponent()); + var instance = new QualityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1723,7 +1726,7 @@ public IEnumerable FMeasure } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RocComponent; @@ -1732,20 +1735,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ScoreElement.Any()) dest.ScoreElement = new List(ScoreElement.DeepCopy()); - if(NumTPElement.Any()) dest.NumTPElement = new List(NumTPElement.DeepCopy()); - if(NumFPElement.Any()) dest.NumFPElement = new List(NumFPElement.DeepCopy()); - if(NumFNElement.Any()) dest.NumFNElement = new List(NumFNElement.DeepCopy()); - if(PrecisionElement.Any()) dest.PrecisionElement = new List(PrecisionElement.DeepCopy()); - if(SensitivityElement.Any()) dest.SensitivityElement = new List(SensitivityElement.DeepCopy()); - if(FMeasureElement.Any()) dest.FMeasureElement = new List(FMeasureElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ScoreElement.Any()) dest.ScoreElement = new List(ScoreElement.DeepCopyInternal()); + if(NumTPElement.Any()) dest.NumTPElement = new List(NumTPElement.DeepCopyInternal()); + if(NumFPElement.Any()) dest.NumFPElement = new List(NumFPElement.DeepCopyInternal()); + if(NumFNElement.Any()) dest.NumFNElement = new List(NumFNElement.DeepCopyInternal()); + if(PrecisionElement.Any()) dest.PrecisionElement = new List(PrecisionElement.DeepCopyInternal()); + if(SensitivityElement.Any()) dest.SensitivityElement = new List(SensitivityElement.DeepCopyInternal()); + if(FMeasureElement.Any()) dest.FMeasureElement = new List(FMeasureElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RocComponent()); + var instance = new RocComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2046,7 +2050,7 @@ public string ReadsetId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepositoryComponent; @@ -2055,19 +2059,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DatasetIdElement != null) dest.DatasetIdElement = (Hl7.Fhir.Model.FhirString)DatasetIdElement.DeepCopy(); - if(VariantsetIdElement != null) dest.VariantsetIdElement = (Hl7.Fhir.Model.FhirString)VariantsetIdElement.DeepCopy(); - if(ReadsetIdElement != null) dest.ReadsetIdElement = (Hl7.Fhir.Model.FhirString)ReadsetIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DatasetIdElement != null) dest.DatasetIdElement = (Hl7.Fhir.Model.FhirString)DatasetIdElement.DeepCopyInternal(); + if(VariantsetIdElement != null) dest.VariantsetIdElement = (Hl7.Fhir.Model.FhirString)VariantsetIdElement.DeepCopyInternal(); + if(ReadsetIdElement != null) dest.ReadsetIdElement = (Hl7.Fhir.Model.FhirString)ReadsetIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepositoryComponent()); + var instance = new RepositoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2273,7 +2278,7 @@ public Hl7.Fhir.Model.MolecularSequence.InnerComponent Inner private Hl7.Fhir.Model.MolecularSequence.InnerComponent _Inner; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureVariantComponent; @@ -2282,18 +2287,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(VariantType != null) dest.VariantType = (Hl7.Fhir.Model.CodeableConcept)VariantType.DeepCopy(); - if(ExactElement != null) dest.ExactElement = (Hl7.Fhir.Model.FhirBoolean)ExactElement.DeepCopy(); - if(LengthElement != null) dest.LengthElement = (Hl7.Fhir.Model.Integer)LengthElement.DeepCopy(); - if(Outer != null) dest.Outer = (Hl7.Fhir.Model.MolecularSequence.OuterComponent)Outer.DeepCopy(); - if(Inner != null) dest.Inner = (Hl7.Fhir.Model.MolecularSequence.InnerComponent)Inner.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(VariantType != null) dest.VariantType = (Hl7.Fhir.Model.CodeableConcept)VariantType.DeepCopyInternal(); + if(ExactElement != null) dest.ExactElement = (Hl7.Fhir.Model.FhirBoolean)ExactElement.DeepCopyInternal(); + if(LengthElement != null) dest.LengthElement = (Hl7.Fhir.Model.Integer)LengthElement.DeepCopyInternal(); + if(Outer != null) dest.Outer = (Hl7.Fhir.Model.MolecularSequence.OuterComponent)Outer.DeepCopyInternal(); + if(Inner != null) dest.Inner = (Hl7.Fhir.Model.MolecularSequence.InnerComponent)Inner.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureVariantComponent()); + var instance = new StructureVariantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2448,7 +2454,7 @@ public int? End } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OuterComponent; @@ -2457,15 +2463,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OuterComponent()); + var instance = new OuterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2596,7 +2603,7 @@ public int? End } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InnerComponent; @@ -2605,15 +2612,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InnerComponent()); + var instance = new InnerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2970,7 +2978,7 @@ public List Structur List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MolecularSequence; @@ -2979,29 +2987,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(CoordinateSystemElement != null) dest.CoordinateSystemElement = (Hl7.Fhir.Model.Integer)CoordinateSystemElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(ReferenceSeq != null) dest.ReferenceSeq = (Hl7.Fhir.Model.MolecularSequence.ReferenceSeqComponent)ReferenceSeq.DeepCopy(); - if(Variant.Any()) dest.Variant = new List(Variant.DeepCopy()); - if(ObservedSeqElement != null) dest.ObservedSeqElement = (Hl7.Fhir.Model.FhirString)ObservedSeqElement.DeepCopy(); - if(Quality.Any()) dest.Quality = new List(Quality.DeepCopy()); - if(ReadCoverageElement != null) dest.ReadCoverageElement = (Hl7.Fhir.Model.Integer)ReadCoverageElement.DeepCopy(); - if(Repository.Any()) dest.Repository = new List(Repository.DeepCopy()); - if(Pointer.Any()) dest.Pointer = new List(Pointer.DeepCopy()); - if(StructureVariant.Any()) dest.StructureVariant = new List(StructureVariant.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(CoordinateSystemElement != null) dest.CoordinateSystemElement = (Hl7.Fhir.Model.Integer)CoordinateSystemElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(ReferenceSeq != null) dest.ReferenceSeq = (Hl7.Fhir.Model.MolecularSequence.ReferenceSeqComponent)ReferenceSeq.DeepCopyInternal(); + if(Variant.Any()) dest.Variant = new List(Variant.DeepCopyInternal()); + if(ObservedSeqElement != null) dest.ObservedSeqElement = (Hl7.Fhir.Model.FhirString)ObservedSeqElement.DeepCopyInternal(); + if(Quality.Any()) dest.Quality = new List(Quality.DeepCopyInternal()); + if(ReadCoverageElement != null) dest.ReadCoverageElement = (Hl7.Fhir.Model.Integer)ReadCoverageElement.DeepCopyInternal(); + if(Repository.Any()) dest.Repository = new List(Repository.DeepCopyInternal()); + if(Pointer.Any()) dest.Pointer = new List(Pointer.DeepCopyInternal()); + if(StructureVariant.Any()) dest.StructureVariant = new List(StructureVariant.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MolecularSequence()); + var instance = new MolecularSequence(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Money.cs b/src/Hl7.Fhir.R4B/Model/Generated/Money.cs index 639169a1aa..102ad2930e 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Money.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Money.cs @@ -1222,7 +1222,7 @@ public Hl7.Fhir.Model.Money.Currencies? Currency } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Money; @@ -1231,15 +1231,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy(); - if(CurrencyElement != null) dest.CurrencyElement = (Code)CurrencyElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopyInternal(); + if(CurrencyElement != null) dest.CurrencyElement = (Code)CurrencyElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Money()); + var instance = new Money(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/NamingSystem.cs b/src/Hl7.Fhir.R4B/Model/Generated/NamingSystem.cs index a3115ec3e6..c32b5bc691 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/NamingSystem.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/NamingSystem.cs @@ -279,7 +279,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UniqueIdComponent; @@ -288,18 +288,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UniqueIdComponent()); + var instance = new UniqueIdComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -706,7 +707,7 @@ public List UniqueId private List _UniqueId; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NamingSystem; @@ -715,26 +716,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirString)ResponsibleElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(UniqueId.Any()) dest.UniqueId = new List(UniqueId.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirString)ResponsibleElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(UniqueId.Any()) dest.UniqueId = new List(UniqueId.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NamingSystem()); + var instance = new NamingSystem(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/NutritionOrder.cs b/src/Hl7.Fhir.R4B/Model/Generated/NutritionOrder.cs index 7a8761d38f..12cc33218a 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/NutritionOrder.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/NutritionOrder.cs @@ -179,7 +179,7 @@ public string Instruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OralDietComponent; @@ -188,19 +188,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopy()); - if(Nutrient.Any()) dest.Nutrient = new List(Nutrient.DeepCopy()); - if(Texture.Any()) dest.Texture = new List(Texture.DeepCopy()); - if(FluidConsistencyType.Any()) dest.FluidConsistencyType = new List(FluidConsistencyType.DeepCopy()); - if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopyInternal()); + if(Nutrient.Any()) dest.Nutrient = new List(Nutrient.DeepCopyInternal()); + if(Texture.Any()) dest.Texture = new List(Texture.DeepCopyInternal()); + if(FluidConsistencyType.Any()) dest.FluidConsistencyType = new List(FluidConsistencyType.DeepCopyInternal()); + if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OralDietComponent()); + var instance = new OralDietComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -331,7 +332,7 @@ public Hl7.Fhir.Model.Quantity Amount private Hl7.Fhir.Model.Quantity _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NutrientComponent; @@ -340,15 +341,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NutrientComponent()); + var instance = new NutrientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -448,7 +450,7 @@ public Hl7.Fhir.Model.CodeableConcept FoodType private Hl7.Fhir.Model.CodeableConcept _FoodType; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TextureComponent; @@ -457,15 +459,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopy(); - if(FoodType != null) dest.FoodType = (Hl7.Fhir.Model.CodeableConcept)FoodType.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopyInternal(); + if(FoodType != null) dest.FoodType = (Hl7.Fhir.Model.CodeableConcept)FoodType.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TextureComponent()); + var instance = new TextureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -640,7 +643,7 @@ public string Instruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplementComponent; @@ -649,18 +652,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopy(); - if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopyInternal(); + if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplementComponent()); + var instance = new SupplementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -931,7 +935,7 @@ public string AdministrationInstruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnteralFormulaComponent; @@ -940,22 +944,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(BaseFormulaType != null) dest.BaseFormulaType = (Hl7.Fhir.Model.CodeableConcept)BaseFormulaType.DeepCopy(); - if(BaseFormulaProductNameElement != null) dest.BaseFormulaProductNameElement = (Hl7.Fhir.Model.FhirString)BaseFormulaProductNameElement.DeepCopy(); - if(AdditiveType != null) dest.AdditiveType = (Hl7.Fhir.Model.CodeableConcept)AdditiveType.DeepCopy(); - if(AdditiveProductNameElement != null) dest.AdditiveProductNameElement = (Hl7.Fhir.Model.FhirString)AdditiveProductNameElement.DeepCopy(); - if(CaloricDensity != null) dest.CaloricDensity = (Hl7.Fhir.Model.Quantity)CaloricDensity.DeepCopy(); - if(RouteofAdministration != null) dest.RouteofAdministration = (Hl7.Fhir.Model.CodeableConcept)RouteofAdministration.DeepCopy(); - if(Administration.Any()) dest.Administration = new List(Administration.DeepCopy()); - if(MaxVolumeToDeliver != null) dest.MaxVolumeToDeliver = (Hl7.Fhir.Model.Quantity)MaxVolumeToDeliver.DeepCopy(); - if(AdministrationInstructionElement != null) dest.AdministrationInstructionElement = (Hl7.Fhir.Model.FhirString)AdministrationInstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(BaseFormulaType != null) dest.BaseFormulaType = (Hl7.Fhir.Model.CodeableConcept)BaseFormulaType.DeepCopyInternal(); + if(BaseFormulaProductNameElement != null) dest.BaseFormulaProductNameElement = (Hl7.Fhir.Model.FhirString)BaseFormulaProductNameElement.DeepCopyInternal(); + if(AdditiveType != null) dest.AdditiveType = (Hl7.Fhir.Model.CodeableConcept)AdditiveType.DeepCopyInternal(); + if(AdditiveProductNameElement != null) dest.AdditiveProductNameElement = (Hl7.Fhir.Model.FhirString)AdditiveProductNameElement.DeepCopyInternal(); + if(CaloricDensity != null) dest.CaloricDensity = (Hl7.Fhir.Model.Quantity)CaloricDensity.DeepCopyInternal(); + if(RouteofAdministration != null) dest.RouteofAdministration = (Hl7.Fhir.Model.CodeableConcept)RouteofAdministration.DeepCopyInternal(); + if(Administration.Any()) dest.Administration = new List(Administration.DeepCopyInternal()); + if(MaxVolumeToDeliver != null) dest.MaxVolumeToDeliver = (Hl7.Fhir.Model.Quantity)MaxVolumeToDeliver.DeepCopyInternal(); + if(AdministrationInstructionElement != null) dest.AdministrationInstructionElement = (Hl7.Fhir.Model.FhirString)AdministrationInstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnteralFormulaComponent()); + var instance = new EnteralFormulaComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1125,7 +1130,7 @@ public Hl7.Fhir.Model.DataType Rate private Hl7.Fhir.Model.DataType _Rate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdministrationComponent; @@ -1134,16 +1139,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.Timing)Schedule.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.Timing)Schedule.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdministrationComponent()); + var instance = new AdministrationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1565,7 +1571,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NutritionOrder; @@ -1574,30 +1580,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopy(); - if(Orderer != null) dest.Orderer = (Hl7.Fhir.Model.ResourceReference)Orderer.DeepCopy(); - if(AllergyIntolerance.Any()) dest.AllergyIntolerance = new List(AllergyIntolerance.DeepCopy()); - if(FoodPreferenceModifier.Any()) dest.FoodPreferenceModifier = new List(FoodPreferenceModifier.DeepCopy()); - if(ExcludeFoodModifier.Any()) dest.ExcludeFoodModifier = new List(ExcludeFoodModifier.DeepCopy()); - if(OralDiet != null) dest.OralDiet = (Hl7.Fhir.Model.NutritionOrder.OralDietComponent)OralDiet.DeepCopy(); - if(Supplement.Any()) dest.Supplement = new List(Supplement.DeepCopy()); - if(EnteralFormula != null) dest.EnteralFormula = (Hl7.Fhir.Model.NutritionOrder.EnteralFormulaComponent)EnteralFormula.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopyInternal(); + if(Orderer != null) dest.Orderer = (Hl7.Fhir.Model.ResourceReference)Orderer.DeepCopyInternal(); + if(AllergyIntolerance.Any()) dest.AllergyIntolerance = new List(AllergyIntolerance.DeepCopyInternal()); + if(FoodPreferenceModifier.Any()) dest.FoodPreferenceModifier = new List(FoodPreferenceModifier.DeepCopyInternal()); + if(ExcludeFoodModifier.Any()) dest.ExcludeFoodModifier = new List(ExcludeFoodModifier.DeepCopyInternal()); + if(OralDiet != null) dest.OralDiet = (Hl7.Fhir.Model.NutritionOrder.OralDietComponent)OralDiet.DeepCopyInternal(); + if(Supplement.Any()) dest.Supplement = new List(Supplement.DeepCopyInternal()); + if(EnteralFormula != null) dest.EnteralFormula = (Hl7.Fhir.Model.NutritionOrder.EnteralFormulaComponent)EnteralFormula.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NutritionOrder()); + var instance = new NutritionOrder(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/NutritionProduct.cs b/src/Hl7.Fhir.R4B/Model/Generated/NutritionProduct.cs index 2a4dbb59a8..704b911c76 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/NutritionProduct.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/NutritionProduct.cs @@ -131,7 +131,7 @@ public List Amount private List _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NutrientComponent; @@ -140,15 +140,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopy(); - if(Amount.Any()) dest.Amount = new List(Amount.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopyInternal(); + if(Amount.Any()) dest.Amount = new List(Amount.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NutrientComponent()); + var instance = new NutrientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -245,7 +246,7 @@ public List Amount private List _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientComponent; @@ -254,15 +255,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopy(); - if(Amount.Any()) dest.Amount = new List(Amount.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopyInternal(); + if(Amount.Any()) dest.Amount = new List(Amount.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientComponent()); + var instance = new IngredientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -362,7 +364,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProductCharacteristicComponent; @@ -371,15 +373,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProductCharacteristicComponent()); + var instance = new ProductCharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -571,7 +574,7 @@ public string UseBy } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -580,18 +583,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopy(); - if(UseByElement != null) dest.UseByElement = (Hl7.Fhir.Model.FhirDateTime)UseByElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopyInternal(); + if(UseByElement != null) dest.UseByElement = (Hl7.Fhir.Model.FhirDateTime)UseByElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -834,7 +838,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NutritionProduct; @@ -843,23 +847,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(Nutrient.Any()) dest.Nutrient = new List(Nutrient.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(KnownAllergen.Any()) dest.KnownAllergen = new List(KnownAllergen.DeepCopy()); - if(ProductCharacteristic.Any()) dest.ProductCharacteristic = new List(ProductCharacteristic.DeepCopy()); - if(Instance != null) dest.Instance = (Hl7.Fhir.Model.NutritionProduct.InstanceComponent)Instance.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(Nutrient.Any()) dest.Nutrient = new List(Nutrient.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(KnownAllergen.Any()) dest.KnownAllergen = new List(KnownAllergen.DeepCopyInternal()); + if(ProductCharacteristic.Any()) dest.ProductCharacteristic = new List(ProductCharacteristic.DeepCopyInternal()); + if(Instance != null) dest.Instance = (Hl7.Fhir.Model.NutritionProduct.InstanceComponent)Instance.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NutritionProduct()); + var instance = new NutritionProduct(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Observation.cs b/src/Hl7.Fhir.R4B/Model/Generated/Observation.cs index 535b6919e2..da9eee6f5f 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Observation.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Observation.cs @@ -176,7 +176,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferenceRangeComponent; @@ -185,19 +185,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Low != null) dest.Low = (Hl7.Fhir.Model.Quantity)Low.DeepCopy(); - if(High != null) dest.High = (Hl7.Fhir.Model.Quantity)High.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopy()); - if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Low != null) dest.Low = (Hl7.Fhir.Model.Quantity)Low.DeepCopyInternal(); + if(High != null) dest.High = (Hl7.Fhir.Model.Quantity)High.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopyInternal()); + if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferenceRangeComponent()); + var instance = new ReferenceRangeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -375,7 +376,7 @@ public List ReferenceRange private List _ReferenceRange; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -384,18 +385,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy(); - if(Interpretation.Any()) dest.Interpretation = new List(Interpretation.DeepCopy()); - if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopyInternal(); + if(Interpretation.Any()) dest.Interpretation = new List(Interpretation.DeepCopyInternal()); + if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -871,7 +873,7 @@ public List Component List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Observation; @@ -880,37 +882,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy(); - if(Interpretation.Any()) dest.Interpretation = new List(Interpretation.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopy()); - if(HasMember.Any()) dest.HasMember = new List(HasMember.DeepCopy()); - if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopy()); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopyInternal(); + if(Interpretation.Any()) dest.Interpretation = new List(Interpretation.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopyInternal()); + if(HasMember.Any()) dest.HasMember = new List(HasMember.DeepCopyInternal()); + if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopyInternal()); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Observation()); + var instance = new Observation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ObservationDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/ObservationDefinition.cs index 5ced123795..e1ed8266ae 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ObservationDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ObservationDefinition.cs @@ -270,7 +270,7 @@ public int? DecimalPrecision } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QuantitativeDetailsComponent; @@ -279,17 +279,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CustomaryUnit != null) dest.CustomaryUnit = (Hl7.Fhir.Model.CodeableConcept)CustomaryUnit.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(ConversionFactorElement != null) dest.ConversionFactorElement = (Hl7.Fhir.Model.FhirDecimal)ConversionFactorElement.DeepCopy(); - if(DecimalPrecisionElement != null) dest.DecimalPrecisionElement = (Hl7.Fhir.Model.Integer)DecimalPrecisionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CustomaryUnit != null) dest.CustomaryUnit = (Hl7.Fhir.Model.CodeableConcept)CustomaryUnit.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(ConversionFactorElement != null) dest.ConversionFactorElement = (Hl7.Fhir.Model.FhirDecimal)ConversionFactorElement.DeepCopyInternal(); + if(DecimalPrecisionElement != null) dest.DecimalPrecisionElement = (Hl7.Fhir.Model.Integer)DecimalPrecisionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QuantitativeDetailsComponent()); + var instance = new QuantitativeDetailsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -542,7 +543,7 @@ public string Condition } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QualifiedIntervalComponent; @@ -551,21 +552,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopy(); - if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.CodeableConcept)Context.DeepCopy(); - if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopy(); - if(GestationalAge != null) dest.GestationalAge = (Hl7.Fhir.Model.Range)GestationalAge.DeepCopy(); - if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopyInternal(); + if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.CodeableConcept)Context.DeepCopyInternal(); + if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopyInternal(); + if(GestationalAge != null) dest.GestationalAge = (Hl7.Fhir.Model.Range)GestationalAge.DeepCopyInternal(); + if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QualifiedIntervalComponent()); + var instance = new QualifiedIntervalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -912,7 +914,7 @@ public Hl7.Fhir.Model.ResourceReference CriticalCodedValueSet List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ObservationDefinition; @@ -921,26 +923,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(PermittedDataTypeElement.Any()) dest.PermittedDataTypeElement = new List>(PermittedDataTypeElement.DeepCopy()); - if(MultipleResultsAllowedElement != null) dest.MultipleResultsAllowedElement = (Hl7.Fhir.Model.FhirBoolean)MultipleResultsAllowedElement.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(PreferredReportNameElement != null) dest.PreferredReportNameElement = (Hl7.Fhir.Model.FhirString)PreferredReportNameElement.DeepCopy(); - if(QuantitativeDetails != null) dest.QuantitativeDetails = (Hl7.Fhir.Model.ObservationDefinition.QuantitativeDetailsComponent)QuantitativeDetails.DeepCopy(); - if(QualifiedInterval.Any()) dest.QualifiedInterval = new List(QualifiedInterval.DeepCopy()); - if(ValidCodedValueSet != null) dest.ValidCodedValueSet = (Hl7.Fhir.Model.ResourceReference)ValidCodedValueSet.DeepCopy(); - if(NormalCodedValueSet != null) dest.NormalCodedValueSet = (Hl7.Fhir.Model.ResourceReference)NormalCodedValueSet.DeepCopy(); - if(AbnormalCodedValueSet != null) dest.AbnormalCodedValueSet = (Hl7.Fhir.Model.ResourceReference)AbnormalCodedValueSet.DeepCopy(); - if(CriticalCodedValueSet != null) dest.CriticalCodedValueSet = (Hl7.Fhir.Model.ResourceReference)CriticalCodedValueSet.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(PermittedDataTypeElement.Any()) dest.PermittedDataTypeElement = new List>(PermittedDataTypeElement.DeepCopyInternal()); + if(MultipleResultsAllowedElement != null) dest.MultipleResultsAllowedElement = (Hl7.Fhir.Model.FhirBoolean)MultipleResultsAllowedElement.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(PreferredReportNameElement != null) dest.PreferredReportNameElement = (Hl7.Fhir.Model.FhirString)PreferredReportNameElement.DeepCopyInternal(); + if(QuantitativeDetails != null) dest.QuantitativeDetails = (Hl7.Fhir.Model.ObservationDefinition.QuantitativeDetailsComponent)QuantitativeDetails.DeepCopyInternal(); + if(QualifiedInterval.Any()) dest.QualifiedInterval = new List(QualifiedInterval.DeepCopyInternal()); + if(ValidCodedValueSet != null) dest.ValidCodedValueSet = (Hl7.Fhir.Model.ResourceReference)ValidCodedValueSet.DeepCopyInternal(); + if(NormalCodedValueSet != null) dest.NormalCodedValueSet = (Hl7.Fhir.Model.ResourceReference)NormalCodedValueSet.DeepCopyInternal(); + if(AbnormalCodedValueSet != null) dest.AbnormalCodedValueSet = (Hl7.Fhir.Model.ResourceReference)AbnormalCodedValueSet.DeepCopyInternal(); + if(CriticalCodedValueSet != null) dest.CriticalCodedValueSet = (Hl7.Fhir.Model.ResourceReference)CriticalCodedValueSet.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ObservationDefinition()); + var instance = new ObservationDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/OperationDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/OperationDefinition.cs index 7aa3e6e724..63c4e45a7a 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/OperationDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/OperationDefinition.cs @@ -398,7 +398,7 @@ public List Part private List _Part; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -407,24 +407,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TargetProfileElement.Any()) dest.TargetProfileElement = new List(TargetProfileElement.DeepCopy()); - if(SearchTypeElement != null) dest.SearchTypeElement = (Code)SearchTypeElement.DeepCopy(); - if(Binding != null) dest.Binding = (Hl7.Fhir.Model.OperationDefinition.BindingComponent)Binding.DeepCopy(); - if(ReferencedFrom.Any()) dest.ReferencedFrom = new List(ReferencedFrom.DeepCopy()); - if(Part.Any()) dest.Part = new List(Part.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TargetProfileElement.Any()) dest.TargetProfileElement = new List(TargetProfileElement.DeepCopyInternal()); + if(SearchTypeElement != null) dest.SearchTypeElement = (Code)SearchTypeElement.DeepCopyInternal(); + if(Binding != null) dest.Binding = (Hl7.Fhir.Model.OperationDefinition.BindingComponent)Binding.DeepCopyInternal(); + if(ReferencedFrom.Any()) dest.ReferencedFrom = new List(ReferencedFrom.DeepCopyInternal()); + if(Part.Any()) dest.Part = new List(Part.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -634,7 +635,7 @@ public string ValueSet } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BindingComponent; @@ -643,15 +644,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StrengthElement != null) dest.StrengthElement = (Code)StrengthElement.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StrengthElement != null) dest.StrengthElement = (Code)StrengthElement.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BindingComponent()); + var instance = new BindingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -787,7 +789,7 @@ public string SourceId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferencedFromComponent; @@ -796,15 +798,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.FhirString)SourceIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.FhirString)SourceIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferencedFromComponent()); + var instance = new ReferencedFromComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -940,7 +943,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OverloadComponent; @@ -949,15 +952,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ParameterNameElement.Any()) dest.ParameterNameElement = new List(ParameterNameElement.DeepCopy()); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ParameterNameElement.Any()) dest.ParameterNameElement = new List(ParameterNameElement.DeepCopyInternal()); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OverloadComponent()); + var instance = new OverloadComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1749,7 +1753,7 @@ public List Overload private List _Overload; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationDefinition; @@ -1758,39 +1762,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(AffectsStateElement != null) dest.AffectsStateElement = (Hl7.Fhir.Model.FhirBoolean)AffectsStateElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopy(); - if(BaseElement != null) dest.BaseElement = (Hl7.Fhir.Model.Canonical)BaseElement.DeepCopy(); - if(ResourceElement.Any()) dest.ResourceElement = new List>(ResourceElement.DeepCopy()); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirBoolean)SystemElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirBoolean)TypeElement.DeepCopy(); - if(InstanceElement != null) dest.InstanceElement = (Hl7.Fhir.Model.FhirBoolean)InstanceElement.DeepCopy(); - if(InputProfileElement != null) dest.InputProfileElement = (Hl7.Fhir.Model.Canonical)InputProfileElement.DeepCopy(); - if(OutputProfileElement != null) dest.OutputProfileElement = (Hl7.Fhir.Model.Canonical)OutputProfileElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Overload.Any()) dest.Overload = new List(Overload.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(AffectsStateElement != null) dest.AffectsStateElement = (Hl7.Fhir.Model.FhirBoolean)AffectsStateElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopyInternal(); + if(BaseElement != null) dest.BaseElement = (Hl7.Fhir.Model.Canonical)BaseElement.DeepCopyInternal(); + if(ResourceElement.Any()) dest.ResourceElement = new List>(ResourceElement.DeepCopyInternal()); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirBoolean)SystemElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirBoolean)TypeElement.DeepCopyInternal(); + if(InstanceElement != null) dest.InstanceElement = (Hl7.Fhir.Model.FhirBoolean)InstanceElement.DeepCopyInternal(); + if(InputProfileElement != null) dest.InputProfileElement = (Hl7.Fhir.Model.Canonical)InputProfileElement.DeepCopyInternal(); + if(OutputProfileElement != null) dest.OutputProfileElement = (Hl7.Fhir.Model.Canonical)OutputProfileElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Overload.Any()) dest.Overload = new List(Overload.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationDefinition()); + var instance = new OperationDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Organization.cs b/src/Hl7.Fhir.R4B/Model/Generated/Organization.cs index 13c428957c..3b8439ed43 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Organization.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Organization.cs @@ -129,7 +129,7 @@ public Hl7.Fhir.Model.Address Address private Hl7.Fhir.Model.Address _Address; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContactComponent; @@ -138,17 +138,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Purpose != null) dest.Purpose = (Hl7.Fhir.Model.CodeableConcept)Purpose.DeepCopy(); - if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Purpose != null) dest.Purpose = (Hl7.Fhir.Model.CodeableConcept)Purpose.DeepCopyInternal(); + if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContactComponent()); + var instance = new ContactComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -418,7 +419,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Organization; @@ -427,23 +428,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Organization()); + var instance = new Organization(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/OrganizationAffiliation.cs b/src/Hl7.Fhir.R4B/Model/Generated/OrganizationAffiliation.cs index bedbe101a1..232196e470 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/OrganizationAffiliation.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/OrganizationAffiliation.cs @@ -254,7 +254,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OrganizationAffiliation; @@ -263,25 +263,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(ParticipatingOrganization != null) dest.ParticipatingOrganization = (Hl7.Fhir.Model.ResourceReference)ParticipatingOrganization.DeepCopy(); - if(Network.Any()) dest.Network = new List(Network.DeepCopy()); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(ParticipatingOrganization != null) dest.ParticipatingOrganization = (Hl7.Fhir.Model.ResourceReference)ParticipatingOrganization.DeepCopyInternal(); + if(Network.Any()) dest.Network = new List(Network.DeepCopyInternal()); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OrganizationAffiliation()); + var instance = new OrganizationAffiliation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/PackagedProductDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/PackagedProductDefinition.cs index c40ad38984..d003a7d9a9 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/PackagedProductDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/PackagedProductDefinition.cs @@ -97,7 +97,7 @@ public Hl7.Fhir.Model.CodeableConcept Jurisdiction private Hl7.Fhir.Model.CodeableConcept _Jurisdiction; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LegalStatusOfSupplyComponent; @@ -106,15 +106,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LegalStatusOfSupplyComponent()); + var instance = new LegalStatusOfSupplyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -347,7 +348,7 @@ public List Package private List _Package; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PackageComponent; @@ -356,23 +357,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.Integer)QuantityElement.DeepCopy(); - if(Material.Any()) dest.Material = new List(Material.DeepCopy()); - if(AlternateMaterial.Any()) dest.AlternateMaterial = new List(AlternateMaterial.DeepCopy()); - if(ShelfLifeStorage.Any()) dest.ShelfLifeStorage = new List(ShelfLifeStorage.DeepCopy()); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(ContainedItem.Any()) dest.ContainedItem = new List(ContainedItem.DeepCopy()); - if(Package.Any()) dest.Package = new List(Package.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.Integer)QuantityElement.DeepCopyInternal(); + if(Material.Any()) dest.Material = new List(Material.DeepCopyInternal()); + if(AlternateMaterial.Any()) dest.AlternateMaterial = new List(AlternateMaterial.DeepCopyInternal()); + if(ShelfLifeStorage.Any()) dest.ShelfLifeStorage = new List(ShelfLifeStorage.DeepCopyInternal()); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(ContainedItem.Any()) dest.ContainedItem = new List(ContainedItem.DeepCopyInternal()); + if(Package.Any()) dest.Package = new List(Package.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PackageComponent()); + var instance = new PackageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -547,7 +549,7 @@ public List SpecialPrecautionsForStorage private List _SpecialPrecautionsForStorage; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ShelfLifeStorageComponent; @@ -556,16 +558,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.DataType)Period.DeepCopy(); - if(SpecialPrecautionsForStorage.Any()) dest.SpecialPrecautionsForStorage = new List(SpecialPrecautionsForStorage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.DataType)Period.DeepCopyInternal(); + if(SpecialPrecautionsForStorage.Any()) dest.SpecialPrecautionsForStorage = new List(SpecialPrecautionsForStorage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ShelfLifeStorageComponent()); + var instance = new ShelfLifeStorageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -672,7 +675,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -681,15 +684,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -785,7 +789,7 @@ public Hl7.Fhir.Model.Quantity Amount private Hl7.Fhir.Model.Quantity _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainedItemComponent; @@ -794,15 +798,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainedItemComponent()); + var instance = new ContainedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1128,7 +1133,7 @@ public Hl7.Fhir.Model.PackagedProductDefinition.PackageComponent Package List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PackagedProductDefinition; @@ -1137,27 +1142,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(PackageFor.Any()) dest.PackageFor = new List(PackageFor.DeepCopy()); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopy(); - if(ContainedItemQuantity.Any()) dest.ContainedItemQuantity = new List(ContainedItemQuantity.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(LegalStatusOfSupply.Any()) dest.LegalStatusOfSupply = new List(LegalStatusOfSupply.DeepCopy()); - if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopy()); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(CopackagedIndicatorElement != null) dest.CopackagedIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)CopackagedIndicatorElement.DeepCopy(); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(Package != null) dest.Package = (Hl7.Fhir.Model.PackagedProductDefinition.PackageComponent)Package.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(PackageFor.Any()) dest.PackageFor = new List(PackageFor.DeepCopyInternal()); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopyInternal(); + if(ContainedItemQuantity.Any()) dest.ContainedItemQuantity = new List(ContainedItemQuantity.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(LegalStatusOfSupply.Any()) dest.LegalStatusOfSupply = new List(LegalStatusOfSupply.DeepCopyInternal()); + if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopyInternal()); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(CopackagedIndicatorElement != null) dest.CopackagedIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)CopackagedIndicatorElement.DeepCopyInternal(); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(Package != null) dest.Package = (Hl7.Fhir.Model.PackagedProductDefinition.PackageComponent)Package.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PackagedProductDefinition()); + var instance = new PackagedProductDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ParameterDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/ParameterDefinition.cs index a56906bf44..be6ccaa399 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ParameterDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ParameterDefinition.cs @@ -282,7 +282,7 @@ public string Profile } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterDefinition; @@ -291,20 +291,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterDefinition()); + var instance = new ParameterDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Patient.cs b/src/Hl7.Fhir.R4B/Model/Generated/Patient.cs index ca2bd8b435..742fc48cdd 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Patient.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Patient.cs @@ -225,7 +225,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContactComponent; @@ -234,20 +234,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopy()); - if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopyInternal()); + if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContactComponent()); + var instance = new ContactComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -405,7 +406,7 @@ public bool? Preferred } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CommunicationComponent; @@ -414,15 +415,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CommunicationComponent()); + var instance = new CommunicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -545,7 +547,7 @@ public Hl7.Fhir.Model.Patient.LinkType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -554,15 +556,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Other != null) dest.Other = (Hl7.Fhir.Model.ResourceReference)Other.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Other != null) dest.Other = (Hl7.Fhir.Model.ResourceReference)Other.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -902,7 +905,7 @@ public List Link List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Patient; @@ -911,29 +914,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy(); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(MaritalStatus != null) dest.MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)MaritalStatus.DeepCopy(); - if(MultipleBirth != null) dest.MultipleBirth = (Hl7.Fhir.Model.DataType)MultipleBirth.DeepCopy(); - if(Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - if(GeneralPractitioner.Any()) dest.GeneralPractitioner = new List(GeneralPractitioner.DeepCopy()); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopyInternal(); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(MaritalStatus != null) dest.MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)MaritalStatus.DeepCopyInternal(); + if(MultipleBirth != null) dest.MultipleBirth = (Hl7.Fhir.Model.DataType)MultipleBirth.DeepCopyInternal(); + if(Photo.Any()) dest.Photo = new List(Photo.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); + if(GeneralPractitioner.Any()) dest.GeneralPractitioner = new List(GeneralPractitioner.DeepCopyInternal()); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Patient()); + var instance = new Patient(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/PaymentNotice.cs b/src/Hl7.Fhir.R4B/Model/Generated/PaymentNotice.cs index 8a056fc70b..c085b4bea4 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/PaymentNotice.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/PaymentNotice.cs @@ -292,7 +292,7 @@ public Hl7.Fhir.Model.CodeableConcept PaymentStatus List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentNotice; @@ -301,25 +301,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ResourceReference)Payment.DeepCopy(); - if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.Date)PaymentDateElement.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopy(); - if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(PaymentStatus != null) dest.PaymentStatus = (Hl7.Fhir.Model.CodeableConcept)PaymentStatus.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ResourceReference)Payment.DeepCopyInternal(); + if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.Date)PaymentDateElement.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopyInternal(); + if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(PaymentStatus != null) dest.PaymentStatus = (Hl7.Fhir.Model.CodeableConcept)PaymentStatus.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentNotice()); + var instance = new PaymentNotice(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/PaymentReconciliation.cs b/src/Hl7.Fhir.R4B/Model/Generated/PaymentReconciliation.cs index 5bbbd29e6c..fe059e86c6 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/PaymentReconciliation.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/PaymentReconciliation.cs @@ -235,7 +235,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailsComponent; @@ -244,23 +244,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Predecessor != null) dest.Predecessor = (Hl7.Fhir.Model.Identifier)Predecessor.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Submitter != null) dest.Submitter = (Hl7.Fhir.Model.ResourceReference)Submitter.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Predecessor != null) dest.Predecessor = (Hl7.Fhir.Model.Identifier)Predecessor.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Submitter != null) dest.Submitter = (Hl7.Fhir.Model.ResourceReference)Submitter.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailsComponent()); + var instance = new DetailsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -460,7 +461,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotesComponent; @@ -469,15 +470,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotesComponent()); + var instance = new NotesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -838,7 +840,7 @@ public List ProcessNote List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentReconciliation; @@ -847,28 +849,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(PaymentIssuer != null) dest.PaymentIssuer = (Hl7.Fhir.Model.ResourceReference)PaymentIssuer.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.Date)PaymentDateElement.DeepCopy(); - if(PaymentAmount != null) dest.PaymentAmount = (Hl7.Fhir.Model.Money)PaymentAmount.DeepCopy(); - if(PaymentIdentifier != null) dest.PaymentIdentifier = (Hl7.Fhir.Model.Identifier)PaymentIdentifier.DeepCopy(); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopy(); - if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(PaymentIssuer != null) dest.PaymentIssuer = (Hl7.Fhir.Model.ResourceReference)PaymentIssuer.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.Date)PaymentDateElement.DeepCopyInternal(); + if(PaymentAmount != null) dest.PaymentAmount = (Hl7.Fhir.Model.Money)PaymentAmount.DeepCopyInternal(); + if(PaymentIdentifier != null) dest.PaymentIdentifier = (Hl7.Fhir.Model.Identifier)PaymentIdentifier.DeepCopyInternal(); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopyInternal(); + if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentReconciliation()); + var instance = new PaymentReconciliation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Person.cs b/src/Hl7.Fhir.R4B/Model/Generated/Person.cs index 3cdd235510..0893aa0a8a 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Person.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Person.cs @@ -156,7 +156,7 @@ public Hl7.Fhir.Model.Person.IdentityAssuranceLevel? Assurance } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -165,15 +165,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - if(AssuranceElement != null) dest.AssuranceElement = (Code)AssuranceElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); + if(AssuranceElement != null) dest.AssuranceElement = (Code)AssuranceElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -424,7 +425,7 @@ public List Link List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Person; @@ -433,23 +434,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Person()); + var instance = new Person(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/PlanDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/PlanDefinition.cs index a641ebf7c9..0b863e4973 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/PlanDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/PlanDefinition.cs @@ -175,7 +175,7 @@ public List Target private List _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GoalComponent; @@ -184,20 +184,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(Start != null) dest.Start = (Hl7.Fhir.Model.CodeableConcept)Start.DeepCopy(); - if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopy()); - if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopy()); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(Start != null) dest.Start = (Hl7.Fhir.Model.CodeableConcept)Start.DeepCopyInternal(); + if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopyInternal()); + if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopyInternal()); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GoalComponent()); + var instance = new GoalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -351,7 +352,7 @@ public Hl7.Fhir.Model.Duration Due private Hl7.Fhir.Model.Duration _Due; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -360,16 +361,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopy(); - if(Due != null) dest.Due = (Hl7.Fhir.Model.Duration)Due.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopyInternal(); + if(Due != null) dest.Due = (Hl7.Fhir.Model.Duration)Due.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1052,7 +1054,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionComponent; @@ -1061,40 +1063,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.FhirString)TextEquivalentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopy()); - if(GoalIdElement.Any()) dest.GoalIdElement = new List(GoalIdElement.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Output.Any()) dest.Output = new List(Output.DeepCopy()); - if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopy()); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopy(); - if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopy(); - if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopy(); - if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopy(); - if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopy(); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopy(); - if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopy(); - if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActionComponent()); + base.CopyToInternal(dest); + if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.FhirString)TextEquivalentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopyInternal()); + if(GoalIdElement.Any()) dest.GoalIdElement = new List(GoalIdElement.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Output.Any()) dest.Output = new List(Output.DeepCopyInternal()); + if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopyInternal()); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopyInternal(); + if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopyInternal(); + if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopyInternal(); + if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopyInternal(); + if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopyInternal(); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopyInternal(); + if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopyInternal(); + if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1414,7 +1417,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConditionComponent; @@ -1423,15 +1426,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConditionComponent()); + var instance = new ConditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1585,7 +1589,7 @@ public Hl7.Fhir.Model.DataType Offset private Hl7.Fhir.Model.DataType _Offset; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedActionComponent; @@ -1594,16 +1598,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ActionIdElement != null) dest.ActionIdElement = (Hl7.Fhir.Model.Id)ActionIdElement.DeepCopy(); - if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopy(); - if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ActionIdElement != null) dest.ActionIdElement = (Hl7.Fhir.Model.Id)ActionIdElement.DeepCopyInternal(); + if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopyInternal(); + if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedActionComponent()); + var instance = new RelatedActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1731,7 +1736,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -1740,15 +1745,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1865,7 +1871,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DynamicValueComponent; @@ -1874,15 +1880,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DynamicValueComponent()); + var instance = new DynamicValueComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2654,7 +2661,7 @@ public List Action List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PlanDefinition; @@ -2663,44 +2670,45 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(Goal.Any()) dest.Goal = new List(Goal.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(Goal.Any()) dest.Goal = new List(Goal.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PlanDefinition()); + var instance = new PlanDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Population.cs b/src/Hl7.Fhir.R4B/Model/Generated/Population.cs index 384a6afb81..902db41d24 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Population.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Population.cs @@ -113,7 +113,7 @@ public Hl7.Fhir.Model.CodeableConcept PhysiologicalCondition private Hl7.Fhir.Model.CodeableConcept _PhysiologicalCondition; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Population; @@ -122,17 +122,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Age != null) dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopy(); - if(Gender != null) dest.Gender = (Hl7.Fhir.Model.CodeableConcept)Gender.DeepCopy(); - if(Race != null) dest.Race = (Hl7.Fhir.Model.CodeableConcept)Race.DeepCopy(); - if(PhysiologicalCondition != null) dest.PhysiologicalCondition = (Hl7.Fhir.Model.CodeableConcept)PhysiologicalCondition.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Age != null) dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopyInternal(); + if(Gender != null) dest.Gender = (Hl7.Fhir.Model.CodeableConcept)Gender.DeepCopyInternal(); + if(Race != null) dest.Race = (Hl7.Fhir.Model.CodeableConcept)Race.DeepCopyInternal(); + if(PhysiologicalCondition != null) dest.PhysiologicalCondition = (Hl7.Fhir.Model.CodeableConcept)PhysiologicalCondition.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Population()); + var instance = new Population(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Practitioner.cs b/src/Hl7.Fhir.R4B/Model/Generated/Practitioner.cs index a7931be351..e0257bb2f7 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Practitioner.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Practitioner.cs @@ -132,7 +132,7 @@ public Hl7.Fhir.Model.ResourceReference Issuer private Hl7.Fhir.Model.ResourceReference _Issuer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QualificationComponent; @@ -141,17 +141,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QualificationComponent()); + var instance = new QualificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -419,7 +420,7 @@ public List Communication List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Practitioner; @@ -428,23 +429,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if(Qualification.Any()) dest.Qualification = new List(Qualification.DeepCopy()); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Photo.Any()) dest.Photo = new List(Photo.DeepCopyInternal()); + if(Qualification.Any()) dest.Qualification = new List(Qualification.DeepCopyInternal()); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Practitioner()); + var instance = new Practitioner(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/PractitionerRole.cs b/src/Hl7.Fhir.R4B/Model/Generated/PractitionerRole.cs index 0e3cbce62d..be49917d1d 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/PractitionerRole.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/PractitionerRole.cs @@ -203,7 +203,7 @@ public string AvailableEndTime } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AvailableTimeComponent; @@ -212,17 +212,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopy()); - if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopy(); - if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopy(); - if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopyInternal()); + if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopyInternal(); + if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopyInternal(); + if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AvailableTimeComponent()); + var instance = new AvailableTimeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -355,7 +356,7 @@ public Hl7.Fhir.Model.Period During private Hl7.Fhir.Model.Period _During; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotAvailableComponent; @@ -364,15 +365,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotAvailableComponent()); + var instance = new NotAvailableComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -669,7 +671,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PractitionerRole; @@ -678,27 +680,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Practitioner != null) dest.Practitioner = (Hl7.Fhir.Model.ResourceReference)Practitioner.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopy()); - if(NotAvailable.Any()) dest.NotAvailable = new List(NotAvailable.DeepCopy()); - if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Practitioner != null) dest.Practitioner = (Hl7.Fhir.Model.ResourceReference)Practitioner.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopyInternal()); + if(NotAvailable.Any()) dest.NotAvailable = new List(NotAvailable.DeepCopyInternal()); + if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PractitionerRole()); + var instance = new PractitionerRole(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Procedure.cs b/src/Hl7.Fhir.R4B/Model/Generated/Procedure.cs index 5085ddc682..ad3dfb9b9d 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Procedure.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Procedure.cs @@ -120,7 +120,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -129,16 +129,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -248,7 +249,7 @@ public Hl7.Fhir.Model.ResourceReference Manipulated private Hl7.Fhir.Model.ResourceReference _Manipulated; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FocalDeviceComponent; @@ -257,15 +258,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopy(); - if(Manipulated != null) dest.Manipulated = (Hl7.Fhir.Model.ResourceReference)Manipulated.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopyInternal(); + if(Manipulated != null) dest.Manipulated = (Hl7.Fhir.Model.ResourceReference)Manipulated.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FocalDeviceComponent()); + var instance = new FocalDeviceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -795,7 +797,7 @@ public List UsedCode List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Procedure; @@ -804,41 +806,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Performed != null) dest.Performed = (Hl7.Fhir.Model.DataType)Performed.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(Report.Any()) dest.Report = new List(Report.DeepCopy()); - if(Complication.Any()) dest.Complication = new List(Complication.DeepCopy()); - if(ComplicationDetail.Any()) dest.ComplicationDetail = new List(ComplicationDetail.DeepCopy()); - if(FollowUp.Any()) dest.FollowUp = new List(FollowUp.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(FocalDevice.Any()) dest.FocalDevice = new List(FocalDevice.DeepCopy()); - if(UsedReference.Any()) dest.UsedReference = new List(UsedReference.DeepCopy()); - if(UsedCode.Any()) dest.UsedCode = new List(UsedCode.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Performed != null) dest.Performed = (Hl7.Fhir.Model.DataType)Performed.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(Report.Any()) dest.Report = new List(Report.DeepCopyInternal()); + if(Complication.Any()) dest.Complication = new List(Complication.DeepCopyInternal()); + if(ComplicationDetail.Any()) dest.ComplicationDetail = new List(ComplicationDetail.DeepCopyInternal()); + if(FollowUp.Any()) dest.FollowUp = new List(FollowUp.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(FocalDevice.Any()) dest.FocalDevice = new List(FocalDevice.DeepCopyInternal()); + if(UsedReference.Any()) dest.UsedReference = new List(UsedReference.DeepCopyInternal()); + if(UsedCode.Any()) dest.UsedCode = new List(UsedCode.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Procedure()); + var instance = new Procedure(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ProdCharacteristic.cs b/src/Hl7.Fhir.R4B/Model/Generated/ProdCharacteristic.cs index 2dda3c372a..e3dd09bf4e 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ProdCharacteristic.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ProdCharacteristic.cs @@ -256,7 +256,7 @@ public Hl7.Fhir.Model.CodeableConcept Scoring private Hl7.Fhir.Model.CodeableConcept _Scoring; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProdCharacteristic; @@ -265,24 +265,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Height != null) dest.Height = (Hl7.Fhir.Model.Quantity)Height.DeepCopy(); - if(Width != null) dest.Width = (Hl7.Fhir.Model.Quantity)Width.DeepCopy(); - if(Depth != null) dest.Depth = (Hl7.Fhir.Model.Quantity)Depth.DeepCopy(); - if(Weight != null) dest.Weight = (Hl7.Fhir.Model.Quantity)Weight.DeepCopy(); - if(NominalVolume != null) dest.NominalVolume = (Hl7.Fhir.Model.Quantity)NominalVolume.DeepCopy(); - if(ExternalDiameter != null) dest.ExternalDiameter = (Hl7.Fhir.Model.Quantity)ExternalDiameter.DeepCopy(); - if(ShapeElement != null) dest.ShapeElement = (Hl7.Fhir.Model.FhirString)ShapeElement.DeepCopy(); - if(ColorElement.Any()) dest.ColorElement = new List(ColorElement.DeepCopy()); - if(ImprintElement.Any()) dest.ImprintElement = new List(ImprintElement.DeepCopy()); - if(Image.Any()) dest.Image = new List(Image.DeepCopy()); - if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Height != null) dest.Height = (Hl7.Fhir.Model.Quantity)Height.DeepCopyInternal(); + if(Width != null) dest.Width = (Hl7.Fhir.Model.Quantity)Width.DeepCopyInternal(); + if(Depth != null) dest.Depth = (Hl7.Fhir.Model.Quantity)Depth.DeepCopyInternal(); + if(Weight != null) dest.Weight = (Hl7.Fhir.Model.Quantity)Weight.DeepCopyInternal(); + if(NominalVolume != null) dest.NominalVolume = (Hl7.Fhir.Model.Quantity)NominalVolume.DeepCopyInternal(); + if(ExternalDiameter != null) dest.ExternalDiameter = (Hl7.Fhir.Model.Quantity)ExternalDiameter.DeepCopyInternal(); + if(ShapeElement != null) dest.ShapeElement = (Hl7.Fhir.Model.FhirString)ShapeElement.DeepCopyInternal(); + if(ColorElement.Any()) dest.ColorElement = new List(ColorElement.DeepCopyInternal()); + if(ImprintElement.Any()) dest.ImprintElement = new List(ImprintElement.DeepCopyInternal()); + if(Image.Any()) dest.Image = new List(Image.DeepCopyInternal()); + if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProdCharacteristic()); + var instance = new ProdCharacteristic(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ProductShelfLife.cs b/src/Hl7.Fhir.R4B/Model/Generated/ProductShelfLife.cs index 8908d05fec..16cefdd6b4 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ProductShelfLife.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ProductShelfLife.cs @@ -111,7 +111,7 @@ public List SpecialPrecautionsForStorage private List _SpecialPrecautionsForStorage; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProductShelfLife; @@ -120,17 +120,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Quantity)Period.DeepCopy(); - if(SpecialPrecautionsForStorage.Any()) dest.SpecialPrecautionsForStorage = new List(SpecialPrecautionsForStorage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Quantity)Period.DeepCopyInternal(); + if(SpecialPrecautionsForStorage.Any()) dest.SpecialPrecautionsForStorage = new List(SpecialPrecautionsForStorage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProductShelfLife()); + var instance = new ProductShelfLife(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Provenance.cs b/src/Hl7.Fhir.R4B/Model/Generated/Provenance.cs index 70919eba84..5396a6d4ec 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Provenance.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Provenance.cs @@ -177,7 +177,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AgentComponent; @@ -186,17 +186,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Role.Any()) dest.Role = new List(Role.DeepCopy()); - if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Role.Any()) dest.Role = new List(Role.DeepCopyInternal()); + if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AgentComponent()); + var instance = new AgentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -345,7 +346,7 @@ public List Agent private List _Agent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EntityComponent; @@ -354,16 +355,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RoleElement != null) dest.RoleElement = (Code)RoleElement.DeepCopy(); - if(What != null) dest.What = (Hl7.Fhir.Model.ResourceReference)What.DeepCopy(); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RoleElement != null) dest.RoleElement = (Code)RoleElement.DeepCopyInternal(); + if(What != null) dest.What = (Hl7.Fhir.Model.ResourceReference)What.DeepCopyInternal(); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EntityComponent()); + var instance = new EntityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -608,7 +610,7 @@ public List Signature private List _Signature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Provenance; @@ -617,23 +619,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(Occurred != null) dest.Occurred = (Hl7.Fhir.Model.DataType)Occurred.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopy(); - if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopy(); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - if(Entity.Any()) dest.Entity = new List(Entity.DeepCopy()); - if(Signature.Any()) dest.Signature = new List(Signature.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(Occurred != null) dest.Occurred = (Hl7.Fhir.Model.DataType)Occurred.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopyInternal(); + if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopyInternal(); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); + if(Entity.Any()) dest.Entity = new List(Entity.DeepCopyInternal()); + if(Signature.Any()) dest.Signature = new List(Signature.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Provenance()); + var instance = new Provenance(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Questionnaire.cs b/src/Hl7.Fhir.R4B/Model/Generated/Questionnaire.cs index 7afc86a89c..ea6560f233 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Questionnaire.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Questionnaire.cs @@ -680,7 +680,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -689,29 +689,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(EnableWhen.Any()) dest.EnableWhen = new List(EnableWhen.DeepCopy()); - if(EnableBehaviorElement != null) dest.EnableBehaviorElement = (Code)EnableBehaviorElement.DeepCopy(); - if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopy(); - if(RepeatsElement != null) dest.RepeatsElement = (Hl7.Fhir.Model.FhirBoolean)RepeatsElement.DeepCopy(); - if(ReadOnlyElement != null) dest.ReadOnlyElement = (Hl7.Fhir.Model.FhirBoolean)ReadOnlyElement.DeepCopy(); - if(MaxLengthElement != null) dest.MaxLengthElement = (Hl7.Fhir.Model.Integer)MaxLengthElement.DeepCopy(); - if(AnswerValueSetElement != null) dest.AnswerValueSetElement = (Hl7.Fhir.Model.Canonical)AnswerValueSetElement.DeepCopy(); - if(AnswerOption.Any()) dest.AnswerOption = new List(AnswerOption.DeepCopy()); - if(Initial.Any()) dest.Initial = new List(Initial.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(EnableWhen.Any()) dest.EnableWhen = new List(EnableWhen.DeepCopyInternal()); + if(EnableBehaviorElement != null) dest.EnableBehaviorElement = (Code)EnableBehaviorElement.DeepCopyInternal(); + if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopyInternal(); + if(RepeatsElement != null) dest.RepeatsElement = (Hl7.Fhir.Model.FhirBoolean)RepeatsElement.DeepCopyInternal(); + if(ReadOnlyElement != null) dest.ReadOnlyElement = (Hl7.Fhir.Model.FhirBoolean)ReadOnlyElement.DeepCopyInternal(); + if(MaxLengthElement != null) dest.MaxLengthElement = (Hl7.Fhir.Model.Integer)MaxLengthElement.DeepCopyInternal(); + if(AnswerValueSetElement != null) dest.AnswerValueSetElement = (Hl7.Fhir.Model.Canonical)AnswerValueSetElement.DeepCopyInternal(); + if(AnswerOption.Any()) dest.AnswerOption = new List(AnswerOption.DeepCopyInternal()); + if(Initial.Any()) dest.Initial = new List(Initial.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -980,7 +981,7 @@ public Hl7.Fhir.Model.DataType Answer private Hl7.Fhir.Model.DataType _Answer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnableWhenComponent; @@ -989,16 +990,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(QuestionElement != null) dest.QuestionElement = (Hl7.Fhir.Model.FhirString)QuestionElement.DeepCopy(); - if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopy(); - if(Answer != null) dest.Answer = (Hl7.Fhir.Model.DataType)Answer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(QuestionElement != null) dest.QuestionElement = (Hl7.Fhir.Model.FhirString)QuestionElement.DeepCopyInternal(); + if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopyInternal(); + if(Answer != null) dest.Answer = (Hl7.Fhir.Model.DataType)Answer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnableWhenComponent()); + var instance = new EnableWhenComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1128,7 +1130,7 @@ public bool? InitialSelected } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AnswerOptionComponent; @@ -1137,15 +1139,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(InitialSelectedElement != null) dest.InitialSelectedElement = (Hl7.Fhir.Model.FhirBoolean)InitialSelectedElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(InitialSelectedElement != null) dest.InitialSelectedElement = (Hl7.Fhir.Model.FhirBoolean)InitialSelectedElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AnswerOptionComponent()); + var instance = new AnswerOptionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1236,7 +1239,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InitialComponent; @@ -1245,14 +1248,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InitialComponent()); + var instance = new InitialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1873,7 +1877,7 @@ public List Item List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Questionnaire; @@ -1882,35 +1886,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(SubjectTypeElement.Any()) dest.SubjectTypeElement = new List>(SubjectTypeElement.DeepCopy()); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(SubjectTypeElement.Any()) dest.SubjectTypeElement = new List>(SubjectTypeElement.DeepCopyInternal()); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Questionnaire()); + var instance = new Questionnaire(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/QuestionnaireResponse.cs b/src/Hl7.Fhir.R4B/Model/Generated/QuestionnaireResponse.cs index d98c0b40ba..24f4212d8f 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/QuestionnaireResponse.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/QuestionnaireResponse.cs @@ -239,7 +239,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -248,18 +248,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Answer.Any()) dest.Answer = new List(Answer.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Answer.Any()) dest.Answer = new List(Answer.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -387,7 +388,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AnswerComponent; @@ -396,15 +397,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AnswerComponent()); + var instance = new AnswerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -677,7 +679,7 @@ public List Item Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QuestionnaireResponse; @@ -686,24 +688,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(QuestionnaireElement != null) dest.QuestionnaireElement = (Hl7.Fhir.Model.Canonical)QuestionnaireElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(AuthoredElement != null) dest.AuthoredElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(QuestionnaireElement != null) dest.QuestionnaireElement = (Hl7.Fhir.Model.Canonical)QuestionnaireElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(AuthoredElement != null) dest.AuthoredElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QuestionnaireResponse()); + var instance = new QuestionnaireResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Ratio.cs b/src/Hl7.Fhir.R4B/Model/Generated/Ratio.cs index 1e95f9a387..4b0299041d 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Ratio.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Ratio.cs @@ -86,7 +86,7 @@ public Hl7.Fhir.Model.Quantity Denominator private Hl7.Fhir.Model.Quantity _Denominator; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Ratio; @@ -95,15 +95,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Numerator != null) dest.Numerator = (Hl7.Fhir.Model.Quantity)Numerator.DeepCopy(); - if(Denominator != null) dest.Denominator = (Hl7.Fhir.Model.Quantity)Denominator.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Numerator != null) dest.Numerator = (Hl7.Fhir.Model.Quantity)Numerator.DeepCopyInternal(); + if(Denominator != null) dest.Denominator = (Hl7.Fhir.Model.Quantity)Denominator.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Ratio()); + var instance = new Ratio(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/RatioRange.cs b/src/Hl7.Fhir.R4B/Model/Generated/RatioRange.cs index 484b6ef4b5..5564767d56 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/RatioRange.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/RatioRange.cs @@ -99,7 +99,7 @@ public Hl7.Fhir.Model.Quantity Denominator private Hl7.Fhir.Model.Quantity _Denominator; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RatioRange; @@ -108,16 +108,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LowNumerator != null) dest.LowNumerator = (Hl7.Fhir.Model.Quantity)LowNumerator.DeepCopy(); - if(HighNumerator != null) dest.HighNumerator = (Hl7.Fhir.Model.Quantity)HighNumerator.DeepCopy(); - if(Denominator != null) dest.Denominator = (Hl7.Fhir.Model.Quantity)Denominator.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LowNumerator != null) dest.LowNumerator = (Hl7.Fhir.Model.Quantity)LowNumerator.DeepCopyInternal(); + if(HighNumerator != null) dest.HighNumerator = (Hl7.Fhir.Model.Quantity)HighNumerator.DeepCopyInternal(); + if(Denominator != null) dest.Denominator = (Hl7.Fhir.Model.Quantity)Denominator.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RatioRange()); + var instance = new RatioRange(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/RegulatedAuthorization.cs b/src/Hl7.Fhir.R4B/Model/Generated/RegulatedAuthorization.cs index 4306ad550f..2b4d27af19 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/RegulatedAuthorization.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/RegulatedAuthorization.cs @@ -145,7 +145,7 @@ public List Application private List _Application; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CaseComponent; @@ -154,18 +154,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(Date != null) dest.Date = (Hl7.Fhir.Model.DataType)Date.DeepCopy(); - if(Application.Any()) dest.Application = new List(Application.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(Date != null) dest.Date = (Hl7.Fhir.Model.DataType)Date.DeepCopyInternal(); + if(Application.Any()) dest.Application = new List(Application.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CaseComponent()); + var instance = new CaseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -480,7 +481,7 @@ public Hl7.Fhir.Model.RegulatedAuthorization.CaseComponent Case List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RegulatedAuthorization; @@ -489,27 +490,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Region.Any()) dest.Region = new List(Region.DeepCopy()); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopy(); - if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopy(); - if(Indication != null) dest.Indication = (Hl7.Fhir.Model.CodeableReference)Indication.DeepCopy(); - if(IntendedUse != null) dest.IntendedUse = (Hl7.Fhir.Model.CodeableConcept)IntendedUse.DeepCopy(); - if(Basis.Any()) dest.Basis = new List(Basis.DeepCopy()); - if(Holder != null) dest.Holder = (Hl7.Fhir.Model.ResourceReference)Holder.DeepCopy(); - if(Regulator != null) dest.Regulator = (Hl7.Fhir.Model.ResourceReference)Regulator.DeepCopy(); - if(Case != null) dest.Case = (Hl7.Fhir.Model.RegulatedAuthorization.CaseComponent)Case.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Region.Any()) dest.Region = new List(Region.DeepCopyInternal()); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopyInternal(); + if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopyInternal(); + if(Indication != null) dest.Indication = (Hl7.Fhir.Model.CodeableReference)Indication.DeepCopyInternal(); + if(IntendedUse != null) dest.IntendedUse = (Hl7.Fhir.Model.CodeableConcept)IntendedUse.DeepCopyInternal(); + if(Basis.Any()) dest.Basis = new List(Basis.DeepCopyInternal()); + if(Holder != null) dest.Holder = (Hl7.Fhir.Model.ResourceReference)Holder.DeepCopyInternal(); + if(Regulator != null) dest.Regulator = (Hl7.Fhir.Model.ResourceReference)Regulator.DeepCopyInternal(); + if(Case != null) dest.Case = (Hl7.Fhir.Model.RegulatedAuthorization.CaseComponent)Case.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RegulatedAuthorization()); + var instance = new RegulatedAuthorization(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/RelatedPerson.cs b/src/Hl7.Fhir.R4B/Model/Generated/RelatedPerson.cs index 5513117462..6d9ca81985 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/RelatedPerson.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/RelatedPerson.cs @@ -121,7 +121,7 @@ public bool? Preferred } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CommunicationComponent; @@ -130,15 +130,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CommunicationComponent()); + var instance = new CommunicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -419,7 +420,7 @@ public List Communication List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedPerson; @@ -428,25 +429,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopy()); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopyInternal()); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(Photo.Any()) dest.Photo = new List(Photo.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedPerson()); + var instance = new RelatedPerson(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/RequestGroup.cs b/src/Hl7.Fhir.R4B/Model/Generated/RequestGroup.cs index 843cd86aab..06337f94ba 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/RequestGroup.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/RequestGroup.cs @@ -527,7 +527,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionComponent; @@ -536,32 +536,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.FhirString)TextEquivalentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopy()); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopy(); - if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopy(); - if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopy(); - if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopy(); - if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActionComponent()); + base.CopyToInternal(dest); + if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.FhirString)TextEquivalentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopyInternal()); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopyInternal(); + if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopyInternal(); + if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopyInternal(); + if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopyInternal(); + if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -817,7 +818,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConditionComponent; @@ -826,15 +827,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConditionComponent()); + var instance = new ConditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -987,7 +989,7 @@ public Hl7.Fhir.Model.DataType Offset private Hl7.Fhir.Model.DataType _Offset; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedActionComponent; @@ -996,16 +998,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ActionIdElement != null) dest.ActionIdElement = (Hl7.Fhir.Model.Id)ActionIdElement.DeepCopy(); - if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopy(); - if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ActionIdElement != null) dest.ActionIdElement = (Hl7.Fhir.Model.Id)ActionIdElement.DeepCopyInternal(); + if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopyInternal(); + if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedActionComponent()); + var instance = new RelatedActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1442,7 +1445,7 @@ public List Action List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequestGroup; @@ -1451,31 +1454,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequestGroup()); + var instance = new RequestGroup(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ResearchDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/ResearchDefinition.cs index 1ecbba7fdc..448be54019 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ResearchDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ResearchDefinition.cs @@ -857,7 +857,7 @@ public Hl7.Fhir.Model.ResourceReference Outcome List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResearchDefinition; @@ -866,47 +866,48 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(CommentElement.Any()) dest.CommentElement = new List(CommentElement.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(Population != null) dest.Population = (Hl7.Fhir.Model.ResourceReference)Population.DeepCopy(); - if(Exposure != null) dest.Exposure = (Hl7.Fhir.Model.ResourceReference)Exposure.DeepCopy(); - if(ExposureAlternative != null) dest.ExposureAlternative = (Hl7.Fhir.Model.ResourceReference)ExposureAlternative.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.ResourceReference)Outcome.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(CommentElement.Any()) dest.CommentElement = new List(CommentElement.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(Population != null) dest.Population = (Hl7.Fhir.Model.ResourceReference)Population.DeepCopyInternal(); + if(Exposure != null) dest.Exposure = (Hl7.Fhir.Model.ResourceReference)Exposure.DeepCopyInternal(); + if(ExposureAlternative != null) dest.ExposureAlternative = (Hl7.Fhir.Model.ResourceReference)ExposureAlternative.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.ResourceReference)Outcome.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResearchDefinition()); + var instance = new ResearchDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ResearchElementDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/ResearchElementDefinition.cs index 85e3af1450..4fed5ff329 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ResearchElementDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ResearchElementDefinition.cs @@ -392,7 +392,7 @@ public Hl7.Fhir.Model.GroupMeasureCode? ParticipantEffectiveGroupMeasure } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -401,25 +401,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopy(); - if(UsageContext.Any()) dest.UsageContext = new List(UsageContext.DeepCopy()); - if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopy(); - if(UnitOfMeasure != null) dest.UnitOfMeasure = (Hl7.Fhir.Model.CodeableConcept)UnitOfMeasure.DeepCopy(); - if(StudyEffectiveDescriptionElement != null) dest.StudyEffectiveDescriptionElement = (Hl7.Fhir.Model.FhirString)StudyEffectiveDescriptionElement.DeepCopy(); - if(StudyEffective != null) dest.StudyEffective = (Hl7.Fhir.Model.DataType)StudyEffective.DeepCopy(); - if(StudyEffectiveTimeFromStart != null) dest.StudyEffectiveTimeFromStart = (Hl7.Fhir.Model.Duration)StudyEffectiveTimeFromStart.DeepCopy(); - if(StudyEffectiveGroupMeasureElement != null) dest.StudyEffectiveGroupMeasureElement = (Code)StudyEffectiveGroupMeasureElement.DeepCopy(); - if(ParticipantEffectiveDescriptionElement != null) dest.ParticipantEffectiveDescriptionElement = (Hl7.Fhir.Model.FhirString)ParticipantEffectiveDescriptionElement.DeepCopy(); - if(ParticipantEffective != null) dest.ParticipantEffective = (Hl7.Fhir.Model.DataType)ParticipantEffective.DeepCopy(); - if(ParticipantEffectiveTimeFromStart != null) dest.ParticipantEffectiveTimeFromStart = (Hl7.Fhir.Model.Duration)ParticipantEffectiveTimeFromStart.DeepCopy(); - if(ParticipantEffectiveGroupMeasureElement != null) dest.ParticipantEffectiveGroupMeasureElement = (Code)ParticipantEffectiveGroupMeasureElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopyInternal(); + if(UsageContext.Any()) dest.UsageContext = new List(UsageContext.DeepCopyInternal()); + if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopyInternal(); + if(UnitOfMeasure != null) dest.UnitOfMeasure = (Hl7.Fhir.Model.CodeableConcept)UnitOfMeasure.DeepCopyInternal(); + if(StudyEffectiveDescriptionElement != null) dest.StudyEffectiveDescriptionElement = (Hl7.Fhir.Model.FhirString)StudyEffectiveDescriptionElement.DeepCopyInternal(); + if(StudyEffective != null) dest.StudyEffective = (Hl7.Fhir.Model.DataType)StudyEffective.DeepCopyInternal(); + if(StudyEffectiveTimeFromStart != null) dest.StudyEffectiveTimeFromStart = (Hl7.Fhir.Model.Duration)StudyEffectiveTimeFromStart.DeepCopyInternal(); + if(StudyEffectiveGroupMeasureElement != null) dest.StudyEffectiveGroupMeasureElement = (Code)StudyEffectiveGroupMeasureElement.DeepCopyInternal(); + if(ParticipantEffectiveDescriptionElement != null) dest.ParticipantEffectiveDescriptionElement = (Hl7.Fhir.Model.FhirString)ParticipantEffectiveDescriptionElement.DeepCopyInternal(); + if(ParticipantEffective != null) dest.ParticipantEffective = (Hl7.Fhir.Model.DataType)ParticipantEffective.DeepCopyInternal(); + if(ParticipantEffectiveTimeFromStart != null) dest.ParticipantEffectiveTimeFromStart = (Hl7.Fhir.Model.Duration)ParticipantEffectiveTimeFromStart.DeepCopyInternal(); + if(ParticipantEffectiveGroupMeasureElement != null) dest.ParticipantEffectiveGroupMeasureElement = (Code)ParticipantEffectiveGroupMeasureElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1373,7 +1374,7 @@ public List Ch List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResearchElementDefinition; @@ -1382,46 +1383,47 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(CommentElement.Any()) dest.CommentElement = new List(CommentElement.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(VariableTypeElement != null) dest.VariableTypeElement = (Code)VariableTypeElement.DeepCopy(); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(CommentElement.Any()) dest.CommentElement = new List(CommentElement.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(VariableTypeElement != null) dest.VariableTypeElement = (Code)VariableTypeElement.DeepCopyInternal(); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResearchElementDefinition()); + var instance = new ResearchElementDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ResearchStudy.cs b/src/Hl7.Fhir.R4B/Model/Generated/ResearchStudy.cs index 5de01cb09d..a374911bf6 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ResearchStudy.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ResearchStudy.cs @@ -228,7 +228,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ArmComponent; @@ -237,16 +237,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ArmComponent()); + var instance = new ArmComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -371,7 +372,7 @@ public Hl7.Fhir.Model.CodeableConcept Type private Hl7.Fhir.Model.CodeableConcept _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ObjectiveComponent; @@ -380,15 +381,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ObjectiveComponent()); + var instance = new ObjectiveComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -850,7 +852,7 @@ public List Objective List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResearchStudy; @@ -859,37 +861,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Protocol.Any()) dest.Protocol = new List(Protocol.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(PrimaryPurposeType != null) dest.PrimaryPurposeType = (Hl7.Fhir.Model.CodeableConcept)PrimaryPurposeType.DeepCopy(); - if(Phase != null) dest.Phase = (Hl7.Fhir.Model.CodeableConcept)Phase.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Keyword.Any()) dest.Keyword = new List(Keyword.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Enrollment.Any()) dest.Enrollment = new List(Enrollment.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Sponsor != null) dest.Sponsor = (Hl7.Fhir.Model.ResourceReference)Sponsor.DeepCopy(); - if(PrincipalInvestigator != null) dest.PrincipalInvestigator = (Hl7.Fhir.Model.ResourceReference)PrincipalInvestigator.DeepCopy(); - if(Site.Any()) dest.Site = new List(Site.DeepCopy()); - if(ReasonStopped != null) dest.ReasonStopped = (Hl7.Fhir.Model.CodeableConcept)ReasonStopped.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Arm.Any()) dest.Arm = new List(Arm.DeepCopy()); - if(Objective.Any()) dest.Objective = new List(Objective.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Protocol.Any()) dest.Protocol = new List(Protocol.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(PrimaryPurposeType != null) dest.PrimaryPurposeType = (Hl7.Fhir.Model.CodeableConcept)PrimaryPurposeType.DeepCopyInternal(); + if(Phase != null) dest.Phase = (Hl7.Fhir.Model.CodeableConcept)Phase.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Keyword.Any()) dest.Keyword = new List(Keyword.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Enrollment.Any()) dest.Enrollment = new List(Enrollment.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Sponsor != null) dest.Sponsor = (Hl7.Fhir.Model.ResourceReference)Sponsor.DeepCopyInternal(); + if(PrincipalInvestigator != null) dest.PrincipalInvestigator = (Hl7.Fhir.Model.ResourceReference)PrincipalInvestigator.DeepCopyInternal(); + if(Site.Any()) dest.Site = new List(Site.DeepCopyInternal()); + if(ReasonStopped != null) dest.ReasonStopped = (Hl7.Fhir.Model.CodeableConcept)ReasonStopped.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Arm.Any()) dest.Arm = new List(Arm.DeepCopyInternal()); + if(Objective.Any()) dest.Objective = new List(Objective.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResearchStudy()); + var instance = new ResearchStudy(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ResearchSubject.cs b/src/Hl7.Fhir.R4B/Model/Generated/ResearchSubject.cs index fab2a91c06..597cde3598 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ResearchSubject.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ResearchSubject.cs @@ -320,7 +320,7 @@ public Hl7.Fhir.Model.ResourceReference Consent List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResearchSubject; @@ -329,21 +329,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Study != null) dest.Study = (Hl7.Fhir.Model.ResourceReference)Study.DeepCopy(); - if(Individual != null) dest.Individual = (Hl7.Fhir.Model.ResourceReference)Individual.DeepCopy(); - if(AssignedArmElement != null) dest.AssignedArmElement = (Hl7.Fhir.Model.FhirString)AssignedArmElement.DeepCopy(); - if(ActualArmElement != null) dest.ActualArmElement = (Hl7.Fhir.Model.FhirString)ActualArmElement.DeepCopy(); - if(Consent != null) dest.Consent = (Hl7.Fhir.Model.ResourceReference)Consent.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Study != null) dest.Study = (Hl7.Fhir.Model.ResourceReference)Study.DeepCopyInternal(); + if(Individual != null) dest.Individual = (Hl7.Fhir.Model.ResourceReference)Individual.DeepCopyInternal(); + if(AssignedArmElement != null) dest.AssignedArmElement = (Hl7.Fhir.Model.FhirString)AssignedArmElement.DeepCopyInternal(); + if(ActualArmElement != null) dest.ActualArmElement = (Hl7.Fhir.Model.FhirString)ActualArmElement.DeepCopyInternal(); + if(Consent != null) dest.Consent = (Hl7.Fhir.Model.ResourceReference)Consent.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResearchSubject()); + var instance = new ResearchSubject(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/RiskAssessment.cs b/src/Hl7.Fhir.R4B/Model/Generated/RiskAssessment.cs index 25f39044c7..2dd71e2098 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/RiskAssessment.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/RiskAssessment.cs @@ -196,7 +196,7 @@ public string Rationale } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PredictionComponent; @@ -205,19 +205,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(Probability != null) dest.Probability = (Hl7.Fhir.Model.DataType)Probability.DeepCopy(); - if(QualitativeRisk != null) dest.QualitativeRisk = (Hl7.Fhir.Model.CodeableConcept)QualitativeRisk.DeepCopy(); - if(RelativeRiskElement != null) dest.RelativeRiskElement = (Hl7.Fhir.Model.FhirDecimal)RelativeRiskElement.DeepCopy(); - if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopy(); - if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.FhirString)RationaleElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(Probability != null) dest.Probability = (Hl7.Fhir.Model.DataType)Probability.DeepCopyInternal(); + if(QualitativeRisk != null) dest.QualitativeRisk = (Hl7.Fhir.Model.CodeableConcept)QualitativeRisk.DeepCopyInternal(); + if(RelativeRiskElement != null) dest.RelativeRiskElement = (Hl7.Fhir.Model.FhirDecimal)RelativeRiskElement.DeepCopyInternal(); + if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopyInternal(); + if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.FhirString)RationaleElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PredictionComponent()); + var instance = new PredictionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -593,7 +594,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RiskAssessment; @@ -602,30 +603,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn != null) dest.BasedOn = (Hl7.Fhir.Model.ResourceReference)BasedOn.DeepCopy(); - if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Basis.Any()) dest.Basis = new List(Basis.DeepCopy()); - if(Prediction.Any()) dest.Prediction = new List(Prediction.DeepCopy()); - if(MitigationElement != null) dest.MitigationElement = (Hl7.Fhir.Model.FhirString)MitigationElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn != null) dest.BasedOn = (Hl7.Fhir.Model.ResourceReference)BasedOn.DeepCopyInternal(); + if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Basis.Any()) dest.Basis = new List(Basis.DeepCopyInternal()); + if(Prediction.Any()) dest.Prediction = new List(Prediction.DeepCopyInternal()); + if(MitigationElement != null) dest.MitigationElement = (Hl7.Fhir.Model.FhirString)MitigationElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RiskAssessment()); + var instance = new RiskAssessment(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/SampledData.cs b/src/Hl7.Fhir.R4B/Model/Generated/SampledData.cs index 94347f0603..722198f3d5 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/SampledData.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/SampledData.cs @@ -262,7 +262,7 @@ public string Data } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SampledData; @@ -271,20 +271,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Origin != null) dest.Origin = (Hl7.Fhir.Model.Quantity)Origin.DeepCopy(); - if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(LowerLimitElement != null) dest.LowerLimitElement = (Hl7.Fhir.Model.FhirDecimal)LowerLimitElement.DeepCopy(); - if(UpperLimitElement != null) dest.UpperLimitElement = (Hl7.Fhir.Model.FhirDecimal)UpperLimitElement.DeepCopy(); - if(DimensionsElement != null) dest.DimensionsElement = (Hl7.Fhir.Model.PositiveInt)DimensionsElement.DeepCopy(); - if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.FhirString)DataElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Origin != null) dest.Origin = (Hl7.Fhir.Model.Quantity)Origin.DeepCopyInternal(); + if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(LowerLimitElement != null) dest.LowerLimitElement = (Hl7.Fhir.Model.FhirDecimal)LowerLimitElement.DeepCopyInternal(); + if(UpperLimitElement != null) dest.UpperLimitElement = (Hl7.Fhir.Model.FhirDecimal)UpperLimitElement.DeepCopyInternal(); + if(DimensionsElement != null) dest.DimensionsElement = (Hl7.Fhir.Model.PositiveInt)DimensionsElement.DeepCopyInternal(); + if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.FhirString)DataElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SampledData()); + var instance = new SampledData(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Schedule.cs b/src/Hl7.Fhir.R4B/Model/Generated/Schedule.cs index eaf9500a22..63689ca141 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Schedule.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Schedule.cs @@ -208,7 +208,7 @@ public string Comment List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Schedule; @@ -217,21 +217,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopy()); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(PlanningHorizon != null) dest.PlanningHorizon = (Hl7.Fhir.Model.Period)PlanningHorizon.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopyInternal()); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(PlanningHorizon != null) dest.PlanningHorizon = (Hl7.Fhir.Model.Period)PlanningHorizon.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Schedule()); + var instance = new Schedule(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/SearchParameter.cs b/src/Hl7.Fhir.R4B/Model/Generated/SearchParameter.cs index 2f303cd469..28e6570c73 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/SearchParameter.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/SearchParameter.cs @@ -326,7 +326,7 @@ public string Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -335,15 +335,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1163,7 +1164,7 @@ public List Component private List _Component; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SearchParameter; @@ -1172,39 +1173,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DerivedFromElement != null) dest.DerivedFromElement = (Hl7.Fhir.Model.Canonical)DerivedFromElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(BaseElement.Any()) dest.BaseElement = new List>(BaseElement.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(XpathElement != null) dest.XpathElement = (Hl7.Fhir.Model.FhirString)XpathElement.DeepCopy(); - if(XpathUsageElement != null) dest.XpathUsageElement = (Code)XpathUsageElement.DeepCopy(); - if(TargetElement.Any()) dest.TargetElement = new List>(TargetElement.DeepCopy()); - if(MultipleOrElement != null) dest.MultipleOrElement = (Hl7.Fhir.Model.FhirBoolean)MultipleOrElement.DeepCopy(); - if(MultipleAndElement != null) dest.MultipleAndElement = (Hl7.Fhir.Model.FhirBoolean)MultipleAndElement.DeepCopy(); - if(ComparatorElement.Any()) dest.ComparatorElement = new List>(ComparatorElement.DeepCopy()); - if(ModifierElement.Any()) dest.ModifierElement = new List>(ModifierElement.DeepCopy()); - if(ChainElement.Any()) dest.ChainElement = new List(ChainElement.DeepCopy()); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DerivedFromElement != null) dest.DerivedFromElement = (Hl7.Fhir.Model.Canonical)DerivedFromElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(BaseElement.Any()) dest.BaseElement = new List>(BaseElement.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(XpathElement != null) dest.XpathElement = (Hl7.Fhir.Model.FhirString)XpathElement.DeepCopyInternal(); + if(XpathUsageElement != null) dest.XpathUsageElement = (Code)XpathUsageElement.DeepCopyInternal(); + if(TargetElement.Any()) dest.TargetElement = new List>(TargetElement.DeepCopyInternal()); + if(MultipleOrElement != null) dest.MultipleOrElement = (Hl7.Fhir.Model.FhirBoolean)MultipleOrElement.DeepCopyInternal(); + if(MultipleAndElement != null) dest.MultipleAndElement = (Hl7.Fhir.Model.FhirBoolean)MultipleAndElement.DeepCopyInternal(); + if(ComparatorElement.Any()) dest.ComparatorElement = new List>(ComparatorElement.DeepCopyInternal()); + if(ModifierElement.Any()) dest.ModifierElement = new List>(ModifierElement.DeepCopyInternal()); + if(ChainElement.Any()) dest.ChainElement = new List(ChainElement.DeepCopyInternal()); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SearchParameter()); + var instance = new SearchParameter(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/ServiceRequest.cs b/src/Hl7.Fhir.R4B/Model/Generated/ServiceRequest.cs index 76f553a991..c88e618102 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/ServiceRequest.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/ServiceRequest.cs @@ -699,7 +699,7 @@ public List RelevantHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ServiceRequest; @@ -708,46 +708,47 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(Requisition != null) dest.Requisition = (Hl7.Fhir.Model.Identifier)Requisition.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(OrderDetail.Any()) dest.OrderDetail = new List(OrderDetail.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.DataType)Quantity.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(LocationCode.Any()) dest.LocationCode = new List(LocationCode.DeepCopy()); - if(LocationReference.Any()) dest.LocationReference = new List(LocationReference.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopy(); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(Requisition != null) dest.Requisition = (Hl7.Fhir.Model.Identifier)Requisition.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(OrderDetail.Any()) dest.OrderDetail = new List(OrderDetail.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.DataType)Quantity.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(LocationCode.Any()) dest.LocationCode = new List(LocationCode.DeepCopyInternal()); + if(LocationReference.Any()) dest.LocationReference = new List(LocationReference.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopyInternal(); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ServiceRequest()); + var instance = new ServiceRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Slot.cs b/src/Hl7.Fhir.R4B/Model/Generated/Slot.cs index 914a3dd39e..b96cc30339 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Slot.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Slot.cs @@ -347,7 +347,7 @@ public string Comment List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Slot; @@ -356,24 +356,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopy()); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopy(); - if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.ResourceReference)Schedule.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(OverbookedElement != null) dest.OverbookedElement = (Hl7.Fhir.Model.FhirBoolean)OverbookedElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopyInternal()); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopyInternal(); + if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.ResourceReference)Schedule.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(OverbookedElement != null) dest.OverbookedElement = (Hl7.Fhir.Model.FhirBoolean)OverbookedElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Slot()); + var instance = new Slot(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Specimen.cs b/src/Hl7.Fhir.R4B/Model/Generated/Specimen.cs index ee519112ab..a921515fc3 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Specimen.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Specimen.cs @@ -209,7 +209,7 @@ public Hl7.Fhir.Model.DataType FastingStatus private Hl7.Fhir.Model.DataType _FastingStatus; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CollectionComponent; @@ -218,20 +218,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopy(); - if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(FastingStatus != null) dest.FastingStatus = (Hl7.Fhir.Model.DataType)FastingStatus.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopyInternal(); + if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(FastingStatus != null) dest.FastingStatus = (Hl7.Fhir.Model.DataType)FastingStatus.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CollectionComponent()); + var instance = new CollectionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -419,7 +420,7 @@ public Hl7.Fhir.Model.DataType Time private Hl7.Fhir.Model.DataType _Time; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcessingComponent; @@ -428,17 +429,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.CodeableConcept)Procedure.DeepCopy(); - if(Additive.Any()) dest.Additive = new List(Additive.DeepCopy()); - if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.CodeableConcept)Procedure.DeepCopyInternal(); + if(Additive.Any()) dest.Additive = new List(Additive.DeepCopyInternal()); + if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcessingComponent()); + var instance = new ProcessingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -628,7 +630,7 @@ public Hl7.Fhir.Model.DataType Additive private Hl7.Fhir.Model.DataType _Additive; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainerComponent; @@ -637,19 +639,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Capacity != null) dest.Capacity = (Hl7.Fhir.Model.Quantity)Capacity.DeepCopy(); - if(SpecimenQuantity != null) dest.SpecimenQuantity = (Hl7.Fhir.Model.Quantity)SpecimenQuantity.DeepCopy(); - if(Additive != null) dest.Additive = (Hl7.Fhir.Model.DataType)Additive.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Capacity != null) dest.Capacity = (Hl7.Fhir.Model.Quantity)Capacity.DeepCopyInternal(); + if(SpecimenQuantity != null) dest.SpecimenQuantity = (Hl7.Fhir.Model.Quantity)SpecimenQuantity.DeepCopyInternal(); + if(Additive != null) dest.Additive = (Hl7.Fhir.Model.DataType)Additive.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainerComponent()); + var instance = new ContainerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -961,7 +964,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Specimen; @@ -970,26 +973,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(AccessionIdentifier != null) dest.AccessionIdentifier = (Hl7.Fhir.Model.Identifier)AccessionIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(ReceivedTimeElement != null) dest.ReceivedTimeElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedTimeElement.DeepCopy(); - if(Parent.Any()) dest.Parent = new List(Parent.DeepCopy()); - if(Request.Any()) dest.Request = new List(Request.DeepCopy()); - if(Collection != null) dest.Collection = (Hl7.Fhir.Model.Specimen.CollectionComponent)Collection.DeepCopy(); - if(Processing.Any()) dest.Processing = new List(Processing.DeepCopy()); - if(Container.Any()) dest.Container = new List(Container.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(AccessionIdentifier != null) dest.AccessionIdentifier = (Hl7.Fhir.Model.Identifier)AccessionIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(ReceivedTimeElement != null) dest.ReceivedTimeElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedTimeElement.DeepCopyInternal(); + if(Parent.Any()) dest.Parent = new List(Parent.DeepCopyInternal()); + if(Request.Any()) dest.Request = new List(Request.DeepCopyInternal()); + if(Collection != null) dest.Collection = (Hl7.Fhir.Model.Specimen.CollectionComponent)Collection.DeepCopyInternal(); + if(Processing.Any()) dest.Processing = new List(Processing.DeepCopyInternal()); + if(Container.Any()) dest.Container = new List(Container.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Specimen()); + var instance = new Specimen(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/SpecimenDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/SpecimenDefinition.cs index e068c10056..189e0314d0 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/SpecimenDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/SpecimenDefinition.cs @@ -262,7 +262,7 @@ public List Handling private List _Handling; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TypeTestedComponent; @@ -271,21 +271,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IsDerivedElement != null) dest.IsDerivedElement = (Hl7.Fhir.Model.FhirBoolean)IsDerivedElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(PreferenceElement != null) dest.PreferenceElement = (Code)PreferenceElement.DeepCopy(); - if(Container != null) dest.Container = (Hl7.Fhir.Model.SpecimenDefinition.ContainerComponent)Container.DeepCopy(); - if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.FhirString)RequirementElement.DeepCopy(); - if(RetentionTime != null) dest.RetentionTime = (Hl7.Fhir.Model.Duration)RetentionTime.DeepCopy(); - if(RejectionCriterion.Any()) dest.RejectionCriterion = new List(RejectionCriterion.DeepCopy()); - if(Handling.Any()) dest.Handling = new List(Handling.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(IsDerivedElement != null) dest.IsDerivedElement = (Hl7.Fhir.Model.FhirBoolean)IsDerivedElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(PreferenceElement != null) dest.PreferenceElement = (Code)PreferenceElement.DeepCopyInternal(); + if(Container != null) dest.Container = (Hl7.Fhir.Model.SpecimenDefinition.ContainerComponent)Container.DeepCopyInternal(); + if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.FhirString)RequirementElement.DeepCopyInternal(); + if(RetentionTime != null) dest.RetentionTime = (Hl7.Fhir.Model.Duration)RetentionTime.DeepCopyInternal(); + if(RejectionCriterion.Any()) dest.RejectionCriterion = new List(RejectionCriterion.DeepCopyInternal()); + if(Handling.Any()) dest.Handling = new List(Handling.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TypeTestedComponent()); + var instance = new TypeTestedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -548,7 +549,7 @@ public string Preparation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainerComponent; @@ -557,21 +558,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Material != null) dest.Material = (Hl7.Fhir.Model.CodeableConcept)Material.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Cap != null) dest.Cap = (Hl7.Fhir.Model.CodeableConcept)Cap.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Capacity != null) dest.Capacity = (Hl7.Fhir.Model.Quantity)Capacity.DeepCopy(); - if(MinimumVolume != null) dest.MinimumVolume = (Hl7.Fhir.Model.DataType)MinimumVolume.DeepCopy(); - if(Additive.Any()) dest.Additive = new List(Additive.DeepCopy()); - if(PreparationElement != null) dest.PreparationElement = (Hl7.Fhir.Model.FhirString)PreparationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Material != null) dest.Material = (Hl7.Fhir.Model.CodeableConcept)Material.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Cap != null) dest.Cap = (Hl7.Fhir.Model.CodeableConcept)Cap.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Capacity != null) dest.Capacity = (Hl7.Fhir.Model.Quantity)Capacity.DeepCopyInternal(); + if(MinimumVolume != null) dest.MinimumVolume = (Hl7.Fhir.Model.DataType)MinimumVolume.DeepCopyInternal(); + if(Additive.Any()) dest.Additive = new List(Additive.DeepCopyInternal()); + if(PreparationElement != null) dest.PreparationElement = (Hl7.Fhir.Model.FhirString)PreparationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainerComponent()); + var instance = new ContainerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -709,7 +711,7 @@ public Hl7.Fhir.Model.DataType Additive private Hl7.Fhir.Model.DataType _Additive; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdditiveComponent; @@ -718,14 +720,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Additive != null) dest.Additive = (Hl7.Fhir.Model.DataType)Additive.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Additive != null) dest.Additive = (Hl7.Fhir.Model.DataType)Additive.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdditiveComponent()); + var instance = new AdditiveComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -860,7 +863,7 @@ public string Instruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HandlingComponent; @@ -869,17 +872,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TemperatureQualifier != null) dest.TemperatureQualifier = (Hl7.Fhir.Model.CodeableConcept)TemperatureQualifier.DeepCopy(); - if(TemperatureRange != null) dest.TemperatureRange = (Hl7.Fhir.Model.Range)TemperatureRange.DeepCopy(); - if(MaxDuration != null) dest.MaxDuration = (Hl7.Fhir.Model.Duration)MaxDuration.DeepCopy(); - if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TemperatureQualifier != null) dest.TemperatureQualifier = (Hl7.Fhir.Model.CodeableConcept)TemperatureQualifier.DeepCopyInternal(); + if(TemperatureRange != null) dest.TemperatureRange = (Hl7.Fhir.Model.Range)TemperatureRange.DeepCopyInternal(); + if(MaxDuration != null) dest.MaxDuration = (Hl7.Fhir.Model.Duration)MaxDuration.DeepCopyInternal(); + if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HandlingComponent()); + var instance = new HandlingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1055,7 +1059,7 @@ public List TypeTested Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SpecimenDefinition; @@ -1064,19 +1068,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(TypeCollected != null) dest.TypeCollected = (Hl7.Fhir.Model.CodeableConcept)TypeCollected.DeepCopy(); - if(PatientPreparation.Any()) dest.PatientPreparation = new List(PatientPreparation.DeepCopy()); - if(TimeAspectElement != null) dest.TimeAspectElement = (Hl7.Fhir.Model.FhirString)TimeAspectElement.DeepCopy(); - if(Collection.Any()) dest.Collection = new List(Collection.DeepCopy()); - if(TypeTested.Any()) dest.TypeTested = new List(TypeTested.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(TypeCollected != null) dest.TypeCollected = (Hl7.Fhir.Model.CodeableConcept)TypeCollected.DeepCopyInternal(); + if(PatientPreparation.Any()) dest.PatientPreparation = new List(PatientPreparation.DeepCopyInternal()); + if(TimeAspectElement != null) dest.TimeAspectElement = (Hl7.Fhir.Model.FhirString)TimeAspectElement.DeepCopyInternal(); + if(Collection.Any()) dest.Collection = new List(Collection.DeepCopyInternal()); + if(TypeTested.Any()) dest.TypeTested = new List(TypeTested.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SpecimenDefinition()); + var instance = new SpecimenDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/StructureMap.cs b/src/Hl7.Fhir.R4B/Model/Generated/StructureMap.cs index 9b31de20b8..c080f29e67 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/StructureMap.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/StructureMap.cs @@ -493,7 +493,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureComponent; @@ -502,17 +502,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.Canonical)UrlElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(AliasElement != null) dest.AliasElement = (Hl7.Fhir.Model.FhirString)AliasElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.Canonical)UrlElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(AliasElement != null) dest.AliasElement = (Hl7.Fhir.Model.FhirString)AliasElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureComponent()); + var instance = new StructureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -756,7 +757,7 @@ public List Rule private List _Rule; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -765,19 +766,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(ExtendsElement != null) dest.ExtendsElement = (Hl7.Fhir.Model.Id)ExtendsElement.DeepCopy(); - if(TypeModeElement != null) dest.TypeModeElement = (Code)TypeModeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(ExtendsElement != null) dest.ExtendsElement = (Hl7.Fhir.Model.Id)ExtendsElement.DeepCopyInternal(); + if(TypeModeElement != null) dest.TypeModeElement = (Code)TypeModeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1010,7 +1012,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InputComponent; @@ -1019,17 +1021,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InputComponent()); + var instance = new InputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1233,7 +1236,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RuleComponent; @@ -1242,19 +1245,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - if(Dependent.Any()) dest.Dependent = new List(Dependent.DeepCopy()); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); + if(Dependent.Any()) dest.Dependent = new List(Dependent.DeepCopyInternal()); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RuleComponent()); + var instance = new RuleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1683,7 +1687,7 @@ public string LogMessage } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceComponent; @@ -1692,24 +1696,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopy(); - if(DefaultValue != null) dest.DefaultValue = (Hl7.Fhir.Model.DataType)DefaultValue.DeepCopy(); - if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopy(); - if(ListModeElement != null) dest.ListModeElement = (Code)ListModeElement.DeepCopy(); - if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopy(); - if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopy(); - if(CheckElement != null) dest.CheckElement = (Hl7.Fhir.Model.FhirString)CheckElement.DeepCopy(); - if(LogMessageElement != null) dest.LogMessageElement = (Hl7.Fhir.Model.FhirString)LogMessageElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopyInternal(); + if(DefaultValue != null) dest.DefaultValue = (Hl7.Fhir.Model.DataType)DefaultValue.DeepCopyInternal(); + if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopyInternal(); + if(ListModeElement != null) dest.ListModeElement = (Code)ListModeElement.DeepCopyInternal(); + if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopyInternal(); + if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopyInternal(); + if(CheckElement != null) dest.CheckElement = (Hl7.Fhir.Model.FhirString)CheckElement.DeepCopyInternal(); + if(LogMessageElement != null) dest.LogMessageElement = (Hl7.Fhir.Model.FhirString)LogMessageElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceComponent()); + var instance = new SourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2088,7 +2093,7 @@ public List Parameter private List _Parameter; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -2097,21 +2102,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopy(); - if(ContextTypeElement != null) dest.ContextTypeElement = (Code)ContextTypeElement.DeepCopy(); - if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopy(); - if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopy(); - if(ListModeElement.Any()) dest.ListModeElement = new List>(ListModeElement.DeepCopy()); - if(ListRuleIdElement != null) dest.ListRuleIdElement = (Hl7.Fhir.Model.Id)ListRuleIdElement.DeepCopy(); - if(TransformElement != null) dest.TransformElement = (Code)TransformElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopyInternal(); + if(ContextTypeElement != null) dest.ContextTypeElement = (Code)ContextTypeElement.DeepCopyInternal(); + if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopyInternal(); + if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopyInternal(); + if(ListModeElement.Any()) dest.ListModeElement = new List>(ListModeElement.DeepCopyInternal()); + if(ListRuleIdElement != null) dest.ListRuleIdElement = (Hl7.Fhir.Model.Id)ListRuleIdElement.DeepCopyInternal(); + if(TransformElement != null) dest.TransformElement = (Code)TransformElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2244,7 +2250,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -2253,14 +2259,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2385,7 +2392,7 @@ public IEnumerable Variable } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DependentComponent; @@ -2394,15 +2401,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(VariableElement.Any()) dest.VariableElement = new List(VariableElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(VariableElement.Any()) dest.VariableElement = new List(VariableElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DependentComponent()); + var instance = new DependentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2923,7 +2931,7 @@ public List Group List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureMap; @@ -2932,31 +2940,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(Structure.Any()) dest.Structure = new List(Structure.DeepCopy()); - if(ImportElement.Any()) dest.ImportElement = new List(ImportElement.DeepCopy()); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(Structure.Any()) dest.Structure = new List(Structure.DeepCopyInternal()); + if(ImportElement.Any()) dest.ImportElement = new List(ImportElement.DeepCopyInternal()); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureMap()); + var instance = new StructureMap(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Subscription.cs b/src/Hl7.Fhir.R4B/Model/Generated/Subscription.cs index d119aac14d..970a2a176d 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Subscription.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Subscription.cs @@ -244,7 +244,7 @@ public IEnumerable Header } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ChannelComponent; @@ -253,17 +253,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopy(); - if(PayloadElement != null) dest.PayloadElement = (Hl7.Fhir.Model.Code)PayloadElement.DeepCopy(); - if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopyInternal(); + if(PayloadElement != null) dest.PayloadElement = (Hl7.Fhir.Model.Code)PayloadElement.DeepCopyInternal(); + if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ChannelComponent()); + var instance = new ChannelComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -523,7 +524,7 @@ public Hl7.Fhir.Model.Subscription.ChannelComponent Channel private Hl7.Fhir.Model.Subscription.ChannelComponent _Channel; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Subscription; @@ -532,20 +533,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(ReasonElement != null) dest.ReasonElement = (Hl7.Fhir.Model.FhirString)ReasonElement.DeepCopy(); - if(CriteriaElement != null) dest.CriteriaElement = (Hl7.Fhir.Model.FhirString)CriteriaElement.DeepCopy(); - if(ErrorElement != null) dest.ErrorElement = (Hl7.Fhir.Model.FhirString)ErrorElement.DeepCopy(); - if(Channel != null) dest.Channel = (Hl7.Fhir.Model.Subscription.ChannelComponent)Channel.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(ReasonElement != null) dest.ReasonElement = (Hl7.Fhir.Model.FhirString)ReasonElement.DeepCopyInternal(); + if(CriteriaElement != null) dest.CriteriaElement = (Hl7.Fhir.Model.FhirString)CriteriaElement.DeepCopyInternal(); + if(ErrorElement != null) dest.ErrorElement = (Hl7.Fhir.Model.FhirString)ErrorElement.DeepCopyInternal(); + if(Channel != null) dest.Channel = (Hl7.Fhir.Model.Subscription.ChannelComponent)Channel.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Subscription()); + var instance = new Subscription(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/SubscriptionStatus.cs b/src/Hl7.Fhir.R4B/Model/Generated/SubscriptionStatus.cs index 23d00df416..4a086ad603 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/SubscriptionStatus.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/SubscriptionStatus.cs @@ -209,7 +209,7 @@ public List AdditionalContext private List _AdditionalContext; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotificationEventComponent; @@ -218,17 +218,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(EventNumberElement != null) dest.EventNumberElement = (Hl7.Fhir.Model.FhirString)EventNumberElement.DeepCopy(); - if(TimestampElement != null) dest.TimestampElement = (Hl7.Fhir.Model.Instant)TimestampElement.DeepCopy(); - if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopy(); - if(AdditionalContext.Any()) dest.AdditionalContext = new List(AdditionalContext.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(EventNumberElement != null) dest.EventNumberElement = (Hl7.Fhir.Model.FhirString)EventNumberElement.DeepCopyInternal(); + if(TimestampElement != null) dest.TimestampElement = (Hl7.Fhir.Model.Instant)TimestampElement.DeepCopyInternal(); + if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopyInternal(); + if(AdditionalContext.Any()) dest.AdditionalContext = new List(AdditionalContext.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotificationEventComponent()); + var instance = new NotificationEventComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -474,7 +475,7 @@ public List Error private List _Error; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubscriptionStatus; @@ -483,20 +484,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(EventsSinceSubscriptionStartElement != null) dest.EventsSinceSubscriptionStartElement = (Hl7.Fhir.Model.FhirString)EventsSinceSubscriptionStartElement.DeepCopy(); - if(NotificationEvent.Any()) dest.NotificationEvent = new List(NotificationEvent.DeepCopy()); - if(Subscription != null) dest.Subscription = (Hl7.Fhir.Model.ResourceReference)Subscription.DeepCopy(); - if(TopicElement != null) dest.TopicElement = (Hl7.Fhir.Model.Canonical)TopicElement.DeepCopy(); - if(Error.Any()) dest.Error = new List(Error.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(EventsSinceSubscriptionStartElement != null) dest.EventsSinceSubscriptionStartElement = (Hl7.Fhir.Model.FhirString)EventsSinceSubscriptionStartElement.DeepCopyInternal(); + if(NotificationEvent.Any()) dest.NotificationEvent = new List(NotificationEvent.DeepCopyInternal()); + if(Subscription != null) dest.Subscription = (Hl7.Fhir.Model.ResourceReference)Subscription.DeepCopyInternal(); + if(TopicElement != null) dest.TopicElement = (Hl7.Fhir.Model.Canonical)TopicElement.DeepCopyInternal(); + if(Error.Any()) dest.Error = new List(Error.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubscriptionStatus()); + var instance = new SubscriptionStatus(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/SubscriptionTopic.cs b/src/Hl7.Fhir.R4B/Model/Generated/SubscriptionTopic.cs index 11831e9921..86ce693a61 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/SubscriptionTopic.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/SubscriptionTopic.cs @@ -367,7 +367,7 @@ public string FhirPathCriteria } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceTriggerComponent; @@ -376,18 +376,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopy(); - if(SupportedInteractionElement.Any()) dest.SupportedInteractionElement = new List>(SupportedInteractionElement.DeepCopy()); - if(QueryCriteria != null) dest.QueryCriteria = (Hl7.Fhir.Model.SubscriptionTopic.QueryCriteriaComponent)QueryCriteria.DeepCopy(); - if(FhirPathCriteriaElement != null) dest.FhirPathCriteriaElement = (Hl7.Fhir.Model.FhirString)FhirPathCriteriaElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopyInternal(); + if(SupportedInteractionElement.Any()) dest.SupportedInteractionElement = new List>(SupportedInteractionElement.DeepCopyInternal()); + if(QueryCriteria != null) dest.QueryCriteria = (Hl7.Fhir.Model.SubscriptionTopic.QueryCriteriaComponent)QueryCriteria.DeepCopyInternal(); + if(FhirPathCriteriaElement != null) dest.FhirPathCriteriaElement = (Hl7.Fhir.Model.FhirString)FhirPathCriteriaElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceTriggerComponent()); + var instance = new ResourceTriggerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -642,7 +643,7 @@ public bool? RequireBoth } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QueryCriteriaComponent; @@ -651,18 +652,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PreviousElement != null) dest.PreviousElement = (Hl7.Fhir.Model.FhirString)PreviousElement.DeepCopy(); - if(ResultForCreateElement != null) dest.ResultForCreateElement = (Code)ResultForCreateElement.DeepCopy(); - if(CurrentElement != null) dest.CurrentElement = (Hl7.Fhir.Model.FhirString)CurrentElement.DeepCopy(); - if(ResultForDeleteElement != null) dest.ResultForDeleteElement = (Code)ResultForDeleteElement.DeepCopy(); - if(RequireBothElement != null) dest.RequireBothElement = (Hl7.Fhir.Model.FhirBoolean)RequireBothElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PreviousElement != null) dest.PreviousElement = (Hl7.Fhir.Model.FhirString)PreviousElement.DeepCopyInternal(); + if(ResultForCreateElement != null) dest.ResultForCreateElement = (Code)ResultForCreateElement.DeepCopyInternal(); + if(CurrentElement != null) dest.CurrentElement = (Hl7.Fhir.Model.FhirString)CurrentElement.DeepCopyInternal(); + if(ResultForDeleteElement != null) dest.ResultForDeleteElement = (Code)ResultForDeleteElement.DeepCopyInternal(); + if(RequireBothElement != null) dest.RequireBothElement = (Hl7.Fhir.Model.FhirBoolean)RequireBothElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QueryCriteriaComponent()); + var instance = new QueryCriteriaComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -837,7 +839,7 @@ public string Resource } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventTriggerComponent; @@ -846,16 +848,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Event != null) dest.Event = (Hl7.Fhir.Model.CodeableConcept)Event.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Event != null) dest.Event = (Hl7.Fhir.Model.CodeableConcept)Event.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventTriggerComponent()); + var instance = new EventTriggerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1095,7 +1098,7 @@ public IEnumerable } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CanFilterByComponent; @@ -1104,18 +1107,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopy(); - if(FilterParameterElement != null) dest.FilterParameterElement = (Hl7.Fhir.Model.FhirString)FilterParameterElement.DeepCopy(); - if(FilterDefinitionElement != null) dest.FilterDefinitionElement = (Hl7.Fhir.Model.FhirUri)FilterDefinitionElement.DeepCopy(); - if(ModifierElement.Any()) dest.ModifierElement = new List>(ModifierElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopyInternal(); + if(FilterParameterElement != null) dest.FilterParameterElement = (Hl7.Fhir.Model.FhirString)FilterParameterElement.DeepCopyInternal(); + if(FilterDefinitionElement != null) dest.FilterDefinitionElement = (Hl7.Fhir.Model.FhirUri)FilterDefinitionElement.DeepCopyInternal(); + if(ModifierElement.Any()) dest.ModifierElement = new List>(ModifierElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CanFilterByComponent()); + var instance = new CanFilterByComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1308,7 +1312,7 @@ public IEnumerable RevInclude } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotificationShapeComponent; @@ -1317,16 +1321,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopy(); - if(IncludeElement.Any()) dest.IncludeElement = new List(IncludeElement.DeepCopy()); - if(RevIncludeElement.Any()) dest.RevIncludeElement = new List(RevIncludeElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopyInternal(); + if(IncludeElement.Any()) dest.IncludeElement = new List(IncludeElement.DeepCopyInternal()); + if(RevIncludeElement.Any()) dest.RevIncludeElement = new List(RevIncludeElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotificationShapeComponent()); + var instance = new NotificationShapeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1926,7 +1931,7 @@ public List Notific List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubscriptionTopic; @@ -1935,35 +1940,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(ResourceTrigger.Any()) dest.ResourceTrigger = new List(ResourceTrigger.DeepCopy()); - if(EventTrigger.Any()) dest.EventTrigger = new List(EventTrigger.DeepCopy()); - if(CanFilterBy.Any()) dest.CanFilterBy = new List(CanFilterBy.DeepCopy()); - if(NotificationShape.Any()) dest.NotificationShape = new List(NotificationShape.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(ResourceTrigger.Any()) dest.ResourceTrigger = new List(ResourceTrigger.DeepCopyInternal()); + if(EventTrigger.Any()) dest.EventTrigger = new List(EventTrigger.DeepCopyInternal()); + if(CanFilterBy.Any()) dest.CanFilterBy = new List(CanFilterBy.DeepCopyInternal()); + if(NotificationShape.Any()) dest.NotificationShape = new List(NotificationShape.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubscriptionTopic()); + var instance = new SubscriptionTopic(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Substance.cs b/src/Hl7.Fhir.R4B/Model/Generated/Substance.cs index 46900c1d6f..6c092b2817 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Substance.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Substance.cs @@ -157,7 +157,7 @@ public Hl7.Fhir.Model.Quantity Quantity private Hl7.Fhir.Model.Quantity _Quantity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -166,16 +166,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -286,7 +287,7 @@ public Hl7.Fhir.Model.DataType Substance private Hl7.Fhir.Model.DataType _Substance; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientComponent; @@ -295,15 +296,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Ratio)Quantity.DeepCopy(); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.DataType)Substance.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Ratio)Quantity.DeepCopyInternal(); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.DataType)Substance.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientComponent()); + var instance = new IngredientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -497,7 +499,7 @@ public List Ingredient List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Substance; @@ -506,20 +508,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Substance()); + var instance = new Substance(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/SubstanceDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/SubstanceDefinition.cs index 8bdb8551ef..1d3494c735 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/SubstanceDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/SubstanceDefinition.cs @@ -214,7 +214,7 @@ public Hl7.Fhir.Model.CodeableConcept MeasurementType private Hl7.Fhir.Model.CodeableConcept _MeasurementType; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MoietyComponent; @@ -223,21 +223,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Stereochemistry != null) dest.Stereochemistry = (Hl7.Fhir.Model.CodeableConcept)Stereochemistry.DeepCopy(); - if(OpticalActivity != null) dest.OpticalActivity = (Hl7.Fhir.Model.CodeableConcept)OpticalActivity.DeepCopy(); - if(MolecularFormulaElement != null) dest.MolecularFormulaElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopy(); - if(MeasurementType != null) dest.MeasurementType = (Hl7.Fhir.Model.CodeableConcept)MeasurementType.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Stereochemistry != null) dest.Stereochemistry = (Hl7.Fhir.Model.CodeableConcept)Stereochemistry.DeepCopyInternal(); + if(OpticalActivity != null) dest.OpticalActivity = (Hl7.Fhir.Model.CodeableConcept)OpticalActivity.DeepCopyInternal(); + if(MolecularFormulaElement != null) dest.MolecularFormulaElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopyInternal(); + if(MeasurementType != null) dest.MeasurementType = (Hl7.Fhir.Model.CodeableConcept)MeasurementType.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MoietyComponent()); + var instance = new MoietyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -384,7 +385,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -393,15 +394,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -515,7 +517,7 @@ public Hl7.Fhir.Model.Quantity Amount private Hl7.Fhir.Model.Quantity _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MolecularWeightComponent; @@ -524,16 +526,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MolecularWeightComponent()); + var instance = new MolecularWeightComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -758,7 +761,7 @@ public List Represen private List _Representation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureComponent; @@ -767,21 +770,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Stereochemistry != null) dest.Stereochemistry = (Hl7.Fhir.Model.CodeableConcept)Stereochemistry.DeepCopy(); - if(OpticalActivity != null) dest.OpticalActivity = (Hl7.Fhir.Model.CodeableConcept)OpticalActivity.DeepCopy(); - if(MolecularFormulaElement != null) dest.MolecularFormulaElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaElement.DeepCopy(); - if(MolecularFormulaByMoietyElement != null) dest.MolecularFormulaByMoietyElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaByMoietyElement.DeepCopy(); - if(MolecularWeight != null) dest.MolecularWeight = (Hl7.Fhir.Model.SubstanceDefinition.MolecularWeightComponent)MolecularWeight.DeepCopy(); - if(Technique.Any()) dest.Technique = new List(Technique.DeepCopy()); - if(SourceDocument.Any()) dest.SourceDocument = new List(SourceDocument.DeepCopy()); - if(Representation.Any()) dest.Representation = new List(Representation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Stereochemistry != null) dest.Stereochemistry = (Hl7.Fhir.Model.CodeableConcept)Stereochemistry.DeepCopyInternal(); + if(OpticalActivity != null) dest.OpticalActivity = (Hl7.Fhir.Model.CodeableConcept)OpticalActivity.DeepCopyInternal(); + if(MolecularFormulaElement != null) dest.MolecularFormulaElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaElement.DeepCopyInternal(); + if(MolecularFormulaByMoietyElement != null) dest.MolecularFormulaByMoietyElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaByMoietyElement.DeepCopyInternal(); + if(MolecularWeight != null) dest.MolecularWeight = (Hl7.Fhir.Model.SubstanceDefinition.MolecularWeightComponent)MolecularWeight.DeepCopyInternal(); + if(Technique.Any()) dest.Technique = new List(Technique.DeepCopyInternal()); + if(SourceDocument.Any()) dest.SourceDocument = new List(SourceDocument.DeepCopyInternal()); + if(Representation.Any()) dest.Representation = new List(Representation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureComponent()); + var instance = new StructureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -972,7 +976,7 @@ public Hl7.Fhir.Model.ResourceReference Document private Hl7.Fhir.Model.ResourceReference _Document; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepresentationComponent; @@ -981,17 +985,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(RepresentationElement != null) dest.RepresentationElement = (Hl7.Fhir.Model.FhirString)RepresentationElement.DeepCopy(); - if(Format != null) dest.Format = (Hl7.Fhir.Model.CodeableConcept)Format.DeepCopy(); - if(Document != null) dest.Document = (Hl7.Fhir.Model.ResourceReference)Document.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(RepresentationElement != null) dest.RepresentationElement = (Hl7.Fhir.Model.FhirString)RepresentationElement.DeepCopyInternal(); + if(Format != null) dest.Format = (Hl7.Fhir.Model.CodeableConcept)Format.DeepCopyInternal(); + if(Document != null) dest.Document = (Hl7.Fhir.Model.ResourceReference)Document.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepresentationComponent()); + var instance = new RepresentationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1164,7 +1169,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeComponent; @@ -1173,18 +1178,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CodeComponent()); + var instance = new CodeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1471,7 +1477,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NameComponent; @@ -1480,24 +1486,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - if(Language.Any()) dest.Language = new List(Language.DeepCopy()); - if(Domain.Any()) dest.Domain = new List(Domain.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(Synonym.Any()) dest.Synonym = new List(Synonym.DeepCopy()); - if(Translation.Any()) dest.Translation = new List(Translation.DeepCopy()); - if(Official.Any()) dest.Official = new List(Official.DeepCopy()); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); + if(Language.Any()) dest.Language = new List(Language.DeepCopyInternal()); + if(Domain.Any()) dest.Domain = new List(Domain.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(Synonym.Any()) dest.Synonym = new List(Synonym.DeepCopyInternal()); + if(Translation.Any()) dest.Translation = new List(Translation.DeepCopyInternal()); + if(Official.Any()) dest.Official = new List(Official.DeepCopyInternal()); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NameComponent()); + var instance = new NameComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1697,7 +1704,7 @@ public string Date } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OfficialComponent; @@ -1706,16 +1713,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Authority != null) dest.Authority = (Hl7.Fhir.Model.CodeableConcept)Authority.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.CodeableConcept)Authority.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OfficialComponent()); + var instance = new OfficialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1915,7 +1923,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelationshipComponent; @@ -1924,20 +1932,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SubstanceDefinition != null) dest.SubstanceDefinition = (Hl7.Fhir.Model.DataType)SubstanceDefinition.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(IsDefiningElement != null) dest.IsDefiningElement = (Hl7.Fhir.Model.FhirBoolean)IsDefiningElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopy(); - if(RatioHighLimitAmount != null) dest.RatioHighLimitAmount = (Hl7.Fhir.Model.Ratio)RatioHighLimitAmount.DeepCopy(); - if(Comparator != null) dest.Comparator = (Hl7.Fhir.Model.CodeableConcept)Comparator.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SubstanceDefinition != null) dest.SubstanceDefinition = (Hl7.Fhir.Model.DataType)SubstanceDefinition.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(IsDefiningElement != null) dest.IsDefiningElement = (Hl7.Fhir.Model.FhirBoolean)IsDefiningElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopyInternal(); + if(RatioHighLimitAmount != null) dest.RatioHighLimitAmount = (Hl7.Fhir.Model.Ratio)RatioHighLimitAmount.DeepCopyInternal(); + if(Comparator != null) dest.Comparator = (Hl7.Fhir.Model.CodeableConcept)Comparator.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelationshipComponent()); + var instance = new RelationshipComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2120,7 +2129,7 @@ public List CountryOfOrigin private List _CountryOfOrigin; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceMaterialComponent; @@ -2129,18 +2138,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Genus != null) dest.Genus = (Hl7.Fhir.Model.CodeableConcept)Genus.DeepCopy(); - if(Species != null) dest.Species = (Hl7.Fhir.Model.CodeableConcept)Species.DeepCopy(); - if(Part != null) dest.Part = (Hl7.Fhir.Model.CodeableConcept)Part.DeepCopy(); - if(CountryOfOrigin.Any()) dest.CountryOfOrigin = new List(CountryOfOrigin.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Genus != null) dest.Genus = (Hl7.Fhir.Model.CodeableConcept)Genus.DeepCopyInternal(); + if(Species != null) dest.Species = (Hl7.Fhir.Model.CodeableConcept)Species.DeepCopyInternal(); + if(Part != null) dest.Part = (Hl7.Fhir.Model.CodeableConcept)Part.DeepCopyInternal(); + if(CountryOfOrigin.Any()) dest.CountryOfOrigin = new List(CountryOfOrigin.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceMaterialComponent()); + var instance = new SourceMaterialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2527,7 +2537,7 @@ public Hl7.Fhir.Model.SubstanceDefinition.SourceMaterialComponent SourceMaterial List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceDefinition; @@ -2536,32 +2546,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - if(Domain != null) dest.Domain = (Hl7.Fhir.Model.CodeableConcept)Domain.DeepCopy(); - if(Grade.Any()) dest.Grade = new List(Grade.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(InformationSource.Any()) dest.InformationSource = new List(InformationSource.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(Supplier.Any()) dest.Supplier = new List(Supplier.DeepCopy()); - if(Moiety.Any()) dest.Moiety = new List(Moiety.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(MolecularWeight.Any()) dest.MolecularWeight = new List(MolecularWeight.DeepCopy()); - if(Structure != null) dest.Structure = (Hl7.Fhir.Model.SubstanceDefinition.StructureComponent)Structure.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopy()); - if(SourceMaterial != null) dest.SourceMaterial = (Hl7.Fhir.Model.SubstanceDefinition.SourceMaterialComponent)SourceMaterial.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); + if(Domain != null) dest.Domain = (Hl7.Fhir.Model.CodeableConcept)Domain.DeepCopyInternal(); + if(Grade.Any()) dest.Grade = new List(Grade.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(InformationSource.Any()) dest.InformationSource = new List(InformationSource.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(Supplier.Any()) dest.Supplier = new List(Supplier.DeepCopyInternal()); + if(Moiety.Any()) dest.Moiety = new List(Moiety.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(MolecularWeight.Any()) dest.MolecularWeight = new List(MolecularWeight.DeepCopyInternal()); + if(Structure != null) dest.Structure = (Hl7.Fhir.Model.SubstanceDefinition.StructureComponent)Structure.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopyInternal()); + if(SourceMaterial != null) dest.SourceMaterial = (Hl7.Fhir.Model.SubstanceDefinition.SourceMaterialComponent)SourceMaterial.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceDefinition()); + var instance = new SubstanceDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/SupplyDelivery.cs b/src/Hl7.Fhir.R4B/Model/Generated/SupplyDelivery.cs index 7bf332bee7..8c7141c652 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/SupplyDelivery.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/SupplyDelivery.cs @@ -161,7 +161,7 @@ public Hl7.Fhir.Model.DataType Item private Hl7.Fhir.Model.DataType _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SuppliedItemComponent; @@ -170,15 +170,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SuppliedItemComponent()); + var instance = new SuppliedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -418,7 +419,7 @@ public List Receiver List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplyDelivery; @@ -427,24 +428,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SuppliedItem != null) dest.SuppliedItem = (Hl7.Fhir.Model.SupplyDelivery.SuppliedItemComponent)SuppliedItem.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Supplier != null) dest.Supplier = (Hl7.Fhir.Model.ResourceReference)Supplier.DeepCopy(); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SuppliedItem != null) dest.SuppliedItem = (Hl7.Fhir.Model.SupplyDelivery.SuppliedItemComponent)SuppliedItem.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Supplier != null) dest.Supplier = (Hl7.Fhir.Model.ResourceReference)Supplier.DeepCopyInternal(); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplyDelivery()); + var instance = new SupplyDelivery(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/SupplyRequest.cs b/src/Hl7.Fhir.R4B/Model/Generated/SupplyRequest.cs index 952bfa93ed..30490fb2ab 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/SupplyRequest.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/SupplyRequest.cs @@ -156,7 +156,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -165,15 +165,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -509,7 +510,7 @@ public Hl7.Fhir.Model.ResourceReference DeliverTo List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplyRequest; @@ -518,28 +519,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(Supplier.Any()) dest.Supplier = new List(Supplier.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(DeliverFrom != null) dest.DeliverFrom = (Hl7.Fhir.Model.ResourceReference)DeliverFrom.DeepCopy(); - if(DeliverTo != null) dest.DeliverTo = (Hl7.Fhir.Model.ResourceReference)DeliverTo.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(Supplier.Any()) dest.Supplier = new List(Supplier.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(DeliverFrom != null) dest.DeliverFrom = (Hl7.Fhir.Model.ResourceReference)DeliverFrom.DeepCopyInternal(); + if(DeliverTo != null) dest.DeliverTo = (Hl7.Fhir.Model.ResourceReference)DeliverTo.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplyRequest()); + var instance = new SupplyRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Task.cs b/src/Hl7.Fhir.R4B/Model/Generated/Task.cs index 0698e72b74..482caa11ca 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Task.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Task.cs @@ -278,7 +278,7 @@ public List Recipient private List _Recipient; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RestrictionComponent; @@ -287,16 +287,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RepetitionsElement != null) dest.RepetitionsElement = (Hl7.Fhir.Model.PositiveInt)RepetitionsElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RepetitionsElement != null) dest.RepetitionsElement = (Hl7.Fhir.Model.PositiveInt)RepetitionsElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RestrictionComponent()); + var instance = new RestrictionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -407,7 +408,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -416,15 +417,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -527,7 +529,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OutputComponent; @@ -536,15 +538,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OutputComponent()); + var instance = new OutputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1193,7 +1196,7 @@ public List Output List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Task; @@ -1202,44 +1205,45 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement != null) dest.InstantiatesCanonicalElement = (Hl7.Fhir.Model.Canonical)InstantiatesCanonicalElement.DeepCopy(); - if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(BusinessStatus != null) dest.BusinessStatus = (Hl7.Fhir.Model.CodeableConcept)BusinessStatus.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopy(); - if(For != null) dest.For = (Hl7.Fhir.Model.ResourceReference)For.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(ExecutionPeriod != null) dest.ExecutionPeriod = (Hl7.Fhir.Model.Period)ExecutionPeriod.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(LastModifiedElement != null) dest.LastModifiedElement = (Hl7.Fhir.Model.FhirDateTime)LastModifiedElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopy()); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(ReasonCode != null) dest.ReasonCode = (Hl7.Fhir.Model.CodeableConcept)ReasonCode.DeepCopy(); - if(ReasonReference != null) dest.ReasonReference = (Hl7.Fhir.Model.ResourceReference)ReasonReference.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - if(Restriction != null) dest.Restriction = (Hl7.Fhir.Model.Task.RestrictionComponent)Restriction.DeepCopy(); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Output.Any()) dest.Output = new List(Output.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement != null) dest.InstantiatesCanonicalElement = (Hl7.Fhir.Model.Canonical)InstantiatesCanonicalElement.DeepCopyInternal(); + if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(BusinessStatus != null) dest.BusinessStatus = (Hl7.Fhir.Model.CodeableConcept)BusinessStatus.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopyInternal(); + if(For != null) dest.For = (Hl7.Fhir.Model.ResourceReference)For.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(ExecutionPeriod != null) dest.ExecutionPeriod = (Hl7.Fhir.Model.Period)ExecutionPeriod.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(LastModifiedElement != null) dest.LastModifiedElement = (Hl7.Fhir.Model.FhirDateTime)LastModifiedElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopyInternal()); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(ReasonCode != null) dest.ReasonCode = (Hl7.Fhir.Model.CodeableConcept)ReasonCode.DeepCopyInternal(); + if(ReasonReference != null) dest.ReasonReference = (Hl7.Fhir.Model.ResourceReference)ReasonReference.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); + if(Restriction != null) dest.Restriction = (Hl7.Fhir.Model.Task.RestrictionComponent)Restriction.DeepCopyInternal(); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Output.Any()) dest.Output = new List(Output.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Task()); + var instance = new Task(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/TerminologyCapabilities.cs b/src/Hl7.Fhir.R4B/Model/Generated/TerminologyCapabilities.cs index 8e1ceee3c0..0a0b805db7 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/TerminologyCapabilities.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/TerminologyCapabilities.cs @@ -160,7 +160,7 @@ public string Version } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SoftwareComponent; @@ -169,15 +169,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SoftwareComponent()); + var instance = new SoftwareComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -312,7 +313,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImplementationComponent; @@ -321,15 +322,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImplementationComponent()); + var instance = new ImplementationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -478,7 +480,7 @@ public bool? Subsumption } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeSystemComponent; @@ -487,16 +489,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.Canonical)UriElement.DeepCopy(); - if(Version.Any()) dest.Version = new List(Version.DeepCopy()); - if(SubsumptionElement != null) dest.SubsumptionElement = (Hl7.Fhir.Model.FhirBoolean)SubsumptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.Canonical)UriElement.DeepCopyInternal(); + if(Version.Any()) dest.Version = new List(Version.DeepCopyInternal()); + if(SubsumptionElement != null) dest.SubsumptionElement = (Hl7.Fhir.Model.FhirBoolean)SubsumptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CodeSystemComponent()); + var instance = new CodeSystemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -748,7 +751,7 @@ public IEnumerable Property } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VersionComponent; @@ -757,19 +760,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.FhirString)CodeElement.DeepCopy(); - if(IsDefaultElement != null) dest.IsDefaultElement = (Hl7.Fhir.Model.FhirBoolean)IsDefaultElement.DeepCopy(); - if(CompositionalElement != null) dest.CompositionalElement = (Hl7.Fhir.Model.FhirBoolean)CompositionalElement.DeepCopy(); - if(LanguageElement.Any()) dest.LanguageElement = new List(LanguageElement.DeepCopy()); - if(Filter.Any()) dest.Filter = new List(Filter.DeepCopy()); - if(PropertyElement.Any()) dest.PropertyElement = new List(PropertyElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.FhirString)CodeElement.DeepCopyInternal(); + if(IsDefaultElement != null) dest.IsDefaultElement = (Hl7.Fhir.Model.FhirBoolean)IsDefaultElement.DeepCopyInternal(); + if(CompositionalElement != null) dest.CompositionalElement = (Hl7.Fhir.Model.FhirBoolean)CompositionalElement.DeepCopyInternal(); + if(LanguageElement.Any()) dest.LanguageElement = new List(LanguageElement.DeepCopyInternal()); + if(Filter.Any()) dest.Filter = new List(Filter.DeepCopyInternal()); + if(PropertyElement.Any()) dest.PropertyElement = new List(PropertyElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VersionComponent()); + var instance = new VersionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -934,7 +938,7 @@ public IEnumerable Op } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FilterComponent; @@ -943,15 +947,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(OpElement.Any()) dest.OpElement = new List(OpElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(OpElement.Any()) dest.OpElement = new List(OpElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FilterComponent()); + var instance = new FilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1158,7 +1163,7 @@ public string TextFilter } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExpansionComponent; @@ -1167,18 +1172,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(HierarchicalElement != null) dest.HierarchicalElement = (Hl7.Fhir.Model.FhirBoolean)HierarchicalElement.DeepCopy(); - if(PagingElement != null) dest.PagingElement = (Hl7.Fhir.Model.FhirBoolean)PagingElement.DeepCopy(); - if(IncompleteElement != null) dest.IncompleteElement = (Hl7.Fhir.Model.FhirBoolean)IncompleteElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(TextFilterElement != null) dest.TextFilterElement = (Hl7.Fhir.Model.Markdown)TextFilterElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(HierarchicalElement != null) dest.HierarchicalElement = (Hl7.Fhir.Model.FhirBoolean)HierarchicalElement.DeepCopyInternal(); + if(PagingElement != null) dest.PagingElement = (Hl7.Fhir.Model.FhirBoolean)PagingElement.DeepCopyInternal(); + if(IncompleteElement != null) dest.IncompleteElement = (Hl7.Fhir.Model.FhirBoolean)IncompleteElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(TextFilterElement != null) dest.TextFilterElement = (Hl7.Fhir.Model.Markdown)TextFilterElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExpansionComponent()); + var instance = new ExpansionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1334,7 +1340,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -1343,15 +1349,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1452,7 +1459,7 @@ public bool? Translations } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ValidateCodeComponent; @@ -1461,14 +1468,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TranslationsElement != null) dest.TranslationsElement = (Hl7.Fhir.Model.FhirBoolean)TranslationsElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TranslationsElement != null) dest.TranslationsElement = (Hl7.Fhir.Model.FhirBoolean)TranslationsElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ValidateCodeComponent()); + var instance = new ValidateCodeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1561,7 +1569,7 @@ public bool? NeedsMap } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TranslationComponent; @@ -1570,14 +1578,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NeedsMapElement != null) dest.NeedsMapElement = (Hl7.Fhir.Model.FhirBoolean)NeedsMapElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NeedsMapElement != null) dest.NeedsMapElement = (Hl7.Fhir.Model.FhirBoolean)NeedsMapElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TranslationComponent()); + var instance = new TranslationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1672,7 +1681,7 @@ public bool? Translation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClosureComponent; @@ -1681,14 +1690,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TranslationElement != null) dest.TranslationElement = (Hl7.Fhir.Model.FhirBoolean)TranslationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TranslationElement != null) dest.TranslationElement = (Hl7.Fhir.Model.FhirBoolean)TranslationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClosureComponent()); + var instance = new ClosureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2314,7 +2324,7 @@ public Hl7.Fhir.Model.TerminologyCapabilities.ClosureComponent Closure private Hl7.Fhir.Model.TerminologyCapabilities.ClosureComponent _Closure; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TerminologyCapabilities; @@ -2323,37 +2333,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(Software != null) dest.Software = (Hl7.Fhir.Model.TerminologyCapabilities.SoftwareComponent)Software.DeepCopy(); - if(Implementation != null) dest.Implementation = (Hl7.Fhir.Model.TerminologyCapabilities.ImplementationComponent)Implementation.DeepCopy(); - if(LockedDateElement != null) dest.LockedDateElement = (Hl7.Fhir.Model.FhirBoolean)LockedDateElement.DeepCopy(); - if(CodeSystem.Any()) dest.CodeSystem = new List(CodeSystem.DeepCopy()); - if(Expansion != null) dest.Expansion = (Hl7.Fhir.Model.TerminologyCapabilities.ExpansionComponent)Expansion.DeepCopy(); - if(CodeSearchElement != null) dest.CodeSearchElement = (Code)CodeSearchElement.DeepCopy(); - if(ValidateCode != null) dest.ValidateCode = (Hl7.Fhir.Model.TerminologyCapabilities.ValidateCodeComponent)ValidateCode.DeepCopy(); - if(Translation != null) dest.Translation = (Hl7.Fhir.Model.TerminologyCapabilities.TranslationComponent)Translation.DeepCopy(); - if(Closure != null) dest.Closure = (Hl7.Fhir.Model.TerminologyCapabilities.ClosureComponent)Closure.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(Software != null) dest.Software = (Hl7.Fhir.Model.TerminologyCapabilities.SoftwareComponent)Software.DeepCopyInternal(); + if(Implementation != null) dest.Implementation = (Hl7.Fhir.Model.TerminologyCapabilities.ImplementationComponent)Implementation.DeepCopyInternal(); + if(LockedDateElement != null) dest.LockedDateElement = (Hl7.Fhir.Model.FhirBoolean)LockedDateElement.DeepCopyInternal(); + if(CodeSystem.Any()) dest.CodeSystem = new List(CodeSystem.DeepCopyInternal()); + if(Expansion != null) dest.Expansion = (Hl7.Fhir.Model.TerminologyCapabilities.ExpansionComponent)Expansion.DeepCopyInternal(); + if(CodeSearchElement != null) dest.CodeSearchElement = (Code)CodeSearchElement.DeepCopyInternal(); + if(ValidateCode != null) dest.ValidateCode = (Hl7.Fhir.Model.TerminologyCapabilities.ValidateCodeComponent)ValidateCode.DeepCopyInternal(); + if(Translation != null) dest.Translation = (Hl7.Fhir.Model.TerminologyCapabilities.TranslationComponent)Translation.DeepCopyInternal(); + if(Closure != null) dest.Closure = (Hl7.Fhir.Model.TerminologyCapabilities.ClosureComponent)Closure.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TerminologyCapabilities()); + var instance = new TerminologyCapabilities(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/TestReport.cs b/src/Hl7.Fhir.R4B/Model/Generated/TestReport.cs index 1f9f25207b..8fd170b2d7 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/TestReport.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/TestReport.cs @@ -305,7 +305,7 @@ public string Display } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -314,16 +314,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -414,7 +415,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupComponent; @@ -423,14 +424,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupComponent()); + var instance = new SetupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -521,7 +523,7 @@ public Hl7.Fhir.Model.TestReport.AssertComponent Assert private Hl7.Fhir.Model.TestReport.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupActionComponent; @@ -530,15 +532,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupActionComponent()); + var instance = new SetupActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -706,7 +709,7 @@ public string Detail } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -715,16 +718,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopy(); - if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopy(); - if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirUri)DetailElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopyInternal(); + if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopyInternal(); + if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirUri)DetailElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationComponent()); + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -900,7 +904,7 @@ public string Detail } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssertComponent; @@ -909,16 +913,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopy(); - if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopy(); - if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopyInternal(); + if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopyInternal(); + if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AssertComponent()); + var instance = new AssertComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1071,7 +1076,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestComponent; @@ -1080,16 +1085,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestComponent()); + var instance = new TestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1196,7 +1202,7 @@ public Hl7.Fhir.Model.TestReport.AssertComponent Assert private Hl7.Fhir.Model.TestReport.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestActionComponent; @@ -1205,15 +1211,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestActionComponent()); + var instance = new TestActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1299,7 +1306,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownComponent; @@ -1308,14 +1315,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownComponent()); + var instance = new TeardownComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1394,7 +1402,7 @@ public Hl7.Fhir.Model.TestReport.OperationComponent Operation private Hl7.Fhir.Model.TestReport.OperationComponent _Operation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownActionComponent; @@ -1403,14 +1411,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownActionComponent()); + var instance = new TeardownActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1735,7 +1744,7 @@ public Hl7.Fhir.Model.TestReport.TeardownComponent Teardown Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestReport; @@ -1744,25 +1753,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(TestScript != null) dest.TestScript = (Hl7.Fhir.Model.ResourceReference)TestScript.DeepCopy(); - if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopy(); - if(ScoreElement != null) dest.ScoreElement = (Hl7.Fhir.Model.FhirDecimal)ScoreElement.DeepCopy(); - if(TesterElement != null) dest.TesterElement = (Hl7.Fhir.Model.FhirString)TesterElement.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestReport.SetupComponent)Setup.DeepCopy(); - if(Test.Any()) dest.Test = new List(Test.DeepCopy()); - if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestReport.TeardownComponent)Teardown.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(TestScript != null) dest.TestScript = (Hl7.Fhir.Model.ResourceReference)TestScript.DeepCopyInternal(); + if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopyInternal(); + if(ScoreElement != null) dest.ScoreElement = (Hl7.Fhir.Model.FhirDecimal)ScoreElement.DeepCopyInternal(); + if(TesterElement != null) dest.TesterElement = (Hl7.Fhir.Model.FhirString)TesterElement.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestReport.SetupComponent)Setup.DeepCopyInternal(); + if(Test.Any()) dest.Test = new List(Test.DeepCopyInternal()); + if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestReport.TeardownComponent)Teardown.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestReport()); + var instance = new TestReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/TestScript.cs b/src/Hl7.Fhir.R4B/Model/Generated/TestScript.cs index 01893f032b..396ac2954e 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/TestScript.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/TestScript.cs @@ -355,7 +355,7 @@ public Hl7.Fhir.Model.Coding Profile private Hl7.Fhir.Model.Coding _Profile; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OriginComponent; @@ -364,15 +364,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OriginComponent()); + var instance = new OriginComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -492,7 +493,7 @@ public Hl7.Fhir.Model.Coding Profile private Hl7.Fhir.Model.Coding _Profile; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DestinationComponent; @@ -501,15 +502,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DestinationComponent()); + var instance = new DestinationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -609,7 +611,7 @@ public List Capability private List _Capability; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MetadataComponent; @@ -618,15 +620,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - if(Capability.Any()) dest.Capability = new List(Capability.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); + if(Capability.Any()) dest.Capability = new List(Capability.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MetadataComponent()); + var instance = new MetadataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -761,7 +764,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -770,15 +773,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1073,7 +1077,7 @@ public string Capabilities } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CapabilityComponent; @@ -1082,20 +1086,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopy(); - if(ValidatedElement != null) dest.ValidatedElement = (Hl7.Fhir.Model.FhirBoolean)ValidatedElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(OriginElement.Any()) dest.OriginElement = new List(OriginElement.DeepCopy()); - if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopy(); - if(LinkElement.Any()) dest.LinkElement = new List(LinkElement.DeepCopy()); - if(CapabilitiesElement != null) dest.CapabilitiesElement = (Hl7.Fhir.Model.Canonical)CapabilitiesElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopyInternal(); + if(ValidatedElement != null) dest.ValidatedElement = (Hl7.Fhir.Model.FhirBoolean)ValidatedElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(OriginElement.Any()) dest.OriginElement = new List(OriginElement.DeepCopyInternal()); + if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopyInternal(); + if(LinkElement.Any()) dest.LinkElement = new List(LinkElement.DeepCopyInternal()); + if(CapabilitiesElement != null) dest.CapabilitiesElement = (Hl7.Fhir.Model.Canonical)CapabilitiesElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CapabilityComponent()); + var instance = new CapabilityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1286,7 +1291,7 @@ public Hl7.Fhir.Model.ResourceReference Resource private Hl7.Fhir.Model.ResourceReference _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FixtureComponent; @@ -1295,16 +1300,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AutocreateElement != null) dest.AutocreateElement = (Hl7.Fhir.Model.FhirBoolean)AutocreateElement.DeepCopy(); - if(AutodeleteElement != null) dest.AutodeleteElement = (Hl7.Fhir.Model.FhirBoolean)AutodeleteElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AutocreateElement != null) dest.AutocreateElement = (Hl7.Fhir.Model.FhirBoolean)AutocreateElement.DeepCopyInternal(); + if(AutodeleteElement != null) dest.AutodeleteElement = (Hl7.Fhir.Model.FhirBoolean)AutodeleteElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FixtureComponent()); + var instance = new FixtureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1634,7 +1640,7 @@ public string SourceId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VariableComponent; @@ -1643,21 +1649,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DefaultValueElement != null) dest.DefaultValueElement = (Hl7.Fhir.Model.FhirString)DefaultValueElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopy(); - if(HintElement != null) dest.HintElement = (Hl7.Fhir.Model.FhirString)HintElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DefaultValueElement != null) dest.DefaultValueElement = (Hl7.Fhir.Model.FhirString)DefaultValueElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopyInternal(); + if(HintElement != null) dest.HintElement = (Hl7.Fhir.Model.FhirString)HintElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VariableComponent()); + var instance = new VariableComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1788,7 +1795,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupComponent; @@ -1797,14 +1804,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupComponent()); + var instance = new SetupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1895,7 +1903,7 @@ public Hl7.Fhir.Model.TestScript.AssertComponent Assert private Hl7.Fhir.Model.TestScript.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupActionComponent; @@ -1904,15 +1912,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupActionComponent()); + var instance = new SetupActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2484,7 +2493,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -2493,30 +2502,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Code)ResourceElement.DeepCopy(); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(AcceptElement != null) dest.AcceptElement = (Hl7.Fhir.Model.Code)AcceptElement.DeepCopy(); - if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopy(); - if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopy(); - if(EncodeRequestUrlElement != null) dest.EncodeRequestUrlElement = (Hl7.Fhir.Model.FhirBoolean)EncodeRequestUrlElement.DeepCopy(); - if(MethodElement != null) dest.MethodElement = (Code)MethodElement.DeepCopy(); - if(OriginElement != null) dest.OriginElement = (Hl7.Fhir.Model.Integer)OriginElement.DeepCopy(); - if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopy(); - if(RequestHeader.Any()) dest.RequestHeader = new List(RequestHeader.DeepCopy()); - if(RequestIdElement != null) dest.RequestIdElement = (Hl7.Fhir.Model.Id)RequestIdElement.DeepCopy(); - if(ResponseIdElement != null) dest.ResponseIdElement = (Hl7.Fhir.Model.Id)ResponseIdElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopy(); - if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirString)UrlElement.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new OperationComponent()); + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Code)ResourceElement.DeepCopyInternal(); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(AcceptElement != null) dest.AcceptElement = (Hl7.Fhir.Model.Code)AcceptElement.DeepCopyInternal(); + if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopyInternal(); + if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopyInternal(); + if(EncodeRequestUrlElement != null) dest.EncodeRequestUrlElement = (Hl7.Fhir.Model.FhirBoolean)EncodeRequestUrlElement.DeepCopyInternal(); + if(MethodElement != null) dest.MethodElement = (Code)MethodElement.DeepCopyInternal(); + if(OriginElement != null) dest.OriginElement = (Hl7.Fhir.Model.Integer)OriginElement.DeepCopyInternal(); + if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopyInternal(); + if(RequestHeader.Any()) dest.RequestHeader = new List(RequestHeader.DeepCopyInternal()); + if(RequestIdElement != null) dest.RequestIdElement = (Hl7.Fhir.Model.Id)RequestIdElement.DeepCopyInternal(); + if(ResponseIdElement != null) dest.ResponseIdElement = (Hl7.Fhir.Model.Id)ResponseIdElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopyInternal(); + if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirString)UrlElement.DeepCopyInternal(); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2773,7 +2783,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequestHeaderComponent; @@ -2782,15 +2792,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(FieldElement != null) dest.FieldElement = (Hl7.Fhir.Model.FhirString)FieldElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(FieldElement != null) dest.FieldElement = (Hl7.Fhir.Model.FhirString)FieldElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequestHeaderComponent()); + var instance = new RequestHeaderComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3557,7 +3568,7 @@ public bool? WarningOnly } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssertComponent; @@ -3566,35 +3577,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopy(); - if(CompareToSourceIdElement != null) dest.CompareToSourceIdElement = (Hl7.Fhir.Model.FhirString)CompareToSourceIdElement.DeepCopy(); - if(CompareToSourceExpressionElement != null) dest.CompareToSourceExpressionElement = (Hl7.Fhir.Model.FhirString)CompareToSourceExpressionElement.DeepCopy(); - if(CompareToSourcePathElement != null) dest.CompareToSourcePathElement = (Hl7.Fhir.Model.FhirString)CompareToSourcePathElement.DeepCopy(); - if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopy(); - if(MinimumIdElement != null) dest.MinimumIdElement = (Hl7.Fhir.Model.FhirString)MinimumIdElement.DeepCopy(); - if(NavigationLinksElement != null) dest.NavigationLinksElement = (Hl7.Fhir.Model.FhirBoolean)NavigationLinksElement.DeepCopy(); - if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(RequestMethodElement != null) dest.RequestMethodElement = (Code)RequestMethodElement.DeepCopy(); - if(RequestURLElement != null) dest.RequestURLElement = (Hl7.Fhir.Model.FhirString)RequestURLElement.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Code)ResourceElement.DeepCopy(); - if(ResponseElement != null) dest.ResponseElement = (Code)ResponseElement.DeepCopy(); - if(ResponseCodeElement != null) dest.ResponseCodeElement = (Hl7.Fhir.Model.FhirString)ResponseCodeElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopy(); - if(ValidateProfileIdElement != null) dest.ValidateProfileIdElement = (Hl7.Fhir.Model.Id)ValidateProfileIdElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(WarningOnlyElement != null) dest.WarningOnlyElement = (Hl7.Fhir.Model.FhirBoolean)WarningOnlyElement.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new AssertComponent()); + base.CopyToInternal(dest); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopyInternal(); + if(CompareToSourceIdElement != null) dest.CompareToSourceIdElement = (Hl7.Fhir.Model.FhirString)CompareToSourceIdElement.DeepCopyInternal(); + if(CompareToSourceExpressionElement != null) dest.CompareToSourceExpressionElement = (Hl7.Fhir.Model.FhirString)CompareToSourceExpressionElement.DeepCopyInternal(); + if(CompareToSourcePathElement != null) dest.CompareToSourcePathElement = (Hl7.Fhir.Model.FhirString)CompareToSourcePathElement.DeepCopyInternal(); + if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopyInternal(); + if(MinimumIdElement != null) dest.MinimumIdElement = (Hl7.Fhir.Model.FhirString)MinimumIdElement.DeepCopyInternal(); + if(NavigationLinksElement != null) dest.NavigationLinksElement = (Hl7.Fhir.Model.FhirBoolean)NavigationLinksElement.DeepCopyInternal(); + if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(RequestMethodElement != null) dest.RequestMethodElement = (Code)RequestMethodElement.DeepCopyInternal(); + if(RequestURLElement != null) dest.RequestURLElement = (Hl7.Fhir.Model.FhirString)RequestURLElement.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Code)ResourceElement.DeepCopyInternal(); + if(ResponseElement != null) dest.ResponseElement = (Code)ResponseElement.DeepCopyInternal(); + if(ResponseCodeElement != null) dest.ResponseCodeElement = (Hl7.Fhir.Model.FhirString)ResponseCodeElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopyInternal(); + if(ValidateProfileIdElement != null) dest.ValidateProfileIdElement = (Hl7.Fhir.Model.Id)ValidateProfileIdElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(WarningOnlyElement != null) dest.WarningOnlyElement = (Hl7.Fhir.Model.FhirBoolean)WarningOnlyElement.DeepCopyInternal(); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new AssertComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3899,7 +3911,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestComponent; @@ -3908,16 +3920,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestComponent()); + var instance = new TestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4024,7 +4037,7 @@ public Hl7.Fhir.Model.TestScript.AssertComponent Assert private Hl7.Fhir.Model.TestScript.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestActionComponent; @@ -4033,15 +4046,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestActionComponent()); + var instance = new TestActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4127,7 +4141,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownComponent; @@ -4136,14 +4150,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownComponent()); + var instance = new TeardownComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4222,7 +4237,7 @@ public Hl7.Fhir.Model.TestScript.OperationComponent Operation private Hl7.Fhir.Model.TestScript.OperationComponent _Operation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownActionComponent; @@ -4231,14 +4246,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownActionComponent()); + var instance = new TeardownActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4815,7 +4831,7 @@ public Hl7.Fhir.Model.TestScript.TeardownComponent Teardown Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestScript; @@ -4824,37 +4840,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(Origin.Any()) dest.Origin = new List(Origin.DeepCopy()); - if(Destination.Any()) dest.Destination = new List(Destination.DeepCopy()); - if(Metadata != null) dest.Metadata = (Hl7.Fhir.Model.TestScript.MetadataComponent)Metadata.DeepCopy(); - if(Fixture.Any()) dest.Fixture = new List(Fixture.DeepCopy()); - if(Profile.Any()) dest.Profile = new List(Profile.DeepCopy()); - if(Variable.Any()) dest.Variable = new List(Variable.DeepCopy()); - if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestScript.SetupComponent)Setup.DeepCopy(); - if(Test.Any()) dest.Test = new List(Test.DeepCopy()); - if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestScript.TeardownComponent)Teardown.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(Origin.Any()) dest.Origin = new List(Origin.DeepCopyInternal()); + if(Destination.Any()) dest.Destination = new List(Destination.DeepCopyInternal()); + if(Metadata != null) dest.Metadata = (Hl7.Fhir.Model.TestScript.MetadataComponent)Metadata.DeepCopyInternal(); + if(Fixture.Any()) dest.Fixture = new List(Fixture.DeepCopyInternal()); + if(Profile.Any()) dest.Profile = new List(Profile.DeepCopyInternal()); + if(Variable.Any()) dest.Variable = new List(Variable.DeepCopyInternal()); + if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestScript.SetupComponent)Setup.DeepCopyInternal(); + if(Test.Any()) dest.Test = new List(Test.DeepCopyInternal()); + if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestScript.TeardownComponent)Teardown.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestScript()); + var instance = new TestScript(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/Timing.cs b/src/Hl7.Fhir.R4B/Model/Generated/Timing.cs index 92621daba4..47350213db 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/Timing.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/Timing.cs @@ -755,7 +755,7 @@ public int? Offset } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepeatComponent; @@ -764,28 +764,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Bounds != null) dest.Bounds = (Hl7.Fhir.Model.DataType)Bounds.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.PositiveInt)CountElement.DeepCopy(); - if(CountMaxElement != null) dest.CountMaxElement = (Hl7.Fhir.Model.PositiveInt)CountMaxElement.DeepCopy(); - if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopy(); - if(DurationMaxElement != null) dest.DurationMaxElement = (Hl7.Fhir.Model.FhirDecimal)DurationMaxElement.DeepCopy(); - if(DurationUnitElement != null) dest.DurationUnitElement = (Code)DurationUnitElement.DeepCopy(); - if(FrequencyElement != null) dest.FrequencyElement = (Hl7.Fhir.Model.PositiveInt)FrequencyElement.DeepCopy(); - if(FrequencyMaxElement != null) dest.FrequencyMaxElement = (Hl7.Fhir.Model.PositiveInt)FrequencyMaxElement.DeepCopy(); - if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopy(); - if(PeriodMaxElement != null) dest.PeriodMaxElement = (Hl7.Fhir.Model.FhirDecimal)PeriodMaxElement.DeepCopy(); - if(PeriodUnitElement != null) dest.PeriodUnitElement = (Code)PeriodUnitElement.DeepCopy(); - if(DayOfWeekElement.Any()) dest.DayOfWeekElement = new List>(DayOfWeekElement.DeepCopy()); - if(TimeOfDayElement.Any()) dest.TimeOfDayElement = new List(TimeOfDayElement.DeepCopy()); - if(WhenElement.Any()) dest.WhenElement = new List>(WhenElement.DeepCopy()); - if(OffsetElement != null) dest.OffsetElement = (Hl7.Fhir.Model.UnsignedInt)OffsetElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Bounds != null) dest.Bounds = (Hl7.Fhir.Model.DataType)Bounds.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.PositiveInt)CountElement.DeepCopyInternal(); + if(CountMaxElement != null) dest.CountMaxElement = (Hl7.Fhir.Model.PositiveInt)CountMaxElement.DeepCopyInternal(); + if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopyInternal(); + if(DurationMaxElement != null) dest.DurationMaxElement = (Hl7.Fhir.Model.FhirDecimal)DurationMaxElement.DeepCopyInternal(); + if(DurationUnitElement != null) dest.DurationUnitElement = (Code)DurationUnitElement.DeepCopyInternal(); + if(FrequencyElement != null) dest.FrequencyElement = (Hl7.Fhir.Model.PositiveInt)FrequencyElement.DeepCopyInternal(); + if(FrequencyMaxElement != null) dest.FrequencyMaxElement = (Hl7.Fhir.Model.PositiveInt)FrequencyMaxElement.DeepCopyInternal(); + if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopyInternal(); + if(PeriodMaxElement != null) dest.PeriodMaxElement = (Hl7.Fhir.Model.FhirDecimal)PeriodMaxElement.DeepCopyInternal(); + if(PeriodUnitElement != null) dest.PeriodUnitElement = (Code)PeriodUnitElement.DeepCopyInternal(); + if(DayOfWeekElement.Any()) dest.DayOfWeekElement = new List>(DayOfWeekElement.DeepCopyInternal()); + if(TimeOfDayElement.Any()) dest.TimeOfDayElement = new List(TimeOfDayElement.DeepCopyInternal()); + if(WhenElement.Any()) dest.WhenElement = new List>(WhenElement.DeepCopyInternal()); + if(OffsetElement != null) dest.OffsetElement = (Hl7.Fhir.Model.UnsignedInt)OffsetElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepeatComponent()); + var instance = new RepeatComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1004,7 +1005,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Timing; @@ -1013,16 +1014,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(EventElement.Any()) dest.EventElement = new List(EventElement.DeepCopy()); - if(Repeat != null) dest.Repeat = (Hl7.Fhir.Model.Timing.RepeatComponent)Repeat.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(EventElement.Any()) dest.EventElement = new List(EventElement.DeepCopyInternal()); + if(Repeat != null) dest.Repeat = (Hl7.Fhir.Model.Timing.RepeatComponent)Repeat.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Timing()); + var instance = new Timing(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/TriggerDefinition.cs b/src/Hl7.Fhir.R4B/Model/Generated/TriggerDefinition.cs index 6a28a90b3a..5b40ebedc5 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/TriggerDefinition.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/TriggerDefinition.cs @@ -226,7 +226,7 @@ public Hl7.Fhir.Model.Expression Condition private Hl7.Fhir.Model.Expression _Condition; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TriggerDefinition; @@ -235,18 +235,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Data.Any()) dest.Data = new List(Data.DeepCopy()); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.Expression)Condition.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Data.Any()) dest.Data = new List(Data.DeepCopyInternal()); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.Expression)Condition.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TriggerDefinition()); + var instance = new TriggerDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/VerificationResult.cs b/src/Hl7.Fhir.R4B/Model/Generated/VerificationResult.cs index 6670b82980..08e0866eca 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/VerificationResult.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/VerificationResult.cs @@ -234,7 +234,7 @@ public List PushTypeAvailable private List _PushTypeAvailable; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PrimarySourceComponent; @@ -243,20 +243,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(CommunicationMethod.Any()) dest.CommunicationMethod = new List(CommunicationMethod.DeepCopy()); - if(ValidationStatus != null) dest.ValidationStatus = (Hl7.Fhir.Model.CodeableConcept)ValidationStatus.DeepCopy(); - if(ValidationDateElement != null) dest.ValidationDateElement = (Hl7.Fhir.Model.FhirDateTime)ValidationDateElement.DeepCopy(); - if(CanPushUpdates != null) dest.CanPushUpdates = (Hl7.Fhir.Model.CodeableConcept)CanPushUpdates.DeepCopy(); - if(PushTypeAvailable.Any()) dest.PushTypeAvailable = new List(PushTypeAvailable.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(CommunicationMethod.Any()) dest.CommunicationMethod = new List(CommunicationMethod.DeepCopyInternal()); + if(ValidationStatus != null) dest.ValidationStatus = (Hl7.Fhir.Model.CodeableConcept)ValidationStatus.DeepCopyInternal(); + if(ValidationDateElement != null) dest.ValidationDateElement = (Hl7.Fhir.Model.FhirDateTime)ValidationDateElement.DeepCopyInternal(); + if(CanPushUpdates != null) dest.CanPushUpdates = (Hl7.Fhir.Model.CodeableConcept)CanPushUpdates.DeepCopyInternal(); + if(PushTypeAvailable.Any()) dest.PushTypeAvailable = new List(PushTypeAvailable.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PrimarySourceComponent()); + var instance = new PrimarySourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -528,7 +529,7 @@ public Hl7.Fhir.Model.Signature SourceSignature private Hl7.Fhir.Model.Signature _SourceSignature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AttestationComponent; @@ -537,21 +538,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - if(CommunicationMethod != null) dest.CommunicationMethod = (Hl7.Fhir.Model.CodeableConcept)CommunicationMethod.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(SourceIdentityCertificateElement != null) dest.SourceIdentityCertificateElement = (Hl7.Fhir.Model.FhirString)SourceIdentityCertificateElement.DeepCopy(); - if(ProxyIdentityCertificateElement != null) dest.ProxyIdentityCertificateElement = (Hl7.Fhir.Model.FhirString)ProxyIdentityCertificateElement.DeepCopy(); - if(ProxySignature != null) dest.ProxySignature = (Hl7.Fhir.Model.Signature)ProxySignature.DeepCopy(); - if(SourceSignature != null) dest.SourceSignature = (Hl7.Fhir.Model.Signature)SourceSignature.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); + if(CommunicationMethod != null) dest.CommunicationMethod = (Hl7.Fhir.Model.CodeableConcept)CommunicationMethod.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(SourceIdentityCertificateElement != null) dest.SourceIdentityCertificateElement = (Hl7.Fhir.Model.FhirString)SourceIdentityCertificateElement.DeepCopyInternal(); + if(ProxyIdentityCertificateElement != null) dest.ProxyIdentityCertificateElement = (Hl7.Fhir.Model.FhirString)ProxyIdentityCertificateElement.DeepCopyInternal(); + if(ProxySignature != null) dest.ProxySignature = (Hl7.Fhir.Model.Signature)ProxySignature.DeepCopyInternal(); + if(SourceSignature != null) dest.SourceSignature = (Hl7.Fhir.Model.Signature)SourceSignature.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AttestationComponent()); + var instance = new AttestationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -728,7 +730,7 @@ public Hl7.Fhir.Model.Signature AttestationSignature private Hl7.Fhir.Model.Signature _AttestationSignature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ValidatorComponent; @@ -737,16 +739,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(IdentityCertificateElement != null) dest.IdentityCertificateElement = (Hl7.Fhir.Model.FhirString)IdentityCertificateElement.DeepCopy(); - if(AttestationSignature != null) dest.AttestationSignature = (Hl7.Fhir.Model.Signature)AttestationSignature.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(IdentityCertificateElement != null) dest.IdentityCertificateElement = (Hl7.Fhir.Model.FhirString)IdentityCertificateElement.DeepCopyInternal(); + if(AttestationSignature != null) dest.AttestationSignature = (Hl7.Fhir.Model.Signature)AttestationSignature.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ValidatorComponent()); + var instance = new ValidatorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1096,7 +1099,7 @@ public List Validator private List _Validator; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VerificationResult; @@ -1105,27 +1108,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(TargetLocationElement.Any()) dest.TargetLocationElement = new List(TargetLocationElement.DeepCopy()); - if(Need != null) dest.Need = (Hl7.Fhir.Model.CodeableConcept)Need.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopy(); - if(ValidationType != null) dest.ValidationType = (Hl7.Fhir.Model.CodeableConcept)ValidationType.DeepCopy(); - if(ValidationProcess.Any()) dest.ValidationProcess = new List(ValidationProcess.DeepCopy()); - if(Frequency != null) dest.Frequency = (Hl7.Fhir.Model.Timing)Frequency.DeepCopy(); - if(LastPerformedElement != null) dest.LastPerformedElement = (Hl7.Fhir.Model.FhirDateTime)LastPerformedElement.DeepCopy(); - if(NextScheduledElement != null) dest.NextScheduledElement = (Hl7.Fhir.Model.Date)NextScheduledElement.DeepCopy(); - if(FailureAction != null) dest.FailureAction = (Hl7.Fhir.Model.CodeableConcept)FailureAction.DeepCopy(); - if(PrimarySource.Any()) dest.PrimarySource = new List(PrimarySource.DeepCopy()); - if(Attestation != null) dest.Attestation = (Hl7.Fhir.Model.VerificationResult.AttestationComponent)Attestation.DeepCopy(); - if(Validator.Any()) dest.Validator = new List(Validator.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(TargetLocationElement.Any()) dest.TargetLocationElement = new List(TargetLocationElement.DeepCopyInternal()); + if(Need != null) dest.Need = (Hl7.Fhir.Model.CodeableConcept)Need.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopyInternal(); + if(ValidationType != null) dest.ValidationType = (Hl7.Fhir.Model.CodeableConcept)ValidationType.DeepCopyInternal(); + if(ValidationProcess.Any()) dest.ValidationProcess = new List(ValidationProcess.DeepCopyInternal()); + if(Frequency != null) dest.Frequency = (Hl7.Fhir.Model.Timing)Frequency.DeepCopyInternal(); + if(LastPerformedElement != null) dest.LastPerformedElement = (Hl7.Fhir.Model.FhirDateTime)LastPerformedElement.DeepCopyInternal(); + if(NextScheduledElement != null) dest.NextScheduledElement = (Hl7.Fhir.Model.Date)NextScheduledElement.DeepCopyInternal(); + if(FailureAction != null) dest.FailureAction = (Hl7.Fhir.Model.CodeableConcept)FailureAction.DeepCopyInternal(); + if(PrimarySource.Any()) dest.PrimarySource = new List(PrimarySource.DeepCopyInternal()); + if(Attestation != null) dest.Attestation = (Hl7.Fhir.Model.VerificationResult.AttestationComponent)Attestation.DeepCopyInternal(); + if(Validator.Any()) dest.Validator = new List(Validator.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VerificationResult()); + var instance = new VerificationResult(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R4B/Model/Generated/VisionPrescription.cs b/src/Hl7.Fhir.R4B/Model/Generated/VisionPrescription.cs index b0c12f2edd..b08c5044ab 100644 --- a/src/Hl7.Fhir.R4B/Model/Generated/VisionPrescription.cs +++ b/src/Hl7.Fhir.R4B/Model/Generated/VisionPrescription.cs @@ -500,7 +500,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LensSpecificationComponent; @@ -509,27 +509,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Product != null) dest.Product = (Hl7.Fhir.Model.CodeableConcept)Product.DeepCopy(); - if(EyeElement != null) dest.EyeElement = (Code)EyeElement.DeepCopy(); - if(SphereElement != null) dest.SphereElement = (Hl7.Fhir.Model.FhirDecimal)SphereElement.DeepCopy(); - if(CylinderElement != null) dest.CylinderElement = (Hl7.Fhir.Model.FhirDecimal)CylinderElement.DeepCopy(); - if(AxisElement != null) dest.AxisElement = (Hl7.Fhir.Model.Integer)AxisElement.DeepCopy(); - if(Prism.Any()) dest.Prism = new List(Prism.DeepCopy()); - if(AddElement != null) dest.AddElement = (Hl7.Fhir.Model.FhirDecimal)AddElement.DeepCopy(); - if(PowerElement != null) dest.PowerElement = (Hl7.Fhir.Model.FhirDecimal)PowerElement.DeepCopy(); - if(BackCurveElement != null) dest.BackCurveElement = (Hl7.Fhir.Model.FhirDecimal)BackCurveElement.DeepCopy(); - if(DiameterElement != null) dest.DiameterElement = (Hl7.Fhir.Model.FhirDecimal)DiameterElement.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Quantity)Duration.DeepCopy(); - if(ColorElement != null) dest.ColorElement = (Hl7.Fhir.Model.FhirString)ColorElement.DeepCopy(); - if(BrandElement != null) dest.BrandElement = (Hl7.Fhir.Model.FhirString)BrandElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Product != null) dest.Product = (Hl7.Fhir.Model.CodeableConcept)Product.DeepCopyInternal(); + if(EyeElement != null) dest.EyeElement = (Code)EyeElement.DeepCopyInternal(); + if(SphereElement != null) dest.SphereElement = (Hl7.Fhir.Model.FhirDecimal)SphereElement.DeepCopyInternal(); + if(CylinderElement != null) dest.CylinderElement = (Hl7.Fhir.Model.FhirDecimal)CylinderElement.DeepCopyInternal(); + if(AxisElement != null) dest.AxisElement = (Hl7.Fhir.Model.Integer)AxisElement.DeepCopyInternal(); + if(Prism.Any()) dest.Prism = new List(Prism.DeepCopyInternal()); + if(AddElement != null) dest.AddElement = (Hl7.Fhir.Model.FhirDecimal)AddElement.DeepCopyInternal(); + if(PowerElement != null) dest.PowerElement = (Hl7.Fhir.Model.FhirDecimal)PowerElement.DeepCopyInternal(); + if(BackCurveElement != null) dest.BackCurveElement = (Hl7.Fhir.Model.FhirDecimal)BackCurveElement.DeepCopyInternal(); + if(DiameterElement != null) dest.DiameterElement = (Hl7.Fhir.Model.FhirDecimal)DiameterElement.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Quantity)Duration.DeepCopyInternal(); + if(ColorElement != null) dest.ColorElement = (Hl7.Fhir.Model.FhirString)ColorElement.DeepCopyInternal(); + if(BrandElement != null) dest.BrandElement = (Hl7.Fhir.Model.FhirString)BrandElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LensSpecificationComponent()); + var instance = new LensSpecificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -763,7 +764,7 @@ public Hl7.Fhir.Model.VisionPrescription.VisionBase? Base } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PrismComponent; @@ -772,15 +773,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AmountElement != null) dest.AmountElement = (Hl7.Fhir.Model.FhirDecimal)AmountElement.DeepCopy(); - if(BaseElement != null) dest.BaseElement = (Code)BaseElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AmountElement != null) dest.AmountElement = (Hl7.Fhir.Model.FhirDecimal)AmountElement.DeepCopyInternal(); + if(BaseElement != null) dest.BaseElement = (Code)BaseElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PrismComponent()); + var instance = new PrismComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1011,7 +1013,7 @@ public List LensSp List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VisionPrescription; @@ -1020,21 +1022,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateWrittenElement != null) dest.DateWrittenElement = (Hl7.Fhir.Model.FhirDateTime)DateWrittenElement.DeepCopy(); - if(Prescriber != null) dest.Prescriber = (Hl7.Fhir.Model.ResourceReference)Prescriber.DeepCopy(); - if(LensSpecification.Any()) dest.LensSpecification = new List(LensSpecification.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateWrittenElement != null) dest.DateWrittenElement = (Hl7.Fhir.Model.FhirDateTime)DateWrittenElement.DeepCopyInternal(); + if(Prescriber != null) dest.Prescriber = (Hl7.Fhir.Model.ResourceReference)Prescriber.DeepCopyInternal(); + if(LensSpecification.Any()) dest.LensSpecification = new List(LensSpecification.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VisionPrescription()); + var instance = new VisionPrescription(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Account.cs b/src/Hl7.Fhir.R5/Model/Generated/Account.cs index 249f0f7494..cdd338c4e7 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Account.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Account.cs @@ -164,7 +164,7 @@ public int? Priority } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageComponent; @@ -173,15 +173,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.PositiveInt)PriorityElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.PositiveInt)PriorityElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageComponent()); + var instance = new CoverageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -313,7 +314,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GuarantorComponent; @@ -322,16 +323,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - if(OnHoldElement != null) dest.OnHoldElement = (Hl7.Fhir.Model.FhirBoolean)OnHoldElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); + if(OnHoldElement != null) dest.OnHoldElement = (Hl7.Fhir.Model.FhirBoolean)OnHoldElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GuarantorComponent()); + var instance = new GuarantorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -549,7 +551,7 @@ public List PackageCode private List _PackageCode; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -558,19 +560,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.CodeableReference)Condition.DeepCopy(); - if(DateOfDiagnosisElement != null) dest.DateOfDiagnosisElement = (Hl7.Fhir.Model.FhirDateTime)DateOfDiagnosisElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(OnAdmissionElement != null) dest.OnAdmissionElement = (Hl7.Fhir.Model.FhirBoolean)OnAdmissionElement.DeepCopy(); - if(PackageCode.Any()) dest.PackageCode = new List(PackageCode.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.CodeableReference)Condition.DeepCopyInternal(); + if(DateOfDiagnosisElement != null) dest.DateOfDiagnosisElement = (Hl7.Fhir.Model.FhirDateTime)DateOfDiagnosisElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(OnAdmissionElement != null) dest.OnAdmissionElement = (Hl7.Fhir.Model.FhirBoolean)OnAdmissionElement.DeepCopyInternal(); + if(PackageCode.Any()) dest.PackageCode = new List(PackageCode.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -796,7 +799,7 @@ public List Device private List _Device; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcedureComponent; @@ -805,19 +808,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableReference)Code.DeepCopy(); - if(DateOfServiceElement != null) dest.DateOfServiceElement = (Hl7.Fhir.Model.FhirDateTime)DateOfServiceElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(PackageCode.Any()) dest.PackageCode = new List(PackageCode.DeepCopy()); - if(Device.Any()) dest.Device = new List(Device.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableReference)Code.DeepCopyInternal(); + if(DateOfServiceElement != null) dest.DateOfServiceElement = (Hl7.Fhir.Model.FhirDateTime)DateOfServiceElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(PackageCode.Any()) dest.PackageCode = new List(PackageCode.DeepCopyInternal()); + if(Device.Any()) dest.Device = new List(Device.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcedureComponent()); + var instance = new ProcedureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -948,7 +952,7 @@ public Hl7.Fhir.Model.ResourceReference Account private Hl7.Fhir.Model.ResourceReference _Account; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedAccountComponent; @@ -957,15 +961,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Account != null) dest.Account = (Hl7.Fhir.Model.ResourceReference)Account.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Account != null) dest.Account = (Hl7.Fhir.Model.ResourceReference)Account.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedAccountComponent()); + var instance = new RelatedAccountComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1111,7 +1116,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BalanceComponent; @@ -1120,17 +1125,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Aggregate != null) dest.Aggregate = (Hl7.Fhir.Model.CodeableConcept)Aggregate.DeepCopy(); - if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopy(); - if(EstimateElement != null) dest.EstimateElement = (Hl7.Fhir.Model.FhirBoolean)EstimateElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Aggregate != null) dest.Aggregate = (Hl7.Fhir.Model.CodeableConcept)Aggregate.DeepCopyInternal(); + if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopyInternal(); + if(EstimateElement != null) dest.EstimateElement = (Hl7.Fhir.Model.FhirBoolean)EstimateElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BalanceComponent()); + var instance = new BalanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1515,7 +1521,7 @@ public DateTimeOffset? CalculatedAt List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Account; @@ -1524,30 +1530,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(BillingStatus != null) dest.BillingStatus = (Hl7.Fhir.Model.CodeableConcept)BillingStatus.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(ServicePeriod != null) dest.ServicePeriod = (Hl7.Fhir.Model.Period)ServicePeriod.DeepCopy(); - if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopy()); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Guarantor.Any()) dest.Guarantor = new List(Guarantor.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopy()); - if(RelatedAccount.Any()) dest.RelatedAccount = new List(RelatedAccount.DeepCopy()); - if(Currency != null) dest.Currency = (Hl7.Fhir.Model.CodeableConcept)Currency.DeepCopy(); - if(Balance.Any()) dest.Balance = new List(Balance.DeepCopy()); - if(CalculatedAtElement != null) dest.CalculatedAtElement = (Hl7.Fhir.Model.Instant)CalculatedAtElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(BillingStatus != null) dest.BillingStatus = (Hl7.Fhir.Model.CodeableConcept)BillingStatus.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(ServicePeriod != null) dest.ServicePeriod = (Hl7.Fhir.Model.Period)ServicePeriod.DeepCopyInternal(); + if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopyInternal()); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Guarantor.Any()) dest.Guarantor = new List(Guarantor.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopyInternal()); + if(RelatedAccount.Any()) dest.RelatedAccount = new List(RelatedAccount.DeepCopyInternal()); + if(Currency != null) dest.Currency = (Hl7.Fhir.Model.CodeableConcept)Currency.DeepCopyInternal(); + if(Balance.Any()) dest.Balance = new List(Balance.DeepCopyInternal()); + if(CalculatedAtElement != null) dest.CalculatedAtElement = (Hl7.Fhir.Model.Instant)CalculatedAtElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Account()); + var instance = new Account(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ActivityDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/ActivityDefinition.cs index 3a23e494bc..8df8193b2a 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ActivityDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ActivityDefinition.cs @@ -294,7 +294,7 @@ public Hl7.Fhir.Model.CodeableConcept Function private Hl7.Fhir.Model.CodeableConcept _Function; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -303,18 +303,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TypeCanonicalElement != null) dest.TypeCanonicalElement = (Hl7.Fhir.Model.Canonical)TypeCanonicalElement.DeepCopy(); - if(TypeReference != null) dest.TypeReference = (Hl7.Fhir.Model.ResourceReference)TypeReference.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TypeCanonicalElement != null) dest.TypeCanonicalElement = (Hl7.Fhir.Model.Canonical)TypeCanonicalElement.DeepCopyInternal(); + if(TypeReference != null) dest.TypeReference = (Hl7.Fhir.Model.ResourceReference)TypeReference.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -457,7 +458,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DynamicValueComponent; @@ -466,15 +467,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DynamicValueComponent()); + var instance = new DynamicValueComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1683,7 +1685,7 @@ public List DynamicValu List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActivityDefinition; @@ -1692,62 +1694,63 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.Markdown)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.CodeableReference)Location.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(SpecimenRequirementElement.Any()) dest.SpecimenRequirementElement = new List(SpecimenRequirementElement.DeepCopy()); - if(ObservationRequirementElement.Any()) dest.ObservationRequirementElement = new List(ObservationRequirementElement.DeepCopy()); - if(ObservationResultRequirementElement.Any()) dest.ObservationResultRequirementElement = new List(ObservationResultRequirementElement.DeepCopy()); - if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopy(); - if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActivityDefinition()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.Markdown)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.CodeableReference)Location.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(SpecimenRequirementElement.Any()) dest.SpecimenRequirementElement = new List(SpecimenRequirementElement.DeepCopyInternal()); + if(ObservationRequirementElement.Any()) dest.ObservationRequirementElement = new List(ObservationRequirementElement.DeepCopyInternal()); + if(ObservationResultRequirementElement.Any()) dest.ObservationResultRequirementElement = new List(ObservationResultRequirementElement.DeepCopyInternal()); + if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopyInternal(); + if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActivityDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ActorDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/ActorDefinition.cs index 123ce100ec..1c08e457b0 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ActorDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ActorDefinition.cs @@ -669,7 +669,7 @@ public IEnumerable DerivedFrom List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActorDefinition; @@ -678,35 +678,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopy(); - if(ReferenceElement.Any()) dest.ReferenceElement = new List(ReferenceElement.DeepCopy()); - if(CapabilitiesElement != null) dest.CapabilitiesElement = (Hl7.Fhir.Model.Canonical)CapabilitiesElement.DeepCopy(); - if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActorDefinition()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopyInternal(); + if(ReferenceElement.Any()) dest.ReferenceElement = new List(ReferenceElement.DeepCopyInternal()); + if(CapabilitiesElement != null) dest.CapabilitiesElement = (Hl7.Fhir.Model.Canonical)CapabilitiesElement.DeepCopyInternal(); + if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActorDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Address.cs b/src/Hl7.Fhir.R5/Model/Generated/Address.cs index 6d1d2119f7..adc53d014e 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Address.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Address.cs @@ -426,7 +426,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Address; @@ -435,23 +435,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(LineElement.Any()) dest.LineElement = new List(LineElement.DeepCopy()); - if(CityElement != null) dest.CityElement = (Hl7.Fhir.Model.FhirString)CityElement.DeepCopy(); - if(DistrictElement != null) dest.DistrictElement = (Hl7.Fhir.Model.FhirString)DistrictElement.DeepCopy(); - if(StateElement != null) dest.StateElement = (Hl7.Fhir.Model.FhirString)StateElement.DeepCopy(); - if(PostalCodeElement != null) dest.PostalCodeElement = (Hl7.Fhir.Model.FhirString)PostalCodeElement.DeepCopy(); - if(CountryElement != null) dest.CountryElement = (Hl7.Fhir.Model.FhirString)CountryElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(LineElement.Any()) dest.LineElement = new List(LineElement.DeepCopyInternal()); + if(CityElement != null) dest.CityElement = (Hl7.Fhir.Model.FhirString)CityElement.DeepCopyInternal(); + if(DistrictElement != null) dest.DistrictElement = (Hl7.Fhir.Model.FhirString)DistrictElement.DeepCopyInternal(); + if(StateElement != null) dest.StateElement = (Hl7.Fhir.Model.FhirString)StateElement.DeepCopyInternal(); + if(PostalCodeElement != null) dest.PostalCodeElement = (Hl7.Fhir.Model.FhirString)PostalCodeElement.DeepCopyInternal(); + if(CountryElement != null) dest.CountryElement = (Hl7.Fhir.Model.FhirString)CountryElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Address()); + var instance = new Address(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/AdministrableProductDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/AdministrableProductDefinition.cs index 48fb9ac304..25bb316511 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/AdministrableProductDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/AdministrableProductDefinition.cs @@ -117,7 +117,7 @@ public Hl7.Fhir.Model.CodeableConcept Status private Hl7.Fhir.Model.CodeableConcept _Status; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -126,16 +126,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -309,7 +310,7 @@ public List _TargetSpecies; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RouteOfAdministrationComponent; @@ -318,20 +319,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(FirstDose != null) dest.FirstDose = (Hl7.Fhir.Model.Quantity)FirstDose.DeepCopy(); - if(MaxSingleDose != null) dest.MaxSingleDose = (Hl7.Fhir.Model.Quantity)MaxSingleDose.DeepCopy(); - if(MaxDosePerDay != null) dest.MaxDosePerDay = (Hl7.Fhir.Model.Quantity)MaxDosePerDay.DeepCopy(); - if(MaxDosePerTreatmentPeriod != null) dest.MaxDosePerTreatmentPeriod = (Hl7.Fhir.Model.Ratio)MaxDosePerTreatmentPeriod.DeepCopy(); - if(MaxTreatmentPeriod != null) dest.MaxTreatmentPeriod = (Hl7.Fhir.Model.Duration)MaxTreatmentPeriod.DeepCopy(); - if(TargetSpecies.Any()) dest.TargetSpecies = new List(TargetSpecies.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(FirstDose != null) dest.FirstDose = (Hl7.Fhir.Model.Quantity)FirstDose.DeepCopyInternal(); + if(MaxSingleDose != null) dest.MaxSingleDose = (Hl7.Fhir.Model.Quantity)MaxSingleDose.DeepCopyInternal(); + if(MaxDosePerDay != null) dest.MaxDosePerDay = (Hl7.Fhir.Model.Quantity)MaxDosePerDay.DeepCopyInternal(); + if(MaxDosePerTreatmentPeriod != null) dest.MaxDosePerTreatmentPeriod = (Hl7.Fhir.Model.Ratio)MaxDosePerTreatmentPeriod.DeepCopyInternal(); + if(MaxTreatmentPeriod != null) dest.MaxTreatmentPeriod = (Hl7.Fhir.Model.Duration)MaxTreatmentPeriod.DeepCopyInternal(); + if(TargetSpecies.Any()) dest.TargetSpecies = new List(TargetSpecies.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RouteOfAdministrationComponent()); + var instance = new RouteOfAdministrationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -469,7 +471,7 @@ public List _WithdrawalPeriod; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetSpeciesComponent; @@ -478,15 +480,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(WithdrawalPeriod.Any()) dest.WithdrawalPeriod = new List(WithdrawalPeriod.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(WithdrawalPeriod.Any()) dest.WithdrawalPeriod = new List(WithdrawalPeriod.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetSpeciesComponent()); + var instance = new TargetSpeciesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -615,7 +618,7 @@ public string SupportingInformation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as WithdrawalPeriodComponent; @@ -624,16 +627,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Tissue != null) dest.Tissue = (Hl7.Fhir.Model.CodeableConcept)Tissue.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopy(); - if(SupportingInformationElement != null) dest.SupportingInformationElement = (Hl7.Fhir.Model.FhirString)SupportingInformationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Tissue != null) dest.Tissue = (Hl7.Fhir.Model.CodeableConcept)Tissue.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopyInternal(); + if(SupportingInformationElement != null) dest.SupportingInformationElement = (Hl7.Fhir.Model.FhirString)SupportingInformationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new WithdrawalPeriodComponent()); + var instance = new WithdrawalPeriodComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -896,7 +900,7 @@ public List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdministrableProductDefinition; @@ -905,24 +909,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(FormOf.Any()) dest.FormOf = new List(FormOf.DeepCopy()); - if(AdministrableDoseForm != null) dest.AdministrableDoseForm = (Hl7.Fhir.Model.CodeableConcept)AdministrableDoseForm.DeepCopy(); - if(UnitOfPresentation != null) dest.UnitOfPresentation = (Hl7.Fhir.Model.CodeableConcept)UnitOfPresentation.DeepCopy(); - if(ProducedFrom.Any()) dest.ProducedFrom = new List(ProducedFrom.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(RouteOfAdministration.Any()) dest.RouteOfAdministration = new List(RouteOfAdministration.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(FormOf.Any()) dest.FormOf = new List(FormOf.DeepCopyInternal()); + if(AdministrableDoseForm != null) dest.AdministrableDoseForm = (Hl7.Fhir.Model.CodeableConcept)AdministrableDoseForm.DeepCopyInternal(); + if(UnitOfPresentation != null) dest.UnitOfPresentation = (Hl7.Fhir.Model.CodeableConcept)UnitOfPresentation.DeepCopyInternal(); + if(ProducedFrom.Any()) dest.ProducedFrom = new List(ProducedFrom.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(RouteOfAdministration.Any()) dest.RouteOfAdministration = new List(RouteOfAdministration.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdministrableProductDefinition()); + var instance = new AdministrableProductDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/AdverseEvent.cs b/src/Hl7.Fhir.R5/Model/Generated/AdverseEvent.cs index bf2fc8b927..fb77122424 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/AdverseEvent.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/AdverseEvent.cs @@ -161,7 +161,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -170,15 +170,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -280,7 +281,7 @@ public Hl7.Fhir.Model.AdverseEvent.CausalityComponent Causality private Hl7.Fhir.Model.AdverseEvent.CausalityComponent _Causality; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SuspectEntityComponent; @@ -289,15 +290,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Instance != null) dest.Instance = (Hl7.Fhir.Model.DataType)Instance.DeepCopy(); - if(Causality != null) dest.Causality = (Hl7.Fhir.Model.AdverseEvent.CausalityComponent)Causality.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Instance != null) dest.Instance = (Hl7.Fhir.Model.DataType)Instance.DeepCopyInternal(); + if(Causality != null) dest.Causality = (Hl7.Fhir.Model.AdverseEvent.CausalityComponent)Causality.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SuspectEntityComponent()); + var instance = new SuspectEntityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -409,7 +411,7 @@ public Hl7.Fhir.Model.ResourceReference Author private Hl7.Fhir.Model.ResourceReference _Author; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CausalityComponent; @@ -418,16 +420,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AssessmentMethod != null) dest.AssessmentMethod = (Hl7.Fhir.Model.CodeableConcept)AssessmentMethod.DeepCopy(); - if(EntityRelatedness != null) dest.EntityRelatedness = (Hl7.Fhir.Model.CodeableConcept)EntityRelatedness.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AssessmentMethod != null) dest.AssessmentMethod = (Hl7.Fhir.Model.CodeableConcept)AssessmentMethod.DeepCopyInternal(); + if(EntityRelatedness != null) dest.EntityRelatedness = (Hl7.Fhir.Model.CodeableConcept)EntityRelatedness.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CausalityComponent()); + var instance = new CausalityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -525,7 +528,7 @@ public Hl7.Fhir.Model.DataType Item private Hl7.Fhir.Model.DataType _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContributingFactorComponent; @@ -534,14 +537,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContributingFactorComponent()); + var instance = new ContributingFactorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -620,7 +624,7 @@ public Hl7.Fhir.Model.DataType Item private Hl7.Fhir.Model.DataType _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PreventiveActionComponent; @@ -629,14 +633,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PreventiveActionComponent()); + var instance = new PreventiveActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -718,7 +723,7 @@ public Hl7.Fhir.Model.DataType Item private Hl7.Fhir.Model.DataType _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MitigatingActionComponent; @@ -727,14 +732,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MitigatingActionComponent()); + var instance = new MitigatingActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -813,7 +819,7 @@ public Hl7.Fhir.Model.DataType Item private Hl7.Fhir.Model.DataType _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportingInfoComponent; @@ -822,14 +828,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportingInfoComponent()); + var instance = new SupportingInfoComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1318,7 +1325,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdverseEvent; @@ -1327,37 +1334,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ActualityElement != null) dest.ActualityElement = (Code)ActualityElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(DetectedElement != null) dest.DetectedElement = (Hl7.Fhir.Model.FhirDateTime)DetectedElement.DeepCopy(); - if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopy(); - if(ResultingEffect.Any()) dest.ResultingEffect = new List(ResultingEffect.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Seriousness != null) dest.Seriousness = (Hl7.Fhir.Model.CodeableConcept)Seriousness.DeepCopy(); - if(Outcome.Any()) dest.Outcome = new List(Outcome.DeepCopy()); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Study.Any()) dest.Study = new List(Study.DeepCopy()); - if(ExpectedInResearchStudyElement != null) dest.ExpectedInResearchStudyElement = (Hl7.Fhir.Model.FhirBoolean)ExpectedInResearchStudyElement.DeepCopy(); - if(SuspectEntity.Any()) dest.SuspectEntity = new List(SuspectEntity.DeepCopy()); - if(ContributingFactor.Any()) dest.ContributingFactor = new List(ContributingFactor.DeepCopy()); - if(PreventiveAction.Any()) dest.PreventiveAction = new List(PreventiveAction.DeepCopy()); - if(MitigatingAction.Any()) dest.MitigatingAction = new List(MitigatingAction.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ActualityElement != null) dest.ActualityElement = (Code)ActualityElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(DetectedElement != null) dest.DetectedElement = (Hl7.Fhir.Model.FhirDateTime)DetectedElement.DeepCopyInternal(); + if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopyInternal(); + if(ResultingEffect.Any()) dest.ResultingEffect = new List(ResultingEffect.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Seriousness != null) dest.Seriousness = (Hl7.Fhir.Model.CodeableConcept)Seriousness.DeepCopyInternal(); + if(Outcome.Any()) dest.Outcome = new List(Outcome.DeepCopyInternal()); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Study.Any()) dest.Study = new List(Study.DeepCopyInternal()); + if(ExpectedInResearchStudyElement != null) dest.ExpectedInResearchStudyElement = (Hl7.Fhir.Model.FhirBoolean)ExpectedInResearchStudyElement.DeepCopyInternal(); + if(SuspectEntity.Any()) dest.SuspectEntity = new List(SuspectEntity.DeepCopyInternal()); + if(ContributingFactor.Any()) dest.ContributingFactor = new List(ContributingFactor.DeepCopyInternal()); + if(PreventiveAction.Any()) dest.PreventiveAction = new List(PreventiveAction.DeepCopyInternal()); + if(MitigatingAction.Any()) dest.MitigatingAction = new List(MitigatingAction.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdverseEvent()); + var instance = new AdverseEvent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Age.cs b/src/Hl7.Fhir.R5/Model/Generated/Age.cs index f735c61e61..2bf3cda381 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Age.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Age.cs @@ -59,9 +59,11 @@ public partial class Age : Quantity /// public override string TypeName { get { return "Age"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Age()); + var instance = new Age(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.R5/Model/Generated/AllergyIntolerance.cs b/src/Hl7.Fhir.R5/Model/Generated/AllergyIntolerance.cs index a50458b07f..bcb76bc3ae 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/AllergyIntolerance.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/AllergyIntolerance.cs @@ -264,7 +264,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -273,15 +273,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -505,7 +506,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReactionComponent; @@ -514,20 +515,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopy(); - if(Manifestation.Any()) dest.Manifestation = new List(Manifestation.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(OnsetElement != null) dest.OnsetElement = (Hl7.Fhir.Model.FhirDateTime)OnsetElement.DeepCopy(); - if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopy(); - if(ExposureRoute != null) dest.ExposureRoute = (Hl7.Fhir.Model.CodeableConcept)ExposureRoute.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopyInternal(); + if(Manifestation.Any()) dest.Manifestation = new List(Manifestation.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(OnsetElement != null) dest.OnsetElement = (Hl7.Fhir.Model.FhirDateTime)OnsetElement.DeepCopyInternal(); + if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopyInternal(); + if(ExposureRoute != null) dest.ExposureRoute = (Hl7.Fhir.Model.CodeableConcept)ExposureRoute.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReactionComponent()); + var instance = new ReactionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -912,7 +914,7 @@ public List Reaction List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AllergyIntolerance; @@ -921,28 +923,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ClinicalStatus != null) dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopy(); - if(VerificationStatus != null) dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(CategoryElement.Any()) dest.CategoryElement = new List>(CategoryElement.DeepCopy()); - if(CriticalityElement != null) dest.CriticalityElement = (Code)CriticalityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy(); - if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(LastOccurrenceElement != null) dest.LastOccurrenceElement = (Hl7.Fhir.Model.FhirDateTime)LastOccurrenceElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ClinicalStatus != null) dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopyInternal(); + if(VerificationStatus != null) dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(CategoryElement.Any()) dest.CategoryElement = new List>(CategoryElement.DeepCopyInternal()); + if(CriticalityElement != null) dest.CriticalityElement = (Code)CriticalityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopyInternal(); + if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(LastOccurrenceElement != null) dest.LastOccurrenceElement = (Hl7.Fhir.Model.FhirDateTime)LastOccurrenceElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AllergyIntolerance()); + var instance = new AllergyIntolerance(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Annotation.cs b/src/Hl7.Fhir.R5/Model/Generated/Annotation.cs index cdb632d2ea..2a806d1b97 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Annotation.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Annotation.cs @@ -139,7 +139,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Annotation; @@ -148,16 +148,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Author != null) dest.Author = (Hl7.Fhir.Model.DataType)Author.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Author != null) dest.Author = (Hl7.Fhir.Model.DataType)Author.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Annotation()); + var instance = new Annotation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Appointment.cs b/src/Hl7.Fhir.R5/Model/Generated/Appointment.cs index b3965a49c9..042d1d198f 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Appointment.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Appointment.cs @@ -3148,7 +3148,7 @@ public Hl7.Fhir.Model.Appointment.ParticipationStatus? Status } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -3157,18 +3157,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3490,7 +3491,7 @@ public IEnumerable ExcludingRecurrenceId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RecurrenceTemplateComponent; @@ -3499,23 +3500,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Timezone != null) dest.Timezone = (Hl7.Fhir.Model.CodeableConcept)Timezone.DeepCopy(); - if(RecurrenceType != null) dest.RecurrenceType = (Hl7.Fhir.Model.CodeableConcept)RecurrenceType.DeepCopy(); - if(LastOccurrenceDateElement != null) dest.LastOccurrenceDateElement = (Hl7.Fhir.Model.Date)LastOccurrenceDateElement.DeepCopy(); - if(OccurrenceCountElement != null) dest.OccurrenceCountElement = (Hl7.Fhir.Model.PositiveInt)OccurrenceCountElement.DeepCopy(); - if(OccurrenceDateElement.Any()) dest.OccurrenceDateElement = new List(OccurrenceDateElement.DeepCopy()); - if(WeeklyTemplate != null) dest.WeeklyTemplate = (Hl7.Fhir.Model.Appointment.WeeklyTemplateComponent)WeeklyTemplate.DeepCopy(); - if(MonthlyTemplate != null) dest.MonthlyTemplate = (Hl7.Fhir.Model.Appointment.MonthlyTemplateComponent)MonthlyTemplate.DeepCopy(); - if(YearlyTemplate != null) dest.YearlyTemplate = (Hl7.Fhir.Model.Appointment.YearlyTemplateComponent)YearlyTemplate.DeepCopy(); - if(ExcludingDateElement.Any()) dest.ExcludingDateElement = new List(ExcludingDateElement.DeepCopy()); - if(ExcludingRecurrenceIdElement.Any()) dest.ExcludingRecurrenceIdElement = new List(ExcludingRecurrenceIdElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Timezone != null) dest.Timezone = (Hl7.Fhir.Model.CodeableConcept)Timezone.DeepCopyInternal(); + if(RecurrenceType != null) dest.RecurrenceType = (Hl7.Fhir.Model.CodeableConcept)RecurrenceType.DeepCopyInternal(); + if(LastOccurrenceDateElement != null) dest.LastOccurrenceDateElement = (Hl7.Fhir.Model.Date)LastOccurrenceDateElement.DeepCopyInternal(); + if(OccurrenceCountElement != null) dest.OccurrenceCountElement = (Hl7.Fhir.Model.PositiveInt)OccurrenceCountElement.DeepCopyInternal(); + if(OccurrenceDateElement.Any()) dest.OccurrenceDateElement = new List(OccurrenceDateElement.DeepCopyInternal()); + if(WeeklyTemplate != null) dest.WeeklyTemplate = (Hl7.Fhir.Model.Appointment.WeeklyTemplateComponent)WeeklyTemplate.DeepCopyInternal(); + if(MonthlyTemplate != null) dest.MonthlyTemplate = (Hl7.Fhir.Model.Appointment.MonthlyTemplateComponent)MonthlyTemplate.DeepCopyInternal(); + if(YearlyTemplate != null) dest.YearlyTemplate = (Hl7.Fhir.Model.Appointment.YearlyTemplateComponent)YearlyTemplate.DeepCopyInternal(); + if(ExcludingDateElement.Any()) dest.ExcludingDateElement = new List(ExcludingDateElement.DeepCopyInternal()); + if(ExcludingRecurrenceIdElement.Any()) dest.ExcludingRecurrenceIdElement = new List(ExcludingRecurrenceIdElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RecurrenceTemplateComponent()); + var instance = new RecurrenceTemplateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3896,7 +3898,7 @@ public int? WeekInterval } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as WeeklyTemplateComponent; @@ -3905,21 +3907,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MondayElement != null) dest.MondayElement = (Hl7.Fhir.Model.FhirBoolean)MondayElement.DeepCopy(); - if(TuesdayElement != null) dest.TuesdayElement = (Hl7.Fhir.Model.FhirBoolean)TuesdayElement.DeepCopy(); - if(WednesdayElement != null) dest.WednesdayElement = (Hl7.Fhir.Model.FhirBoolean)WednesdayElement.DeepCopy(); - if(ThursdayElement != null) dest.ThursdayElement = (Hl7.Fhir.Model.FhirBoolean)ThursdayElement.DeepCopy(); - if(FridayElement != null) dest.FridayElement = (Hl7.Fhir.Model.FhirBoolean)FridayElement.DeepCopy(); - if(SaturdayElement != null) dest.SaturdayElement = (Hl7.Fhir.Model.FhirBoolean)SaturdayElement.DeepCopy(); - if(SundayElement != null) dest.SundayElement = (Hl7.Fhir.Model.FhirBoolean)SundayElement.DeepCopy(); - if(WeekIntervalElement != null) dest.WeekIntervalElement = (Hl7.Fhir.Model.PositiveInt)WeekIntervalElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MondayElement != null) dest.MondayElement = (Hl7.Fhir.Model.FhirBoolean)MondayElement.DeepCopyInternal(); + if(TuesdayElement != null) dest.TuesdayElement = (Hl7.Fhir.Model.FhirBoolean)TuesdayElement.DeepCopyInternal(); + if(WednesdayElement != null) dest.WednesdayElement = (Hl7.Fhir.Model.FhirBoolean)WednesdayElement.DeepCopyInternal(); + if(ThursdayElement != null) dest.ThursdayElement = (Hl7.Fhir.Model.FhirBoolean)ThursdayElement.DeepCopyInternal(); + if(FridayElement != null) dest.FridayElement = (Hl7.Fhir.Model.FhirBoolean)FridayElement.DeepCopyInternal(); + if(SaturdayElement != null) dest.SaturdayElement = (Hl7.Fhir.Model.FhirBoolean)SaturdayElement.DeepCopyInternal(); + if(SundayElement != null) dest.SundayElement = (Hl7.Fhir.Model.FhirBoolean)SundayElement.DeepCopyInternal(); + if(WeekIntervalElement != null) dest.WeekIntervalElement = (Hl7.Fhir.Model.PositiveInt)WeekIntervalElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new WeeklyTemplateComponent()); + var instance = new WeeklyTemplateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4127,7 +4130,7 @@ public int? MonthInterval } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MonthlyTemplateComponent; @@ -4136,17 +4139,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DayOfMonthElement != null) dest.DayOfMonthElement = (Hl7.Fhir.Model.PositiveInt)DayOfMonthElement.DeepCopy(); - if(NthWeekOfMonth != null) dest.NthWeekOfMonth = (Hl7.Fhir.Model.Coding)NthWeekOfMonth.DeepCopy(); - if(DayOfWeek != null) dest.DayOfWeek = (Hl7.Fhir.Model.Coding)DayOfWeek.DeepCopy(); - if(MonthIntervalElement != null) dest.MonthIntervalElement = (Hl7.Fhir.Model.PositiveInt)MonthIntervalElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DayOfMonthElement != null) dest.DayOfMonthElement = (Hl7.Fhir.Model.PositiveInt)DayOfMonthElement.DeepCopyInternal(); + if(NthWeekOfMonth != null) dest.NthWeekOfMonth = (Hl7.Fhir.Model.Coding)NthWeekOfMonth.DeepCopyInternal(); + if(DayOfWeek != null) dest.DayOfWeek = (Hl7.Fhir.Model.Coding)DayOfWeek.DeepCopyInternal(); + if(MonthIntervalElement != null) dest.MonthIntervalElement = (Hl7.Fhir.Model.PositiveInt)MonthIntervalElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MonthlyTemplateComponent()); + var instance = new MonthlyTemplateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4263,7 +4267,7 @@ public int? YearInterval } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as YearlyTemplateComponent; @@ -4272,14 +4276,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(YearIntervalElement != null) dest.YearIntervalElement = (Hl7.Fhir.Model.PositiveInt)YearIntervalElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(YearIntervalElement != null) dest.YearIntervalElement = (Hl7.Fhir.Model.PositiveInt)YearIntervalElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new YearlyTemplateComponent()); + var instance = new YearlyTemplateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4951,7 +4956,7 @@ public List RecurrenceTe List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Appointment; @@ -4960,45 +4965,46 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CancellationReason != null) dest.CancellationReason = (Hl7.Fhir.Model.CodeableConcept)CancellationReason.DeepCopy(); - if(Class.Any()) dest.Class = new List(Class.DeepCopy()); - if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopy()); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(VirtualService.Any()) dest.VirtualService = new List(VirtualService.DeepCopy()); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(PreviousAppointment != null) dest.PreviousAppointment = (Hl7.Fhir.Model.ResourceReference)PreviousAppointment.DeepCopy(); - if(OriginatingAppointment != null) dest.OriginatingAppointment = (Hl7.Fhir.Model.ResourceReference)OriginatingAppointment.DeepCopy(); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(MinutesDurationElement != null) dest.MinutesDurationElement = (Hl7.Fhir.Model.PositiveInt)MinutesDurationElement.DeepCopy(); - if(RequestedPeriod.Any()) dest.RequestedPeriod = new List(RequestedPeriod.DeepCopy()); - if(Slot.Any()) dest.Slot = new List(Slot.DeepCopy()); - if(Account.Any()) dest.Account = new List(Account.DeepCopy()); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(CancellationDateElement != null) dest.CancellationDateElement = (Hl7.Fhir.Model.FhirDateTime)CancellationDateElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(PatientInstruction.Any()) dest.PatientInstruction = new List(PatientInstruction.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(RecurrenceIdElement != null) dest.RecurrenceIdElement = (Hl7.Fhir.Model.PositiveInt)RecurrenceIdElement.DeepCopy(); - if(OccurrenceChangedElement != null) dest.OccurrenceChangedElement = (Hl7.Fhir.Model.FhirBoolean)OccurrenceChangedElement.DeepCopy(); - if(RecurrenceTemplate.Any()) dest.RecurrenceTemplate = new List(RecurrenceTemplate.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CancellationReason != null) dest.CancellationReason = (Hl7.Fhir.Model.CodeableConcept)CancellationReason.DeepCopyInternal(); + if(Class.Any()) dest.Class = new List(Class.DeepCopyInternal()); + if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopyInternal()); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(VirtualService.Any()) dest.VirtualService = new List(VirtualService.DeepCopyInternal()); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(PreviousAppointment != null) dest.PreviousAppointment = (Hl7.Fhir.Model.ResourceReference)PreviousAppointment.DeepCopyInternal(); + if(OriginatingAppointment != null) dest.OriginatingAppointment = (Hl7.Fhir.Model.ResourceReference)OriginatingAppointment.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(MinutesDurationElement != null) dest.MinutesDurationElement = (Hl7.Fhir.Model.PositiveInt)MinutesDurationElement.DeepCopyInternal(); + if(RequestedPeriod.Any()) dest.RequestedPeriod = new List(RequestedPeriod.DeepCopyInternal()); + if(Slot.Any()) dest.Slot = new List(Slot.DeepCopyInternal()); + if(Account.Any()) dest.Account = new List(Account.DeepCopyInternal()); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(CancellationDateElement != null) dest.CancellationDateElement = (Hl7.Fhir.Model.FhirDateTime)CancellationDateElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(PatientInstruction.Any()) dest.PatientInstruction = new List(PatientInstruction.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(RecurrenceIdElement != null) dest.RecurrenceIdElement = (Hl7.Fhir.Model.PositiveInt)RecurrenceIdElement.DeepCopyInternal(); + if(OccurrenceChangedElement != null) dest.OccurrenceChangedElement = (Hl7.Fhir.Model.FhirBoolean)OccurrenceChangedElement.DeepCopyInternal(); + if(RecurrenceTemplate.Any()) dest.RecurrenceTemplate = new List(RecurrenceTemplate.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Appointment()); + var instance = new Appointment(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/AppointmentResponse.cs b/src/Hl7.Fhir.R5/Model/Generated/AppointmentResponse.cs index 169c2362ca..a39061f9fa 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/AppointmentResponse.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/AppointmentResponse.cs @@ -409,7 +409,7 @@ public int? RecurrenceId List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AppointmentResponse; @@ -418,25 +418,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Appointment != null) dest.Appointment = (Hl7.Fhir.Model.ResourceReference)Appointment.DeepCopy(); - if(ProposedNewTimeElement != null) dest.ProposedNewTimeElement = (Hl7.Fhir.Model.FhirBoolean)ProposedNewTimeElement.DeepCopy(); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(ParticipantType.Any()) dest.ParticipantType = new List(ParticipantType.DeepCopy()); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(ParticipantStatusElement != null) dest.ParticipantStatusElement = (Code)ParticipantStatusElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopy(); - if(RecurringElement != null) dest.RecurringElement = (Hl7.Fhir.Model.FhirBoolean)RecurringElement.DeepCopy(); - if(OccurrenceDateElement != null) dest.OccurrenceDateElement = (Hl7.Fhir.Model.Date)OccurrenceDateElement.DeepCopy(); - if(RecurrenceIdElement != null) dest.RecurrenceIdElement = (Hl7.Fhir.Model.PositiveInt)RecurrenceIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Appointment != null) dest.Appointment = (Hl7.Fhir.Model.ResourceReference)Appointment.DeepCopyInternal(); + if(ProposedNewTimeElement != null) dest.ProposedNewTimeElement = (Hl7.Fhir.Model.FhirBoolean)ProposedNewTimeElement.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(ParticipantType.Any()) dest.ParticipantType = new List(ParticipantType.DeepCopyInternal()); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(ParticipantStatusElement != null) dest.ParticipantStatusElement = (Code)ParticipantStatusElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopyInternal(); + if(RecurringElement != null) dest.RecurringElement = (Hl7.Fhir.Model.FhirBoolean)RecurringElement.DeepCopyInternal(); + if(OccurrenceDateElement != null) dest.OccurrenceDateElement = (Hl7.Fhir.Model.Date)OccurrenceDateElement.DeepCopyInternal(); + if(RecurrenceIdElement != null) dest.RecurrenceIdElement = (Hl7.Fhir.Model.PositiveInt)RecurrenceIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AppointmentResponse()); + var instance = new AppointmentResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ArtifactAssessment.cs b/src/Hl7.Fhir.R5/Model/Generated/ArtifactAssessment.cs index 2b83687413..e0c03c5b26 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ArtifactAssessment.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ArtifactAssessment.cs @@ -443,7 +443,7 @@ public List Component private List _Component; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContentComponent; @@ -452,23 +452,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(InformationTypeElement != null) dest.InformationTypeElement = (Code)InformationTypeElement.DeepCopy(); - if(SummaryElement != null) dest.SummaryElement = (Hl7.Fhir.Model.Markdown)SummaryElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(PathElement.Any()) dest.PathElement = new List(PathElement.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(FreeToShareElement != null) dest.FreeToShareElement = (Hl7.Fhir.Model.FhirBoolean)FreeToShareElement.DeepCopy(); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(InformationTypeElement != null) dest.InformationTypeElement = (Code)InformationTypeElement.DeepCopyInternal(); + if(SummaryElement != null) dest.SummaryElement = (Hl7.Fhir.Model.Markdown)SummaryElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(PathElement.Any()) dest.PathElement = new List(PathElement.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(FreeToShareElement != null) dest.FreeToShareElement = (Hl7.Fhir.Model.FhirBoolean)FreeToShareElement.DeepCopyInternal(); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContentComponent()); + var instance = new ContentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -872,7 +873,7 @@ public Hl7.Fhir.Model.ArtifactAssessment.ArtifactAssessmentDisposition? Disposit List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ArtifactAssessment; @@ -881,24 +882,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(CiteAs != null) dest.CiteAs = (Hl7.Fhir.Model.DataType)CiteAs.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(Artifact != null) dest.Artifact = (Hl7.Fhir.Model.DataType)Artifact.DeepCopy(); - if(Content.Any()) dest.Content = new List(Content.DeepCopy()); - if(WorkflowStatusElement != null) dest.WorkflowStatusElement = (Code)WorkflowStatusElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Code)DispositionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(CiteAs != null) dest.CiteAs = (Hl7.Fhir.Model.DataType)CiteAs.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(Artifact != null) dest.Artifact = (Hl7.Fhir.Model.DataType)Artifact.DeepCopyInternal(); + if(Content.Any()) dest.Content = new List(Content.DeepCopyInternal()); + if(WorkflowStatusElement != null) dest.WorkflowStatusElement = (Code)WorkflowStatusElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Code)DispositionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ArtifactAssessment()); + var instance = new ArtifactAssessment(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/AuditEvent.cs b/src/Hl7.Fhir.R5/Model/Generated/AuditEvent.cs index c517e697ac..b73056b251 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/AuditEvent.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/AuditEvent.cs @@ -205,7 +205,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OutcomeComponent; @@ -214,15 +214,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.Coding)Code.DeepCopy(); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.Coding)Code.DeepCopyInternal(); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OutcomeComponent()); + var instance = new OutcomeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -451,7 +452,7 @@ public List Authorization private List _Authorization; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AgentComponent; @@ -460,21 +461,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Role.Any()) dest.Role = new List(Role.DeepCopy()); - if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopy(); - if(RequestorElement != null) dest.RequestorElement = (Hl7.Fhir.Model.FhirBoolean)RequestorElement.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopy()); - if(Network != null) dest.Network = (Hl7.Fhir.Model.DataType)Network.DeepCopy(); - if(Authorization.Any()) dest.Authorization = new List(Authorization.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Role.Any()) dest.Role = new List(Role.DeepCopyInternal()); + if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopyInternal(); + if(RequestorElement != null) dest.RequestorElement = (Hl7.Fhir.Model.FhirBoolean)RequestorElement.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopyInternal()); + if(Network != null) dest.Network = (Hl7.Fhir.Model.DataType)Network.DeepCopyInternal(); + if(Authorization.Any()) dest.Authorization = new List(Authorization.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AgentComponent()); + var instance = new AgentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -641,7 +643,7 @@ public List Type private List _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceComponent; @@ -650,16 +652,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Site != null) dest.Site = (Hl7.Fhir.Model.ResourceReference)Site.DeepCopy(); - if(Observer != null) dest.Observer = (Hl7.Fhir.Model.ResourceReference)Observer.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Site != null) dest.Site = (Hl7.Fhir.Model.ResourceReference)Site.DeepCopyInternal(); + if(Observer != null) dest.Observer = (Hl7.Fhir.Model.ResourceReference)Observer.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceComponent()); + var instance = new SourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -843,7 +846,7 @@ public List Agent private List _Agent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EntityComponent; @@ -852,19 +855,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(What != null) dest.What = (Hl7.Fhir.Model.ResourceReference)What.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(QueryElement != null) dest.QueryElement = (Hl7.Fhir.Model.Base64Binary)QueryElement.DeepCopy(); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(What != null) dest.What = (Hl7.Fhir.Model.ResourceReference)What.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(QueryElement != null) dest.QueryElement = (Hl7.Fhir.Model.Base64Binary)QueryElement.DeepCopyInternal(); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EntityComponent()); + var instance = new EntityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -999,7 +1003,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -1008,15 +1012,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1331,7 +1336,7 @@ public List Entity private List _Entity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AuditEvent; @@ -1340,27 +1345,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(ActionElement != null) dest.ActionElement = (Code)ActionElement.DeepCopy(); - if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopy(); - if(Occurred != null) dest.Occurred = (Hl7.Fhir.Model.DataType)Occurred.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.AuditEvent.OutcomeComponent)Outcome.DeepCopy(); - if(Authorization.Any()) dest.Authorization = new List(Authorization.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - if(Source != null) dest.Source = (Hl7.Fhir.Model.AuditEvent.SourceComponent)Source.DeepCopy(); - if(Entity.Any()) dest.Entity = new List(Entity.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(ActionElement != null) dest.ActionElement = (Code)ActionElement.DeepCopyInternal(); + if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopyInternal(); + if(Occurred != null) dest.Occurred = (Hl7.Fhir.Model.DataType)Occurred.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.AuditEvent.OutcomeComponent)Outcome.DeepCopyInternal(); + if(Authorization.Any()) dest.Authorization = new List(Authorization.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); + if(Source != null) dest.Source = (Hl7.Fhir.Model.AuditEvent.SourceComponent)Source.DeepCopyInternal(); + if(Entity.Any()) dest.Entity = new List(Entity.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AuditEvent()); + var instance = new AuditEvent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Availability.cs b/src/Hl7.Fhir.R5/Model/Generated/Availability.cs index bdf0afe866..20eaaa3a6e 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Availability.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Availability.cs @@ -196,7 +196,7 @@ public string AvailableEndTime } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AvailableTimeComponent; @@ -205,17 +205,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopy()); - if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopy(); - if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopy(); - if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopyInternal()); + if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopyInternal(); + if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopyInternal(); + if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AvailableTimeComponent()); + var instance = new AvailableTimeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -344,7 +345,7 @@ public Hl7.Fhir.Model.Period During private Hl7.Fhir.Model.Period _During; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotAvailableTimeComponent; @@ -353,15 +354,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotAvailableTimeComponent()); + var instance = new NotAvailableTimeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -445,7 +447,7 @@ public List NotAvailableT private List _NotAvailableTime; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Availability; @@ -454,15 +456,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopy()); - if(NotAvailableTime.Any()) dest.NotAvailableTime = new List(NotAvailableTime.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopyInternal()); + if(NotAvailableTime.Any()) dest.NotAvailableTime = new List(NotAvailableTime.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Availability()); + var instance = new Availability(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Basic.cs b/src/Hl7.Fhir.R5/Model/Generated/Basic.cs index 07fbb76f78..9f34274c09 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Basic.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Basic.cs @@ -151,7 +151,7 @@ public Hl7.Fhir.Model.ResourceReference Author List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Basic; @@ -160,18 +160,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Basic()); + var instance = new Basic(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/BiologicallyDerivedProduct.cs b/src/Hl7.Fhir.R5/Model/Generated/BiologicallyDerivedProduct.cs index 69606c0fc6..eeb4266eba 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/BiologicallyDerivedProduct.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/BiologicallyDerivedProduct.cs @@ -119,7 +119,7 @@ public Hl7.Fhir.Model.DataType Collected private Hl7.Fhir.Model.DataType _Collected; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CollectionComponent; @@ -128,16 +128,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CollectionComponent()); + var instance = new CollectionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -248,7 +249,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -257,15 +258,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -542,7 +544,7 @@ public List Propert List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BiologicallyDerivedProduct; @@ -551,26 +553,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ProductCategory != null) dest.ProductCategory = (Hl7.Fhir.Model.Coding)ProductCategory.DeepCopy(); - if(ProductCode != null) dest.ProductCode = (Hl7.Fhir.Model.CodeableConcept)ProductCode.DeepCopy(); - if(Parent.Any()) dest.Parent = new List(Parent.DeepCopy()); - if(Request.Any()) dest.Request = new List(Request.DeepCopy()); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BiologicalSourceEvent != null) dest.BiologicalSourceEvent = (Hl7.Fhir.Model.Identifier)BiologicalSourceEvent.DeepCopy(); - if(ProcessingFacility.Any()) dest.ProcessingFacility = new List(ProcessingFacility.DeepCopy()); - if(DivisionElement != null) dest.DivisionElement = (Hl7.Fhir.Model.FhirString)DivisionElement.DeepCopy(); - if(ProductStatus != null) dest.ProductStatus = (Hl7.Fhir.Model.Coding)ProductStatus.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopy(); - if(Collection != null) dest.Collection = (Hl7.Fhir.Model.BiologicallyDerivedProduct.CollectionComponent)Collection.DeepCopy(); - if(StorageTempRequirements != null) dest.StorageTempRequirements = (Hl7.Fhir.Model.Range)StorageTempRequirements.DeepCopy(); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ProductCategory != null) dest.ProductCategory = (Hl7.Fhir.Model.Coding)ProductCategory.DeepCopyInternal(); + if(ProductCode != null) dest.ProductCode = (Hl7.Fhir.Model.CodeableConcept)ProductCode.DeepCopyInternal(); + if(Parent.Any()) dest.Parent = new List(Parent.DeepCopyInternal()); + if(Request.Any()) dest.Request = new List(Request.DeepCopyInternal()); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BiologicalSourceEvent != null) dest.BiologicalSourceEvent = (Hl7.Fhir.Model.Identifier)BiologicalSourceEvent.DeepCopyInternal(); + if(ProcessingFacility.Any()) dest.ProcessingFacility = new List(ProcessingFacility.DeepCopyInternal()); + if(DivisionElement != null) dest.DivisionElement = (Hl7.Fhir.Model.FhirString)DivisionElement.DeepCopyInternal(); + if(ProductStatus != null) dest.ProductStatus = (Hl7.Fhir.Model.Coding)ProductStatus.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopyInternal(); + if(Collection != null) dest.Collection = (Hl7.Fhir.Model.BiologicallyDerivedProduct.CollectionComponent)Collection.DeepCopyInternal(); + if(StorageTempRequirements != null) dest.StorageTempRequirements = (Hl7.Fhir.Model.Range)StorageTempRequirements.DeepCopyInternal(); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BiologicallyDerivedProduct()); + var instance = new BiologicallyDerivedProduct(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/BiologicallyDerivedProductDispense.cs b/src/Hl7.Fhir.R5/Model/Generated/BiologicallyDerivedProductDispense.cs index 1a01909f7a..19098998de 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/BiologicallyDerivedProductDispense.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/BiologicallyDerivedProductDispense.cs @@ -160,7 +160,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -169,15 +169,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -539,7 +540,7 @@ public string UsageInstruction List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BiologicallyDerivedProductDispense; @@ -548,29 +549,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(OriginRelationshipType != null) dest.OriginRelationshipType = (Hl7.Fhir.Model.CodeableConcept)OriginRelationshipType.DeepCopy(); - if(Product != null) dest.Product = (Hl7.Fhir.Model.ResourceReference)Product.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(MatchStatus != null) dest.MatchStatus = (Hl7.Fhir.Model.CodeableConcept)MatchStatus.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(PreparedDateElement != null) dest.PreparedDateElement = (Hl7.Fhir.Model.FhirDateTime)PreparedDateElement.DeepCopy(); - if(WhenHandedOverElement != null) dest.WhenHandedOverElement = (Hl7.Fhir.Model.FhirDateTime)WhenHandedOverElement.DeepCopy(); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(UsageInstructionElement != null) dest.UsageInstructionElement = (Hl7.Fhir.Model.FhirString)UsageInstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(OriginRelationshipType != null) dest.OriginRelationshipType = (Hl7.Fhir.Model.CodeableConcept)OriginRelationshipType.DeepCopyInternal(); + if(Product != null) dest.Product = (Hl7.Fhir.Model.ResourceReference)Product.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(MatchStatus != null) dest.MatchStatus = (Hl7.Fhir.Model.CodeableConcept)MatchStatus.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(PreparedDateElement != null) dest.PreparedDateElement = (Hl7.Fhir.Model.FhirDateTime)PreparedDateElement.DeepCopyInternal(); + if(WhenHandedOverElement != null) dest.WhenHandedOverElement = (Hl7.Fhir.Model.FhirDateTime)WhenHandedOverElement.DeepCopyInternal(); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(UsageInstructionElement != null) dest.UsageInstructionElement = (Hl7.Fhir.Model.FhirString)UsageInstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BiologicallyDerivedProductDispense()); + var instance = new BiologicallyDerivedProductDispense(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/BodyStructure.cs b/src/Hl7.Fhir.R5/Model/Generated/BodyStructure.cs index 448da360d2..c0fadfa8a9 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/BodyStructure.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/BodyStructure.cs @@ -149,7 +149,7 @@ public List Qualifier private List _Qualifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IncludedStructureComponent; @@ -158,18 +158,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Structure != null) dest.Structure = (Hl7.Fhir.Model.CodeableConcept)Structure.DeepCopy(); - if(Laterality != null) dest.Laterality = (Hl7.Fhir.Model.CodeableConcept)Laterality.DeepCopy(); - if(BodyLandmarkOrientation.Any()) dest.BodyLandmarkOrientation = new List(BodyLandmarkOrientation.DeepCopy()); - if(SpatialReference.Any()) dest.SpatialReference = new List(SpatialReference.DeepCopy()); - if(Qualifier.Any()) dest.Qualifier = new List(Qualifier.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Structure != null) dest.Structure = (Hl7.Fhir.Model.CodeableConcept)Structure.DeepCopyInternal(); + if(Laterality != null) dest.Laterality = (Hl7.Fhir.Model.CodeableConcept)Laterality.DeepCopyInternal(); + if(BodyLandmarkOrientation.Any()) dest.BodyLandmarkOrientation = new List(BodyLandmarkOrientation.DeepCopyInternal()); + if(SpatialReference.Any()) dest.SpatialReference = new List(SpatialReference.DeepCopyInternal()); + if(Qualifier.Any()) dest.Qualifier = new List(Qualifier.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IncludedStructureComponent()); + var instance = new IncludedStructureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -324,7 +325,7 @@ public List SurfaceOrientation private List _SurfaceOrientation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BodyLandmarkOrientationComponent; @@ -333,17 +334,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LandmarkDescription.Any()) dest.LandmarkDescription = new List(LandmarkDescription.DeepCopy()); - if(ClockFacePosition.Any()) dest.ClockFacePosition = new List(ClockFacePosition.DeepCopy()); - if(DistanceFromLandmark.Any()) dest.DistanceFromLandmark = new List(DistanceFromLandmark.DeepCopy()); - if(SurfaceOrientation.Any()) dest.SurfaceOrientation = new List(SurfaceOrientation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LandmarkDescription.Any()) dest.LandmarkDescription = new List(LandmarkDescription.DeepCopyInternal()); + if(ClockFacePosition.Any()) dest.ClockFacePosition = new List(ClockFacePosition.DeepCopyInternal()); + if(DistanceFromLandmark.Any()) dest.DistanceFromLandmark = new List(DistanceFromLandmark.DeepCopyInternal()); + if(SurfaceOrientation.Any()) dest.SurfaceOrientation = new List(SurfaceOrientation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BodyLandmarkOrientationComponent()); + var instance = new BodyLandmarkOrientationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -460,7 +462,7 @@ public List Value private List _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DistanceFromLandmarkComponent; @@ -469,15 +471,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Device.Any()) dest.Device = new List(Device.DeepCopy()); - if(Value.Any()) dest.Value = new List(Value.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Device.Any()) dest.Device = new List(Device.DeepCopyInternal()); + if(Value.Any()) dest.Value = new List(Value.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DistanceFromLandmarkComponent()); + var instance = new DistanceFromLandmarkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -683,7 +686,7 @@ public Hl7.Fhir.Model.ResourceReference Patient List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BodyStructure; @@ -692,21 +695,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Morphology != null) dest.Morphology = (Hl7.Fhir.Model.CodeableConcept)Morphology.DeepCopy(); - if(IncludedStructure.Any()) dest.IncludedStructure = new List(IncludedStructure.DeepCopy()); - if(ExcludedStructure.Any()) dest.ExcludedStructure = new List(ExcludedStructure.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Image.Any()) dest.Image = new List(Image.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Morphology != null) dest.Morphology = (Hl7.Fhir.Model.CodeableConcept)Morphology.DeepCopyInternal(); + if(IncludedStructure.Any()) dest.IncludedStructure = new List(IncludedStructure.DeepCopyInternal()); + if(ExcludedStructure.Any()) dest.ExcludedStructure = new List(ExcludedStructure.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Image.Any()) dest.Image = new List(Image.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BodyStructure()); + var instance = new BodyStructure(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/CarePlan.cs b/src/Hl7.Fhir.R5/Model/Generated/CarePlan.cs index 2e786f1b12..488bf738b8 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/CarePlan.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/CarePlan.cs @@ -159,7 +159,7 @@ public Hl7.Fhir.Model.ResourceReference PlannedActivityReference private Hl7.Fhir.Model.ResourceReference _PlannedActivityReference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActivityComponent; @@ -168,16 +168,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PerformedActivity.Any()) dest.PerformedActivity = new List(PerformedActivity.DeepCopy()); - if(Progress.Any()) dest.Progress = new List(Progress.DeepCopy()); - if(PlannedActivityReference != null) dest.PlannedActivityReference = (Hl7.Fhir.Model.ResourceReference)PlannedActivityReference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PerformedActivity.Any()) dest.PerformedActivity = new List(PerformedActivity.DeepCopyInternal()); + if(Progress.Any()) dest.Progress = new List(Progress.DeepCopyInternal()); + if(PlannedActivityReference != null) dest.PlannedActivityReference = (Hl7.Fhir.Model.ResourceReference)PlannedActivityReference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActivityComponent()); + var instance = new ActivityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -711,7 +712,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CarePlan; @@ -720,36 +721,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy(); - if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopy()); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Goal.Any()) dest.Goal = new List(Goal.DeepCopy()); - if(Activity.Any()) dest.Activity = new List(Activity.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new CarePlan()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopyInternal(); + if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopyInternal()); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Goal.Any()) dest.Goal = new List(Goal.DeepCopyInternal()); + if(Activity.Any()) dest.Activity = new List(Activity.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new CarePlan(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/CareTeam.cs b/src/Hl7.Fhir.R5/Model/Generated/CareTeam.cs index 48b8f3f2f5..2dc0056cd2 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/CareTeam.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/CareTeam.cs @@ -174,7 +174,7 @@ public Hl7.Fhir.Model.DataType Coverage private Hl7.Fhir.Model.DataType _Coverage; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -183,17 +183,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Member != null) dest.Member = (Hl7.Fhir.Model.ResourceReference)Member.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.DataType)Coverage.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Member != null) dest.Member = (Hl7.Fhir.Model.ResourceReference)Member.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.DataType)Coverage.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -461,7 +462,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CareTeam; @@ -470,24 +471,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(ManagingOrganization.Any()) dest.ManagingOrganization = new List(ManagingOrganization.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(ManagingOrganization.Any()) dest.ManagingOrganization = new List(ManagingOrganization.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CareTeam()); + var instance = new CareTeam(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ChargeItem.cs b/src/Hl7.Fhir.R5/Model/Generated/ChargeItem.cs index 3c29ceafb8..cab0fff35b 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ChargeItem.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ChargeItem.cs @@ -157,7 +157,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -166,15 +166,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -684,7 +685,7 @@ public List SupportingInformation List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ChargeItem; @@ -693,39 +694,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(DefinitionUriElement.Any()) dest.DefinitionUriElement = new List(DefinitionUriElement.DeepCopy()); - if(DefinitionCanonicalElement.Any()) dest.DefinitionCanonicalElement = new List(DefinitionCanonicalElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(PerformingOrganization != null) dest.PerformingOrganization = (Hl7.Fhir.Model.ResourceReference)PerformingOrganization.DeepCopy(); - if(RequestingOrganization != null) dest.RequestingOrganization = (Hl7.Fhir.Model.ResourceReference)RequestingOrganization.DeepCopy(); - if(CostCenter != null) dest.CostCenter = (Hl7.Fhir.Model.ResourceReference)CostCenter.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Bodysite.Any()) dest.Bodysite = new List(Bodysite.DeepCopy()); - if(UnitPriceComponent != null) dest.UnitPriceComponent = (Hl7.Fhir.Model.MonetaryComponent)UnitPriceComponent.DeepCopy(); - if(TotalPriceComponent != null) dest.TotalPriceComponent = (Hl7.Fhir.Model.MonetaryComponent)TotalPriceComponent.DeepCopy(); - if(OverrideReason != null) dest.OverrideReason = (Hl7.Fhir.Model.CodeableConcept)OverrideReason.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(EnteredDateElement != null) dest.EnteredDateElement = (Hl7.Fhir.Model.FhirDateTime)EnteredDateElement.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Service.Any()) dest.Service = new List(Service.DeepCopy()); - if(Product.Any()) dest.Product = new List(Product.DeepCopy()); - if(Account.Any()) dest.Account = new List(Account.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ChargeItem()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(DefinitionUriElement.Any()) dest.DefinitionUriElement = new List(DefinitionUriElement.DeepCopyInternal()); + if(DefinitionCanonicalElement.Any()) dest.DefinitionCanonicalElement = new List(DefinitionCanonicalElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(PerformingOrganization != null) dest.PerformingOrganization = (Hl7.Fhir.Model.ResourceReference)PerformingOrganization.DeepCopyInternal(); + if(RequestingOrganization != null) dest.RequestingOrganization = (Hl7.Fhir.Model.ResourceReference)RequestingOrganization.DeepCopyInternal(); + if(CostCenter != null) dest.CostCenter = (Hl7.Fhir.Model.ResourceReference)CostCenter.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Bodysite.Any()) dest.Bodysite = new List(Bodysite.DeepCopyInternal()); + if(UnitPriceComponent != null) dest.UnitPriceComponent = (Hl7.Fhir.Model.MonetaryComponent)UnitPriceComponent.DeepCopyInternal(); + if(TotalPriceComponent != null) dest.TotalPriceComponent = (Hl7.Fhir.Model.MonetaryComponent)TotalPriceComponent.DeepCopyInternal(); + if(OverrideReason != null) dest.OverrideReason = (Hl7.Fhir.Model.CodeableConcept)OverrideReason.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(EnteredDateElement != null) dest.EnteredDateElement = (Hl7.Fhir.Model.FhirDateTime)EnteredDateElement.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Service.Any()) dest.Service = new List(Service.DeepCopyInternal()); + if(Product.Any()) dest.Product = new List(Product.DeepCopyInternal()); + if(Account.Any()) dest.Account = new List(Account.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ChargeItem(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ChargeItemDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/ChargeItemDefinition.cs index 0a6200c79b..89ba4b8a32 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ChargeItemDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ChargeItemDefinition.cs @@ -115,7 +115,7 @@ public Hl7.Fhir.Model.RelatedArtifact RelatedArtifact private Hl7.Fhir.Model.RelatedArtifact _RelatedArtifact; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ApplicabilityComponent; @@ -124,16 +124,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.Expression)Condition.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(RelatedArtifact != null) dest.RelatedArtifact = (Hl7.Fhir.Model.RelatedArtifact)RelatedArtifact.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.Expression)Condition.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(RelatedArtifact != null) dest.RelatedArtifact = (Hl7.Fhir.Model.RelatedArtifact)RelatedArtifact.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ApplicabilityComponent()); + var instance = new ApplicabilityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -241,7 +242,7 @@ public List PriceComponent private List _PriceComponent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyGroupComponent; @@ -250,15 +251,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Applicability.Any()) dest.Applicability = new List(Applicability.DeepCopy()); - if(PriceComponent.Any()) dest.PriceComponent = new List(PriceComponent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Applicability.Any()) dest.Applicability = new List(Applicability.DeepCopyInternal()); + if(PriceComponent.Any()) dest.PriceComponent = new List(PriceComponent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyGroupComponent()); + var instance = new PropertyGroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -979,7 +981,7 @@ public List Property List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ChargeItemDefinition; @@ -988,39 +990,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DerivedFromUriElement.Any()) dest.DerivedFromUriElement = new List(DerivedFromUriElement.DeepCopy()); - if(PartOfElement.Any()) dest.PartOfElement = new List(PartOfElement.DeepCopy()); - if(ReplacesElement.Any()) dest.ReplacesElement = new List(ReplacesElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - if(Applicability.Any()) dest.Applicability = new List(Applicability.DeepCopy()); - if(PropertyGroup.Any()) dest.PropertyGroup = new List(PropertyGroup.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DerivedFromUriElement.Any()) dest.DerivedFromUriElement = new List(DerivedFromUriElement.DeepCopyInternal()); + if(PartOfElement.Any()) dest.PartOfElement = new List(PartOfElement.DeepCopyInternal()); + if(ReplacesElement.Any()) dest.ReplacesElement = new List(ReplacesElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); + if(Applicability.Any()) dest.Applicability = new List(Applicability.DeepCopyInternal()); + if(PropertyGroup.Any()) dest.PropertyGroup = new List(PropertyGroup.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ChargeItemDefinition()); + var instance = new ChargeItemDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Citation.cs b/src/Hl7.Fhir.R5/Model/Generated/Citation.cs index 950f706484..076b3614a9 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Citation.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Citation.cs @@ -356,7 +356,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SummaryComponent; @@ -365,15 +365,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Style != null) dest.Style = (Hl7.Fhir.Model.CodeableConcept)Style.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Style != null) dest.Style = (Hl7.Fhir.Model.CodeableConcept)Style.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SummaryComponent()); + var instance = new SummaryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -474,7 +475,7 @@ public List Classifier private List _Classifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClassificationComponent; @@ -483,15 +484,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClassificationComponent()); + var instance = new ClassificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -624,7 +626,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StatusDateComponent; @@ -633,16 +635,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopy(); - if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopyInternal(); + if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StatusDateComponent()); + var instance = new StatusDateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -944,7 +947,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactComponent; @@ -953,28 +956,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(RelatedIdentifier.Any()) dest.RelatedIdentifier = new List(RelatedIdentifier.DeepCopy()); - if(DateAccessedElement != null) dest.DateAccessedElement = (Hl7.Fhir.Model.FhirDateTime)DateAccessedElement.DeepCopy(); - if(Version != null) dest.Version = (Hl7.Fhir.Model.Citation.CitedArtifactVersionComponent)Version.DeepCopy(); - if(CurrentState.Any()) dest.CurrentState = new List(CurrentState.DeepCopy()); - if(StatusDate.Any()) dest.StatusDate = new List(StatusDate.DeepCopy()); - if(Title.Any()) dest.Title = new List(Title.DeepCopy()); - if(Abstract.Any()) dest.Abstract = new List(Abstract.DeepCopy()); - if(Part != null) dest.Part = (Hl7.Fhir.Model.Citation.CitedArtifactPartComponent)Part.DeepCopy(); - if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopy()); - if(PublicationForm.Any()) dest.PublicationForm = new List(PublicationForm.DeepCopy()); - if(WebLocation.Any()) dest.WebLocation = new List(WebLocation.DeepCopy()); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - if(Contributorship != null) dest.Contributorship = (Hl7.Fhir.Model.Citation.CitedArtifactContributorshipComponent)Contributorship.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(RelatedIdentifier.Any()) dest.RelatedIdentifier = new List(RelatedIdentifier.DeepCopyInternal()); + if(DateAccessedElement != null) dest.DateAccessedElement = (Hl7.Fhir.Model.FhirDateTime)DateAccessedElement.DeepCopyInternal(); + if(Version != null) dest.Version = (Hl7.Fhir.Model.Citation.CitedArtifactVersionComponent)Version.DeepCopyInternal(); + if(CurrentState.Any()) dest.CurrentState = new List(CurrentState.DeepCopyInternal()); + if(StatusDate.Any()) dest.StatusDate = new List(StatusDate.DeepCopyInternal()); + if(Title.Any()) dest.Title = new List(Title.DeepCopyInternal()); + if(Abstract.Any()) dest.Abstract = new List(Abstract.DeepCopyInternal()); + if(Part != null) dest.Part = (Hl7.Fhir.Model.Citation.CitedArtifactPartComponent)Part.DeepCopyInternal(); + if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopyInternal()); + if(PublicationForm.Any()) dest.PublicationForm = new List(PublicationForm.DeepCopyInternal()); + if(WebLocation.Any()) dest.WebLocation = new List(WebLocation.DeepCopyInternal()); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); + if(Contributorship != null) dest.Contributorship = (Hl7.Fhir.Model.Citation.CitedArtifactContributorshipComponent)Contributorship.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactComponent()); + var instance = new CitedArtifactComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1194,7 +1198,7 @@ public Hl7.Fhir.Model.ResourceReference BaseCitation private Hl7.Fhir.Model.ResourceReference _BaseCitation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactVersionComponent; @@ -1203,15 +1207,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(BaseCitation != null) dest.BaseCitation = (Hl7.Fhir.Model.ResourceReference)BaseCitation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(BaseCitation != null) dest.BaseCitation = (Hl7.Fhir.Model.ResourceReference)BaseCitation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactVersionComponent()); + var instance = new CitedArtifactVersionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1343,7 +1348,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactStatusDateComponent; @@ -1352,16 +1357,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopy(); - if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopyInternal(); + if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactStatusDateComponent()); + var instance = new CitedArtifactStatusDateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1499,7 +1505,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactTitleComponent; @@ -1508,16 +1514,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactTitleComponent()); + var instance = new CitedArtifactTitleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1688,7 +1695,7 @@ public string Copyright } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactAbstractComponent; @@ -1697,17 +1704,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactAbstractComponent()); + var instance = new CitedArtifactAbstractComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1852,7 +1860,7 @@ public Hl7.Fhir.Model.ResourceReference BaseCitation private Hl7.Fhir.Model.ResourceReference _BaseCitation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactPartComponent; @@ -1861,16 +1869,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(BaseCitation != null) dest.BaseCitation = (Hl7.Fhir.Model.ResourceReference)BaseCitation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(BaseCitation != null) dest.BaseCitation = (Hl7.Fhir.Model.ResourceReference)BaseCitation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactPartComponent()); + var instance = new CitedArtifactPartComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2149,7 +2158,7 @@ public Hl7.Fhir.Model.ResourceReference ResourceReference private Hl7.Fhir.Model.ResourceReference _ResourceReference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactRelatesToComponent; @@ -2158,21 +2167,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopy()); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(CitationElement != null) dest.CitationElement = (Hl7.Fhir.Model.Markdown)CitationElement.DeepCopy(); - if(Document != null) dest.Document = (Hl7.Fhir.Model.Attachment)Document.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.Canonical)ResourceElement.DeepCopy(); - if(ResourceReference != null) dest.ResourceReference = (Hl7.Fhir.Model.ResourceReference)ResourceReference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopyInternal()); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(CitationElement != null) dest.CitationElement = (Hl7.Fhir.Model.Markdown)CitationElement.DeepCopyInternal(); + if(Document != null) dest.Document = (Hl7.Fhir.Model.Attachment)Document.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.Canonical)ResourceElement.DeepCopyInternal(); + if(ResourceReference != null) dest.ResourceReference = (Hl7.Fhir.Model.ResourceReference)ResourceReference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactRelatesToComponent()); + var instance = new CitedArtifactRelatesToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2706,7 +2716,7 @@ public string Copyright } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactPublicationFormComponent; @@ -2715,28 +2725,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PublishedIn != null) dest.PublishedIn = (Hl7.Fhir.Model.Citation.CitedArtifactPublicationFormPublishedInComponent)PublishedIn.DeepCopy(); - if(CitedMedium != null) dest.CitedMedium = (Hl7.Fhir.Model.CodeableConcept)CitedMedium.DeepCopy(); - if(VolumeElement != null) dest.VolumeElement = (Hl7.Fhir.Model.FhirString)VolumeElement.DeepCopy(); - if(IssueElement != null) dest.IssueElement = (Hl7.Fhir.Model.FhirString)IssueElement.DeepCopy(); - if(ArticleDateElement != null) dest.ArticleDateElement = (Hl7.Fhir.Model.FhirDateTime)ArticleDateElement.DeepCopy(); - if(PublicationDateTextElement != null) dest.PublicationDateTextElement = (Hl7.Fhir.Model.FhirString)PublicationDateTextElement.DeepCopy(); - if(PublicationDateSeasonElement != null) dest.PublicationDateSeasonElement = (Hl7.Fhir.Model.FhirString)PublicationDateSeasonElement.DeepCopy(); - if(LastRevisionDateElement != null) dest.LastRevisionDateElement = (Hl7.Fhir.Model.FhirDateTime)LastRevisionDateElement.DeepCopy(); - if(Language.Any()) dest.Language = new List(Language.DeepCopy()); - if(AccessionNumberElement != null) dest.AccessionNumberElement = (Hl7.Fhir.Model.FhirString)AccessionNumberElement.DeepCopy(); - if(PageStringElement != null) dest.PageStringElement = (Hl7.Fhir.Model.FhirString)PageStringElement.DeepCopy(); - if(FirstPageElement != null) dest.FirstPageElement = (Hl7.Fhir.Model.FhirString)FirstPageElement.DeepCopy(); - if(LastPageElement != null) dest.LastPageElement = (Hl7.Fhir.Model.FhirString)LastPageElement.DeepCopy(); - if(PageCountElement != null) dest.PageCountElement = (Hl7.Fhir.Model.FhirString)PageCountElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PublishedIn != null) dest.PublishedIn = (Hl7.Fhir.Model.Citation.CitedArtifactPublicationFormPublishedInComponent)PublishedIn.DeepCopyInternal(); + if(CitedMedium != null) dest.CitedMedium = (Hl7.Fhir.Model.CodeableConcept)CitedMedium.DeepCopyInternal(); + if(VolumeElement != null) dest.VolumeElement = (Hl7.Fhir.Model.FhirString)VolumeElement.DeepCopyInternal(); + if(IssueElement != null) dest.IssueElement = (Hl7.Fhir.Model.FhirString)IssueElement.DeepCopyInternal(); + if(ArticleDateElement != null) dest.ArticleDateElement = (Hl7.Fhir.Model.FhirDateTime)ArticleDateElement.DeepCopyInternal(); + if(PublicationDateTextElement != null) dest.PublicationDateTextElement = (Hl7.Fhir.Model.FhirString)PublicationDateTextElement.DeepCopyInternal(); + if(PublicationDateSeasonElement != null) dest.PublicationDateSeasonElement = (Hl7.Fhir.Model.FhirString)PublicationDateSeasonElement.DeepCopyInternal(); + if(LastRevisionDateElement != null) dest.LastRevisionDateElement = (Hl7.Fhir.Model.FhirDateTime)LastRevisionDateElement.DeepCopyInternal(); + if(Language.Any()) dest.Language = new List(Language.DeepCopyInternal()); + if(AccessionNumberElement != null) dest.AccessionNumberElement = (Hl7.Fhir.Model.FhirString)AccessionNumberElement.DeepCopyInternal(); + if(PageStringElement != null) dest.PageStringElement = (Hl7.Fhir.Model.FhirString)PageStringElement.DeepCopyInternal(); + if(FirstPageElement != null) dest.FirstPageElement = (Hl7.Fhir.Model.FhirString)FirstPageElement.DeepCopyInternal(); + if(LastPageElement != null) dest.LastPageElement = (Hl7.Fhir.Model.FhirString)LastPageElement.DeepCopyInternal(); + if(PageCountElement != null) dest.PageCountElement = (Hl7.Fhir.Model.FhirString)PageCountElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactPublicationFormComponent()); + var instance = new CitedArtifactPublicationFormComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3014,7 +3025,7 @@ public string PublisherLocation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactPublicationFormPublishedInComponent; @@ -3023,18 +3034,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Publisher != null) dest.Publisher = (Hl7.Fhir.Model.ResourceReference)Publisher.DeepCopy(); - if(PublisherLocationElement != null) dest.PublisherLocationElement = (Hl7.Fhir.Model.FhirString)PublisherLocationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Publisher != null) dest.Publisher = (Hl7.Fhir.Model.ResourceReference)Publisher.DeepCopyInternal(); + if(PublisherLocationElement != null) dest.PublisherLocationElement = (Hl7.Fhir.Model.FhirString)PublisherLocationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactPublicationFormPublishedInComponent()); + var instance = new CitedArtifactPublicationFormPublishedInComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3173,7 +3185,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactWebLocationComponent; @@ -3182,15 +3194,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopy()); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopyInternal()); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactWebLocationComponent()); + var instance = new CitedArtifactWebLocationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3304,7 +3317,7 @@ public List ArtifactAssessment private List _ArtifactAssessment; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactClassificationComponent; @@ -3313,16 +3326,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopy()); - if(ArtifactAssessment.Any()) dest.ArtifactAssessment = new List(ArtifactAssessment.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopyInternal()); + if(ArtifactAssessment.Any()) dest.ArtifactAssessment = new List(ArtifactAssessment.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactClassificationComponent()); + var instance = new CitedArtifactClassificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3461,7 +3475,7 @@ public List Summary private List _Summary; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactContributorshipComponent; @@ -3470,16 +3484,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CompleteElement != null) dest.CompleteElement = (Hl7.Fhir.Model.FhirBoolean)CompleteElement.DeepCopy(); - if(Entry.Any()) dest.Entry = new List(Entry.DeepCopy()); - if(Summary.Any()) dest.Summary = new List(Summary.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CompleteElement != null) dest.CompleteElement = (Hl7.Fhir.Model.FhirBoolean)CompleteElement.DeepCopyInternal(); + if(Entry.Any()) dest.Entry = new List(Entry.DeepCopyInternal()); + if(Summary.Any()) dest.Summary = new List(Summary.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactContributorshipComponent()); + var instance = new CitedArtifactContributorshipComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3728,7 +3743,7 @@ public int? RankingOrder } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactContributorshipEntryComponent; @@ -3737,21 +3752,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Contributor != null) dest.Contributor = (Hl7.Fhir.Model.ResourceReference)Contributor.DeepCopy(); - if(ForenameInitialsElement != null) dest.ForenameInitialsElement = (Hl7.Fhir.Model.FhirString)ForenameInitialsElement.DeepCopy(); - if(Affiliation.Any()) dest.Affiliation = new List(Affiliation.DeepCopy()); - if(ContributionType.Any()) dest.ContributionType = new List(ContributionType.DeepCopy()); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(ContributionInstance.Any()) dest.ContributionInstance = new List(ContributionInstance.DeepCopy()); - if(CorrespondingContactElement != null) dest.CorrespondingContactElement = (Hl7.Fhir.Model.FhirBoolean)CorrespondingContactElement.DeepCopy(); - if(RankingOrderElement != null) dest.RankingOrderElement = (Hl7.Fhir.Model.PositiveInt)RankingOrderElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Contributor != null) dest.Contributor = (Hl7.Fhir.Model.ResourceReference)Contributor.DeepCopyInternal(); + if(ForenameInitialsElement != null) dest.ForenameInitialsElement = (Hl7.Fhir.Model.FhirString)ForenameInitialsElement.DeepCopyInternal(); + if(Affiliation.Any()) dest.Affiliation = new List(Affiliation.DeepCopyInternal()); + if(ContributionType.Any()) dest.ContributionType = new List(ContributionType.DeepCopyInternal()); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(ContributionInstance.Any()) dest.ContributionInstance = new List(ContributionInstance.DeepCopyInternal()); + if(CorrespondingContactElement != null) dest.CorrespondingContactElement = (Hl7.Fhir.Model.FhirBoolean)CorrespondingContactElement.DeepCopyInternal(); + if(RankingOrderElement != null) dest.RankingOrderElement = (Hl7.Fhir.Model.PositiveInt)RankingOrderElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactContributorshipEntryComponent()); + var instance = new CitedArtifactContributorshipEntryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3914,7 +3930,7 @@ public string Time } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CitedArtifactContributorshipEntryContributionInstanceComponent; @@ -3923,15 +3939,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CitedArtifactContributorshipEntryContributionInstanceComponent()); + var instance = new CitedArtifactContributorshipEntryContributionInstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4074,7 +4091,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContributorshipSummaryComponent; @@ -4083,17 +4100,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Style != null) dest.Style = (Hl7.Fhir.Model.CodeableConcept)Style.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.CodeableConcept)Source.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.Markdown)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Style != null) dest.Style = (Hl7.Fhir.Model.CodeableConcept)Style.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.CodeableConcept)Source.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.Markdown)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContributorshipSummaryComponent()); + var instance = new ContributorshipSummaryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4843,7 +4861,7 @@ public Hl7.Fhir.Model.Citation.CitedArtifactComponent CitedArtifact List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Citation; @@ -4852,44 +4870,45 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(Summary.Any()) dest.Summary = new List(Summary.DeepCopy()); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(CurrentState.Any()) dest.CurrentState = new List(CurrentState.DeepCopy()); - if(StatusDate.Any()) dest.StatusDate = new List(StatusDate.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(CitedArtifact != null) dest.CitedArtifact = (Hl7.Fhir.Model.Citation.CitedArtifactComponent)CitedArtifact.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(Summary.Any()) dest.Summary = new List(Summary.DeepCopyInternal()); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(CurrentState.Any()) dest.CurrentState = new List(CurrentState.DeepCopyInternal()); + if(StatusDate.Any()) dest.StatusDate = new List(StatusDate.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(CitedArtifact != null) dest.CitedArtifact = (Hl7.Fhir.Model.Citation.CitedArtifactComponent)CitedArtifact.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Citation()); + var instance = new Citation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Claim.cs b/src/Hl7.Fhir.R5/Model/Generated/Claim.cs index 65d6efc22b..a8baab7ef9 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Claim.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Claim.cs @@ -119,7 +119,7 @@ public Hl7.Fhir.Model.Identifier Reference private Hl7.Fhir.Model.Identifier _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedClaimComponent; @@ -128,16 +128,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedClaimComponent()); + var instance = new RelatedClaimComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -248,7 +249,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayeeComponent; @@ -257,15 +258,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayeeComponent()); + var instance = new PayeeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -368,7 +370,7 @@ public Hl7.Fhir.Model.DataType When private Hl7.Fhir.Model.DataType _When; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventComponent; @@ -377,15 +379,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventComponent()); + var instance = new EventComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -564,7 +567,7 @@ public Hl7.Fhir.Model.CodeableConcept Specialty private Hl7.Fhir.Model.CodeableConcept _Specialty; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CareTeamComponent; @@ -573,18 +576,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Specialty != null) dest.Specialty = (Hl7.Fhir.Model.CodeableConcept)Specialty.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Specialty != null) dest.Specialty = (Hl7.Fhir.Model.CodeableConcept)Specialty.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CareTeamComponent()); + var instance = new CareTeamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -787,7 +791,7 @@ public Hl7.Fhir.Model.CodeableConcept Reason private Hl7.Fhir.Model.CodeableConcept _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportingInformationComponent; @@ -796,19 +800,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportingInformationComponent()); + var instance = new SupportingInformationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -991,7 +996,7 @@ public Hl7.Fhir.Model.CodeableConcept OnAdmission private Hl7.Fhir.Model.CodeableConcept _OnAdmission; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -1000,17 +1005,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(OnAdmission != null) dest.OnAdmission = (Hl7.Fhir.Model.CodeableConcept)OnAdmission.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(OnAdmission != null) dest.OnAdmission = (Hl7.Fhir.Model.CodeableConcept)OnAdmission.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1210,7 +1216,7 @@ public List Udi private List _Udi; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcedureComponent; @@ -1219,18 +1225,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcedureComponent()); + var instance = new ProcedureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1498,7 +1505,7 @@ public Hl7.Fhir.Model.ResourceReference ClaimResponse private Hl7.Fhir.Model.ResourceReference _ClaimResponse; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -1507,20 +1514,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopy(); - if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopy()); - if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopyInternal(); + if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopyInternal()); + if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1694,7 +1702,7 @@ public Hl7.Fhir.Model.DataType Location private Hl7.Fhir.Model.DataType _Location; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AccidentComponent; @@ -1703,16 +1711,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AccidentComponent()); + var instance = new AccidentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2256,7 +2265,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -2265,38 +2274,39 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(CareTeamSequenceElement.Any()) dest.CareTeamSequenceElement = new List(CareTeamSequenceElement.DeepCopy()); - if(DiagnosisSequenceElement.Any()) dest.DiagnosisSequenceElement = new List(DiagnosisSequenceElement.DeepCopy()); - if(ProcedureSequenceElement.Any()) dest.ProcedureSequenceElement = new List(ProcedureSequenceElement.DeepCopy()); - if(InformationSequenceElement.Any()) dest.InformationSequenceElement = new List(InformationSequenceElement.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopy(); - if(Request.Any()) dest.Request = new List(Request.DeepCopy()); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ItemComponent()); + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(CareTeamSequenceElement.Any()) dest.CareTeamSequenceElement = new List(CareTeamSequenceElement.DeepCopyInternal()); + if(DiagnosisSequenceElement.Any()) dest.DiagnosisSequenceElement = new List(DiagnosisSequenceElement.DeepCopyInternal()); + if(ProcedureSequenceElement.Any()) dest.ProcedureSequenceElement = new List(ProcedureSequenceElement.DeepCopyInternal()); + if(InformationSequenceElement.Any()) dest.InformationSequenceElement = new List(InformationSequenceElement.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopyInternal(); + if(Request.Any()) dest.Request = new List(Request.DeepCopyInternal()); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2582,7 +2592,7 @@ public List SubSite private List _SubSite; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BodySiteComponent; @@ -2591,15 +2601,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Site.Any()) dest.Site = new List(Site.DeepCopy()); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Site.Any()) dest.Site = new List(Site.DeepCopyInternal()); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BodySiteComponent()); + var instance = new BodySiteComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2929,7 +2940,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -2938,29 +2949,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3388,7 +3400,7 @@ public List Udi private List _Udi; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubDetailComponent; @@ -3397,28 +3409,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubDetailComponent()); + var instance = new SubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4093,7 +4106,7 @@ public Hl7.Fhir.Model.Money Total List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Claim; @@ -4102,45 +4115,46 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopy(); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopy(); - if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.Claim.PayeeComponent)Payee.DeepCopy(); - if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopy(); - if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopy()); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(DiagnosisRelatedGroup != null) dest.DiagnosisRelatedGroup = (Hl7.Fhir.Model.CodeableConcept)DiagnosisRelatedGroup.DeepCopy(); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Accident != null) dest.Accident = (Hl7.Fhir.Model.Claim.AccidentComponent)Accident.DeepCopy(); - if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - if(Total != null) dest.Total = (Hl7.Fhir.Model.Money)Total.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopyInternal(); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); + if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopyInternal(); + if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.Claim.PayeeComponent)Payee.DeepCopyInternal(); + if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopyInternal(); + if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopyInternal()); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(DiagnosisRelatedGroup != null) dest.DiagnosisRelatedGroup = (Hl7.Fhir.Model.CodeableConcept)DiagnosisRelatedGroup.DeepCopyInternal(); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Accident != null) dest.Accident = (Hl7.Fhir.Model.Claim.AccidentComponent)Accident.DeepCopyInternal(); + if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + if(Total != null) dest.Total = (Hl7.Fhir.Model.Money)Total.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Claim()); + var instance = new Claim(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ClaimResponse.cs b/src/Hl7.Fhir.R5/Model/Generated/ClaimResponse.cs index 4052be5f4d..53014dc7fe 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ClaimResponse.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ClaimResponse.cs @@ -106,7 +106,7 @@ public Hl7.Fhir.Model.DataType When private Hl7.Fhir.Model.DataType _When; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventComponent; @@ -115,15 +115,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventComponent()); + var instance = new EventComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -314,7 +315,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -323,19 +324,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemSequenceElement != null) dest.ItemSequenceElement = (Hl7.Fhir.Model.PositiveInt)ItemSequenceElement.DeepCopy(); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ClaimResponse.ReviewOutcomeComponent)ReviewOutcome.DeepCopy(); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ItemSequenceElement != null) dest.ItemSequenceElement = (Hl7.Fhir.Model.PositiveInt)ItemSequenceElement.DeepCopyInternal(); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ClaimResponse.ReviewOutcomeComponent)ReviewOutcome.DeepCopyInternal(); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -512,7 +514,7 @@ public Hl7.Fhir.Model.Period PreAuthPeriod private Hl7.Fhir.Model.Period _PreAuthPeriod; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReviewOutcomeComponent; @@ -521,17 +523,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopy(); - if(PreAuthPeriod != null) dest.PreAuthPeriod = (Hl7.Fhir.Model.Period)PreAuthPeriod.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopyInternal(); + if(PreAuthPeriod != null) dest.PreAuthPeriod = (Hl7.Fhir.Model.Period)PreAuthPeriod.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReviewOutcomeComponent()); + var instance = new ReviewOutcomeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -674,7 +677,7 @@ public Hl7.Fhir.Model.Quantity Quantity private Hl7.Fhir.Model.Quantity _Quantity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdjudicationComponent; @@ -683,17 +686,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdjudicationComponent()); + var instance = new AdjudicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -900,7 +904,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemDetailComponent; @@ -909,19 +913,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DetailSequenceElement != null) dest.DetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceElement.DeepCopy(); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ClaimResponse.ReviewOutcomeComponent)ReviewOutcome.DeepCopy(); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DetailSequenceElement != null) dest.DetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceElement.DeepCopyInternal(); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ClaimResponse.ReviewOutcomeComponent)ReviewOutcome.DeepCopyInternal(); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemDetailComponent()); + var instance = new ItemDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1130,7 +1135,7 @@ public List Adjudication private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubDetailComponent; @@ -1139,18 +1144,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SubDetailSequenceElement != null) dest.SubDetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)SubDetailSequenceElement.DeepCopy(); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ClaimResponse.ReviewOutcomeComponent)ReviewOutcome.DeepCopy(); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SubDetailSequenceElement != null) dest.SubDetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)SubDetailSequenceElement.DeepCopyInternal(); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ClaimResponse.ReviewOutcomeComponent)ReviewOutcome.DeepCopyInternal(); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubDetailComponent()); + var instance = new SubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1662,7 +1668,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemComponent; @@ -1671,36 +1677,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemSequenceElement.Any()) dest.ItemSequenceElement = new List(ItemSequenceElement.DeepCopy()); - if(DetailSequenceElement.Any()) dest.DetailSequenceElement = new List(DetailSequenceElement.DeepCopy()); - if(SubdetailSequenceElement.Any()) dest.SubdetailSequenceElement = new List(SubdetailSequenceElement.DeepCopy()); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(Provider.Any()) dest.Provider = new List(Provider.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopy(); - if(Request.Any()) dest.Request = new List(Request.DeepCopy()); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ClaimResponse.ReviewOutcomeComponent)ReviewOutcome.DeepCopy(); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new AddedItemComponent()); + base.CopyToInternal(dest); + if(ItemSequenceElement.Any()) dest.ItemSequenceElement = new List(ItemSequenceElement.DeepCopyInternal()); + if(DetailSequenceElement.Any()) dest.DetailSequenceElement = new List(DetailSequenceElement.DeepCopyInternal()); + if(SubdetailSequenceElement.Any()) dest.SubdetailSequenceElement = new List(SubdetailSequenceElement.DeepCopyInternal()); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(Provider.Any()) dest.Provider = new List(Provider.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopyInternal(); + if(Request.Any()) dest.Request = new List(Request.DeepCopyInternal()); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ClaimResponse.ReviewOutcomeComponent)ReviewOutcome.DeepCopyInternal(); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new AddedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1970,7 +1977,7 @@ public List SubSite private List _SubSite; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BodySiteComponent; @@ -1979,15 +1986,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Site.Any()) dest.Site = new List(Site.DeepCopy()); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Site.Any()) dest.Site = new List(Site.DeepCopyInternal()); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BodySiteComponent()); + var instance = new BodySiteComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2286,7 +2294,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemDetailComponent; @@ -2295,27 +2303,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ClaimResponse.ReviewOutcomeComponent)ReviewOutcome.DeepCopy(); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ClaimResponse.ReviewOutcomeComponent)ReviewOutcome.DeepCopyInternal(); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemDetailComponent()); + var instance = new AddedItemDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2696,7 +2705,7 @@ public List Adjudication private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemSubDetailComponent; @@ -2705,26 +2714,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ClaimResponse.ReviewOutcomeComponent)ReviewOutcome.DeepCopy(); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ClaimResponse.ReviewOutcomeComponent)ReviewOutcome.DeepCopyInternal(); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemSubDetailComponent()); + var instance = new AddedItemSubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2914,7 +2924,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TotalComponent; @@ -2923,15 +2933,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TotalComponent()); + var instance = new TotalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3103,7 +3114,7 @@ public Hl7.Fhir.Model.Identifier Identifier private Hl7.Fhir.Model.Identifier _Identifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentComponent; @@ -3112,19 +3123,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopy(); - if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopyInternal(); + if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentComponent()); + var instance = new PaymentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3319,7 +3331,7 @@ public Hl7.Fhir.Model.CodeableConcept Language private Hl7.Fhir.Model.CodeableConcept _Language; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NoteComponent; @@ -3328,17 +3340,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NoteComponent()); + var instance = new NoteComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3553,7 +3566,7 @@ public Hl7.Fhir.Model.ResourceReference ClaimResponse private Hl7.Fhir.Model.ResourceReference _ClaimResponse; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -3562,18 +3575,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopy(); - if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopyInternal(); + if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3810,7 +3824,7 @@ public IEnumerable Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ErrorComponent; @@ -3819,18 +3833,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemSequenceElement != null) dest.ItemSequenceElement = (Hl7.Fhir.Model.PositiveInt)ItemSequenceElement.DeepCopy(); - if(DetailSequenceElement != null) dest.DetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceElement.DeepCopy(); - if(SubDetailSequenceElement != null) dest.SubDetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)SubDetailSequenceElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(ExpressionElement.Any()) dest.ExpressionElement = new List(ExpressionElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ItemSequenceElement != null) dest.ItemSequenceElement = (Hl7.Fhir.Model.PositiveInt)ItemSequenceElement.DeepCopyInternal(); + if(DetailSequenceElement != null) dest.DetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceElement.DeepCopyInternal(); + if(SubDetailSequenceElement != null) dest.SubDetailSequenceElement = (Hl7.Fhir.Model.PositiveInt)SubDetailSequenceElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(ExpressionElement.Any()) dest.ExpressionElement = new List(ExpressionElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ErrorComponent()); + var instance = new ErrorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4479,7 +4494,7 @@ public List Error List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClaimResponse; @@ -4488,45 +4503,46 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopy(); - if(PreAuthPeriod != null) dest.PreAuthPeriod = (Hl7.Fhir.Model.Period)PreAuthPeriod.DeepCopy(); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - if(PayeeType != null) dest.PayeeType = (Hl7.Fhir.Model.CodeableConcept)PayeeType.DeepCopy(); - if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopy()); - if(DiagnosisRelatedGroup != null) dest.DiagnosisRelatedGroup = (Hl7.Fhir.Model.CodeableConcept)DiagnosisRelatedGroup.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Total.Any()) dest.Total = new List(Total.DeepCopy()); - if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ClaimResponse.PaymentComponent)Payment.DeepCopy(); - if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopy(); - if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.Attachment)Form.DeepCopy(); - if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopy()); - if(CommunicationRequest.Any()) dest.CommunicationRequest = new List(CommunicationRequest.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Error.Any()) dest.Error = new List(Error.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopyInternal(); + if(PreAuthPeriod != null) dest.PreAuthPeriod = (Hl7.Fhir.Model.Period)PreAuthPeriod.DeepCopyInternal(); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); + if(PayeeType != null) dest.PayeeType = (Hl7.Fhir.Model.CodeableConcept)PayeeType.DeepCopyInternal(); + if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopyInternal()); + if(DiagnosisRelatedGroup != null) dest.DiagnosisRelatedGroup = (Hl7.Fhir.Model.CodeableConcept)DiagnosisRelatedGroup.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Total.Any()) dest.Total = new List(Total.DeepCopyInternal()); + if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ClaimResponse.PaymentComponent)Payment.DeepCopyInternal(); + if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopyInternal(); + if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.Attachment)Form.DeepCopyInternal(); + if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopyInternal()); + if(CommunicationRequest.Any()) dest.CommunicationRequest = new List(CommunicationRequest.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Error.Any()) dest.Error = new List(Error.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClaimResponse()); + var instance = new ClaimResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ClinicalImpression.cs b/src/Hl7.Fhir.R5/Model/Generated/ClinicalImpression.cs index a866e50cff..3b1cb95fcb 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ClinicalImpression.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ClinicalImpression.cs @@ -120,7 +120,7 @@ public string Basis } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FindingComponent; @@ -129,15 +129,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopy(); - if(BasisElement != null) dest.BasisElement = (Hl7.Fhir.Model.FhirString)BasisElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopyInternal(); + if(BasisElement != null) dest.BasisElement = (Hl7.Fhir.Model.FhirString)BasisElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FindingComponent()); + var instance = new FindingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -563,7 +564,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClinicalImpression; @@ -572,32 +573,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(Previous != null) dest.Previous = (Hl7.Fhir.Model.ResourceReference)Previous.DeepCopy(); - if(Problem.Any()) dest.Problem = new List(Problem.DeepCopy()); - if(ChangePattern != null) dest.ChangePattern = (Hl7.Fhir.Model.CodeableConcept)ChangePattern.DeepCopy(); - if(ProtocolElement.Any()) dest.ProtocolElement = new List(ProtocolElement.DeepCopy()); - if(SummaryElement != null) dest.SummaryElement = (Hl7.Fhir.Model.FhirString)SummaryElement.DeepCopy(); - if(Finding.Any()) dest.Finding = new List(Finding.DeepCopy()); - if(PrognosisCodeableConcept.Any()) dest.PrognosisCodeableConcept = new List(PrognosisCodeableConcept.DeepCopy()); - if(PrognosisReference.Any()) dest.PrognosisReference = new List(PrognosisReference.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(Previous != null) dest.Previous = (Hl7.Fhir.Model.ResourceReference)Previous.DeepCopyInternal(); + if(Problem.Any()) dest.Problem = new List(Problem.DeepCopyInternal()); + if(ChangePattern != null) dest.ChangePattern = (Hl7.Fhir.Model.CodeableConcept)ChangePattern.DeepCopyInternal(); + if(ProtocolElement.Any()) dest.ProtocolElement = new List(ProtocolElement.DeepCopyInternal()); + if(SummaryElement != null) dest.SummaryElement = (Hl7.Fhir.Model.FhirString)SummaryElement.DeepCopyInternal(); + if(Finding.Any()) dest.Finding = new List(Finding.DeepCopyInternal()); + if(PrognosisCodeableConcept.Any()) dest.PrognosisCodeableConcept = new List(PrognosisCodeableConcept.DeepCopyInternal()); + if(PrognosisReference.Any()) dest.PrognosisReference = new List(PrognosisReference.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClinicalImpression()); + var instance = new ClinicalImpression(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ClinicalUseDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/ClinicalUseDefinition.cs index 879f462a95..6cc43403e2 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ClinicalUseDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ClinicalUseDefinition.cs @@ -195,7 +195,7 @@ public List OtherThe private List _OtherTherapy; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContraindicationComponent; @@ -204,19 +204,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DiseaseSymptomProcedure != null) dest.DiseaseSymptomProcedure = (Hl7.Fhir.Model.CodeableReference)DiseaseSymptomProcedure.DeepCopy(); - if(DiseaseStatus != null) dest.DiseaseStatus = (Hl7.Fhir.Model.CodeableReference)DiseaseStatus.DeepCopy(); - if(Comorbidity.Any()) dest.Comorbidity = new List(Comorbidity.DeepCopy()); - if(Indication.Any()) dest.Indication = new List(Indication.DeepCopy()); - if(Applicability != null) dest.Applicability = (Hl7.Fhir.Model.Expression)Applicability.DeepCopy(); - if(OtherTherapy.Any()) dest.OtherTherapy = new List(OtherTherapy.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DiseaseSymptomProcedure != null) dest.DiseaseSymptomProcedure = (Hl7.Fhir.Model.CodeableReference)DiseaseSymptomProcedure.DeepCopyInternal(); + if(DiseaseStatus != null) dest.DiseaseStatus = (Hl7.Fhir.Model.CodeableReference)DiseaseStatus.DeepCopyInternal(); + if(Comorbidity.Any()) dest.Comorbidity = new List(Comorbidity.DeepCopyInternal()); + if(Indication.Any()) dest.Indication = new List(Indication.DeepCopyInternal()); + if(Applicability != null) dest.Applicability = (Hl7.Fhir.Model.Expression)Applicability.DeepCopyInternal(); + if(OtherTherapy.Any()) dest.OtherTherapy = new List(OtherTherapy.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContraindicationComponent()); + var instance = new ContraindicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -350,7 +351,7 @@ public Hl7.Fhir.Model.CodeableReference Treatment private Hl7.Fhir.Model.CodeableReference _Treatment; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OtherTherapyComponent; @@ -359,15 +360,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RelationshipType != null) dest.RelationshipType = (Hl7.Fhir.Model.CodeableConcept)RelationshipType.DeepCopy(); - if(Treatment != null) dest.Treatment = (Hl7.Fhir.Model.CodeableReference)Treatment.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RelationshipType != null) dest.RelationshipType = (Hl7.Fhir.Model.CodeableConcept)RelationshipType.DeepCopyInternal(); + if(Treatment != null) dest.Treatment = (Hl7.Fhir.Model.CodeableReference)Treatment.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OtherTherapyComponent()); + var instance = new OtherTherapyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -551,7 +553,7 @@ public List OtherThe private List _OtherTherapy; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IndicationComponent; @@ -560,21 +562,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DiseaseSymptomProcedure != null) dest.DiseaseSymptomProcedure = (Hl7.Fhir.Model.CodeableReference)DiseaseSymptomProcedure.DeepCopy(); - if(DiseaseStatus != null) dest.DiseaseStatus = (Hl7.Fhir.Model.CodeableReference)DiseaseStatus.DeepCopy(); - if(Comorbidity.Any()) dest.Comorbidity = new List(Comorbidity.DeepCopy()); - if(IntendedEffect != null) dest.IntendedEffect = (Hl7.Fhir.Model.CodeableReference)IntendedEffect.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.DataType)Duration.DeepCopy(); - if(UndesirableEffect.Any()) dest.UndesirableEffect = new List(UndesirableEffect.DeepCopy()); - if(Applicability != null) dest.Applicability = (Hl7.Fhir.Model.Expression)Applicability.DeepCopy(); - if(OtherTherapy.Any()) dest.OtherTherapy = new List(OtherTherapy.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DiseaseSymptomProcedure != null) dest.DiseaseSymptomProcedure = (Hl7.Fhir.Model.CodeableReference)DiseaseSymptomProcedure.DeepCopyInternal(); + if(DiseaseStatus != null) dest.DiseaseStatus = (Hl7.Fhir.Model.CodeableReference)DiseaseStatus.DeepCopyInternal(); + if(Comorbidity.Any()) dest.Comorbidity = new List(Comorbidity.DeepCopyInternal()); + if(IntendedEffect != null) dest.IntendedEffect = (Hl7.Fhir.Model.CodeableReference)IntendedEffect.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.DataType)Duration.DeepCopyInternal(); + if(UndesirableEffect.Any()) dest.UndesirableEffect = new List(UndesirableEffect.DeepCopyInternal()); + if(Applicability != null) dest.Applicability = (Hl7.Fhir.Model.Expression)Applicability.DeepCopyInternal(); + if(OtherTherapy.Any()) dest.OtherTherapy = new List(OtherTherapy.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IndicationComponent()); + var instance = new IndicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -762,7 +765,7 @@ public List Management private List _Management; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InteractionComponent; @@ -771,18 +774,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Interactant.Any()) dest.Interactant = new List(Interactant.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Effect != null) dest.Effect = (Hl7.Fhir.Model.CodeableReference)Effect.DeepCopy(); - if(Incidence != null) dest.Incidence = (Hl7.Fhir.Model.CodeableConcept)Incidence.DeepCopy(); - if(Management.Any()) dest.Management = new List(Management.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Interactant.Any()) dest.Interactant = new List(Interactant.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Effect != null) dest.Effect = (Hl7.Fhir.Model.CodeableReference)Effect.DeepCopyInternal(); + if(Incidence != null) dest.Incidence = (Hl7.Fhir.Model.CodeableConcept)Incidence.DeepCopyInternal(); + if(Management.Any()) dest.Management = new List(Management.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InteractionComponent()); + var instance = new InteractionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -896,7 +900,7 @@ public Hl7.Fhir.Model.DataType Item private Hl7.Fhir.Model.DataType _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InteractantComponent; @@ -905,14 +909,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InteractantComponent()); + var instance = new InteractantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1018,7 +1023,7 @@ public Hl7.Fhir.Model.CodeableConcept FrequencyOfOccurrence private Hl7.Fhir.Model.CodeableConcept _FrequencyOfOccurrence; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UndesirableEffectComponent; @@ -1027,16 +1032,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SymptomConditionEffect != null) dest.SymptomConditionEffect = (Hl7.Fhir.Model.CodeableReference)SymptomConditionEffect.DeepCopy(); - if(Classification != null) dest.Classification = (Hl7.Fhir.Model.CodeableConcept)Classification.DeepCopy(); - if(FrequencyOfOccurrence != null) dest.FrequencyOfOccurrence = (Hl7.Fhir.Model.CodeableConcept)FrequencyOfOccurrence.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SymptomConditionEffect != null) dest.SymptomConditionEffect = (Hl7.Fhir.Model.CodeableReference)SymptomConditionEffect.DeepCopyInternal(); + if(Classification != null) dest.Classification = (Hl7.Fhir.Model.CodeableConcept)Classification.DeepCopyInternal(); + if(FrequencyOfOccurrence != null) dest.FrequencyOfOccurrence = (Hl7.Fhir.Model.CodeableConcept)FrequencyOfOccurrence.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UndesirableEffectComponent()); + var instance = new UndesirableEffectComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1161,7 +1167,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as WarningComponent; @@ -1170,15 +1176,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new WarningComponent()); + var instance = new WarningComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1442,7 +1449,7 @@ public Hl7.Fhir.Model.ClinicalUseDefinition.WarningComponent Warning List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClinicalUseDefinition; @@ -1451,25 +1458,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(Contraindication != null) dest.Contraindication = (Hl7.Fhir.Model.ClinicalUseDefinition.ContraindicationComponent)Contraindication.DeepCopy(); - if(Indication != null) dest.Indication = (Hl7.Fhir.Model.ClinicalUseDefinition.IndicationComponent)Indication.DeepCopy(); - if(Interaction != null) dest.Interaction = (Hl7.Fhir.Model.ClinicalUseDefinition.InteractionComponent)Interaction.DeepCopy(); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(UndesirableEffect != null) dest.UndesirableEffect = (Hl7.Fhir.Model.ClinicalUseDefinition.UndesirableEffectComponent)UndesirableEffect.DeepCopy(); - if(Warning != null) dest.Warning = (Hl7.Fhir.Model.ClinicalUseDefinition.WarningComponent)Warning.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(Contraindication != null) dest.Contraindication = (Hl7.Fhir.Model.ClinicalUseDefinition.ContraindicationComponent)Contraindication.DeepCopyInternal(); + if(Indication != null) dest.Indication = (Hl7.Fhir.Model.ClinicalUseDefinition.IndicationComponent)Indication.DeepCopyInternal(); + if(Interaction != null) dest.Interaction = (Hl7.Fhir.Model.ClinicalUseDefinition.InteractionComponent)Interaction.DeepCopyInternal(); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(UndesirableEffect != null) dest.UndesirableEffect = (Hl7.Fhir.Model.ClinicalUseDefinition.UndesirableEffectComponent)UndesirableEffect.DeepCopyInternal(); + if(Warning != null) dest.Warning = (Hl7.Fhir.Model.ClinicalUseDefinition.WarningComponent)Warning.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClinicalUseDefinition()); + var instance = new ClinicalUseDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Communication.cs b/src/Hl7.Fhir.R5/Model/Generated/Communication.cs index 5c4a031c7e..6e383bfa11 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Communication.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Communication.cs @@ -92,7 +92,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayloadComponent; @@ -101,14 +101,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayloadComponent()); + var instance = new PayloadComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -591,7 +592,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Communication; @@ -600,35 +601,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(InResponseTo.Any()) dest.InResponseTo = new List(InResponseTo.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Medium.Any()) dest.Medium = new List(Medium.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Topic != null) dest.Topic = (Hl7.Fhir.Model.CodeableConcept)Topic.DeepCopy(); - if(About.Any()) dest.About = new List(About.DeepCopy()); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(SentElement != null) dest.SentElement = (Hl7.Fhir.Model.FhirDateTime)SentElement.DeepCopy(); - if(ReceivedElement != null) dest.ReceivedElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedElement.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Payload.Any()) dest.Payload = new List(Payload.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Communication()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(InResponseTo.Any()) dest.InResponseTo = new List(InResponseTo.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Medium.Any()) dest.Medium = new List(Medium.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Topic != null) dest.Topic = (Hl7.Fhir.Model.CodeableConcept)Topic.DeepCopyInternal(); + if(About.Any()) dest.About = new List(About.DeepCopyInternal()); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(SentElement != null) dest.SentElement = (Hl7.Fhir.Model.FhirDateTime)SentElement.DeepCopyInternal(); + if(ReceivedElement != null) dest.ReceivedElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedElement.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); + if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Payload.Any()) dest.Payload = new List(Payload.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Communication(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/CommunicationRequest.cs b/src/Hl7.Fhir.R5/Model/Generated/CommunicationRequest.cs index 0190a6b17e..edaf24f477 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/CommunicationRequest.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/CommunicationRequest.cs @@ -92,7 +92,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayloadComponent; @@ -101,14 +101,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayloadComponent()); + var instance = new PayloadComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -575,7 +576,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CommunicationRequest; @@ -584,35 +585,36 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Medium.Any()) dest.Medium = new List(Medium.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(About.Any()) dest.About = new List(About.DeepCopy()); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Payload.Any()) dest.Payload = new List(Payload.DeepCopy()); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - if(InformationProvider.Any()) dest.InformationProvider = new List(InformationProvider.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new CommunicationRequest()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Medium.Any()) dest.Medium = new List(Medium.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(About.Any()) dest.About = new List(About.DeepCopyInternal()); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Payload.Any()) dest.Payload = new List(Payload.DeepCopyInternal()); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); + if(InformationProvider.Any()) dest.InformationProvider = new List(InformationProvider.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new CommunicationRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/CompartmentDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/CompartmentDefinition.cs index 0dcb15a3ac..5273cadd90 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/CompartmentDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/CompartmentDefinition.cs @@ -235,7 +235,7 @@ public string EndParam } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceComponent; @@ -244,18 +244,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(ParamElement.Any()) dest.ParamElement = new List(ParamElement.DeepCopy()); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(StartParamElement != null) dest.StartParamElement = (Hl7.Fhir.Model.FhirUri)StartParamElement.DeepCopy(); - if(EndParamElement != null) dest.EndParamElement = (Hl7.Fhir.Model.FhirUri)EndParamElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(ParamElement.Any()) dest.ParamElement = new List(ParamElement.DeepCopyInternal()); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(StartParamElement != null) dest.StartParamElement = (Hl7.Fhir.Model.FhirUri)StartParamElement.DeepCopyInternal(); + if(EndParamElement != null) dest.EndParamElement = (Hl7.Fhir.Model.FhirUri)EndParamElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceComponent()); + var instance = new ResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -773,7 +774,7 @@ public List Resource private List _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CompartmentDefinition; @@ -782,29 +783,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(SearchElement != null) dest.SearchElement = (Hl7.Fhir.Model.FhirBoolean)SearchElement.DeepCopy(); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new CompartmentDefinition()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(SearchElement != null) dest.SearchElement = (Hl7.Fhir.Model.FhirBoolean)SearchElement.DeepCopyInternal(); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new CompartmentDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Composition.cs b/src/Hl7.Fhir.R5/Model/Generated/Composition.cs index a697dff722..6c8e4c26de 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Composition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Composition.cs @@ -138,7 +138,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AttesterComponent; @@ -147,16 +147,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Mode != null) dest.Mode = (Hl7.Fhir.Model.CodeableConcept)Mode.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Mode != null) dest.Mode = (Hl7.Fhir.Model.CodeableConcept)Mode.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AttesterComponent()); + var instance = new AttesterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -265,7 +266,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventComponent; @@ -274,15 +275,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventComponent()); + var instance = new EventComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -501,7 +503,7 @@ public List Section private List _Section; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SectionComponent; @@ -510,22 +512,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopy(); - if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopy(); - if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopy(); - if(Entry.Any()) dest.Entry = new List(Entry.DeepCopy()); - if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopy(); - if(Section.Any()) dest.Section = new List(Section.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopyInternal(); + if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopyInternal(); + if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopyInternal(); + if(Entry.Any()) dest.Entry = new List(Entry.DeepCopyInternal()); + if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopyInternal(); + if(Section.Any()) dest.Section = new List(Section.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SectionComponent()); + var instance = new SectionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1020,7 +1023,7 @@ public List Section List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Composition; @@ -1029,32 +1032,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Attester.Any()) dest.Attester = new List(Attester.DeepCopy()); - if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy(); - if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopy()); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - if(Section.Any()) dest.Section = new List(Section.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Attester.Any()) dest.Attester = new List(Attester.DeepCopyInternal()); + if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopyInternal(); + if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopyInternal()); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); + if(Section.Any()) dest.Section = new List(Section.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Composition()); + var instance = new Composition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ConceptMap.cs b/src/Hl7.Fhir.R5/Model/Generated/ConceptMap.cs index 479c2dfb3d..3be7ccf752 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ConceptMap.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ConceptMap.cs @@ -395,7 +395,7 @@ public string System } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -404,18 +404,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.Canonical)SystemElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.Canonical)SystemElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -640,7 +641,7 @@ public Hl7.Fhir.Model.ConceptMap.ConceptMapAttributeType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdditionalAttributeComponent; @@ -649,17 +650,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdditionalAttributeComponent()); + var instance = new AdditionalAttributeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -836,7 +838,7 @@ public Hl7.Fhir.Model.ConceptMap.UnmappedComponent Unmapped private Hl7.Fhir.Model.ConceptMap.UnmappedComponent _Unmapped; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -845,17 +847,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.Canonical)SourceElement.DeepCopy(); - if(TargetElement != null) dest.TargetElement = (Hl7.Fhir.Model.Canonical)TargetElement.DeepCopy(); - if(Element.Any()) dest.Element = new List(Element.DeepCopy()); - if(Unmapped != null) dest.Unmapped = (Hl7.Fhir.Model.ConceptMap.UnmappedComponent)Unmapped.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.Canonical)SourceElement.DeepCopyInternal(); + if(TargetElement != null) dest.TargetElement = (Hl7.Fhir.Model.Canonical)TargetElement.DeepCopyInternal(); + if(Element.Any()) dest.Element = new List(Element.DeepCopyInternal()); + if(Unmapped != null) dest.Unmapped = (Hl7.Fhir.Model.ConceptMap.UnmappedComponent)Unmapped.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1082,7 +1085,7 @@ public List Target private List _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceElementComponent; @@ -1091,18 +1094,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopy(); - if(NoMapElement != null) dest.NoMapElement = (Hl7.Fhir.Model.FhirBoolean)NoMapElement.DeepCopy(); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopyInternal(); + if(NoMapElement != null) dest.NoMapElement = (Hl7.Fhir.Model.FhirBoolean)NoMapElement.DeepCopyInternal(); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceElementComponent()); + var instance = new SourceElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1399,7 +1403,7 @@ public List Product private List _Product; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetElementComponent; @@ -1408,21 +1412,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopy(); - if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopy()); - if(Product.Any()) dest.Product = new List(Product.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopyInternal(); + if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopyInternal()); + if(Product.Any()) dest.Product = new List(Product.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetElementComponent()); + var instance = new TargetElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1590,7 +1595,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MappingPropertyComponent; @@ -1599,15 +1604,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MappingPropertyComponent()); + var instance = new MappingPropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1757,7 +1763,7 @@ public string ValueSet } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OtherElementComponent; @@ -1766,16 +1772,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AttributeElement != null) dest.AttributeElement = (Hl7.Fhir.Model.Code)AttributeElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AttributeElement != null) dest.AttributeElement = (Hl7.Fhir.Model.Code)AttributeElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OtherElementComponent()); + var instance = new OtherElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2047,7 +2054,7 @@ public string OtherMap } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UnmappedComponent; @@ -2056,19 +2063,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopy(); - if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopy(); - if(OtherMapElement != null) dest.OtherMapElement = (Hl7.Fhir.Model.Canonical)OtherMapElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopyInternal(); + if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopyInternal(); + if(OtherMapElement != null) dest.OtherMapElement = (Hl7.Fhir.Model.Canonical)OtherMapElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UnmappedComponent()); + var instance = new UnmappedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2837,7 +2845,7 @@ public List Group List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptMap; @@ -2846,44 +2854,45 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(AdditionalAttribute.Any()) dest.AdditionalAttribute = new List(AdditionalAttribute.DeepCopy()); - if(SourceScope != null) dest.SourceScope = (Hl7.Fhir.Model.DataType)SourceScope.DeepCopy(); - if(TargetScope != null) dest.TargetScope = (Hl7.Fhir.Model.DataType)TargetScope.DeepCopy(); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(AdditionalAttribute.Any()) dest.AdditionalAttribute = new List(AdditionalAttribute.DeepCopyInternal()); + if(SourceScope != null) dest.SourceScope = (Hl7.Fhir.Model.DataType)SourceScope.DeepCopyInternal(); + if(TargetScope != null) dest.TargetScope = (Hl7.Fhir.Model.DataType)TargetScope.DeepCopyInternal(); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptMap()); + var instance = new ConceptMap(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Condition.cs b/src/Hl7.Fhir.R5/Model/Generated/Condition.cs index 74ad30f114..fdcc5832c1 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Condition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Condition.cs @@ -203,7 +203,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -212,15 +212,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -336,7 +337,7 @@ public Hl7.Fhir.Model.CodeableConcept Type private Hl7.Fhir.Model.CodeableConcept _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StageComponent; @@ -345,16 +346,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Summary != null) dest.Summary = (Hl7.Fhir.Model.CodeableConcept)Summary.DeepCopy(); - if(Assessment.Any()) dest.Assessment = new List(Assessment.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Summary != null) dest.Summary = (Hl7.Fhir.Model.CodeableConcept)Summary.DeepCopyInternal(); + if(Assessment.Any()) dest.Assessment = new List(Assessment.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StageComponent()); + var instance = new StageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -670,7 +672,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Condition; @@ -679,29 +681,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ClinicalStatus != null) dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopy(); - if(VerificationStatus != null) dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy(); - if(Abatement != null) dest.Abatement = (Hl7.Fhir.Model.DataType)Abatement.DeepCopy(); - if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Stage.Any()) dest.Stage = new List(Stage.DeepCopy()); - if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ClinicalStatus != null) dest.ClinicalStatus = (Hl7.Fhir.Model.CodeableConcept)ClinicalStatus.DeepCopyInternal(); + if(VerificationStatus != null) dest.VerificationStatus = (Hl7.Fhir.Model.CodeableConcept)VerificationStatus.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopyInternal(); + if(Abatement != null) dest.Abatement = (Hl7.Fhir.Model.DataType)Abatement.DeepCopyInternal(); + if(RecordedDateElement != null) dest.RecordedDateElement = (Hl7.Fhir.Model.FhirDateTime)RecordedDateElement.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Stage.Any()) dest.Stage = new List(Stage.DeepCopyInternal()); + if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Condition()); + var instance = new Condition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ConditionDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/ConditionDefinition.cs index 751c38a9fe..082c4e50bf 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ConditionDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ConditionDefinition.cs @@ -150,7 +150,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ObservationComponent; @@ -159,15 +159,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ObservationComponent()); + var instance = new ObservationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -264,7 +265,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationComponent; @@ -273,15 +274,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationComponent()); + var instance = new MedicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -417,7 +419,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PreconditionComponent; @@ -426,16 +428,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PreconditionComponent()); + var instance = new PreconditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -562,7 +565,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QuestionnaireComponent; @@ -571,15 +574,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PurposeElement != null) dest.PurposeElement = (Code)PurposeElement.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PurposeElement != null) dest.PurposeElement = (Code)PurposeElement.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QuestionnaireComponent()); + var instance = new QuestionnaireComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -677,7 +681,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PlanComponent; @@ -686,15 +690,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PlanComponent()); + var instance = new PlanComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1405,7 +1410,7 @@ public List Plan List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConditionDefinition; @@ -1414,42 +1419,43 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopy(); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(Stage != null) dest.Stage = (Hl7.Fhir.Model.CodeableConcept)Stage.DeepCopy(); - if(HasSeverityElement != null) dest.HasSeverityElement = (Hl7.Fhir.Model.FhirBoolean)HasSeverityElement.DeepCopy(); - if(HasBodySiteElement != null) dest.HasBodySiteElement = (Hl7.Fhir.Model.FhirBoolean)HasBodySiteElement.DeepCopy(); - if(HasStageElement != null) dest.HasStageElement = (Hl7.Fhir.Model.FhirBoolean)HasStageElement.DeepCopy(); - if(DefinitionElement.Any()) dest.DefinitionElement = new List(DefinitionElement.DeepCopy()); - if(Observation.Any()) dest.Observation = new List(Observation.DeepCopy()); - if(Medication.Any()) dest.Medication = new List(Medication.DeepCopy()); - if(Precondition.Any()) dest.Precondition = new List(Precondition.DeepCopy()); - if(Team.Any()) dest.Team = new List(Team.DeepCopy()); - if(Questionnaire.Any()) dest.Questionnaire = new List(Questionnaire.DeepCopy()); - if(Plan.Any()) dest.Plan = new List(Plan.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopyInternal(); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(Stage != null) dest.Stage = (Hl7.Fhir.Model.CodeableConcept)Stage.DeepCopyInternal(); + if(HasSeverityElement != null) dest.HasSeverityElement = (Hl7.Fhir.Model.FhirBoolean)HasSeverityElement.DeepCopyInternal(); + if(HasBodySiteElement != null) dest.HasBodySiteElement = (Hl7.Fhir.Model.FhirBoolean)HasBodySiteElement.DeepCopyInternal(); + if(HasStageElement != null) dest.HasStageElement = (Hl7.Fhir.Model.FhirBoolean)HasStageElement.DeepCopyInternal(); + if(DefinitionElement.Any()) dest.DefinitionElement = new List(DefinitionElement.DeepCopyInternal()); + if(Observation.Any()) dest.Observation = new List(Observation.DeepCopyInternal()); + if(Medication.Any()) dest.Medication = new List(Medication.DeepCopyInternal()); + if(Precondition.Any()) dest.Precondition = new List(Precondition.DeepCopyInternal()); + if(Team.Any()) dest.Team = new List(Team.DeepCopyInternal()); + if(Questionnaire.Any()) dest.Questionnaire = new List(Questionnaire.DeepCopyInternal()); + if(Plan.Any()) dest.Plan = new List(Plan.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConditionDefinition()); + var instance = new ConditionDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Consent.cs b/src/Hl7.Fhir.R5/Model/Generated/Consent.cs index 71e140525e..d4ade00592 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Consent.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Consent.cs @@ -168,7 +168,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PolicyBasisComponent; @@ -177,15 +177,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PolicyBasisComponent()); + var instance = new PolicyBasisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -365,7 +366,7 @@ public IEnumerable VerificationDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VerificationComponent; @@ -374,18 +375,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(VerifiedElement != null) dest.VerifiedElement = (Hl7.Fhir.Model.FhirBoolean)VerifiedElement.DeepCopy(); - if(VerificationType != null) dest.VerificationType = (Hl7.Fhir.Model.CodeableConcept)VerificationType.DeepCopy(); - if(VerifiedBy != null) dest.VerifiedBy = (Hl7.Fhir.Model.ResourceReference)VerifiedBy.DeepCopy(); - if(VerifiedWith != null) dest.VerifiedWith = (Hl7.Fhir.Model.ResourceReference)VerifiedWith.DeepCopy(); - if(VerificationDateElement.Any()) dest.VerificationDateElement = new List(VerificationDateElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(VerifiedElement != null) dest.VerifiedElement = (Hl7.Fhir.Model.FhirBoolean)VerifiedElement.DeepCopyInternal(); + if(VerificationType != null) dest.VerificationType = (Hl7.Fhir.Model.CodeableConcept)VerificationType.DeepCopyInternal(); + if(VerifiedBy != null) dest.VerifiedBy = (Hl7.Fhir.Model.ResourceReference)VerifiedBy.DeepCopyInternal(); + if(VerifiedWith != null) dest.VerifiedWith = (Hl7.Fhir.Model.ResourceReference)VerifiedWith.DeepCopyInternal(); + if(VerificationDateElement.Any()) dest.VerificationDateElement = new List(VerificationDateElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VerificationComponent()); + var instance = new VerificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -652,7 +654,7 @@ public List Provision private List _Provision; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as provisionComponent; @@ -661,25 +663,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Purpose.Any()) dest.Purpose = new List(Purpose.DeepCopy()); - if(DocumentType.Any()) dest.DocumentType = new List(DocumentType.DeepCopy()); - if(ResourceType.Any()) dest.ResourceType = new List(ResourceType.DeepCopy()); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(DataPeriod != null) dest.DataPeriod = (Hl7.Fhir.Model.Period)DataPeriod.DeepCopy(); - if(Data.Any()) dest.Data = new List(Data.DeepCopy()); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - if(Provision.Any()) dest.Provision = new List(Provision.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Purpose.Any()) dest.Purpose = new List(Purpose.DeepCopyInternal()); + if(DocumentType.Any()) dest.DocumentType = new List(DocumentType.DeepCopyInternal()); + if(ResourceType.Any()) dest.ResourceType = new List(ResourceType.DeepCopyInternal()); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(DataPeriod != null) dest.DataPeriod = (Hl7.Fhir.Model.Period)DataPeriod.DeepCopyInternal(); + if(Data.Any()) dest.Data = new List(Data.DeepCopyInternal()); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); + if(Provision.Any()) dest.Provision = new List(Provision.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new provisionComponent()); + var instance = new provisionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -860,7 +863,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as provisionActorComponent; @@ -869,15 +872,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new provisionActorComponent()); + var instance = new provisionActorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -999,7 +1003,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as provisionDataComponent; @@ -1008,15 +1012,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MeaningElement != null) dest.MeaningElement = (Code)MeaningElement.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MeaningElement != null) dest.MeaningElement = (Code)MeaningElement.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new provisionDataComponent()); + var instance = new provisionDataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1395,7 +1400,7 @@ public List Provision List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Consent; @@ -1404,31 +1409,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Grantor.Any()) dest.Grantor = new List(Grantor.DeepCopy()); - if(Grantee.Any()) dest.Grantee = new List(Grantee.DeepCopy()); - if(Manager.Any()) dest.Manager = new List(Manager.DeepCopy()); - if(Controller.Any()) dest.Controller = new List(Controller.DeepCopy()); - if(SourceAttachment.Any()) dest.SourceAttachment = new List(SourceAttachment.DeepCopy()); - if(SourceReference.Any()) dest.SourceReference = new List(SourceReference.DeepCopy()); - if(RegulatoryBasis.Any()) dest.RegulatoryBasis = new List(RegulatoryBasis.DeepCopy()); - if(PolicyBasis != null) dest.PolicyBasis = (Hl7.Fhir.Model.Consent.PolicyBasisComponent)PolicyBasis.DeepCopy(); - if(PolicyText.Any()) dest.PolicyText = new List(PolicyText.DeepCopy()); - if(Verification.Any()) dest.Verification = new List(Verification.DeepCopy()); - if(DecisionElement != null) dest.DecisionElement = (Code)DecisionElement.DeepCopy(); - if(Provision.Any()) dest.Provision = new List(Provision.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Grantor.Any()) dest.Grantor = new List(Grantor.DeepCopyInternal()); + if(Grantee.Any()) dest.Grantee = new List(Grantee.DeepCopyInternal()); + if(Manager.Any()) dest.Manager = new List(Manager.DeepCopyInternal()); + if(Controller.Any()) dest.Controller = new List(Controller.DeepCopyInternal()); + if(SourceAttachment.Any()) dest.SourceAttachment = new List(SourceAttachment.DeepCopyInternal()); + if(SourceReference.Any()) dest.SourceReference = new List(SourceReference.DeepCopyInternal()); + if(RegulatoryBasis.Any()) dest.RegulatoryBasis = new List(RegulatoryBasis.DeepCopyInternal()); + if(PolicyBasis != null) dest.PolicyBasis = (Hl7.Fhir.Model.Consent.PolicyBasisComponent)PolicyBasis.DeepCopyInternal(); + if(PolicyText.Any()) dest.PolicyText = new List(PolicyText.DeepCopyInternal()); + if(Verification.Any()) dest.Verification = new List(Verification.DeepCopyInternal()); + if(DecisionElement != null) dest.DecisionElement = (Code)DecisionElement.DeepCopyInternal(); + if(Provision.Any()) dest.Provision = new List(Provision.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Consent()); + var instance = new Consent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Contract.cs b/src/Hl7.Fhir.R5/Model/Generated/Contract.cs index b1d9229323..f393ad7e18 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Contract.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Contract.cs @@ -415,7 +415,7 @@ public string Copyright } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContentDefinitionComponent; @@ -424,19 +424,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(Publisher != null) dest.Publisher = (Hl7.Fhir.Model.ResourceReference)Publisher.DeepCopy(); - if(PublicationDateElement != null) dest.PublicationDateElement = (Hl7.Fhir.Model.FhirDateTime)PublicationDateElement.DeepCopy(); - if(PublicationStatusElement != null) dest.PublicationStatusElement = (Code)PublicationStatusElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(Publisher != null) dest.Publisher = (Hl7.Fhir.Model.ResourceReference)Publisher.DeepCopyInternal(); + if(PublicationDateElement != null) dest.PublicationDateElement = (Hl7.Fhir.Model.FhirDateTime)PublicationDateElement.DeepCopyInternal(); + if(PublicationStatusElement != null) dest.PublicationStatusElement = (Code)PublicationStatusElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContentDefinitionComponent()); + var instance = new ContentDefinitionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -742,7 +743,7 @@ public List Group private List _Group; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TermComponent; @@ -751,25 +752,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopy(); - if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopy(); - if(Topic != null) dest.Topic = (Hl7.Fhir.Model.DataType)Topic.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Offer != null) dest.Offer = (Hl7.Fhir.Model.Contract.ContractOfferComponent)Offer.DeepCopy(); - if(Asset.Any()) dest.Asset = new List(Asset.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopyInternal(); + if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopyInternal(); + if(Topic != null) dest.Topic = (Hl7.Fhir.Model.DataType)Topic.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Offer != null) dest.Offer = (Hl7.Fhir.Model.Contract.ContractOfferComponent)Offer.DeepCopyInternal(); + if(Asset.Any()) dest.Asset = new List(Asset.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TermComponent()); + var instance = new TermComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1000,7 +1002,7 @@ public List Control private List _Control; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SecurityLabelComponent; @@ -1009,17 +1011,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement.Any()) dest.NumberElement = new List(NumberElement.DeepCopy()); - if(Classification != null) dest.Classification = (Hl7.Fhir.Model.Coding)Classification.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Control.Any()) dest.Control = new List(Control.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NumberElement.Any()) dest.NumberElement = new List(NumberElement.DeepCopyInternal()); + if(Classification != null) dest.Classification = (Hl7.Fhir.Model.Coding)Classification.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Control.Any()) dest.Control = new List(Control.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SecurityLabelComponent()); + var instance = new SecurityLabelComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1302,7 +1305,7 @@ public IEnumerable SecurityLabelNumber } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContractOfferComponent; @@ -1311,23 +1314,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Party.Any()) dest.Party = new List(Party.DeepCopy()); - if(Topic != null) dest.Topic = (Hl7.Fhir.Model.ResourceReference)Topic.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopy(); - if(DecisionMode.Any()) dest.DecisionMode = new List(DecisionMode.DeepCopy()); - if(Answer.Any()) dest.Answer = new List(Answer.DeepCopy()); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopy()); - if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Party.Any()) dest.Party = new List(Party.DeepCopyInternal()); + if(Topic != null) dest.Topic = (Hl7.Fhir.Model.ResourceReference)Topic.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopyInternal(); + if(DecisionMode.Any()) dest.DecisionMode = new List(DecisionMode.DeepCopyInternal()); + if(Answer.Any()) dest.Answer = new List(Answer.DeepCopyInternal()); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopyInternal()); + if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContractOfferComponent()); + var instance = new ContractOfferComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1491,7 +1495,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContractPartyComponent; @@ -1500,15 +1504,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference.Any()) dest.Reference = new List(Reference.DeepCopy()); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference.Any()) dest.Reference = new List(Reference.DeepCopyInternal()); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContractPartyComponent()); + var instance = new ContractPartyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1594,7 +1599,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AnswerComponent; @@ -1603,14 +1608,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AnswerComponent()); + var instance = new AnswerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1956,7 +1962,7 @@ public List ValuedItem private List _ValuedItem; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContractAssetComponent; @@ -1965,28 +1971,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(TypeReference.Any()) dest.TypeReference = new List(TypeReference.DeepCopy()); - if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopy()); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.Coding)Relationship.DeepCopy(); - if(Context.Any()) dest.Context = new List(Context.DeepCopy()); - if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopy(); - if(PeriodType.Any()) dest.PeriodType = new List(PeriodType.DeepCopy()); - if(Period.Any()) dest.Period = new List(Period.DeepCopy()); - if(UsePeriod.Any()) dest.UsePeriod = new List(UsePeriod.DeepCopy()); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopy()); - if(Answer.Any()) dest.Answer = new List(Answer.DeepCopy()); - if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopy()); - if(ValuedItem.Any()) dest.ValuedItem = new List(ValuedItem.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(TypeReference.Any()) dest.TypeReference = new List(TypeReference.DeepCopyInternal()); + if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopyInternal()); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.Coding)Relationship.DeepCopyInternal(); + if(Context.Any()) dest.Context = new List(Context.DeepCopyInternal()); + if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopyInternal(); + if(PeriodType.Any()) dest.PeriodType = new List(PeriodType.DeepCopyInternal()); + if(Period.Any()) dest.Period = new List(Period.DeepCopyInternal()); + if(UsePeriod.Any()) dest.UsePeriod = new List(UsePeriod.DeepCopyInternal()); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopyInternal()); + if(Answer.Any()) dest.Answer = new List(Answer.DeepCopyInternal()); + if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopyInternal()); + if(ValuedItem.Any()) dest.ValuedItem = new List(ValuedItem.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContractAssetComponent()); + var instance = new ContractAssetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2220,7 +2227,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssetContextComponent; @@ -2229,16 +2236,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AssetContextComponent()); + var instance = new AssetContextComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2632,7 +2640,7 @@ public IEnumerable SecurityLabelNumber } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ValuedItemComponent; @@ -2641,27 +2649,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Entity != null) dest.Entity = (Hl7.Fhir.Model.DataType)Entity.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(EffectiveTimeElement != null) dest.EffectiveTimeElement = (Hl7.Fhir.Model.FhirDateTime)EffectiveTimeElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(PointsElement != null) dest.PointsElement = (Hl7.Fhir.Model.FhirDecimal)PointsElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(PaymentElement != null) dest.PaymentElement = (Hl7.Fhir.Model.FhirString)PaymentElement.DeepCopy(); - if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.FhirDateTime)PaymentDateElement.DeepCopy(); - if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy(); - if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopy(); - if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopy()); - if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Entity != null) dest.Entity = (Hl7.Fhir.Model.DataType)Entity.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(EffectiveTimeElement != null) dest.EffectiveTimeElement = (Hl7.Fhir.Model.FhirDateTime)EffectiveTimeElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(PointsElement != null) dest.PointsElement = (Hl7.Fhir.Model.FhirDecimal)PointsElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(PaymentElement != null) dest.PaymentElement = (Hl7.Fhir.Model.FhirString)PaymentElement.DeepCopyInternal(); + if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.FhirDateTime)PaymentDateElement.DeepCopyInternal(); + if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopyInternal(); + if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopyInternal(); + if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopyInternal()); + if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ValuedItemComponent()); + var instance = new ValuedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3232,7 +3241,7 @@ public IEnumerable SecurityLabelNumber } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionComponent; @@ -3241,32 +3250,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Intent != null) dest.Intent = (Hl7.Fhir.Model.CodeableConcept)Intent.DeepCopy(); - if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopy()); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(ContextLinkIdElement.Any()) dest.ContextLinkIdElement = new List(ContextLinkIdElement.DeepCopy()); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Requester.Any()) dest.Requester = new List(Requester.DeepCopy()); - if(RequesterLinkIdElement.Any()) dest.RequesterLinkIdElement = new List(RequesterLinkIdElement.DeepCopy()); - if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopy()); - if(PerformerRole != null) dest.PerformerRole = (Hl7.Fhir.Model.CodeableConcept)PerformerRole.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(PerformerLinkIdElement.Any()) dest.PerformerLinkIdElement = new List(PerformerLinkIdElement.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(ReasonLinkIdElement.Any()) dest.ReasonLinkIdElement = new List(ReasonLinkIdElement.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActionComponent()); + base.CopyToInternal(dest); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Intent != null) dest.Intent = (Hl7.Fhir.Model.CodeableConcept)Intent.DeepCopyInternal(); + if(LinkIdElement.Any()) dest.LinkIdElement = new List(LinkIdElement.DeepCopyInternal()); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(ContextLinkIdElement.Any()) dest.ContextLinkIdElement = new List(ContextLinkIdElement.DeepCopyInternal()); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Requester.Any()) dest.Requester = new List(Requester.DeepCopyInternal()); + if(RequesterLinkIdElement.Any()) dest.RequesterLinkIdElement = new List(RequesterLinkIdElement.DeepCopyInternal()); + if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopyInternal()); + if(PerformerRole != null) dest.PerformerRole = (Hl7.Fhir.Model.CodeableConcept)PerformerRole.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(PerformerLinkIdElement.Any()) dest.PerformerLinkIdElement = new List(PerformerLinkIdElement.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(ReasonLinkIdElement.Any()) dest.ReasonLinkIdElement = new List(ReasonLinkIdElement.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(SecurityLabelNumberElement.Any()) dest.SecurityLabelNumberElement = new List(SecurityLabelNumberElement.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3501,7 +3511,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionSubjectComponent; @@ -3510,15 +3520,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference.Any()) dest.Reference = new List(Reference.DeepCopy()); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference.Any()) dest.Reference = new List(Reference.DeepCopyInternal()); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActionSubjectComponent()); + var instance = new ActionSubjectComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3637,7 +3648,7 @@ public List Signature private List _Signature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SignatoryComponent; @@ -3646,16 +3657,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - if(Signature.Any()) dest.Signature = new List(Signature.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); + if(Signature.Any()) dest.Signature = new List(Signature.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SignatoryComponent()); + var instance = new SignatoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3752,7 +3764,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FriendlyLanguageComponent; @@ -3761,14 +3773,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FriendlyLanguageComponent()); + var instance = new FriendlyLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3849,7 +3862,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LegalLanguageComponent; @@ -3858,14 +3871,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LegalLanguageComponent()); + var instance = new LegalLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3946,7 +3960,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComputableLanguageComponent; @@ -3955,14 +3969,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComputableLanguageComponent()); + var instance = new ComputableLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4647,7 +4662,7 @@ public Hl7.Fhir.Model.DataType LegallyBinding List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Contract; @@ -4656,46 +4671,47 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(LegalState != null) dest.LegalState = (Hl7.Fhir.Model.CodeableConcept)LegalState.DeepCopy(); - if(InstantiatesCanonical != null) dest.InstantiatesCanonical = (Hl7.Fhir.Model.ResourceReference)InstantiatesCanonical.DeepCopy(); - if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopy(); - if(ContentDerivative != null) dest.ContentDerivative = (Hl7.Fhir.Model.CodeableConcept)ContentDerivative.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopy(); - if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopy(); - if(ExpirationType != null) dest.ExpirationType = (Hl7.Fhir.Model.CodeableConcept)ExpirationType.DeepCopy(); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Authority.Any()) dest.Authority = new List(Authority.DeepCopy()); - if(Domain.Any()) dest.Domain = new List(Domain.DeepCopy()); - if(Site.Any()) dest.Site = new List(Site.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopy(); - if(Topic != null) dest.Topic = (Hl7.Fhir.Model.DataType)Topic.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType.Any()) dest.SubType = new List(SubType.DeepCopy()); - if(ContentDefinition != null) dest.ContentDefinition = (Hl7.Fhir.Model.Contract.ContentDefinitionComponent)ContentDefinition.DeepCopy(); - if(Term.Any()) dest.Term = new List(Term.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - if(Signer.Any()) dest.Signer = new List(Signer.DeepCopy()); - if(Friendly.Any()) dest.Friendly = new List(Friendly.DeepCopy()); - if(Legal.Any()) dest.Legal = new List(Legal.DeepCopy()); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - if(LegallyBinding != null) dest.LegallyBinding = (Hl7.Fhir.Model.DataType)LegallyBinding.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(LegalState != null) dest.LegalState = (Hl7.Fhir.Model.CodeableConcept)LegalState.DeepCopyInternal(); + if(InstantiatesCanonical != null) dest.InstantiatesCanonical = (Hl7.Fhir.Model.ResourceReference)InstantiatesCanonical.DeepCopyInternal(); + if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopyInternal(); + if(ContentDerivative != null) dest.ContentDerivative = (Hl7.Fhir.Model.CodeableConcept)ContentDerivative.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopyInternal(); + if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopyInternal(); + if(ExpirationType != null) dest.ExpirationType = (Hl7.Fhir.Model.CodeableConcept)ExpirationType.DeepCopyInternal(); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Authority.Any()) dest.Authority = new List(Authority.DeepCopyInternal()); + if(Domain.Any()) dest.Domain = new List(Domain.DeepCopyInternal()); + if(Site.Any()) dest.Site = new List(Site.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Scope != null) dest.Scope = (Hl7.Fhir.Model.CodeableConcept)Scope.DeepCopyInternal(); + if(Topic != null) dest.Topic = (Hl7.Fhir.Model.DataType)Topic.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType.Any()) dest.SubType = new List(SubType.DeepCopyInternal()); + if(ContentDefinition != null) dest.ContentDefinition = (Hl7.Fhir.Model.Contract.ContentDefinitionComponent)ContentDefinition.DeepCopyInternal(); + if(Term.Any()) dest.Term = new List(Term.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); + if(Signer.Any()) dest.Signer = new List(Signer.DeepCopyInternal()); + if(Friendly.Any()) dest.Friendly = new List(Friendly.DeepCopyInternal()); + if(Legal.Any()) dest.Legal = new List(Legal.DeepCopyInternal()); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); + if(LegallyBinding != null) dest.LegallyBinding = (Hl7.Fhir.Model.DataType)LegallyBinding.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Contract()); + var instance = new Contract(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Contributor.cs b/src/Hl7.Fhir.R5/Model/Generated/Contributor.cs index 9ce8527876..a5807dd391 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Contributor.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Contributor.cs @@ -173,7 +173,7 @@ public List Contact private List _Contact; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Contributor; @@ -182,16 +182,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Contributor()); + var instance = new Contributor(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Count.cs b/src/Hl7.Fhir.R5/Model/Generated/Count.cs index 137d7073fd..576a906343 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Count.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Count.cs @@ -60,9 +60,11 @@ public partial class Count : Quantity /// public override string TypeName { get { return "Count"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Count()); + var instance = new Count(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.R5/Model/Generated/Coverage.cs b/src/Hl7.Fhir.R5/Model/Generated/Coverage.cs index 761e2a8ab7..63a2981d68 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Coverage.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Coverage.cs @@ -151,7 +151,7 @@ public string Responsibility } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentByComponent; @@ -160,15 +160,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - if(ResponsibilityElement != null) dest.ResponsibilityElement = (Hl7.Fhir.Model.FhirString)ResponsibilityElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); + if(ResponsibilityElement != null) dest.ResponsibilityElement = (Hl7.Fhir.Model.FhirString)ResponsibilityElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentByComponent()); + var instance = new PaymentByComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -301,7 +302,7 @@ public string Name } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClassComponent; @@ -310,16 +311,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.Identifier)Value.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.Identifier)Value.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClassComponent()); + var instance = new ClassComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -499,7 +501,7 @@ public List Exception private List _Exception; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CostToBeneficiaryComponent; @@ -508,20 +510,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Exception.Any()) dest.Exception = new List(Exception.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Exception.Any()) dest.Exception = new List(Exception.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CostToBeneficiaryComponent()); + var instance = new CostToBeneficiaryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -661,7 +664,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExemptionComponent; @@ -670,15 +673,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExemptionComponent()); + var instance = new ExemptionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1131,7 +1135,7 @@ public Hl7.Fhir.Model.ResourceReference InsurancePlan List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Coverage; @@ -1140,33 +1144,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(PaymentBy.Any()) dest.PaymentBy = new List(PaymentBy.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(PolicyHolder != null) dest.PolicyHolder = (Hl7.Fhir.Model.ResourceReference)PolicyHolder.DeepCopy(); - if(Subscriber != null) dest.Subscriber = (Hl7.Fhir.Model.ResourceReference)Subscriber.DeepCopy(); - if(SubscriberId.Any()) dest.SubscriberId = new List(SubscriberId.DeepCopy()); - if(Beneficiary != null) dest.Beneficiary = (Hl7.Fhir.Model.ResourceReference)Beneficiary.DeepCopy(); - if(DependentElement != null) dest.DependentElement = (Hl7.Fhir.Model.FhirString)DependentElement.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Class.Any()) dest.Class = new List(Class.DeepCopy()); - if(OrderElement != null) dest.OrderElement = (Hl7.Fhir.Model.PositiveInt)OrderElement.DeepCopy(); - if(NetworkElement != null) dest.NetworkElement = (Hl7.Fhir.Model.FhirString)NetworkElement.DeepCopy(); - if(CostToBeneficiary.Any()) dest.CostToBeneficiary = new List(CostToBeneficiary.DeepCopy()); - if(SubrogationElement != null) dest.SubrogationElement = (Hl7.Fhir.Model.FhirBoolean)SubrogationElement.DeepCopy(); - if(Contract.Any()) dest.Contract = new List(Contract.DeepCopy()); - if(InsurancePlan != null) dest.InsurancePlan = (Hl7.Fhir.Model.ResourceReference)InsurancePlan.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(PaymentBy.Any()) dest.PaymentBy = new List(PaymentBy.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(PolicyHolder != null) dest.PolicyHolder = (Hl7.Fhir.Model.ResourceReference)PolicyHolder.DeepCopyInternal(); + if(Subscriber != null) dest.Subscriber = (Hl7.Fhir.Model.ResourceReference)Subscriber.DeepCopyInternal(); + if(SubscriberId.Any()) dest.SubscriberId = new List(SubscriberId.DeepCopyInternal()); + if(Beneficiary != null) dest.Beneficiary = (Hl7.Fhir.Model.ResourceReference)Beneficiary.DeepCopyInternal(); + if(DependentElement != null) dest.DependentElement = (Hl7.Fhir.Model.FhirString)DependentElement.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Class.Any()) dest.Class = new List(Class.DeepCopyInternal()); + if(OrderElement != null) dest.OrderElement = (Hl7.Fhir.Model.PositiveInt)OrderElement.DeepCopyInternal(); + if(NetworkElement != null) dest.NetworkElement = (Hl7.Fhir.Model.FhirString)NetworkElement.DeepCopyInternal(); + if(CostToBeneficiary.Any()) dest.CostToBeneficiary = new List(CostToBeneficiary.DeepCopyInternal()); + if(SubrogationElement != null) dest.SubrogationElement = (Hl7.Fhir.Model.FhirBoolean)SubrogationElement.DeepCopyInternal(); + if(Contract.Any()) dest.Contract = new List(Contract.DeepCopyInternal()); + if(InsurancePlan != null) dest.InsurancePlan = (Hl7.Fhir.Model.ResourceReference)InsurancePlan.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Coverage()); + var instance = new Coverage(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/CoverageEligibilityRequest.cs b/src/Hl7.Fhir.R5/Model/Generated/CoverageEligibilityRequest.cs index 2f522f9192..34117094a6 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/CoverageEligibilityRequest.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/CoverageEligibilityRequest.cs @@ -140,7 +140,7 @@ public Hl7.Fhir.Model.DataType When private Hl7.Fhir.Model.DataType _When; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventComponent; @@ -149,15 +149,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventComponent()); + var instance = new EventComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -309,7 +310,7 @@ public bool? AppliesToAll } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportingInformationComponent; @@ -318,16 +319,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Information != null) dest.Information = (Hl7.Fhir.Model.ResourceReference)Information.DeepCopy(); - if(AppliesToAllElement != null) dest.AppliesToAllElement = (Hl7.Fhir.Model.FhirBoolean)AppliesToAllElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Information != null) dest.Information = (Hl7.Fhir.Model.ResourceReference)Information.DeepCopyInternal(); + if(AppliesToAllElement != null) dest.AppliesToAllElement = (Hl7.Fhir.Model.FhirBoolean)AppliesToAllElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportingInformationComponent()); + var instance = new SupportingInformationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -486,7 +488,7 @@ public string BusinessArrangement } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -495,16 +497,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -745,7 +748,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailsComponent; @@ -754,23 +757,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SupportingInfoSequenceElement.Any()) dest.SupportingInfoSequenceElement = new List(SupportingInfoSequenceElement.DeepCopy()); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SupportingInfoSequenceElement.Any()) dest.SupportingInfoSequenceElement = new List(SupportingInfoSequenceElement.DeepCopyInternal()); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailsComponent()); + var instance = new DetailsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -923,7 +927,7 @@ public Hl7.Fhir.Model.DataType Diagnosis private Hl7.Fhir.Model.DataType _Diagnosis; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -932,14 +936,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1265,7 +1270,7 @@ public List Item List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageEligibilityRequest; @@ -1274,28 +1279,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(PurposeElement.Any()) dest.PurposeElement = new List>(PurposeElement.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(PurposeElement.Any()) dest.PurposeElement = new List>(PurposeElement.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageEligibilityRequest()); + var instance = new CoverageEligibilityRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/CoverageEligibilityResponse.cs b/src/Hl7.Fhir.R5/Model/Generated/CoverageEligibilityResponse.cs index fc33ca4eba..a3602e6f28 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/CoverageEligibilityResponse.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/CoverageEligibilityResponse.cs @@ -174,7 +174,7 @@ public Hl7.Fhir.Model.DataType When private Hl7.Fhir.Model.DataType _When; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventComponent; @@ -183,15 +183,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventComponent()); + var instance = new EventComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -338,7 +339,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -347,17 +348,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(InforceElement != null) dest.InforceElement = (Hl7.Fhir.Model.FhirBoolean)InforceElement.DeepCopy(); - if(BenefitPeriod != null) dest.BenefitPeriod = (Hl7.Fhir.Model.Period)BenefitPeriod.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(InforceElement != null) dest.InforceElement = (Hl7.Fhir.Model.FhirBoolean)InforceElement.DeepCopyInternal(); + if(BenefitPeriod != null) dest.BenefitPeriod = (Hl7.Fhir.Model.Period)BenefitPeriod.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -729,7 +731,7 @@ public string AuthorizationUrl } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemsComponent; @@ -738,27 +740,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopy(); - if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopy()); - if(AuthorizationRequiredElement != null) dest.AuthorizationRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AuthorizationRequiredElement.DeepCopy(); - if(AuthorizationSupporting.Any()) dest.AuthorizationSupporting = new List(AuthorizationSupporting.DeepCopy()); - if(AuthorizationUrlElement != null) dest.AuthorizationUrlElement = (Hl7.Fhir.Model.FhirUri)AuthorizationUrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopyInternal(); + if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopyInternal()); + if(AuthorizationRequiredElement != null) dest.AuthorizationRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AuthorizationRequiredElement.DeepCopyInternal(); + if(AuthorizationSupporting.Any()) dest.AuthorizationSupporting = new List(AuthorizationSupporting.DeepCopyInternal()); + if(AuthorizationUrlElement != null) dest.AuthorizationUrlElement = (Hl7.Fhir.Model.FhirUri)AuthorizationUrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemsComponent()); + var instance = new ItemsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -971,7 +974,7 @@ public Hl7.Fhir.Model.DataType Used private Hl7.Fhir.Model.DataType _Used; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BenefitComponent; @@ -980,16 +983,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopy(); - if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopyInternal(); + if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BenefitComponent()); + var instance = new BenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1116,7 +1120,7 @@ public IEnumerable Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ErrorsComponent; @@ -1125,15 +1129,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(ExpressionElement.Any()) dest.ExpressionElement = new List(ExpressionElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(ExpressionElement.Any()) dest.ExpressionElement = new List(ExpressionElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ErrorsComponent()); + var instance = new ErrorsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1535,7 +1540,7 @@ public List Error List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageEligibilityResponse; @@ -1544,29 +1549,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(PurposeElement.Any()) dest.PurposeElement = new List>(PurposeElement.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(Error.Any()) dest.Error = new List(Error.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(PurposeElement.Any()) dest.PurposeElement = new List>(PurposeElement.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(Error.Any()) dest.Error = new List(Error.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageEligibilityResponse()); + var instance = new CoverageEligibilityResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/DataRequirement.cs b/src/Hl7.Fhir.R5/Model/Generated/DataRequirement.cs index ae0e2da3d6..2f4a2f97f4 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/DataRequirement.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/DataRequirement.cs @@ -256,7 +256,7 @@ public List Code private List _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeFilterComponent; @@ -265,17 +265,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CodeFilterComponent()); + var instance = new CodeFilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -440,7 +441,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DateFilterComponent; @@ -449,16 +450,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DateFilterComponent()); + var instance = new DateFilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -648,7 +650,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ValueFilterComponent; @@ -657,17 +659,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopy(); - if(ComparatorElement != null) dest.ComparatorElement = (Code)ComparatorElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SearchParamElement != null) dest.SearchParamElement = (Hl7.Fhir.Model.FhirString)SearchParamElement.DeepCopyInternal(); + if(ComparatorElement != null) dest.ComparatorElement = (Code)ComparatorElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ValueFilterComponent()); + var instance = new ValueFilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -822,7 +825,7 @@ public Hl7.Fhir.Model.DataRequirement.SortDirection? Direction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SortComponent; @@ -831,15 +834,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SortComponent()); + var instance = new SortComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1097,7 +1101,7 @@ public List Sort private List _Sort; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DataRequirement; @@ -1106,22 +1110,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(MustSupportElement.Any()) dest.MustSupportElement = new List(MustSupportElement.DeepCopy()); - if(CodeFilter.Any()) dest.CodeFilter = new List(CodeFilter.DeepCopy()); - if(DateFilter.Any()) dest.DateFilter = new List(DateFilter.DeepCopy()); - if(ValueFilter.Any()) dest.ValueFilter = new List(ValueFilter.DeepCopy()); - if(LimitElement != null) dest.LimitElement = (Hl7.Fhir.Model.PositiveInt)LimitElement.DeepCopy(); - if(Sort.Any()) dest.Sort = new List(Sort.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(MustSupportElement.Any()) dest.MustSupportElement = new List(MustSupportElement.DeepCopyInternal()); + if(CodeFilter.Any()) dest.CodeFilter = new List(CodeFilter.DeepCopyInternal()); + if(DateFilter.Any()) dest.DateFilter = new List(DateFilter.DeepCopyInternal()); + if(ValueFilter.Any()) dest.ValueFilter = new List(ValueFilter.DeepCopyInternal()); + if(LimitElement != null) dest.LimitElement = (Hl7.Fhir.Model.PositiveInt)LimitElement.DeepCopyInternal(); + if(Sort.Any()) dest.Sort = new List(Sort.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DataRequirement()); + var instance = new DataRequirement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/DetectedIssue.cs b/src/Hl7.Fhir.R5/Model/Generated/DetectedIssue.cs index 4d2b98016d..76554295ba 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/DetectedIssue.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/DetectedIssue.cs @@ -168,7 +168,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EvidenceComponent; @@ -177,15 +177,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EvidenceComponent()); + var instance = new EvidenceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -332,7 +333,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MitigationComponent; @@ -341,17 +342,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MitigationComponent()); + var instance = new MitigationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -701,7 +703,7 @@ public List Mitigation List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetectedIssue; @@ -710,27 +712,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Identified != null) dest.Identified = (Hl7.Fhir.Model.DataType)Identified.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Implicated.Any()) dest.Implicated = new List(Implicated.DeepCopy()); - if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopy()); - if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.Markdown)DetailElement.DeepCopy(); - if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopy(); - if(Mitigation.Any()) dest.Mitigation = new List(Mitigation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Identified != null) dest.Identified = (Hl7.Fhir.Model.DataType)Identified.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Implicated.Any()) dest.Implicated = new List(Implicated.DeepCopyInternal()); + if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopyInternal()); + if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.Markdown)DetailElement.DeepCopyInternal(); + if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopyInternal(); + if(Mitigation.Any()) dest.Mitigation = new List(Mitigation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetectedIssue()); + var instance = new DetectedIssue(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Device.cs b/src/Hl7.Fhir.R5/Model/Generated/Device.cs index 6fffdf23ea..3850c54f96 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Device.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Device.cs @@ -346,7 +346,7 @@ public Hl7.Fhir.Model.Device.UDIEntryType? EntryType } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UdiCarrierComponent; @@ -355,19 +355,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopy(); - if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopy(); - if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopy(); - if(CarrierAIDCElement != null) dest.CarrierAIDCElement = (Hl7.Fhir.Model.Base64Binary)CarrierAIDCElement.DeepCopy(); - if(CarrierHRFElement != null) dest.CarrierHRFElement = (Hl7.Fhir.Model.FhirString)CarrierHRFElement.DeepCopy(); - if(EntryTypeElement != null) dest.EntryTypeElement = (Code)EntryTypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopyInternal(); + if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopyInternal(); + if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopyInternal(); + if(CarrierAIDCElement != null) dest.CarrierAIDCElement = (Hl7.Fhir.Model.Base64Binary)CarrierAIDCElement.DeepCopyInternal(); + if(CarrierHRFElement != null) dest.CarrierHRFElement = (Hl7.Fhir.Model.FhirString)CarrierHRFElement.DeepCopyInternal(); + if(EntryTypeElement != null) dest.EntryTypeElement = (Code)EntryTypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UdiCarrierComponent()); + var instance = new UdiCarrierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -568,7 +569,7 @@ public bool? Display } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NameComponent; @@ -577,16 +578,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirBoolean)DisplayElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirBoolean)DisplayElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NameComponent()); + var instance = new NameComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -753,7 +755,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VersionComponent; @@ -762,17 +764,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Component != null) dest.Component = (Hl7.Fhir.Model.Identifier)Component.DeepCopy(); - if(InstallDateElement != null) dest.InstallDateElement = (Hl7.Fhir.Model.FhirDateTime)InstallDateElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Component != null) dest.Component = (Hl7.Fhir.Model.Identifier)Component.DeepCopyInternal(); + if(InstallDateElement != null) dest.InstallDateElement = (Hl7.Fhir.Model.FhirDateTime)InstallDateElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VersionComponent()); + var instance = new VersionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -920,7 +923,7 @@ public string Version } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConformsToComponent; @@ -929,16 +932,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Specification != null) dest.Specification = (Hl7.Fhir.Model.CodeableConcept)Specification.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Specification != null) dest.Specification = (Hl7.Fhir.Model.CodeableConcept)Specification.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConformsToComponent()); + var instance = new ConformsToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1050,7 +1054,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -1059,15 +1063,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1749,7 +1754,7 @@ public Hl7.Fhir.Model.ResourceReference Parent List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Device; @@ -1758,45 +1763,46 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(DisplayNameElement != null) dest.DisplayNameElement = (Hl7.Fhir.Model.FhirString)DisplayNameElement.DeepCopy(); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.CodeableReference)Definition.DeepCopy(); - if(UdiCarrier.Any()) dest.UdiCarrier = new List(UdiCarrier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(AvailabilityStatus != null) dest.AvailabilityStatus = (Hl7.Fhir.Model.CodeableConcept)AvailabilityStatus.DeepCopy(); - if(BiologicalSourceEvent != null) dest.BiologicalSourceEvent = (Hl7.Fhir.Model.Identifier)BiologicalSourceEvent.DeepCopy(); - if(ManufacturerElement != null) dest.ManufacturerElement = (Hl7.Fhir.Model.FhirString)ManufacturerElement.DeepCopy(); - if(ManufactureDateElement != null) dest.ManufactureDateElement = (Hl7.Fhir.Model.FhirDateTime)ManufactureDateElement.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopy(); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(SerialNumberElement != null) dest.SerialNumberElement = (Hl7.Fhir.Model.FhirString)SerialNumberElement.DeepCopy(); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(ModelNumberElement != null) dest.ModelNumberElement = (Hl7.Fhir.Model.FhirString)ModelNumberElement.DeepCopy(); - if(PartNumberElement != null) dest.PartNumberElement = (Hl7.Fhir.Model.FhirString)PartNumberElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Version.Any()) dest.Version = new List(Version.DeepCopy()); - if(ConformsTo.Any()) dest.ConformsTo = new List(ConformsTo.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Mode != null) dest.Mode = (Hl7.Fhir.Model.CodeableConcept)Mode.DeepCopy(); - if(Cycle != null) dest.Cycle = (Hl7.Fhir.Model.Count)Cycle.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopy(); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(Gateway.Any()) dest.Gateway = new List(Gateway.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Safety.Any()) dest.Safety = new List(Safety.DeepCopy()); - if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(DisplayNameElement != null) dest.DisplayNameElement = (Hl7.Fhir.Model.FhirString)DisplayNameElement.DeepCopyInternal(); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.CodeableReference)Definition.DeepCopyInternal(); + if(UdiCarrier.Any()) dest.UdiCarrier = new List(UdiCarrier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(AvailabilityStatus != null) dest.AvailabilityStatus = (Hl7.Fhir.Model.CodeableConcept)AvailabilityStatus.DeepCopyInternal(); + if(BiologicalSourceEvent != null) dest.BiologicalSourceEvent = (Hl7.Fhir.Model.Identifier)BiologicalSourceEvent.DeepCopyInternal(); + if(ManufacturerElement != null) dest.ManufacturerElement = (Hl7.Fhir.Model.FhirString)ManufacturerElement.DeepCopyInternal(); + if(ManufactureDateElement != null) dest.ManufactureDateElement = (Hl7.Fhir.Model.FhirDateTime)ManufactureDateElement.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopyInternal(); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(SerialNumberElement != null) dest.SerialNumberElement = (Hl7.Fhir.Model.FhirString)SerialNumberElement.DeepCopyInternal(); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(ModelNumberElement != null) dest.ModelNumberElement = (Hl7.Fhir.Model.FhirString)ModelNumberElement.DeepCopyInternal(); + if(PartNumberElement != null) dest.PartNumberElement = (Hl7.Fhir.Model.FhirString)PartNumberElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Version.Any()) dest.Version = new List(Version.DeepCopyInternal()); + if(ConformsTo.Any()) dest.ConformsTo = new List(ConformsTo.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Mode != null) dest.Mode = (Hl7.Fhir.Model.CodeableConcept)Mode.DeepCopyInternal(); + if(Cycle != null) dest.Cycle = (Hl7.Fhir.Model.Count)Cycle.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopyInternal(); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(Gateway.Any()) dest.Gateway = new List(Gateway.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Safety.Any()) dest.Safety = new List(Safety.DeepCopyInternal()); + if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Device()); + var instance = new Device(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/DeviceAssociation.cs b/src/Hl7.Fhir.R5/Model/Generated/DeviceAssociation.cs index 6c95e21370..3ae7a8defc 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/DeviceAssociation.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/DeviceAssociation.cs @@ -153,7 +153,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -162,16 +162,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(Operator.Any()) dest.Operator = new List(Operator.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(Operator.Any()) dest.Operator = new List(Operator.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationComponent()); + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -368,7 +369,7 @@ public List Operation List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceAssociation; @@ -377,22 +378,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(BodyStructure != null) dest.BodyStructure = (Hl7.Fhir.Model.ResourceReference)BodyStructure.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Operation.Any()) dest.Operation = new List(Operation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(BodyStructure != null) dest.BodyStructure = (Hl7.Fhir.Model.ResourceReference)BodyStructure.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Operation.Any()) dest.Operation = new List(Operation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceAssociation()); + var instance = new DeviceAssociation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/DeviceDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/DeviceDefinition.cs index 808584128a..ac45359bf5 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/DeviceDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/DeviceDefinition.cs @@ -288,7 +288,7 @@ public List _MarketDistribution; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UdiDeviceIdentifierComponent; @@ -297,17 +297,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopy(); - if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopy(); - if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopy(); - if(MarketDistribution.Any()) dest.MarketDistribution = new List(MarketDistribution.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopyInternal(); + if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopyInternal(); + if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopyInternal(); + if(MarketDistribution.Any()) dest.MarketDistribution = new List(MarketDistribution.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UdiDeviceIdentifierComponent()); + var instance = new UdiDeviceIdentifierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -441,7 +442,7 @@ public string SubJurisdiction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UdiDeviceIdentifierMarketDistributionComponent; @@ -450,15 +451,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MarketPeriod != null) dest.MarketPeriod = (Hl7.Fhir.Model.Period)MarketPeriod.DeepCopy(); - if(SubJurisdictionElement != null) dest.SubJurisdictionElement = (Hl7.Fhir.Model.FhirUri)SubJurisdictionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MarketPeriod != null) dest.MarketPeriod = (Hl7.Fhir.Model.Period)MarketPeriod.DeepCopyInternal(); + if(SubJurisdictionElement != null) dest.SubJurisdictionElement = (Hl7.Fhir.Model.FhirUri)SubJurisdictionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UdiDeviceIdentifierMarketDistributionComponent()); + var instance = new UdiDeviceIdentifierMarketDistributionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -661,7 +663,7 @@ public string Jurisdiction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RegulatoryIdentifierComponent; @@ -670,17 +672,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopy(); - if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopy(); - if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopyInternal(); + if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopyInternal(); + if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RegulatoryIdentifierComponent()); + var instance = new RegulatoryIdentifierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -831,7 +834,7 @@ public Hl7.Fhir.Model.DeviceNameType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceNameComponent; @@ -840,15 +843,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceNameComponent()); + var instance = new DeviceNameComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -949,7 +953,7 @@ public List Justification private List _Justification; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClassificationComponent; @@ -958,15 +962,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Justification.Any()) dest.Justification = new List(Justification.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Justification.Any()) dest.Justification = new List(Justification.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClassificationComponent()); + var instance = new ClassificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1113,7 +1118,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConformsToComponent; @@ -1122,17 +1127,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Specification != null) dest.Specification = (Hl7.Fhir.Model.CodeableConcept)Specification.DeepCopy(); - if(VersionElement.Any()) dest.VersionElement = new List(VersionElement.DeepCopy()); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Specification != null) dest.Specification = (Hl7.Fhir.Model.CodeableConcept)Specification.DeepCopyInternal(); + if(VersionElement.Any()) dest.VersionElement = new List(VersionElement.DeepCopyInternal()); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConformsToComponent()); + var instance = new ConformsToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1267,7 +1273,7 @@ public int? Count } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HasPartComponent; @@ -1276,15 +1282,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HasPartComponent()); + var instance = new HasPartComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1452,7 +1459,7 @@ public List Packaging private List _Packaging; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PackagingComponent; @@ -1461,19 +1468,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy(); - if(Distributor.Any()) dest.Distributor = new List(Distributor.DeepCopy()); - if(UdiDeviceIdentifier.Any()) dest.UdiDeviceIdentifier = new List(UdiDeviceIdentifier.DeepCopy()); - if(Packaging.Any()) dest.Packaging = new List(Packaging.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopyInternal(); + if(Distributor.Any()) dest.Distributor = new List(Distributor.DeepCopyInternal()); + if(UdiDeviceIdentifier.Any()) dest.UdiDeviceIdentifier = new List(UdiDeviceIdentifier.DeepCopyInternal()); + if(Packaging.Any()) dest.Packaging = new List(Packaging.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PackagingComponent()); + var instance = new PackagingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1621,7 +1629,7 @@ public List OrganizationReference private List _OrganizationReference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PackagingDistributorComponent; @@ -1630,15 +1638,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(OrganizationReference.Any()) dest.OrganizationReference = new List(OrganizationReference.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(OrganizationReference.Any()) dest.OrganizationReference = new List(OrganizationReference.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PackagingDistributorComponent()); + var instance = new PackagingDistributorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1765,7 +1774,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VersionComponent; @@ -1774,16 +1783,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Component != null) dest.Component = (Hl7.Fhir.Model.Identifier)Component.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Component != null) dest.Component = (Hl7.Fhir.Model.Identifier)Component.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VersionComponent()); + var instance = new VersionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1895,7 +1905,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -1904,15 +1914,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2010,7 +2021,7 @@ public Hl7.Fhir.Model.CodeableReference RelatedDevice private Hl7.Fhir.Model.CodeableReference _RelatedDevice; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -2019,15 +2030,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Relation != null) dest.Relation = (Hl7.Fhir.Model.Coding)Relation.DeepCopy(); - if(RelatedDevice != null) dest.RelatedDevice = (Hl7.Fhir.Model.CodeableReference)RelatedDevice.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Relation != null) dest.Relation = (Hl7.Fhir.Model.Coding)Relation.DeepCopyInternal(); + if(RelatedDevice != null) dest.RelatedDevice = (Hl7.Fhir.Model.CodeableReference)RelatedDevice.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2172,7 +2184,7 @@ public bool? AllergenicIndicator } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MaterialComponent; @@ -2181,16 +2193,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopy(); - if(AlternateElement != null) dest.AlternateElement = (Hl7.Fhir.Model.FhirBoolean)AlternateElement.DeepCopy(); - if(AllergenicIndicatorElement != null) dest.AllergenicIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)AllergenicIndicatorElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopyInternal(); + if(AlternateElement != null) dest.AlternateElement = (Hl7.Fhir.Model.FhirBoolean)AlternateElement.DeepCopyInternal(); + if(AllergenicIndicatorElement != null) dest.AllergenicIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)AllergenicIndicatorElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MaterialComponent()); + var instance = new MaterialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2402,7 +2415,7 @@ public string IntendedUse } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GuidelineComponent; @@ -2411,20 +2424,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(UsageInstructionElement != null) dest.UsageInstructionElement = (Hl7.Fhir.Model.Markdown)UsageInstructionElement.DeepCopy(); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Indication.Any()) dest.Indication = new List(Indication.DeepCopy()); - if(Contraindication.Any()) dest.Contraindication = new List(Contraindication.DeepCopy()); - if(Warning.Any()) dest.Warning = new List(Warning.DeepCopy()); - if(IntendedUseElement != null) dest.IntendedUseElement = (Hl7.Fhir.Model.FhirString)IntendedUseElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(UsageInstructionElement != null) dest.UsageInstructionElement = (Hl7.Fhir.Model.Markdown)UsageInstructionElement.DeepCopyInternal(); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Indication.Any()) dest.Indication = new List(Indication.DeepCopyInternal()); + if(Contraindication.Any()) dest.Contraindication = new List(Contraindication.DeepCopyInternal()); + if(Warning.Any()) dest.Warning = new List(Warning.DeepCopyInternal()); + if(IntendedUseElement != null) dest.IntendedUseElement = (Hl7.Fhir.Model.FhirString)IntendedUseElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GuidelineComponent()); + var instance = new GuidelineComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2612,7 +2626,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CorrectiveActionComponent; @@ -2621,16 +2635,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RecallElement != null) dest.RecallElement = (Hl7.Fhir.Model.FhirBoolean)RecallElement.DeepCopy(); - if(ScopeElement != null) dest.ScopeElement = (Code)ScopeElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RecallElement != null) dest.RecallElement = (Hl7.Fhir.Model.FhirBoolean)RecallElement.DeepCopyInternal(); + if(ScopeElement != null) dest.ScopeElement = (Code)ScopeElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CorrectiveActionComponent()); + var instance = new CorrectiveActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2762,7 +2777,7 @@ public List UseContext private List _UseContext; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ChargeItemComponent; @@ -2771,17 +2786,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ChargeItemCode != null) dest.ChargeItemCode = (Hl7.Fhir.Model.CodeableReference)ChargeItemCode.DeepCopy(); - if(Count != null) dest.Count = (Hl7.Fhir.Model.Quantity)Count.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ChargeItemCode != null) dest.ChargeItemCode = (Hl7.Fhir.Model.CodeableReference)ChargeItemCode.DeepCopyInternal(); + if(Count != null) dest.Count = (Hl7.Fhir.Model.Quantity)Count.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ChargeItemComponent()); + var instance = new ChargeItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3291,7 +3307,7 @@ public List ChargeItem List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceDefinition; @@ -3300,39 +3316,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(UdiDeviceIdentifier.Any()) dest.UdiDeviceIdentifier = new List(UdiDeviceIdentifier.DeepCopy()); - if(RegulatoryIdentifier.Any()) dest.RegulatoryIdentifier = new List(RegulatoryIdentifier.DeepCopy()); - if(PartNumberElement != null) dest.PartNumberElement = (Hl7.Fhir.Model.FhirString)PartNumberElement.DeepCopy(); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy(); - if(DeviceName.Any()) dest.DeviceName = new List(DeviceName.DeepCopy()); - if(ModelNumberElement != null) dest.ModelNumberElement = (Hl7.Fhir.Model.FhirString)ModelNumberElement.DeepCopy(); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - if(ConformsTo.Any()) dest.ConformsTo = new List(ConformsTo.DeepCopy()); - if(HasPart.Any()) dest.HasPart = new List(HasPart.DeepCopy()); - if(Packaging.Any()) dest.Packaging = new List(Packaging.DeepCopy()); - if(Version.Any()) dest.Version = new List(Version.DeepCopy()); - if(Safety.Any()) dest.Safety = new List(Safety.DeepCopy()); - if(ShelfLifeStorage.Any()) dest.ShelfLifeStorage = new List(ShelfLifeStorage.DeepCopy()); - if(LanguageCode.Any()) dest.LanguageCode = new List(LanguageCode.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Material.Any()) dest.Material = new List(Material.DeepCopy()); - if(ProductionIdentifierInUDIElement.Any()) dest.ProductionIdentifierInUDIElement = new List>(ProductionIdentifierInUDIElement.DeepCopy()); - if(Guideline != null) dest.Guideline = (Hl7.Fhir.Model.DeviceDefinition.GuidelineComponent)Guideline.DeepCopy(); - if(CorrectiveAction != null) dest.CorrectiveAction = (Hl7.Fhir.Model.DeviceDefinition.CorrectiveActionComponent)CorrectiveAction.DeepCopy(); - if(ChargeItem.Any()) dest.ChargeItem = new List(ChargeItem.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(UdiDeviceIdentifier.Any()) dest.UdiDeviceIdentifier = new List(UdiDeviceIdentifier.DeepCopyInternal()); + if(RegulatoryIdentifier.Any()) dest.RegulatoryIdentifier = new List(RegulatoryIdentifier.DeepCopyInternal()); + if(PartNumberElement != null) dest.PartNumberElement = (Hl7.Fhir.Model.FhirString)PartNumberElement.DeepCopyInternal(); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopyInternal(); + if(DeviceName.Any()) dest.DeviceName = new List(DeviceName.DeepCopyInternal()); + if(ModelNumberElement != null) dest.ModelNumberElement = (Hl7.Fhir.Model.FhirString)ModelNumberElement.DeepCopyInternal(); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); + if(ConformsTo.Any()) dest.ConformsTo = new List(ConformsTo.DeepCopyInternal()); + if(HasPart.Any()) dest.HasPart = new List(HasPart.DeepCopyInternal()); + if(Packaging.Any()) dest.Packaging = new List(Packaging.DeepCopyInternal()); + if(Version.Any()) dest.Version = new List(Version.DeepCopyInternal()); + if(Safety.Any()) dest.Safety = new List(Safety.DeepCopyInternal()); + if(ShelfLifeStorage.Any()) dest.ShelfLifeStorage = new List(ShelfLifeStorage.DeepCopyInternal()); + if(LanguageCode.Any()) dest.LanguageCode = new List(LanguageCode.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Material.Any()) dest.Material = new List(Material.DeepCopyInternal()); + if(ProductionIdentifierInUDIElement.Any()) dest.ProductionIdentifierInUDIElement = new List>(ProductionIdentifierInUDIElement.DeepCopyInternal()); + if(Guideline != null) dest.Guideline = (Hl7.Fhir.Model.DeviceDefinition.GuidelineComponent)Guideline.DeepCopyInternal(); + if(CorrectiveAction != null) dest.CorrectiveAction = (Hl7.Fhir.Model.DeviceDefinition.CorrectiveActionComponent)CorrectiveAction.DeepCopyInternal(); + if(ChargeItem.Any()) dest.ChargeItem = new List(ChargeItem.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceDefinition()); + var instance = new DeviceDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/DeviceDispense.cs b/src/Hl7.Fhir.R5/Model/Generated/DeviceDispense.cs index ca9fbd4cb7..9735d7e3f4 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/DeviceDispense.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/DeviceDispense.cs @@ -168,7 +168,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -177,15 +177,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -620,7 +621,7 @@ public List EventHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceDispense; @@ -629,34 +630,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableReference)StatusReason.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Device != null) dest.Device = (Hl7.Fhir.Model.CodeableReference)Device.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Receiver != null) dest.Receiver = (Hl7.Fhir.Model.ResourceReference)Receiver.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(PreparedDateElement != null) dest.PreparedDateElement = (Hl7.Fhir.Model.FhirDateTime)PreparedDateElement.DeepCopy(); - if(WhenHandedOverElement != null) dest.WhenHandedOverElement = (Hl7.Fhir.Model.FhirDateTime)WhenHandedOverElement.DeepCopy(); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(UsageInstructionElement != null) dest.UsageInstructionElement = (Hl7.Fhir.Model.Markdown)UsageInstructionElement.DeepCopy(); - if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new DeviceDispense()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableReference)StatusReason.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Device != null) dest.Device = (Hl7.Fhir.Model.CodeableReference)Device.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Receiver != null) dest.Receiver = (Hl7.Fhir.Model.ResourceReference)Receiver.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(PreparedDateElement != null) dest.PreparedDateElement = (Hl7.Fhir.Model.FhirDateTime)PreparedDateElement.DeepCopyInternal(); + if(WhenHandedOverElement != null) dest.WhenHandedOverElement = (Hl7.Fhir.Model.FhirDateTime)WhenHandedOverElement.DeepCopyInternal(); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(UsageInstructionElement != null) dest.UsageInstructionElement = (Hl7.Fhir.Model.Markdown)UsageInstructionElement.DeepCopyInternal(); + if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new DeviceDispense(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/DeviceMetric.cs b/src/Hl7.Fhir.R5/Model/Generated/DeviceMetric.cs index f5f704081f..95fca76674 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/DeviceMetric.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/DeviceMetric.cs @@ -306,7 +306,7 @@ public DateTimeOffset? Time } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CalibrationComponent; @@ -315,16 +315,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(StateElement != null) dest.StateElement = (Code)StateElement.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.Instant)TimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(StateElement != null) dest.StateElement = (Code)StateElement.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.Instant)TimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CalibrationComponent()); + var instance = new CalibrationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -574,7 +575,7 @@ public List Calibration List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceMetric; @@ -583,22 +584,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(OperationalStatusElement != null) dest.OperationalStatusElement = (Code)OperationalStatusElement.DeepCopy(); - if(ColorElement != null) dest.ColorElement = (Hl7.Fhir.Model.Code)ColorElement.DeepCopy(); - if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopy(); - if(MeasurementFrequency != null) dest.MeasurementFrequency = (Hl7.Fhir.Model.Quantity)MeasurementFrequency.DeepCopy(); - if(Calibration.Any()) dest.Calibration = new List(Calibration.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(OperationalStatusElement != null) dest.OperationalStatusElement = (Code)OperationalStatusElement.DeepCopyInternal(); + if(ColorElement != null) dest.ColorElement = (Hl7.Fhir.Model.Code)ColorElement.DeepCopyInternal(); + if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopyInternal(); + if(MeasurementFrequency != null) dest.MeasurementFrequency = (Hl7.Fhir.Model.Quantity)MeasurementFrequency.DeepCopyInternal(); + if(Calibration.Any()) dest.Calibration = new List(Calibration.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceMetric()); + var instance = new DeviceMetric(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/DeviceRequest.cs b/src/Hl7.Fhir.R5/Model/Generated/DeviceRequest.cs index 713a8b79a3..5ca0d0b8d9 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/DeviceRequest.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/DeviceRequest.cs @@ -104,7 +104,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -113,15 +113,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -719,7 +720,7 @@ public List RelevantHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceRequest; @@ -728,39 +729,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableReference)Code.DeepCopy(); - if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.Integer)QuantityElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.CodeableReference)Performer.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(AsNeededElement != null) dest.AsNeededElement = (Hl7.Fhir.Model.FhirBoolean)AsNeededElement.DeepCopy(); - if(AsNeededFor != null) dest.AsNeededFor = (Hl7.Fhir.Model.CodeableConcept)AsNeededFor.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new DeviceRequest()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableReference)Code.DeepCopyInternal(); + if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.Integer)QuantityElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.CodeableReference)Performer.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(AsNeededElement != null) dest.AsNeededElement = (Hl7.Fhir.Model.FhirBoolean)AsNeededElement.DeepCopyInternal(); + if(AsNeededFor != null) dest.AsNeededFor = (Hl7.Fhir.Model.CodeableConcept)AsNeededFor.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new DeviceRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/DeviceUsage.cs b/src/Hl7.Fhir.R5/Model/Generated/DeviceUsage.cs index 0c1dcd0012..6a540a6721 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/DeviceUsage.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/DeviceUsage.cs @@ -157,7 +157,7 @@ public List Reason private List _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdherenceComponent; @@ -166,15 +166,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdherenceComponent()); + var instance = new AdherenceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -515,7 +516,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceUsage; @@ -524,30 +525,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopy()); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(DateAssertedElement != null) dest.DateAssertedElement = (Hl7.Fhir.Model.FhirDateTime)DateAssertedElement.DeepCopy(); - if(UsageStatus != null) dest.UsageStatus = (Hl7.Fhir.Model.CodeableConcept)UsageStatus.DeepCopy(); - if(UsageReason.Any()) dest.UsageReason = new List(UsageReason.DeepCopy()); - if(Adherence != null) dest.Adherence = (Hl7.Fhir.Model.DeviceUsage.AdherenceComponent)Adherence.DeepCopy(); - if(InformationSource != null) dest.InformationSource = (Hl7.Fhir.Model.ResourceReference)InformationSource.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.CodeableReference)Device.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableReference)BodySite.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopyInternal()); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(DateAssertedElement != null) dest.DateAssertedElement = (Hl7.Fhir.Model.FhirDateTime)DateAssertedElement.DeepCopyInternal(); + if(UsageStatus != null) dest.UsageStatus = (Hl7.Fhir.Model.CodeableConcept)UsageStatus.DeepCopyInternal(); + if(UsageReason.Any()) dest.UsageReason = new List(UsageReason.DeepCopyInternal()); + if(Adherence != null) dest.Adherence = (Hl7.Fhir.Model.DeviceUsage.AdherenceComponent)Adherence.DeepCopyInternal(); + if(InformationSource != null) dest.InformationSource = (Hl7.Fhir.Model.ResourceReference)InformationSource.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.CodeableReference)Device.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableReference)BodySite.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceUsage()); + var instance = new DeviceUsage(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/DiagnosticReport.cs b/src/Hl7.Fhir.R5/Model/Generated/DiagnosticReport.cs index 8d994b70e6..b09260d599 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/DiagnosticReport.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/DiagnosticReport.cs @@ -183,7 +183,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportingInfoComponent; @@ -192,15 +192,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportingInfoComponent()); + var instance = new SupportingInfoComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -319,7 +320,7 @@ public Hl7.Fhir.Model.ResourceReference Link private Hl7.Fhir.Model.ResourceReference _Link; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MediaComponent; @@ -328,15 +329,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Link != null) dest.Link = (Hl7.Fhir.Model.ResourceReference)Link.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Link != null) dest.Link = (Hl7.Fhir.Model.ResourceReference)Link.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MediaComponent()); + var instance = new MediaComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -761,7 +763,7 @@ public List PresentedForm List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosticReport; @@ -770,34 +772,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(ResultsInterpreter.Any()) dest.ResultsInterpreter = new List(ResultsInterpreter.DeepCopy()); - if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopy()); - if(Result.Any()) dest.Result = new List(Result.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Study.Any()) dest.Study = new List(Study.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Media.Any()) dest.Media = new List(Media.DeepCopy()); - if(Composition != null) dest.Composition = (Hl7.Fhir.Model.ResourceReference)Composition.DeepCopy(); - if(ConclusionElement != null) dest.ConclusionElement = (Hl7.Fhir.Model.Markdown)ConclusionElement.DeepCopy(); - if(ConclusionCode.Any()) dest.ConclusionCode = new List(ConclusionCode.DeepCopy()); - if(PresentedForm.Any()) dest.PresentedForm = new List(PresentedForm.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new DiagnosticReport()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(ResultsInterpreter.Any()) dest.ResultsInterpreter = new List(ResultsInterpreter.DeepCopyInternal()); + if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopyInternal()); + if(Result.Any()) dest.Result = new List(Result.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Study.Any()) dest.Study = new List(Study.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Media.Any()) dest.Media = new List(Media.DeepCopyInternal()); + if(Composition != null) dest.Composition = (Hl7.Fhir.Model.ResourceReference)Composition.DeepCopyInternal(); + if(ConclusionElement != null) dest.ConclusionElement = (Hl7.Fhir.Model.Markdown)ConclusionElement.DeepCopyInternal(); + if(ConclusionCode.Any()) dest.ConclusionCode = new List(ConclusionCode.DeepCopyInternal()); + if(PresentedForm.Any()) dest.PresentedForm = new List(PresentedForm.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new DiagnosticReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Distance.cs b/src/Hl7.Fhir.R5/Model/Generated/Distance.cs index 14fabec10e..158612f28a 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Distance.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Distance.cs @@ -59,9 +59,11 @@ public partial class Distance : Quantity /// public override string TypeName { get { return "Distance"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Distance()); + var instance = new Distance(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.R5/Model/Generated/DocumentReference.cs b/src/Hl7.Fhir.R5/Model/Generated/DocumentReference.cs index bc8d4f479b..3d6d2f8384 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/DocumentReference.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/DocumentReference.cs @@ -166,7 +166,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AttesterComponent; @@ -175,16 +175,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Mode != null) dest.Mode = (Hl7.Fhir.Model.CodeableConcept)Mode.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Mode != null) dest.Mode = (Hl7.Fhir.Model.CodeableConcept)Mode.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AttesterComponent()); + var instance = new AttesterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -296,7 +297,7 @@ public Hl7.Fhir.Model.ResourceReference Target private Hl7.Fhir.Model.ResourceReference _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatesToComponent; @@ -305,15 +306,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatesToComponent()); + var instance = new RelatesToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -414,7 +416,7 @@ public List Profile private List _Profile; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContentComponent; @@ -423,15 +425,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopy(); - if(Profile.Any()) dest.Profile = new List(Profile.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopyInternal(); + if(Profile.Any()) dest.Profile = new List(Profile.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContentComponent()); + var instance = new ContentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -522,7 +525,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProfileComponent; @@ -531,14 +534,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProfileComponent()); + var instance = new ProfileComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1012,7 +1016,7 @@ public List Content List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DocumentReference; @@ -1021,36 +1025,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DocStatusElement != null) dest.DocStatusElement = (Code)DocStatusElement.DeepCopy(); - if(Modality.Any()) dest.Modality = new List(Modality.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context.Any()) dest.Context = new List(Context.DeepCopy()); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(FacilityType != null) dest.FacilityType = (Hl7.Fhir.Model.CodeableConcept)FacilityType.DeepCopy(); - if(PracticeSetting != null) dest.PracticeSetting = (Hl7.Fhir.Model.CodeableConcept)PracticeSetting.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Instant)DateElement.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Attester.Any()) dest.Attester = new List(Attester.DeepCopy()); - if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy(); - if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Content.Any()) dest.Content = new List(Content.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DocStatusElement != null) dest.DocStatusElement = (Code)DocStatusElement.DeepCopyInternal(); + if(Modality.Any()) dest.Modality = new List(Modality.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context.Any()) dest.Context = new List(Context.DeepCopyInternal()); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(FacilityType != null) dest.FacilityType = (Hl7.Fhir.Model.CodeableConcept)FacilityType.DeepCopyInternal(); + if(PracticeSetting != null) dest.PracticeSetting = (Hl7.Fhir.Model.CodeableConcept)PracticeSetting.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Instant)DateElement.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Attester.Any()) dest.Attester = new List(Attester.DeepCopyInternal()); + if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopyInternal(); + if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Content.Any()) dest.Content = new List(Content.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DocumentReference()); + var instance = new DocumentReference(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Dosage.cs b/src/Hl7.Fhir.R5/Model/Generated/Dosage.cs index 28608be52b..cac127baa1 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Dosage.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Dosage.cs @@ -119,7 +119,7 @@ public Hl7.Fhir.Model.DataType Rate private Hl7.Fhir.Model.DataType _Rate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DoseAndRateComponent; @@ -128,16 +128,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Dose != null) dest.Dose = (Hl7.Fhir.Model.DataType)Dose.DeepCopy(); - if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Dose != null) dest.Dose = (Hl7.Fhir.Model.DataType)Dose.DeepCopyInternal(); + if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DoseAndRateComponent()); + var instance = new DoseAndRateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -464,7 +465,7 @@ public Hl7.Fhir.Model.Quantity MaxDosePerLifetime private Hl7.Fhir.Model.Quantity _MaxDosePerLifetime; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Dosage; @@ -473,27 +474,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.Integer)SequenceElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(AdditionalInstruction.Any()) dest.AdditionalInstruction = new List(AdditionalInstruction.DeepCopy()); - if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.Timing)Timing.DeepCopy(); - if(AsNeededElement != null) dest.AsNeededElement = (Hl7.Fhir.Model.FhirBoolean)AsNeededElement.DeepCopy(); - if(AsNeededFor.Any()) dest.AsNeededFor = new List(AsNeededFor.DeepCopy()); - if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy(); - if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(DoseAndRate.Any()) dest.DoseAndRate = new List(DoseAndRate.DeepCopy()); - if(MaxDosePerPeriod.Any()) dest.MaxDosePerPeriod = new List(MaxDosePerPeriod.DeepCopy()); - if(MaxDosePerAdministration != null) dest.MaxDosePerAdministration = (Hl7.Fhir.Model.Quantity)MaxDosePerAdministration.DeepCopy(); - if(MaxDosePerLifetime != null) dest.MaxDosePerLifetime = (Hl7.Fhir.Model.Quantity)MaxDosePerLifetime.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.Integer)SequenceElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(AdditionalInstruction.Any()) dest.AdditionalInstruction = new List(AdditionalInstruction.DeepCopyInternal()); + if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.Timing)Timing.DeepCopyInternal(); + if(AsNeededElement != null) dest.AsNeededElement = (Hl7.Fhir.Model.FhirBoolean)AsNeededElement.DeepCopyInternal(); + if(AsNeededFor.Any()) dest.AsNeededFor = new List(AsNeededFor.DeepCopyInternal()); + if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopyInternal(); + if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(DoseAndRate.Any()) dest.DoseAndRate = new List(DoseAndRate.DeepCopyInternal()); + if(MaxDosePerPeriod.Any()) dest.MaxDosePerPeriod = new List(MaxDosePerPeriod.DeepCopyInternal()); + if(MaxDosePerAdministration != null) dest.MaxDosePerAdministration = (Hl7.Fhir.Model.Quantity)MaxDosePerAdministration.DeepCopyInternal(); + if(MaxDosePerLifetime != null) dest.MaxDosePerLifetime = (Hl7.Fhir.Model.Quantity)MaxDosePerLifetime.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Dosage()); + var instance = new Dosage(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Duration.cs b/src/Hl7.Fhir.R5/Model/Generated/Duration.cs index 6f31af421d..54c08c7fc3 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Duration.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Duration.cs @@ -59,9 +59,11 @@ public partial class Duration : Quantity /// public override string TypeName { get { return "Duration"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Duration()); + var instance = new Duration(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.R5/Model/Generated/Encounter.cs b/src/Hl7.Fhir.R5/Model/Generated/Encounter.cs index c7a3001499..50128e7100 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Encounter.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Encounter.cs @@ -155,7 +155,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -164,16 +164,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -286,7 +287,7 @@ public List Value private List _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReasonComponent; @@ -295,15 +296,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Use.Any()) dest.Use = new List(Use.DeepCopy()); - if(Value.Any()) dest.Value = new List(Value.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Use.Any()) dest.Use = new List(Use.DeepCopyInternal()); + if(Value.Any()) dest.Value = new List(Value.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReasonComponent()); + var instance = new ReasonComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -405,7 +407,7 @@ public List Use private List _Use; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -414,15 +416,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Use.Any()) dest.Use = new List(Use.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Use.Any()) dest.Use = new List(Use.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -582,7 +585,7 @@ public Hl7.Fhir.Model.CodeableConcept DischargeDisposition private Hl7.Fhir.Model.CodeableConcept _DischargeDisposition; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdmissionComponent; @@ -591,19 +594,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PreAdmissionIdentifier != null) dest.PreAdmissionIdentifier = (Hl7.Fhir.Model.Identifier)PreAdmissionIdentifier.DeepCopy(); - if(Origin != null) dest.Origin = (Hl7.Fhir.Model.ResourceReference)Origin.DeepCopy(); - if(AdmitSource != null) dest.AdmitSource = (Hl7.Fhir.Model.CodeableConcept)AdmitSource.DeepCopy(); - if(ReAdmission != null) dest.ReAdmission = (Hl7.Fhir.Model.CodeableConcept)ReAdmission.DeepCopy(); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(DischargeDisposition != null) dest.DischargeDisposition = (Hl7.Fhir.Model.CodeableConcept)DischargeDisposition.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PreAdmissionIdentifier != null) dest.PreAdmissionIdentifier = (Hl7.Fhir.Model.Identifier)PreAdmissionIdentifier.DeepCopyInternal(); + if(Origin != null) dest.Origin = (Hl7.Fhir.Model.ResourceReference)Origin.DeepCopyInternal(); + if(AdmitSource != null) dest.AdmitSource = (Hl7.Fhir.Model.CodeableConcept)AdmitSource.DeepCopyInternal(); + if(ReAdmission != null) dest.ReAdmission = (Hl7.Fhir.Model.CodeableConcept)ReAdmission.DeepCopyInternal(); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(DischargeDisposition != null) dest.DischargeDisposition = (Hl7.Fhir.Model.CodeableConcept)DischargeDisposition.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdmissionComponent()); + var instance = new AdmissionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -784,7 +788,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LocationComponent; @@ -793,17 +797,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LocationComponent()); + var instance = new LocationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1339,7 +1344,7 @@ public List Location List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Encounter; @@ -1348,41 +1353,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Class.Any()) dest.Class = new List(Class.DeepCopy()); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(SubjectStatus != null) dest.SubjectStatus = (Hl7.Fhir.Model.CodeableConcept)SubjectStatus.DeepCopy(); - if(EpisodeOfCare.Any()) dest.EpisodeOfCare = new List(EpisodeOfCare.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - if(ServiceProvider != null) dest.ServiceProvider = (Hl7.Fhir.Model.ResourceReference)ServiceProvider.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Appointment.Any()) dest.Appointment = new List(Appointment.DeepCopy()); - if(VirtualService.Any()) dest.VirtualService = new List(VirtualService.DeepCopy()); - if(ActualPeriod != null) dest.ActualPeriod = (Hl7.Fhir.Model.Period)ActualPeriod.DeepCopy(); - if(PlannedStartDateElement != null) dest.PlannedStartDateElement = (Hl7.Fhir.Model.FhirDateTime)PlannedStartDateElement.DeepCopy(); - if(PlannedEndDateElement != null) dest.PlannedEndDateElement = (Hl7.Fhir.Model.FhirDateTime)PlannedEndDateElement.DeepCopy(); - if(Length != null) dest.Length = (Hl7.Fhir.Model.Duration)Length.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Account.Any()) dest.Account = new List(Account.DeepCopy()); - if(DietPreference.Any()) dest.DietPreference = new List(DietPreference.DeepCopy()); - if(SpecialArrangement.Any()) dest.SpecialArrangement = new List(SpecialArrangement.DeepCopy()); - if(SpecialCourtesy.Any()) dest.SpecialCourtesy = new List(SpecialCourtesy.DeepCopy()); - if(Admission != null) dest.Admission = (Hl7.Fhir.Model.Encounter.AdmissionComponent)Admission.DeepCopy(); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Class.Any()) dest.Class = new List(Class.DeepCopyInternal()); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(SubjectStatus != null) dest.SubjectStatus = (Hl7.Fhir.Model.CodeableConcept)SubjectStatus.DeepCopyInternal(); + if(EpisodeOfCare.Any()) dest.EpisodeOfCare = new List(EpisodeOfCare.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); + if(ServiceProvider != null) dest.ServiceProvider = (Hl7.Fhir.Model.ResourceReference)ServiceProvider.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Appointment.Any()) dest.Appointment = new List(Appointment.DeepCopyInternal()); + if(VirtualService.Any()) dest.VirtualService = new List(VirtualService.DeepCopyInternal()); + if(ActualPeriod != null) dest.ActualPeriod = (Hl7.Fhir.Model.Period)ActualPeriod.DeepCopyInternal(); + if(PlannedStartDateElement != null) dest.PlannedStartDateElement = (Hl7.Fhir.Model.FhirDateTime)PlannedStartDateElement.DeepCopyInternal(); + if(PlannedEndDateElement != null) dest.PlannedEndDateElement = (Hl7.Fhir.Model.FhirDateTime)PlannedEndDateElement.DeepCopyInternal(); + if(Length != null) dest.Length = (Hl7.Fhir.Model.Duration)Length.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Account.Any()) dest.Account = new List(Account.DeepCopyInternal()); + if(DietPreference.Any()) dest.DietPreference = new List(DietPreference.DeepCopyInternal()); + if(SpecialArrangement.Any()) dest.SpecialArrangement = new List(SpecialArrangement.DeepCopyInternal()); + if(SpecialCourtesy.Any()) dest.SpecialCourtesy = new List(SpecialCourtesy.DeepCopyInternal()); + if(Admission != null) dest.Admission = (Hl7.Fhir.Model.Encounter.AdmissionComponent)Admission.DeepCopyInternal(); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Encounter()); + var instance = new Encounter(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/EncounterHistory.cs b/src/Hl7.Fhir.R5/Model/Generated/EncounterHistory.cs index 4a87f74cdc..77f02732dc 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/EncounterHistory.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/EncounterHistory.cs @@ -106,7 +106,7 @@ public Hl7.Fhir.Model.CodeableConcept Form private Hl7.Fhir.Model.CodeableConcept _Form; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LocationComponent; @@ -115,15 +115,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LocationComponent()); + var instance = new LocationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -420,7 +421,7 @@ public List Location List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EncounterHistory; @@ -429,26 +430,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(SubjectStatus != null) dest.SubjectStatus = (Hl7.Fhir.Model.CodeableConcept)SubjectStatus.DeepCopy(); - if(ActualPeriod != null) dest.ActualPeriod = (Hl7.Fhir.Model.Period)ActualPeriod.DeepCopy(); - if(PlannedStartDateElement != null) dest.PlannedStartDateElement = (Hl7.Fhir.Model.FhirDateTime)PlannedStartDateElement.DeepCopy(); - if(PlannedEndDateElement != null) dest.PlannedEndDateElement = (Hl7.Fhir.Model.FhirDateTime)PlannedEndDateElement.DeepCopy(); - if(Length != null) dest.Length = (Hl7.Fhir.Model.Duration)Length.DeepCopy(); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(SubjectStatus != null) dest.SubjectStatus = (Hl7.Fhir.Model.CodeableConcept)SubjectStatus.DeepCopyInternal(); + if(ActualPeriod != null) dest.ActualPeriod = (Hl7.Fhir.Model.Period)ActualPeriod.DeepCopyInternal(); + if(PlannedStartDateElement != null) dest.PlannedStartDateElement = (Hl7.Fhir.Model.FhirDateTime)PlannedStartDateElement.DeepCopyInternal(); + if(PlannedEndDateElement != null) dest.PlannedEndDateElement = (Hl7.Fhir.Model.FhirDateTime)PlannedEndDateElement.DeepCopyInternal(); + if(Length != null) dest.Length = (Hl7.Fhir.Model.Duration)Length.DeepCopyInternal(); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EncounterHistory()); + var instance = new EncounterHistory(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Endpoint.cs b/src/Hl7.Fhir.R5/Model/Generated/Endpoint.cs index db408e7eb1..5fbb74d3a8 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Endpoint.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Endpoint.cs @@ -164,7 +164,7 @@ public IEnumerable MimeType } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayloadComponent; @@ -173,15 +173,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(MimeTypeElement.Any()) dest.MimeTypeElement = new List(MimeTypeElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(MimeTypeElement.Any()) dest.MimeTypeElement = new List(MimeTypeElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayloadComponent()); + var instance = new PayloadComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -499,7 +500,7 @@ public IEnumerable Header List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Endpoint; @@ -508,25 +509,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ConnectionType.Any()) dest.ConnectionType = new List(ConnectionType.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(EnvironmentType.Any()) dest.EnvironmentType = new List(EnvironmentType.DeepCopy()); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Payload.Any()) dest.Payload = new List(Payload.DeepCopy()); - if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirUrl)AddressElement.DeepCopy(); - if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ConnectionType.Any()) dest.ConnectionType = new List(ConnectionType.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(EnvironmentType.Any()) dest.EnvironmentType = new List(EnvironmentType.DeepCopyInternal()); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Payload.Any()) dest.Payload = new List(Payload.DeepCopyInternal()); + if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirUrl)AddressElement.DeepCopyInternal(); + if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Endpoint()); + var instance = new Endpoint(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/EnrollmentRequest.cs b/src/Hl7.Fhir.R5/Model/Generated/EnrollmentRequest.cs index 27f4ead9c4..ec9f2098fb 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/EnrollmentRequest.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/EnrollmentRequest.cs @@ -199,7 +199,7 @@ public Hl7.Fhir.Model.ResourceReference Coverage List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnrollmentRequest; @@ -208,20 +208,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Candidate != null) dest.Candidate = (Hl7.Fhir.Model.ResourceReference)Candidate.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Candidate != null) dest.Candidate = (Hl7.Fhir.Model.ResourceReference)Candidate.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnrollmentRequest()); + var instance = new EnrollmentRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/EnrollmentResponse.cs b/src/Hl7.Fhir.R5/Model/Generated/EnrollmentResponse.cs index 14385a27aa..ece8161853 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/EnrollmentResponse.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/EnrollmentResponse.cs @@ -282,7 +282,7 @@ public Hl7.Fhir.Model.ResourceReference RequestProvider List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnrollmentResponse; @@ -291,21 +291,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnrollmentResponse()); + var instance = new EnrollmentResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/EpisodeOfCare.cs b/src/Hl7.Fhir.R5/Model/Generated/EpisodeOfCare.cs index 249187e1f0..34b0df5575 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/EpisodeOfCare.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/EpisodeOfCare.cs @@ -175,7 +175,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StatusHistoryComponent; @@ -184,15 +184,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StatusHistoryComponent()); + var instance = new StatusHistoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -296,7 +297,7 @@ public List Value private List _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReasonComponent; @@ -305,15 +306,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Use != null) dest.Use = (Hl7.Fhir.Model.CodeableConcept)Use.DeepCopy(); - if(Value.Any()) dest.Value = new List(Value.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Use != null) dest.Use = (Hl7.Fhir.Model.CodeableConcept)Use.DeepCopyInternal(); + if(Value.Any()) dest.Value = new List(Value.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReasonComponent()); + var instance = new ReasonComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -415,7 +417,7 @@ public Hl7.Fhir.Model.CodeableConcept Use private Hl7.Fhir.Model.CodeableConcept _Use; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -424,15 +426,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Use != null) dest.Use = (Hl7.Fhir.Model.CodeableConcept)Use.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Use != null) dest.Use = (Hl7.Fhir.Model.CodeableConcept)Use.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -702,7 +705,7 @@ public List Account List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EpisodeOfCare; @@ -711,26 +714,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopy()); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(ReferralRequest.Any()) dest.ReferralRequest = new List(ReferralRequest.DeepCopy()); - if(CareManager != null) dest.CareManager = (Hl7.Fhir.Model.ResourceReference)CareManager.DeepCopy(); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(Account.Any()) dest.Account = new List(Account.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopyInternal()); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(ReferralRequest.Any()) dest.ReferralRequest = new List(ReferralRequest.DeepCopyInternal()); + if(CareManager != null) dest.CareManager = (Hl7.Fhir.Model.ResourceReference)CareManager.DeepCopyInternal(); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(Account.Any()) dest.Account = new List(Account.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EpisodeOfCare()); + var instance = new EpisodeOfCare(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/EventDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/EventDefinition.cs index 6e988cb084..45cc397d03 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/EventDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/EventDefinition.cs @@ -761,7 +761,7 @@ public List Trigger List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventDefinition; @@ -770,43 +770,44 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.Markdown)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.Markdown)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventDefinition()); + var instance = new EventDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Evidence.cs b/src/Hl7.Fhir.R5/Model/Generated/Evidence.cs index ce427b7590..e392938423 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Evidence.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Evidence.cs @@ -176,7 +176,7 @@ public Hl7.Fhir.Model.CodeableConcept DirectnessMatch private Hl7.Fhir.Model.CodeableConcept _DirectnessMatch; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VariableDefinitionComponent; @@ -185,19 +185,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(VariableRole != null) dest.VariableRole = (Hl7.Fhir.Model.CodeableConcept)VariableRole.DeepCopy(); - if(Observed != null) dest.Observed = (Hl7.Fhir.Model.ResourceReference)Observed.DeepCopy(); - if(Intended != null) dest.Intended = (Hl7.Fhir.Model.ResourceReference)Intended.DeepCopy(); - if(DirectnessMatch != null) dest.DirectnessMatch = (Hl7.Fhir.Model.CodeableConcept)DirectnessMatch.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(VariableRole != null) dest.VariableRole = (Hl7.Fhir.Model.CodeableConcept)VariableRole.DeepCopyInternal(); + if(Observed != null) dest.Observed = (Hl7.Fhir.Model.ResourceReference)Observed.DeepCopyInternal(); + if(Intended != null) dest.Intended = (Hl7.Fhir.Model.ResourceReference)Intended.DeepCopyInternal(); + if(DirectnessMatch != null) dest.DirectnessMatch = (Hl7.Fhir.Model.CodeableConcept)DirectnessMatch.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VariableDefinitionComponent()); + var instance = new VariableDefinitionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -486,7 +487,7 @@ public List ModelCharacter private List _ModelCharacteristic; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StatisticComponent; @@ -495,23 +496,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(StatisticType != null) dest.StatisticType = (Hl7.Fhir.Model.CodeableConcept)StatisticType.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(NumberOfEventsElement != null) dest.NumberOfEventsElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfEventsElement.DeepCopy(); - if(NumberAffectedElement != null) dest.NumberAffectedElement = (Hl7.Fhir.Model.UnsignedInt)NumberAffectedElement.DeepCopy(); - if(SampleSize != null) dest.SampleSize = (Hl7.Fhir.Model.Evidence.SampleSizeComponent)SampleSize.DeepCopy(); - if(AttributeEstimate.Any()) dest.AttributeEstimate = new List(AttributeEstimate.DeepCopy()); - if(ModelCharacteristic.Any()) dest.ModelCharacteristic = new List(ModelCharacteristic.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(StatisticType != null) dest.StatisticType = (Hl7.Fhir.Model.CodeableConcept)StatisticType.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(NumberOfEventsElement != null) dest.NumberOfEventsElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfEventsElement.DeepCopyInternal(); + if(NumberAffectedElement != null) dest.NumberAffectedElement = (Hl7.Fhir.Model.UnsignedInt)NumberAffectedElement.DeepCopyInternal(); + if(SampleSize != null) dest.SampleSize = (Hl7.Fhir.Model.Evidence.SampleSizeComponent)SampleSize.DeepCopyInternal(); + if(AttributeEstimate.Any()) dest.AttributeEstimate = new List(AttributeEstimate.DeepCopyInternal()); + if(ModelCharacteristic.Any()) dest.ModelCharacteristic = new List(ModelCharacteristic.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StatisticComponent()); + var instance = new StatisticComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -782,7 +784,7 @@ public int? KnownDataCount } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SampleSizeComponent; @@ -791,18 +793,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(NumberOfStudiesElement != null) dest.NumberOfStudiesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfStudiesElement.DeepCopy(); - if(NumberOfParticipantsElement != null) dest.NumberOfParticipantsElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfParticipantsElement.DeepCopy(); - if(KnownDataCountElement != null) dest.KnownDataCountElement = (Hl7.Fhir.Model.UnsignedInt)KnownDataCountElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(NumberOfStudiesElement != null) dest.NumberOfStudiesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfStudiesElement.DeepCopyInternal(); + if(NumberOfParticipantsElement != null) dest.NumberOfParticipantsElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfParticipantsElement.DeepCopyInternal(); + if(KnownDataCountElement != null) dest.KnownDataCountElement = (Hl7.Fhir.Model.UnsignedInt)KnownDataCountElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SampleSizeComponent()); + var instance = new SampleSizeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1028,7 +1031,7 @@ public List AttributeEstimat private List _AttributeEstimate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AttributeEstimateComponent; @@ -1037,20 +1040,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(LevelElement != null) dest.LevelElement = (Hl7.Fhir.Model.FhirDecimal)LevelElement.DeepCopy(); - if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopy(); - if(AttributeEstimate.Any()) dest.AttributeEstimate = new List(AttributeEstimate.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(LevelElement != null) dest.LevelElement = (Hl7.Fhir.Model.FhirDecimal)LevelElement.DeepCopyInternal(); + if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopyInternal(); + if(AttributeEstimate.Any()) dest.AttributeEstimate = new List(AttributeEstimate.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AttributeEstimateComponent()); + var instance = new AttributeEstimateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1218,7 +1222,7 @@ public List AttributeEstimat private List _AttributeEstimate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ModelCharacteristicComponent; @@ -1227,17 +1231,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopy(); - if(Variable.Any()) dest.Variable = new List(Variable.DeepCopy()); - if(AttributeEstimate.Any()) dest.AttributeEstimate = new List(AttributeEstimate.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopyInternal(); + if(Variable.Any()) dest.Variable = new List(Variable.DeepCopyInternal()); + if(AttributeEstimate.Any()) dest.AttributeEstimate = new List(AttributeEstimate.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ModelCharacteristicComponent()); + var instance = new ModelCharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1413,7 +1418,7 @@ public List ValueRange private List _ValueRange; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VariableComponent; @@ -1422,18 +1427,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(VariableDefinition != null) dest.VariableDefinition = (Hl7.Fhir.Model.ResourceReference)VariableDefinition.DeepCopy(); - if(HandlingElement != null) dest.HandlingElement = (Code)HandlingElement.DeepCopy(); - if(ValueCategory.Any()) dest.ValueCategory = new List(ValueCategory.DeepCopy()); - if(ValueQuantity.Any()) dest.ValueQuantity = new List(ValueQuantity.DeepCopy()); - if(ValueRange.Any()) dest.ValueRange = new List(ValueRange.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(VariableDefinition != null) dest.VariableDefinition = (Hl7.Fhir.Model.ResourceReference)VariableDefinition.DeepCopyInternal(); + if(HandlingElement != null) dest.HandlingElement = (Code)HandlingElement.DeepCopyInternal(); + if(ValueCategory.Any()) dest.ValueCategory = new List(ValueCategory.DeepCopyInternal()); + if(ValueQuantity.Any()) dest.ValueQuantity = new List(ValueQuantity.DeepCopyInternal()); + if(ValueRange.Any()) dest.ValueRange = new List(ValueRange.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VariableComponent()); + var instance = new VariableComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1647,7 +1653,7 @@ public List Subcomponent private List _Subcomponent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CertaintyComponent; @@ -1656,19 +1662,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Rating != null) dest.Rating = (Hl7.Fhir.Model.CodeableConcept)Rating.DeepCopy(); - if(RaterElement != null) dest.RaterElement = (Hl7.Fhir.Model.FhirString)RaterElement.DeepCopy(); - if(Subcomponent.Any()) dest.Subcomponent = new List(Subcomponent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Rating != null) dest.Rating = (Hl7.Fhir.Model.CodeableConcept)Rating.DeepCopyInternal(); + if(RaterElement != null) dest.RaterElement = (Hl7.Fhir.Model.FhirString)RaterElement.DeepCopyInternal(); + if(Subcomponent.Any()) dest.Subcomponent = new List(Subcomponent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CertaintyComponent()); + var instance = new CertaintyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2454,7 +2461,7 @@ public List Certainty List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Evidence; @@ -2463,44 +2470,45 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(CiteAs != null) dest.CiteAs = (Hl7.Fhir.Model.DataType)CiteAs.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(AssertionElement != null) dest.AssertionElement = (Hl7.Fhir.Model.Markdown)AssertionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(VariableDefinition.Any()) dest.VariableDefinition = new List(VariableDefinition.DeepCopy()); - if(SynthesisType != null) dest.SynthesisType = (Hl7.Fhir.Model.CodeableConcept)SynthesisType.DeepCopy(); - if(StudyDesign.Any()) dest.StudyDesign = new List(StudyDesign.DeepCopy()); - if(Statistic.Any()) dest.Statistic = new List(Statistic.DeepCopy()); - if(Certainty.Any()) dest.Certainty = new List(Certainty.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(CiteAs != null) dest.CiteAs = (Hl7.Fhir.Model.DataType)CiteAs.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(AssertionElement != null) dest.AssertionElement = (Hl7.Fhir.Model.Markdown)AssertionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(VariableDefinition.Any()) dest.VariableDefinition = new List(VariableDefinition.DeepCopyInternal()); + if(SynthesisType != null) dest.SynthesisType = (Hl7.Fhir.Model.CodeableConcept)SynthesisType.DeepCopyInternal(); + if(StudyDesign.Any()) dest.StudyDesign = new List(StudyDesign.DeepCopyInternal()); + if(Statistic.Any()) dest.Statistic = new List(Statistic.DeepCopyInternal()); + if(Certainty.Any()) dest.Certainty = new List(Certainty.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Evidence()); + var instance = new Evidence(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/EvidenceReport.cs b/src/Hl7.Fhir.R5/Model/Generated/EvidenceReport.cs index 740de2d14e..7fb882ec1a 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/EvidenceReport.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/EvidenceReport.cs @@ -162,7 +162,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubjectComponent; @@ -171,15 +171,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubjectComponent()); + var instance = new SubjectComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -324,7 +325,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -333,17 +334,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -480,7 +482,7 @@ public Hl7.Fhir.Model.EvidenceReport.TargetComponent Target private Hl7.Fhir.Model.EvidenceReport.TargetComponent _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatesToComponent; @@ -489,15 +491,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.EvidenceReport.TargetComponent)Target.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.EvidenceReport.TargetComponent)Target.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatesToComponent()); + var instance = new RelatesToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -659,7 +662,7 @@ public Hl7.Fhir.Model.ResourceReference Resource private Hl7.Fhir.Model.ResourceReference _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -668,17 +671,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.Markdown)DisplayElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.Markdown)DisplayElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -975,7 +979,7 @@ public List Section private List _Section; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SectionComponent; @@ -984,25 +988,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Focus != null) dest.Focus = (Hl7.Fhir.Model.CodeableConcept)Focus.DeepCopy(); - if(FocusReference != null) dest.FocusReference = (Hl7.Fhir.Model.ResourceReference)FocusReference.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopy(); - if(EntryClassifier.Any()) dest.EntryClassifier = new List(EntryClassifier.DeepCopy()); - if(EntryReference.Any()) dest.EntryReference = new List(EntryReference.DeepCopy()); - if(EntryQuantity.Any()) dest.EntryQuantity = new List(EntryQuantity.DeepCopy()); - if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopy(); - if(Section.Any()) dest.Section = new List(Section.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Focus != null) dest.Focus = (Hl7.Fhir.Model.CodeableConcept)Focus.DeepCopyInternal(); + if(FocusReference != null) dest.FocusReference = (Hl7.Fhir.Model.ResourceReference)FocusReference.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopyInternal(); + if(EntryClassifier.Any()) dest.EntryClassifier = new List(EntryClassifier.DeepCopyInternal()); + if(EntryReference.Any()) dest.EntryReference = new List(EntryReference.DeepCopyInternal()); + if(EntryQuantity.Any()) dest.EntryQuantity = new List(EntryQuantity.DeepCopyInternal()); + if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopyInternal(); + if(Section.Any()) dest.Section = new List(Section.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SectionComponent()); + var instance = new SectionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1448,7 +1453,7 @@ public List Section List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EvidenceReport; @@ -1457,31 +1462,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(RelatedIdentifier.Any()) dest.RelatedIdentifier = new List(RelatedIdentifier.DeepCopy()); - if(CiteAs != null) dest.CiteAs = (Hl7.Fhir.Model.DataType)CiteAs.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.EvidenceReport.SubjectComponent)Subject.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopy()); - if(Section.Any()) dest.Section = new List(Section.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(RelatedIdentifier.Any()) dest.RelatedIdentifier = new List(RelatedIdentifier.DeepCopyInternal()); + if(CiteAs != null) dest.CiteAs = (Hl7.Fhir.Model.DataType)CiteAs.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.EvidenceReport.SubjectComponent)Subject.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopyInternal()); + if(Section.Any()) dest.Section = new List(Section.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EvidenceReport()); + var instance = new EvidenceReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/EvidenceVariable.cs b/src/Hl7.Fhir.R5/Model/Generated/EvidenceVariable.cs index a7903eeffa..5cc6d6c5e5 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/EvidenceVariable.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/EvidenceVariable.cs @@ -409,7 +409,7 @@ public List TimeFromEven private List _TimeFromEvent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -418,27 +418,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.Id)LinkIdElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopy(); - if(DefinitionReference != null) dest.DefinitionReference = (Hl7.Fhir.Model.ResourceReference)DefinitionReference.DeepCopy(); - if(DefinitionCanonicalElement != null) dest.DefinitionCanonicalElement = (Hl7.Fhir.Model.Canonical)DefinitionCanonicalElement.DeepCopy(); - if(DefinitionCodeableConcept != null) dest.DefinitionCodeableConcept = (Hl7.Fhir.Model.CodeableConcept)DefinitionCodeableConcept.DeepCopy(); - if(DefinitionExpression != null) dest.DefinitionExpression = (Hl7.Fhir.Model.Expression)DefinitionExpression.DeepCopy(); - if(DefinitionIdElement != null) dest.DefinitionIdElement = (Hl7.Fhir.Model.Id)DefinitionIdElement.DeepCopy(); - if(DefinitionByTypeAndValue != null) dest.DefinitionByTypeAndValue = (Hl7.Fhir.Model.EvidenceVariable.DefinitionByTypeAndValueComponent)DefinitionByTypeAndValue.DeepCopy(); - if(DefinitionByCombination != null) dest.DefinitionByCombination = (Hl7.Fhir.Model.EvidenceVariable.DefinitionByCombinationComponent)DefinitionByCombination.DeepCopy(); - if(Instances != null) dest.Instances = (Hl7.Fhir.Model.DataType)Instances.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.DataType)Duration.DeepCopy(); - if(TimeFromEvent.Any()) dest.TimeFromEvent = new List(TimeFromEvent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.Id)LinkIdElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopyInternal(); + if(DefinitionReference != null) dest.DefinitionReference = (Hl7.Fhir.Model.ResourceReference)DefinitionReference.DeepCopyInternal(); + if(DefinitionCanonicalElement != null) dest.DefinitionCanonicalElement = (Hl7.Fhir.Model.Canonical)DefinitionCanonicalElement.DeepCopyInternal(); + if(DefinitionCodeableConcept != null) dest.DefinitionCodeableConcept = (Hl7.Fhir.Model.CodeableConcept)DefinitionCodeableConcept.DeepCopyInternal(); + if(DefinitionExpression != null) dest.DefinitionExpression = (Hl7.Fhir.Model.Expression)DefinitionExpression.DeepCopyInternal(); + if(DefinitionIdElement != null) dest.DefinitionIdElement = (Hl7.Fhir.Model.Id)DefinitionIdElement.DeepCopyInternal(); + if(DefinitionByTypeAndValue != null) dest.DefinitionByTypeAndValue = (Hl7.Fhir.Model.EvidenceVariable.DefinitionByTypeAndValueComponent)DefinitionByTypeAndValue.DeepCopyInternal(); + if(DefinitionByCombination != null) dest.DefinitionByCombination = (Hl7.Fhir.Model.EvidenceVariable.DefinitionByCombinationComponent)DefinitionByCombination.DeepCopyInternal(); + if(Instances != null) dest.Instances = (Hl7.Fhir.Model.DataType)Instances.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.DataType)Duration.DeepCopyInternal(); + if(TimeFromEvent.Any()) dest.TimeFromEvent = new List(TimeFromEvent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -681,7 +682,7 @@ public Hl7.Fhir.Model.CodeableConcept Offset private Hl7.Fhir.Model.CodeableConcept _Offset; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DefinitionByTypeAndValueComponent; @@ -690,18 +691,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Method.Any()) dest.Method = new List(Method.DeepCopy()); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Offset != null) dest.Offset = (Hl7.Fhir.Model.CodeableConcept)Offset.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Method.Any()) dest.Method = new List(Method.DeepCopyInternal()); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Offset != null) dest.Offset = (Hl7.Fhir.Model.CodeableConcept)Offset.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DefinitionByTypeAndValueComponent()); + var instance = new DefinitionByTypeAndValueComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -876,7 +878,7 @@ public List Characteris private List _Characteristic; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DefinitionByCombinationComponent; @@ -885,16 +887,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(ThresholdElement != null) dest.ThresholdElement = (Hl7.Fhir.Model.PositiveInt)ThresholdElement.DeepCopy(); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(ThresholdElement != null) dest.ThresholdElement = (Hl7.Fhir.Model.PositiveInt)ThresholdElement.DeepCopyInternal(); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DefinitionByCombinationComponent()); + var instance = new DefinitionByCombinationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1058,7 +1061,7 @@ public Hl7.Fhir.Model.Range Range private Hl7.Fhir.Model.Range _Range; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TimeFromEventComponent; @@ -1067,18 +1070,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TimeFromEventComponent()); + var instance = new TimeFromEventComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1217,7 +1221,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CategoryComponent; @@ -1226,15 +1230,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CategoryComponent()); + var instance = new CategoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2006,7 +2011,7 @@ public List Category List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EvidenceVariable; @@ -2015,43 +2020,44 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopy(); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(HandlingElement != null) dest.HandlingElement = (Code)HandlingElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ShortTitleElement != null) dest.ShortTitleElement = (Hl7.Fhir.Model.FhirString)ShortTitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopyInternal(); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(HandlingElement != null) dest.HandlingElement = (Code)HandlingElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EvidenceVariable()); + var instance = new EvidenceVariable(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ExampleScenario.cs b/src/Hl7.Fhir.R5/Model/Generated/ExampleScenario.cs index 56904341dd..746595494b 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ExampleScenario.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ExampleScenario.cs @@ -201,7 +201,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActorComponent; @@ -210,17 +210,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KeyElement != null) dest.KeyElement = (Hl7.Fhir.Model.FhirString)KeyElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KeyElement != null) dest.KeyElement = (Hl7.Fhir.Model.FhirString)KeyElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActorComponent()); + var instance = new ActorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -505,7 +506,7 @@ public List Contained private List _ContainedInstance; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -514,22 +515,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KeyElement != null) dest.KeyElement = (Hl7.Fhir.Model.FhirString)KeyElement.DeepCopy(); - if(StructureType != null) dest.StructureType = (Hl7.Fhir.Model.Coding)StructureType.DeepCopy(); - if(StructureVersionElement != null) dest.StructureVersionElement = (Hl7.Fhir.Model.FhirString)StructureVersionElement.DeepCopy(); - if(StructureProfile != null) dest.StructureProfile = (Hl7.Fhir.Model.DataType)StructureProfile.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Content != null) dest.Content = (Hl7.Fhir.Model.ResourceReference)Content.DeepCopy(); - if(Version.Any()) dest.Version = new List(Version.DeepCopy()); - if(ContainedInstance.Any()) dest.ContainedInstance = new List(ContainedInstance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(KeyElement != null) dest.KeyElement = (Hl7.Fhir.Model.FhirString)KeyElement.DeepCopyInternal(); + if(StructureType != null) dest.StructureType = (Hl7.Fhir.Model.Coding)StructureType.DeepCopyInternal(); + if(StructureVersionElement != null) dest.StructureVersionElement = (Hl7.Fhir.Model.FhirString)StructureVersionElement.DeepCopyInternal(); + if(StructureProfile != null) dest.StructureProfile = (Hl7.Fhir.Model.DataType)StructureProfile.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Content != null) dest.Content = (Hl7.Fhir.Model.ResourceReference)Content.DeepCopyInternal(); + if(Version.Any()) dest.Version = new List(Version.DeepCopyInternal()); + if(ContainedInstance.Any()) dest.ContainedInstance = new List(ContainedInstance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -766,7 +768,7 @@ public Hl7.Fhir.Model.ResourceReference Content private Hl7.Fhir.Model.ResourceReference _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VersionComponent; @@ -775,17 +777,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KeyElement != null) dest.KeyElement = (Hl7.Fhir.Model.FhirString)KeyElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Content != null) dest.Content = (Hl7.Fhir.Model.ResourceReference)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KeyElement != null) dest.KeyElement = (Hl7.Fhir.Model.FhirString)KeyElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Content != null) dest.Content = (Hl7.Fhir.Model.ResourceReference)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VersionComponent()); + var instance = new VersionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -936,7 +939,7 @@ public string VersionReference } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainedInstanceComponent; @@ -945,15 +948,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(InstanceReferenceElement != null) dest.InstanceReferenceElement = (Hl7.Fhir.Model.FhirString)InstanceReferenceElement.DeepCopy(); - if(VersionReferenceElement != null) dest.VersionReferenceElement = (Hl7.Fhir.Model.FhirString)VersionReferenceElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(InstanceReferenceElement != null) dest.InstanceReferenceElement = (Hl7.Fhir.Model.FhirString)InstanceReferenceElement.DeepCopyInternal(); + if(VersionReferenceElement != null) dest.VersionReferenceElement = (Hl7.Fhir.Model.FhirString)VersionReferenceElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainedInstanceComponent()); + var instance = new ContainedInstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1165,7 +1169,7 @@ public List Step private List _Step; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcessComponent; @@ -1174,18 +1178,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(PreConditionsElement != null) dest.PreConditionsElement = (Hl7.Fhir.Model.Markdown)PreConditionsElement.DeepCopy(); - if(PostConditionsElement != null) dest.PostConditionsElement = (Hl7.Fhir.Model.Markdown)PostConditionsElement.DeepCopy(); - if(Step.Any()) dest.Step = new List(Step.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(PreConditionsElement != null) dest.PreConditionsElement = (Hl7.Fhir.Model.Markdown)PreConditionsElement.DeepCopyInternal(); + if(PostConditionsElement != null) dest.PostConditionsElement = (Hl7.Fhir.Model.Markdown)PostConditionsElement.DeepCopyInternal(); + if(Step.Any()) dest.Step = new List(Step.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcessComponent()); + var instance = new ProcessComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1414,7 +1419,7 @@ public bool? Pause } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StepComponent; @@ -1423,19 +1428,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.FhirString)NumberElement.DeepCopy(); - if(Process != null) dest.Process = (Hl7.Fhir.Model.ExampleScenario.ProcessComponent)Process.DeepCopy(); - if(WorkflowElement != null) dest.WorkflowElement = (Hl7.Fhir.Model.Canonical)WorkflowElement.DeepCopy(); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.ExampleScenario.OperationComponent)Operation.DeepCopy(); - if(Alternative.Any()) dest.Alternative = new List(Alternative.DeepCopy()); - if(PauseElement != null) dest.PauseElement = (Hl7.Fhir.Model.FhirBoolean)PauseElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.FhirString)NumberElement.DeepCopyInternal(); + if(Process != null) dest.Process = (Hl7.Fhir.Model.ExampleScenario.ProcessComponent)Process.DeepCopyInternal(); + if(WorkflowElement != null) dest.WorkflowElement = (Hl7.Fhir.Model.Canonical)WorkflowElement.DeepCopyInternal(); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.ExampleScenario.OperationComponent)Operation.DeepCopyInternal(); + if(Alternative.Any()) dest.Alternative = new List(Alternative.DeepCopyInternal()); + if(PauseElement != null) dest.PauseElement = (Hl7.Fhir.Model.FhirBoolean)PauseElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StepComponent()); + var instance = new StepComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1765,7 +1771,7 @@ public Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent Response private Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent _Response; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -1774,22 +1780,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(InitiatorElement != null) dest.InitiatorElement = (Hl7.Fhir.Model.FhirString)InitiatorElement.DeepCopy(); - if(ReceiverElement != null) dest.ReceiverElement = (Hl7.Fhir.Model.FhirString)ReceiverElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(InitiatorActiveElement != null) dest.InitiatorActiveElement = (Hl7.Fhir.Model.FhirBoolean)InitiatorActiveElement.DeepCopy(); - if(ReceiverActiveElement != null) dest.ReceiverActiveElement = (Hl7.Fhir.Model.FhirBoolean)ReceiverActiveElement.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent)Request.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent)Response.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(InitiatorElement != null) dest.InitiatorElement = (Hl7.Fhir.Model.FhirString)InitiatorElement.DeepCopyInternal(); + if(ReceiverElement != null) dest.ReceiverElement = (Hl7.Fhir.Model.FhirString)ReceiverElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(InitiatorActiveElement != null) dest.InitiatorActiveElement = (Hl7.Fhir.Model.FhirBoolean)InitiatorActiveElement.DeepCopyInternal(); + if(ReceiverActiveElement != null) dest.ReceiverActiveElement = (Hl7.Fhir.Model.FhirBoolean)ReceiverActiveElement.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent)Request.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.ExampleScenario.ContainedInstanceComponent)Response.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationComponent()); + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1994,7 +2001,7 @@ public List Step private List _Step; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AlternativeComponent; @@ -2003,16 +2010,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Step.Any()) dest.Step = new List(Step.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Step.Any()) dest.Step = new List(Step.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AlternativeComponent()); + var instance = new AlternativeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2567,7 +2575,7 @@ public List Process List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExampleScenario; @@ -2576,33 +2584,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - if(Process.Any()) dest.Process = new List(Process.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); + if(Process.Any()) dest.Process = new List(Process.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExampleScenario()); + var instance = new ExampleScenario(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ExplanationOfBenefit.cs b/src/Hl7.Fhir.R5/Model/Generated/ExplanationOfBenefit.cs index 7de1ad46ee..5c98ad303e 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ExplanationOfBenefit.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ExplanationOfBenefit.cs @@ -152,7 +152,7 @@ public Hl7.Fhir.Model.Identifier Reference private Hl7.Fhir.Model.Identifier _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedClaimComponent; @@ -161,16 +161,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedClaimComponent()); + var instance = new RelatedClaimComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -281,7 +282,7 @@ public Hl7.Fhir.Model.DataType When private Hl7.Fhir.Model.DataType _When; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventComponent; @@ -290,15 +291,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventComponent()); + var instance = new EventComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -400,7 +402,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayeeComponent; @@ -409,15 +411,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayeeComponent()); + var instance = new PayeeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -596,7 +599,7 @@ public Hl7.Fhir.Model.CodeableConcept Specialty private Hl7.Fhir.Model.CodeableConcept _Specialty; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CareTeamComponent; @@ -605,18 +608,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Specialty != null) dest.Specialty = (Hl7.Fhir.Model.CodeableConcept)Specialty.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Specialty != null) dest.Specialty = (Hl7.Fhir.Model.CodeableConcept)Specialty.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CareTeamComponent()); + var instance = new CareTeamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -819,7 +823,7 @@ public Hl7.Fhir.Model.Coding Reason private Hl7.Fhir.Model.Coding _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportingInformationComponent; @@ -828,19 +832,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.Coding)Reason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.Coding)Reason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportingInformationComponent()); + var instance = new SupportingInformationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1023,7 +1028,7 @@ public Hl7.Fhir.Model.CodeableConcept OnAdmission private Hl7.Fhir.Model.CodeableConcept _OnAdmission; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -1032,17 +1037,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(OnAdmission != null) dest.OnAdmission = (Hl7.Fhir.Model.CodeableConcept)OnAdmission.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(OnAdmission != null) dest.OnAdmission = (Hl7.Fhir.Model.CodeableConcept)OnAdmission.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1242,7 +1248,7 @@ public List Udi private List _Udi; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcedureComponent; @@ -1251,18 +1257,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcedureComponent()); + var instance = new ProcedureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1439,7 +1446,7 @@ public IEnumerable PreAuthRef } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -1448,16 +1455,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1598,7 +1606,7 @@ public Hl7.Fhir.Model.DataType Location private Hl7.Fhir.Model.DataType _Location; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AccidentComponent; @@ -1607,16 +1615,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AccidentComponent()); + var instance = new AccidentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2219,7 +2228,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -2228,41 +2237,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(CareTeamSequenceElement.Any()) dest.CareTeamSequenceElement = new List(CareTeamSequenceElement.DeepCopy()); - if(DiagnosisSequenceElement.Any()) dest.DiagnosisSequenceElement = new List(DiagnosisSequenceElement.DeepCopy()); - if(ProcedureSequenceElement.Any()) dest.ProcedureSequenceElement = new List(ProcedureSequenceElement.DeepCopy()); - if(InformationSequenceElement.Any()) dest.InformationSequenceElement = new List(InformationSequenceElement.DeepCopy()); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopy(); - if(Request.Any()) dest.Request = new List(Request.DeepCopy()); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ExplanationOfBenefit.ReviewOutcomeComponent)ReviewOutcome.DeepCopy(); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ItemComponent()); + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(CareTeamSequenceElement.Any()) dest.CareTeamSequenceElement = new List(CareTeamSequenceElement.DeepCopyInternal()); + if(DiagnosisSequenceElement.Any()) dest.DiagnosisSequenceElement = new List(DiagnosisSequenceElement.DeepCopyInternal()); + if(ProcedureSequenceElement.Any()) dest.ProcedureSequenceElement = new List(ProcedureSequenceElement.DeepCopyInternal()); + if(InformationSequenceElement.Any()) dest.InformationSequenceElement = new List(InformationSequenceElement.DeepCopyInternal()); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopyInternal(); + if(Request.Any()) dest.Request = new List(Request.DeepCopyInternal()); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ExplanationOfBenefit.ReviewOutcomeComponent)ReviewOutcome.DeepCopyInternal(); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2572,7 +2582,7 @@ public List SubSite private List _SubSite; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemBodySiteComponent; @@ -2581,15 +2591,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Site.Any()) dest.Site = new List(Site.DeepCopy()); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Site.Any()) dest.Site = new List(Site.DeepCopyInternal()); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemBodySiteComponent()); + var instance = new ItemBodySiteComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2734,7 +2745,7 @@ public Hl7.Fhir.Model.Period PreAuthPeriod private Hl7.Fhir.Model.Period _PreAuthPeriod; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReviewOutcomeComponent; @@ -2743,17 +2754,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopy(); - if(PreAuthPeriod != null) dest.PreAuthPeriod = (Hl7.Fhir.Model.Period)PreAuthPeriod.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(PreAuthRefElement != null) dest.PreAuthRefElement = (Hl7.Fhir.Model.FhirString)PreAuthRefElement.DeepCopyInternal(); + if(PreAuthPeriod != null) dest.PreAuthPeriod = (Hl7.Fhir.Model.Period)PreAuthPeriod.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReviewOutcomeComponent()); + var instance = new ReviewOutcomeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2896,7 +2908,7 @@ public Hl7.Fhir.Model.Quantity Quantity private Hl7.Fhir.Model.Quantity _Quantity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdjudicationComponent; @@ -2905,17 +2917,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdjudicationComponent()); + var instance = new AdjudicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3320,7 +3333,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -3329,32 +3342,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ExplanationOfBenefit.ReviewOutcomeComponent)ReviewOutcome.DeepCopy(); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new DetailComponent()); + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ExplanationOfBenefit.ReviewOutcomeComponent)ReviewOutcome.DeepCopyInternal(); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3865,7 +3879,7 @@ public List Adjudicat private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubDetailComponent; @@ -3874,31 +3888,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ExplanationOfBenefit.ReviewOutcomeComponent)ReviewOutcome.DeepCopy(); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new SubDetailComponent()); + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ExplanationOfBenefit.ReviewOutcomeComponent)ReviewOutcome.DeepCopyInternal(); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new SubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4527,7 +4542,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemComponent; @@ -4536,37 +4551,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ItemSequenceElement.Any()) dest.ItemSequenceElement = new List(ItemSequenceElement.DeepCopy()); - if(DetailSequenceElement.Any()) dest.DetailSequenceElement = new List(DetailSequenceElement.DeepCopy()); - if(SubDetailSequenceElement.Any()) dest.SubDetailSequenceElement = new List(SubDetailSequenceElement.DeepCopy()); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(Provider.Any()) dest.Provider = new List(Provider.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopy(); - if(Request.Any()) dest.Request = new List(Request.DeepCopy()); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ExplanationOfBenefit.ReviewOutcomeComponent)ReviewOutcome.DeepCopy(); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new AddedItemComponent()); + base.CopyToInternal(dest); + if(ItemSequenceElement.Any()) dest.ItemSequenceElement = new List(ItemSequenceElement.DeepCopyInternal()); + if(DetailSequenceElement.Any()) dest.DetailSequenceElement = new List(DetailSequenceElement.DeepCopyInternal()); + if(SubDetailSequenceElement.Any()) dest.SubDetailSequenceElement = new List(SubDetailSequenceElement.DeepCopyInternal()); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(Provider.Any()) dest.Provider = new List(Provider.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopyInternal(); + if(Request.Any()) dest.Request = new List(Request.DeepCopyInternal()); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ExplanationOfBenefit.ReviewOutcomeComponent)ReviewOutcome.DeepCopyInternal(); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new AddedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4844,7 +4860,7 @@ public List SubSite private List _SubSite; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemBodySiteComponent; @@ -4853,15 +4869,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Site.Any()) dest.Site = new List(Site.DeepCopy()); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Site.Any()) dest.Site = new List(Site.DeepCopyInternal()); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemBodySiteComponent()); + var instance = new AddedItemBodySiteComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5173,7 +5190,7 @@ public List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemDetailComponent; @@ -5182,28 +5199,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ExplanationOfBenefit.ReviewOutcomeComponent)ReviewOutcome.DeepCopy(); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ExplanationOfBenefit.ReviewOutcomeComponent)ReviewOutcome.DeepCopyInternal(); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemDetailComponent()); + var instance = new AddedItemDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5605,7 +5623,7 @@ public List Adjudicat private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemDetailSubDetailComponent; @@ -5614,27 +5632,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopy(); - if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ExplanationOfBenefit.ReviewOutcomeComponent)ReviewOutcome.DeepCopy(); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(ProductOrService != null) dest.ProductOrService = (Hl7.Fhir.Model.CodeableConcept)ProductOrService.DeepCopyInternal(); + if(ProductOrServiceEnd != null) dest.ProductOrServiceEnd = (Hl7.Fhir.Model.CodeableConcept)ProductOrServiceEnd.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Tax != null) dest.Tax = (Hl7.Fhir.Model.Money)Tax.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(ReviewOutcome != null) dest.ReviewOutcome = (Hl7.Fhir.Model.ExplanationOfBenefit.ReviewOutcomeComponent)ReviewOutcome.DeepCopyInternal(); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemDetailSubDetailComponent()); + var instance = new AddedItemDetailSubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5832,7 +5851,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TotalComponent; @@ -5841,15 +5860,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TotalComponent()); + var instance = new TotalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -6019,7 +6039,7 @@ public Hl7.Fhir.Model.Identifier Identifier private Hl7.Fhir.Model.Identifier _Identifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentComponent; @@ -6028,19 +6048,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopy(); - if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopyInternal(); + if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentComponent()); + var instance = new PaymentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -6234,7 +6255,7 @@ public Hl7.Fhir.Model.CodeableConcept Language private Hl7.Fhir.Model.CodeableConcept _Language; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NoteComponent; @@ -6243,17 +6264,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NoteComponent()); + var instance = new NoteComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -6502,7 +6524,7 @@ public List Financial private List _Financial; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BenefitBalanceComponent; @@ -6511,21 +6533,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopy(); - if(Financial.Any()) dest.Financial = new List(Financial.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopyInternal(); + if(Financial.Any()) dest.Financial = new List(Financial.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BenefitBalanceComponent()); + var instance = new BenefitBalanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -6690,7 +6713,7 @@ public Hl7.Fhir.Model.DataType Used private Hl7.Fhir.Model.DataType _Used; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BenefitComponent; @@ -6699,16 +6722,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopy(); - if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopyInternal(); + if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BenefitComponent()); + var instance = new BenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -7597,7 +7621,7 @@ public List Benefit List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExplanationOfBenefit; @@ -7606,62 +7630,63 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(FundsReserveRequested != null) dest.FundsReserveRequested = (Hl7.Fhir.Model.CodeableConcept)FundsReserveRequested.DeepCopy(); - if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopy(); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopy(); - if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopy(); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ExplanationOfBenefit.PayeeComponent)Payee.DeepCopy(); - if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopy(); - if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopy()); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopy(); - if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopy()); - if(PreAuthRefPeriod.Any()) dest.PreAuthRefPeriod = new List(PreAuthRefPeriod.DeepCopy()); - if(DiagnosisRelatedGroup != null) dest.DiagnosisRelatedGroup = (Hl7.Fhir.Model.CodeableConcept)DiagnosisRelatedGroup.DeepCopy(); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopy()); - if(PrecedenceElement != null) dest.PrecedenceElement = (Hl7.Fhir.Model.PositiveInt)PrecedenceElement.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Accident != null) dest.Accident = (Hl7.Fhir.Model.ExplanationOfBenefit.AccidentComponent)Accident.DeepCopy(); - if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Total.Any()) dest.Total = new List(Total.DeepCopy()); - if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ExplanationOfBenefit.PaymentComponent)Payment.DeepCopy(); - if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.Attachment)Form.DeepCopy(); - if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopy()); - if(BenefitPeriod != null) dest.BenefitPeriod = (Hl7.Fhir.Model.Period)BenefitPeriod.DeepCopy(); - if(BenefitBalance.Any()) dest.BenefitBalance = new List(BenefitBalance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TraceNumber.Any()) dest.TraceNumber = new List(TraceNumber.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(FundsReserveRequested != null) dest.FundsReserveRequested = (Hl7.Fhir.Model.CodeableConcept)FundsReserveRequested.DeepCopyInternal(); + if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopyInternal(); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); + if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopyInternal(); + if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopyInternal(); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ExplanationOfBenefit.PayeeComponent)Payee.DeepCopyInternal(); + if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopyInternal(); + if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopyInternal()); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopyInternal(); + if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(Decision != null) dest.Decision = (Hl7.Fhir.Model.CodeableConcept)Decision.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopyInternal()); + if(PreAuthRefPeriod.Any()) dest.PreAuthRefPeriod = new List(PreAuthRefPeriod.DeepCopyInternal()); + if(DiagnosisRelatedGroup != null) dest.DiagnosisRelatedGroup = (Hl7.Fhir.Model.CodeableConcept)DiagnosisRelatedGroup.DeepCopyInternal(); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopyInternal()); + if(PrecedenceElement != null) dest.PrecedenceElement = (Hl7.Fhir.Model.PositiveInt)PrecedenceElement.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Accident != null) dest.Accident = (Hl7.Fhir.Model.ExplanationOfBenefit.AccidentComponent)Accident.DeepCopyInternal(); + if(PatientPaid != null) dest.PatientPaid = (Hl7.Fhir.Model.Money)PatientPaid.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Total.Any()) dest.Total = new List(Total.DeepCopyInternal()); + if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ExplanationOfBenefit.PaymentComponent)Payment.DeepCopyInternal(); + if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.Attachment)Form.DeepCopyInternal(); + if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopyInternal()); + if(BenefitPeriod != null) dest.BenefitPeriod = (Hl7.Fhir.Model.Period)BenefitPeriod.DeepCopyInternal(); + if(BenefitBalance.Any()) dest.BenefitBalance = new List(BenefitBalance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExplanationOfBenefit()); + var instance = new ExplanationOfBenefit(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Expression.cs b/src/Hl7.Fhir.R5/Model/Generated/Expression.cs index 00a1be4880..83a96882ba 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Expression.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Expression.cs @@ -215,7 +215,7 @@ public string Reference } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Expression; @@ -224,18 +224,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Expression()); + var instance = new Expression(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ExtendedContactDetail.cs b/src/Hl7.Fhir.R5/Model/Generated/ExtendedContactDetail.cs index 443ed2d895..7975c2972e 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ExtendedContactDetail.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ExtendedContactDetail.cs @@ -143,7 +143,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExtendedContactDetail; @@ -152,19 +152,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Purpose != null) dest.Purpose = (Hl7.Fhir.Model.CodeableConcept)Purpose.DeepCopy(); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Purpose != null) dest.Purpose = (Hl7.Fhir.Model.CodeableConcept)Purpose.DeepCopyInternal(); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExtendedContactDetail()); + var instance = new ExtendedContactDetail(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/FamilyMemberHistory.cs b/src/Hl7.Fhir.R5/Model/Generated/FamilyMemberHistory.cs index 94c9ca8292..65bcd88ffb 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/FamilyMemberHistory.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/FamilyMemberHistory.cs @@ -139,7 +139,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -148,15 +148,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -317,7 +318,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConditionComponent; @@ -326,18 +327,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(ContributedToDeathElement != null) dest.ContributedToDeathElement = (Hl7.Fhir.Model.FhirBoolean)ContributedToDeathElement.DeepCopy(); - if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(ContributedToDeathElement != null) dest.ContributedToDeathElement = (Hl7.Fhir.Model.FhirBoolean)ContributedToDeathElement.DeepCopyInternal(); + if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConditionComponent()); + var instance = new ConditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -522,7 +524,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcedureComponent; @@ -531,18 +533,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(ContributedToDeathElement != null) dest.ContributedToDeathElement = (Hl7.Fhir.Model.FhirBoolean)ContributedToDeathElement.DeepCopy(); - if(Performed != null) dest.Performed = (Hl7.Fhir.Model.DataType)Performed.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(ContributedToDeathElement != null) dest.ContributedToDeathElement = (Hl7.Fhir.Model.FhirBoolean)ContributedToDeathElement.DeepCopyInternal(); + if(Performed != null) dest.Performed = (Hl7.Fhir.Model.DataType)Performed.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcedureComponent()); + var instance = new ProcedureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1004,7 +1007,7 @@ public List Procedure List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FamilyMemberHistory; @@ -1013,32 +1016,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Sex != null) dest.Sex = (Hl7.Fhir.Model.CodeableConcept)Sex.DeepCopy(); - if(Born != null) dest.Born = (Hl7.Fhir.Model.DataType)Born.DeepCopy(); - if(Age != null) dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopy(); - if(EstimatedAgeElement != null) dest.EstimatedAgeElement = (Hl7.Fhir.Model.FhirBoolean)EstimatedAgeElement.DeepCopy(); - if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Sex != null) dest.Sex = (Hl7.Fhir.Model.CodeableConcept)Sex.DeepCopyInternal(); + if(Born != null) dest.Born = (Hl7.Fhir.Model.DataType)Born.DeepCopyInternal(); + if(Age != null) dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopyInternal(); + if(EstimatedAgeElement != null) dest.EstimatedAgeElement = (Hl7.Fhir.Model.FhirBoolean)EstimatedAgeElement.DeepCopyInternal(); + if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FamilyMemberHistory()); + var instance = new FamilyMemberHistory(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Flag.cs b/src/Hl7.Fhir.R5/Model/Generated/Flag.cs index 2b938667ff..6aea57f5fa 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Flag.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Flag.cs @@ -226,7 +226,7 @@ public Hl7.Fhir.Model.ResourceReference Author List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Flag; @@ -235,21 +235,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Flag()); + var instance = new Flag(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/FormularyItem.cs b/src/Hl7.Fhir.R5/Model/Generated/FormularyItem.cs index e78fd9eddb..ac6833a8ce 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/FormularyItem.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/FormularyItem.cs @@ -150,7 +150,7 @@ public Hl7.Fhir.Model.FormularyItem.FormularyItemStatusCodes? Status List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FormularyItem; @@ -159,16 +159,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FormularyItem()); + var instance = new FormularyItem(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/GenomicStudy.cs b/src/Hl7.Fhir.R5/Model/Generated/GenomicStudy.cs index cf2d491f4e..7bfb553223 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/GenomicStudy.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/GenomicStudy.cs @@ -446,7 +446,7 @@ public List Device private List _Device; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AnalysisComponent; @@ -455,31 +455,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(MethodType.Any()) dest.MethodType = new List(MethodType.DeepCopy()); - if(ChangeType.Any()) dest.ChangeType = new List(ChangeType.DeepCopy()); - if(GenomeBuild != null) dest.GenomeBuild = (Hl7.Fhir.Model.CodeableConcept)GenomeBuild.DeepCopy(); - if(InstantiatesCanonicalElement != null) dest.InstantiatesCanonicalElement = (Hl7.Fhir.Model.Canonical)InstantiatesCanonicalElement.DeepCopy(); - if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopy()); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(ProtocolPerformed != null) dest.ProtocolPerformed = (Hl7.Fhir.Model.ResourceReference)ProtocolPerformed.DeepCopy(); - if(RegionsStudied.Any()) dest.RegionsStudied = new List(RegionsStudied.DeepCopy()); - if(RegionsCalled.Any()) dest.RegionsCalled = new List(RegionsCalled.DeepCopy()); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Output.Any()) dest.Output = new List(Output.DeepCopy()); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Device.Any()) dest.Device = new List(Device.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new AnalysisComponent()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(MethodType.Any()) dest.MethodType = new List(MethodType.DeepCopyInternal()); + if(ChangeType.Any()) dest.ChangeType = new List(ChangeType.DeepCopyInternal()); + if(GenomeBuild != null) dest.GenomeBuild = (Hl7.Fhir.Model.CodeableConcept)GenomeBuild.DeepCopyInternal(); + if(InstantiatesCanonicalElement != null) dest.InstantiatesCanonicalElement = (Hl7.Fhir.Model.Canonical)InstantiatesCanonicalElement.DeepCopyInternal(); + if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopyInternal()); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(ProtocolPerformed != null) dest.ProtocolPerformed = (Hl7.Fhir.Model.ResourceReference)ProtocolPerformed.DeepCopyInternal(); + if(RegionsStudied.Any()) dest.RegionsStudied = new List(RegionsStudied.DeepCopyInternal()); + if(RegionsCalled.Any()) dest.RegionsCalled = new List(RegionsCalled.DeepCopyInternal()); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Output.Any()) dest.Output = new List(Output.DeepCopyInternal()); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Device.Any()) dest.Device = new List(Device.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new AnalysisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -721,7 +722,7 @@ public Hl7.Fhir.Model.DataType GeneratedBy private Hl7.Fhir.Model.DataType _GeneratedBy; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InputComponent; @@ -730,16 +731,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(File != null) dest.File = (Hl7.Fhir.Model.ResourceReference)File.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(GeneratedBy != null) dest.GeneratedBy = (Hl7.Fhir.Model.DataType)GeneratedBy.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(File != null) dest.File = (Hl7.Fhir.Model.ResourceReference)File.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(GeneratedBy != null) dest.GeneratedBy = (Hl7.Fhir.Model.DataType)GeneratedBy.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InputComponent()); + var instance = new InputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -845,7 +847,7 @@ public Hl7.Fhir.Model.CodeableConcept Type private Hl7.Fhir.Model.CodeableConcept _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OutputComponent; @@ -854,15 +856,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(File != null) dest.File = (Hl7.Fhir.Model.ResourceReference)File.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(File != null) dest.File = (Hl7.Fhir.Model.ResourceReference)File.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OutputComponent()); + var instance = new OutputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -959,7 +962,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -968,15 +971,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1073,7 +1077,7 @@ public Hl7.Fhir.Model.CodeableConcept Function private Hl7.Fhir.Model.CodeableConcept _Function; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceComponent; @@ -1082,15 +1086,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceComponent()); + var instance = new DeviceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1455,7 +1460,7 @@ public List Analysis List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GenomicStudy; @@ -1464,28 +1469,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(StartDateElement != null) dest.StartDateElement = (Hl7.Fhir.Model.FhirDateTime)StartDateElement.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Referrer != null) dest.Referrer = (Hl7.Fhir.Model.ResourceReference)Referrer.DeepCopy(); - if(Interpreter.Any()) dest.Interpreter = new List(Interpreter.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(InstantiatesCanonicalElement != null) dest.InstantiatesCanonicalElement = (Hl7.Fhir.Model.Canonical)InstantiatesCanonicalElement.DeepCopy(); - if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Analysis.Any()) dest.Analysis = new List(Analysis.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(StartDateElement != null) dest.StartDateElement = (Hl7.Fhir.Model.FhirDateTime)StartDateElement.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Referrer != null) dest.Referrer = (Hl7.Fhir.Model.ResourceReference)Referrer.DeepCopyInternal(); + if(Interpreter.Any()) dest.Interpreter = new List(Interpreter.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(InstantiatesCanonicalElement != null) dest.InstantiatesCanonicalElement = (Hl7.Fhir.Model.Canonical)InstantiatesCanonicalElement.DeepCopyInternal(); + if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Analysis.Any()) dest.Analysis = new List(Analysis.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GenomicStudy()); + var instance = new GenomicStudy(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Goal.cs b/src/Hl7.Fhir.R5/Model/Generated/Goal.cs index 38bf57a378..2183ba78d8 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Goal.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Goal.cs @@ -186,7 +186,7 @@ public Hl7.Fhir.Model.DataType Due private Hl7.Fhir.Model.DataType _Due; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -195,16 +195,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopy(); - if(Due != null) dest.Due = (Hl7.Fhir.Model.DataType)Due.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopyInternal(); + if(Due != null) dest.Due = (Hl7.Fhir.Model.DataType)Due.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -575,7 +576,7 @@ public List Outcome List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Goal; @@ -584,29 +585,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(LifecycleStatusElement != null) dest.LifecycleStatusElement = (Code)LifecycleStatusElement.DeepCopy(); - if(AchievementStatus != null) dest.AchievementStatus = (Hl7.Fhir.Model.CodeableConcept)AchievementStatus.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(ContinuousElement != null) dest.ContinuousElement = (Hl7.Fhir.Model.FhirBoolean)ContinuousElement.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Start != null) dest.Start = (Hl7.Fhir.Model.DataType)Start.DeepCopy(); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.Date)StatusDateElement.DeepCopy(); - if(StatusReasonElement != null) dest.StatusReasonElement = (Hl7.Fhir.Model.FhirString)StatusReasonElement.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Outcome.Any()) dest.Outcome = new List(Outcome.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(LifecycleStatusElement != null) dest.LifecycleStatusElement = (Code)LifecycleStatusElement.DeepCopyInternal(); + if(AchievementStatus != null) dest.AchievementStatus = (Hl7.Fhir.Model.CodeableConcept)AchievementStatus.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(ContinuousElement != null) dest.ContinuousElement = (Hl7.Fhir.Model.FhirBoolean)ContinuousElement.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Start != null) dest.Start = (Hl7.Fhir.Model.DataType)Start.DeepCopyInternal(); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.Date)StatusDateElement.DeepCopyInternal(); + if(StatusReasonElement != null) dest.StatusReasonElement = (Hl7.Fhir.Model.FhirString)StatusReasonElement.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Outcome.Any()) dest.Outcome = new List(Outcome.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Goal()); + var instance = new Goal(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/GraphDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/GraphDefinition.cs index e09f35e2c2..2ee44bd61a 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/GraphDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/GraphDefinition.cs @@ -256,7 +256,7 @@ public string Profile } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NodeComponent; @@ -265,17 +265,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NodeIdElement != null) dest.NodeIdElement = (Hl7.Fhir.Model.Id)NodeIdElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NodeIdElement != null) dest.NodeIdElement = (Hl7.Fhir.Model.Id)NodeIdElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NodeComponent()); + var instance = new NodeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -624,7 +625,7 @@ public List Compartment private List _Compartment; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -633,22 +634,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SliceNameElement != null) dest.SliceNameElement = (Hl7.Fhir.Model.FhirString)SliceNameElement.DeepCopy(); - if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopy(); - if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopy(); - if(Compartment.Any()) dest.Compartment = new List(Compartment.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SliceNameElement != null) dest.SliceNameElement = (Hl7.Fhir.Model.FhirString)SliceNameElement.DeepCopyInternal(); + if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopyInternal(); + if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopyInternal(); + if(Compartment.Any()) dest.Compartment = new List(Compartment.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -937,7 +939,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CompartmentComponent; @@ -946,18 +948,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(RuleElement != null) dest.RuleElement = (Code)RuleElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(RuleElement != null) dest.RuleElement = (Code)RuleElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CompartmentComponent()); + var instance = new CompartmentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1547,7 +1550,7 @@ public List Link List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GraphDefinition; @@ -1556,33 +1559,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Id)StartElement.DeepCopy(); - if(Node.Any()) dest.Node = new List(Node.DeepCopy()); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Id)StartElement.DeepCopyInternal(); + if(Node.Any()) dest.Node = new List(Node.DeepCopyInternal()); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GraphDefinition()); + var instance = new GraphDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Group.cs b/src/Hl7.Fhir.R5/Model/Generated/Group.cs index bf8cefa63e..f59c726b2e 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Group.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Group.cs @@ -246,7 +246,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -255,17 +255,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -413,7 +414,7 @@ public bool? Inactive } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MemberComponent; @@ -422,16 +423,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Entity != null) dest.Entity = (Hl7.Fhir.Model.ResourceReference)Entity.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Entity != null) dest.Entity = (Hl7.Fhir.Model.ResourceReference)Entity.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MemberComponent()); + var instance = new MemberComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -759,7 +761,7 @@ public List Member List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Group; @@ -768,24 +770,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(MembershipElement != null) dest.MembershipElement = (Code)MembershipElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.UnsignedInt)QuantityElement.DeepCopy(); - if(ManagingEntity != null) dest.ManagingEntity = (Hl7.Fhir.Model.ResourceReference)ManagingEntity.DeepCopy(); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(Member.Any()) dest.Member = new List(Member.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(MembershipElement != null) dest.MembershipElement = (Code)MembershipElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.UnsignedInt)QuantityElement.DeepCopyInternal(); + if(ManagingEntity != null) dest.ManagingEntity = (Hl7.Fhir.Model.ResourceReference)ManagingEntity.DeepCopyInternal(); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(Member.Any()) dest.Member = new List(Member.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Group()); + var instance = new Group(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/GuidanceResponse.cs b/src/Hl7.Fhir.R5/Model/Generated/GuidanceResponse.cs index 75734f4011..d18ac19560 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/GuidanceResponse.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/GuidanceResponse.cs @@ -349,7 +349,7 @@ public List DataRequirement List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GuidanceResponse; @@ -358,27 +358,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RequestIdentifier != null) dest.RequestIdentifier = (Hl7.Fhir.Model.Identifier)RequestIdentifier.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Module != null) dest.Module = (Hl7.Fhir.Model.DataType)Module.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(OccurrenceDateTimeElement != null) dest.OccurrenceDateTimeElement = (Hl7.Fhir.Model.FhirDateTime)OccurrenceDateTimeElement.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(EvaluationMessage != null) dest.EvaluationMessage = (Hl7.Fhir.Model.ResourceReference)EvaluationMessage.DeepCopy(); - if(OutputParameters != null) dest.OutputParameters = (Hl7.Fhir.Model.ResourceReference)OutputParameters.DeepCopy(); - if(Result.Any()) dest.Result = new List(Result.DeepCopy()); - if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RequestIdentifier != null) dest.RequestIdentifier = (Hl7.Fhir.Model.Identifier)RequestIdentifier.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Module != null) dest.Module = (Hl7.Fhir.Model.DataType)Module.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(OccurrenceDateTimeElement != null) dest.OccurrenceDateTimeElement = (Hl7.Fhir.Model.FhirDateTime)OccurrenceDateTimeElement.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(EvaluationMessage != null) dest.EvaluationMessage = (Hl7.Fhir.Model.ResourceReference)EvaluationMessage.DeepCopyInternal(); + if(OutputParameters != null) dest.OutputParameters = (Hl7.Fhir.Model.ResourceReference)OutputParameters.DeepCopyInternal(); + if(Result.Any()) dest.Result = new List(Result.DeepCopyInternal()); + if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GuidanceResponse()); + var instance = new GuidanceResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/HealthcareService.cs b/src/Hl7.Fhir.R5/Model/Generated/HealthcareService.cs index c50cbbbe04..1f18c7b4f1 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/HealthcareService.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/HealthcareService.cs @@ -117,7 +117,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EligibilityComponent; @@ -126,15 +126,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EligibilityComponent()); + var instance = new EligibilityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -615,7 +616,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HealthcareService; @@ -624,36 +625,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(ProvidedBy != null) dest.ProvidedBy = (Hl7.Fhir.Model.ResourceReference)ProvidedBy.DeepCopy(); - if(OfferedIn.Any()) dest.OfferedIn = new List(OfferedIn.DeepCopy()); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopy(); - if(ExtraDetailsElement != null) dest.ExtraDetailsElement = (Hl7.Fhir.Model.Markdown)ExtraDetailsElement.DeepCopy(); - if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopy()); - if(ServiceProvisionCode.Any()) dest.ServiceProvisionCode = new List(ServiceProvisionCode.DeepCopy()); - if(Eligibility.Any()) dest.Eligibility = new List(Eligibility.DeepCopy()); - if(Program.Any()) dest.Program = new List(Program.DeepCopy()); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - if(ReferralMethod.Any()) dest.ReferralMethod = new List(ReferralMethod.DeepCopy()); - if(AppointmentRequiredElement != null) dest.AppointmentRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AppointmentRequiredElement.DeepCopy(); - if(Availability.Any()) dest.Availability = new List(Availability.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new HealthcareService()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(ProvidedBy != null) dest.ProvidedBy = (Hl7.Fhir.Model.ResourceReference)ProvidedBy.DeepCopyInternal(); + if(OfferedIn.Any()) dest.OfferedIn = new List(OfferedIn.DeepCopyInternal()); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopyInternal(); + if(ExtraDetailsElement != null) dest.ExtraDetailsElement = (Hl7.Fhir.Model.Markdown)ExtraDetailsElement.DeepCopyInternal(); + if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopyInternal()); + if(ServiceProvisionCode.Any()) dest.ServiceProvisionCode = new List(ServiceProvisionCode.DeepCopyInternal()); + if(Eligibility.Any()) dest.Eligibility = new List(Eligibility.DeepCopyInternal()); + if(Program.Any()) dest.Program = new List(Program.DeepCopyInternal()); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); + if(ReferralMethod.Any()) dest.ReferralMethod = new List(ReferralMethod.DeepCopyInternal()); + if(AppointmentRequiredElement != null) dest.AppointmentRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AppointmentRequiredElement.DeepCopyInternal(); + if(Availability.Any()) dest.Availability = new List(Availability.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new HealthcareService(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/HumanName.cs b/src/Hl7.Fhir.R5/Model/Generated/HumanName.cs index 7d7998d4fc..a648c2d3e2 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/HumanName.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/HumanName.cs @@ -316,7 +316,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HumanName; @@ -325,20 +325,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(FamilyElement != null) dest.FamilyElement = (Hl7.Fhir.Model.FhirString)FamilyElement.DeepCopy(); - if(GivenElement.Any()) dest.GivenElement = new List(GivenElement.DeepCopy()); - if(PrefixElement.Any()) dest.PrefixElement = new List(PrefixElement.DeepCopy()); - if(SuffixElement.Any()) dest.SuffixElement = new List(SuffixElement.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(FamilyElement != null) dest.FamilyElement = (Hl7.Fhir.Model.FhirString)FamilyElement.DeepCopyInternal(); + if(GivenElement.Any()) dest.GivenElement = new List(GivenElement.DeepCopyInternal()); + if(PrefixElement.Any()) dest.PrefixElement = new List(PrefixElement.DeepCopyInternal()); + if(SuffixElement.Any()) dest.SuffixElement = new List(SuffixElement.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HumanName()); + var instance = new HumanName(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ImagingSelection.cs b/src/Hl7.Fhir.R5/Model/Generated/ImagingSelection.cs index e8b581579d..62de2c5171 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ImagingSelection.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ImagingSelection.cs @@ -218,7 +218,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -227,15 +227,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -444,7 +445,7 @@ public List ImageRegion3 private List _ImageRegion3D; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -453,19 +454,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopy(); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopy(); - if(SopClass != null) dest.SopClass = (Hl7.Fhir.Model.Coding)SopClass.DeepCopy(); - if(SubsetElement.Any()) dest.SubsetElement = new List(SubsetElement.DeepCopy()); - if(ImageRegion2D.Any()) dest.ImageRegion2D = new List(ImageRegion2D.DeepCopy()); - if(ImageRegion3D.Any()) dest.ImageRegion3D = new List(ImageRegion3D.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopyInternal(); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopyInternal(); + if(SopClass != null) dest.SopClass = (Hl7.Fhir.Model.Coding)SopClass.DeepCopyInternal(); + if(SubsetElement.Any()) dest.SubsetElement = new List(SubsetElement.DeepCopyInternal()); + if(ImageRegion2D.Any()) dest.ImageRegion2D = new List(ImageRegion2D.DeepCopyInternal()); + if(ImageRegion3D.Any()) dest.ImageRegion3D = new List(ImageRegion3D.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -636,7 +638,7 @@ public IEnumerable Coordinate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImageRegion2DComponent; @@ -645,15 +647,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RegionTypeElement != null) dest.RegionTypeElement = (Code)RegionTypeElement.DeepCopy(); - if(CoordinateElement.Any()) dest.CoordinateElement = new List(CoordinateElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RegionTypeElement != null) dest.RegionTypeElement = (Code)RegionTypeElement.DeepCopyInternal(); + if(CoordinateElement.Any()) dest.CoordinateElement = new List(CoordinateElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImageRegion2DComponent()); + var instance = new ImageRegion2DComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -791,7 +794,7 @@ public IEnumerable Coordinate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImageRegion3DComponent; @@ -800,15 +803,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RegionTypeElement != null) dest.RegionTypeElement = (Code)RegionTypeElement.DeepCopy(); - if(CoordinateElement.Any()) dest.CoordinateElement = new List(CoordinateElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RegionTypeElement != null) dest.RegionTypeElement = (Code)RegionTypeElement.DeepCopyInternal(); + if(CoordinateElement.Any()) dest.CoordinateElement = new List(CoordinateElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImageRegion3DComponent()); + var instance = new ImageRegion3DComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1220,7 +1224,7 @@ public List Instance List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImagingSelection; @@ -1229,30 +1233,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(StudyUidElement != null) dest.StudyUidElement = (Hl7.Fhir.Model.Id)StudyUidElement.DeepCopy(); - if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(SeriesUidElement != null) dest.SeriesUidElement = (Hl7.Fhir.Model.Id)SeriesUidElement.DeepCopy(); - if(SeriesNumberElement != null) dest.SeriesNumberElement = (Hl7.Fhir.Model.UnsignedInt)SeriesNumberElement.DeepCopy(); - if(FrameOfReferenceUidElement != null) dest.FrameOfReferenceUidElement = (Hl7.Fhir.Model.Id)FrameOfReferenceUidElement.DeepCopy(); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableReference)BodySite.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(StudyUidElement != null) dest.StudyUidElement = (Hl7.Fhir.Model.Id)StudyUidElement.DeepCopyInternal(); + if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(SeriesUidElement != null) dest.SeriesUidElement = (Hl7.Fhir.Model.Id)SeriesUidElement.DeepCopyInternal(); + if(SeriesNumberElement != null) dest.SeriesNumberElement = (Hl7.Fhir.Model.UnsignedInt)SeriesNumberElement.DeepCopyInternal(); + if(FrameOfReferenceUidElement != null) dest.FrameOfReferenceUidElement = (Hl7.Fhir.Model.Id)FrameOfReferenceUidElement.DeepCopyInternal(); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableReference)BodySite.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImagingSelection()); + var instance = new ImagingSelection(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ImagingStudy.cs b/src/Hl7.Fhir.R5/Model/Generated/ImagingStudy.cs index d939d422a9..032b10c087 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ImagingStudy.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ImagingStudy.cs @@ -374,7 +374,7 @@ public List Instance private List _Instance; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SeriesComponent; @@ -383,25 +383,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopy(); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopy(); - if(Modality != null) dest.Modality = (Hl7.Fhir.Model.CodeableConcept)Modality.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableReference)BodySite.DeepCopy(); - if(Laterality != null) dest.Laterality = (Hl7.Fhir.Model.CodeableConcept)Laterality.DeepCopy(); - if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopy()); - if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopyInternal(); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopyInternal(); + if(Modality != null) dest.Modality = (Hl7.Fhir.Model.CodeableConcept)Modality.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableReference)BodySite.DeepCopyInternal(); + if(Laterality != null) dest.Laterality = (Hl7.Fhir.Model.CodeableConcept)Laterality.DeepCopyInternal(); + if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopyInternal()); + if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SeriesComponent()); + var instance = new SeriesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -584,7 +585,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -593,15 +594,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -782,7 +784,7 @@ public string Title } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -791,17 +793,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopy(); - if(SopClass != null) dest.SopClass = (Hl7.Fhir.Model.Coding)SopClass.DeepCopy(); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Id)UidElement.DeepCopyInternal(); + if(SopClass != null) dest.SopClass = (Hl7.Fhir.Model.Coding)SopClass.DeepCopyInternal(); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1229,7 +1232,7 @@ public List Series List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImagingStudy; @@ -1238,31 +1241,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Modality.Any()) dest.Modality = new List(Modality.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(Referrer != null) dest.Referrer = (Hl7.Fhir.Model.ResourceReference)Referrer.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(NumberOfSeriesElement != null) dest.NumberOfSeriesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfSeriesElement.DeepCopy(); - if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopy(); - if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Series.Any()) dest.Series = new List(Series.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Modality.Any()) dest.Modality = new List(Modality.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(Referrer != null) dest.Referrer = (Hl7.Fhir.Model.ResourceReference)Referrer.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(NumberOfSeriesElement != null) dest.NumberOfSeriesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfSeriesElement.DeepCopyInternal(); + if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopyInternal(); + if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Series.Any()) dest.Series = new List(Series.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImagingStudy()); + var instance = new ImagingStudy(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Immunization.cs b/src/Hl7.Fhir.R5/Model/Generated/Immunization.cs index 101613f367..ce6bb69ccf 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Immunization.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Immunization.cs @@ -133,7 +133,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -142,15 +142,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -252,7 +253,7 @@ public Hl7.Fhir.Model.CodeableConcept ProgramStatus private Hl7.Fhir.Model.CodeableConcept _ProgramStatus; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProgramEligibilityComponent; @@ -261,15 +262,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Program != null) dest.Program = (Hl7.Fhir.Model.CodeableConcept)Program.DeepCopy(); - if(ProgramStatus != null) dest.ProgramStatus = (Hl7.Fhir.Model.CodeableConcept)ProgramStatus.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Program != null) dest.Program = (Hl7.Fhir.Model.CodeableConcept)Program.DeepCopyInternal(); + if(ProgramStatus != null) dest.ProgramStatus = (Hl7.Fhir.Model.CodeableConcept)ProgramStatus.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProgramEligibilityComponent()); + var instance = new ProgramEligibilityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -417,7 +419,7 @@ public bool? Reported } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReactionComponent; @@ -426,16 +428,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Manifestation != null) dest.Manifestation = (Hl7.Fhir.Model.CodeableReference)Manifestation.DeepCopy(); - if(ReportedElement != null) dest.ReportedElement = (Hl7.Fhir.Model.FhirBoolean)ReportedElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Manifestation != null) dest.Manifestation = (Hl7.Fhir.Model.CodeableReference)Manifestation.DeepCopyInternal(); + if(ReportedElement != null) dest.ReportedElement = (Hl7.Fhir.Model.FhirBoolean)ReportedElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReactionComponent()); + var instance = new ReactionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -639,7 +642,7 @@ public string SeriesDoses } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProtocolAppliedComponent; @@ -648,18 +651,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopy(); - if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopy(); - if(TargetDisease.Any()) dest.TargetDisease = new List(TargetDisease.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; + base.CopyToInternal(dest); + if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopyInternal(); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopyInternal(); + if(TargetDisease.Any()) dest.TargetDisease = new List(TargetDisease.DeepCopyInternal()); + if(DoseNumberElement != null) dest.DoseNumberElement = (Hl7.Fhir.Model.FhirString)DoseNumberElement.DeepCopyInternal(); + if(SeriesDosesElement != null) dest.SeriesDosesElement = (Hl7.Fhir.Model.FhirString)SeriesDosesElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProtocolAppliedComponent()); + var instance = new ProtocolAppliedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1231,7 +1235,7 @@ public List ProtocolApplie List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Immunization; @@ -1240,41 +1244,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(VaccineCode != null) dest.VaccineCode = (Hl7.Fhir.Model.CodeableConcept)VaccineCode.DeepCopy(); - if(AdministeredProduct != null) dest.AdministeredProduct = (Hl7.Fhir.Model.CodeableReference)AdministeredProduct.DeepCopy(); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.CodeableReference)Manufacturer.DeepCopy(); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.Date)ExpirationDateElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(PrimarySourceElement != null) dest.PrimarySourceElement = (Hl7.Fhir.Model.FhirBoolean)PrimarySourceElement.DeepCopy(); - if(InformationSource != null) dest.InformationSource = (Hl7.Fhir.Model.CodeableReference)InformationSource.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy(); - if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy(); - if(DoseQuantity != null) dest.DoseQuantity = (Hl7.Fhir.Model.Quantity)DoseQuantity.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(IsSubpotentElement != null) dest.IsSubpotentElement = (Hl7.Fhir.Model.FhirBoolean)IsSubpotentElement.DeepCopy(); - if(SubpotentReason.Any()) dest.SubpotentReason = new List(SubpotentReason.DeepCopy()); - if(ProgramEligibility.Any()) dest.ProgramEligibility = new List(ProgramEligibility.DeepCopy()); - if(FundingSource != null) dest.FundingSource = (Hl7.Fhir.Model.CodeableConcept)FundingSource.DeepCopy(); - if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopy()); - if(ProtocolApplied.Any()) dest.ProtocolApplied = new List(ProtocolApplied.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(VaccineCode != null) dest.VaccineCode = (Hl7.Fhir.Model.CodeableConcept)VaccineCode.DeepCopyInternal(); + if(AdministeredProduct != null) dest.AdministeredProduct = (Hl7.Fhir.Model.CodeableReference)AdministeredProduct.DeepCopyInternal(); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.CodeableReference)Manufacturer.DeepCopyInternal(); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.Date)ExpirationDateElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(PrimarySourceElement != null) dest.PrimarySourceElement = (Hl7.Fhir.Model.FhirBoolean)PrimarySourceElement.DeepCopyInternal(); + if(InformationSource != null) dest.InformationSource = (Hl7.Fhir.Model.CodeableReference)InformationSource.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopyInternal(); + if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopyInternal(); + if(DoseQuantity != null) dest.DoseQuantity = (Hl7.Fhir.Model.Quantity)DoseQuantity.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(IsSubpotentElement != null) dest.IsSubpotentElement = (Hl7.Fhir.Model.FhirBoolean)IsSubpotentElement.DeepCopyInternal(); + if(SubpotentReason.Any()) dest.SubpotentReason = new List(SubpotentReason.DeepCopyInternal()); + if(ProgramEligibility.Any()) dest.ProgramEligibility = new List(ProgramEligibility.DeepCopyInternal()); + if(FundingSource != null) dest.FundingSource = (Hl7.Fhir.Model.CodeableConcept)FundingSource.DeepCopyInternal(); + if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopyInternal()); + if(ProtocolApplied.Any()) dest.ProtocolApplied = new List(ProtocolApplied.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Immunization()); + var instance = new Immunization(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ImmunizationEvaluation.cs b/src/Hl7.Fhir.R5/Model/Generated/ImmunizationEvaluation.cs index f006c5af41..2c7003ce5d 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ImmunizationEvaluation.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ImmunizationEvaluation.cs @@ -378,7 +378,7 @@ public string SeriesDoses List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImmunizationEvaluation; @@ -387,26 +387,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)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.Any()) dest.DoseStatusReason = new List(DoseStatusReason.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)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; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopyInternal(); + if(TargetDisease != null) dest.TargetDisease = (Hl7.Fhir.Model.CodeableConcept)TargetDisease.DeepCopyInternal(); + if(ImmunizationEvent != null) dest.ImmunizationEvent = (Hl7.Fhir.Model.ResourceReference)ImmunizationEvent.DeepCopyInternal(); + if(DoseStatus != null) dest.DoseStatus = (Hl7.Fhir.Model.CodeableConcept)DoseStatus.DeepCopyInternal(); + if(DoseStatusReason.Any()) dest.DoseStatusReason = new List(DoseStatusReason.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopyInternal(); + if(DoseNumberElement != null) dest.DoseNumberElement = (Hl7.Fhir.Model.FhirString)DoseNumberElement.DeepCopyInternal(); + if(SeriesDosesElement != null) dest.SeriesDosesElement = (Hl7.Fhir.Model.FhirString)SeriesDosesElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImmunizationEvaluation()); + var instance = new ImmunizationEvaluation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ImmunizationRecommendation.cs b/src/Hl7.Fhir.R5/Model/Generated/ImmunizationRecommendation.cs index 4e6cbbe5bf..e52a0a503b 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ImmunizationRecommendation.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ImmunizationRecommendation.cs @@ -320,7 +320,7 @@ public List SupportingPatientInformation private List _SupportingPatientInformation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RecommendationComponent; @@ -329,25 +329,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(VaccineCode.Any()) dest.VaccineCode = new List(VaccineCode.DeepCopy()); - if(TargetDisease.Any()) dest.TargetDisease = new List(TargetDisease.DeepCopy()); - if(ContraindicatedVaccineCode.Any()) dest.ContraindicatedVaccineCode = new List(ContraindicatedVaccineCode.DeepCopy()); - if(ForecastStatus != null) dest.ForecastStatus = (Hl7.Fhir.Model.CodeableConcept)ForecastStatus.DeepCopy(); - if(ForecastReason.Any()) dest.ForecastReason = new List(ForecastReason.DeepCopy()); - if(DateCriterion.Any()) dest.DateCriterion = new List(DateCriterion.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)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(); - if(SupportingImmunization.Any()) dest.SupportingImmunization = new List(SupportingImmunization.DeepCopy()); - if(SupportingPatientInformation.Any()) dest.SupportingPatientInformation = new List(SupportingPatientInformation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(VaccineCode.Any()) dest.VaccineCode = new List(VaccineCode.DeepCopyInternal()); + if(TargetDisease.Any()) dest.TargetDisease = new List(TargetDisease.DeepCopyInternal()); + if(ContraindicatedVaccineCode.Any()) dest.ContraindicatedVaccineCode = new List(ContraindicatedVaccineCode.DeepCopyInternal()); + if(ForecastStatus != null) dest.ForecastStatus = (Hl7.Fhir.Model.CodeableConcept)ForecastStatus.DeepCopyInternal(); + if(ForecastReason.Any()) dest.ForecastReason = new List(ForecastReason.DeepCopyInternal()); + if(DateCriterion.Any()) dest.DateCriterion = new List(DateCriterion.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopyInternal(); + if(DoseNumberElement != null) dest.DoseNumberElement = (Hl7.Fhir.Model.FhirString)DoseNumberElement.DeepCopyInternal(); + if(SeriesDosesElement != null) dest.SeriesDosesElement = (Hl7.Fhir.Model.FhirString)SeriesDosesElement.DeepCopyInternal(); + if(SupportingImmunization.Any()) dest.SupportingImmunization = new List(SupportingImmunization.DeepCopyInternal()); + if(SupportingPatientInformation.Any()) dest.SupportingPatientInformation = new List(SupportingPatientInformation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RecommendationComponent()); + var instance = new RecommendationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -546,7 +547,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DateCriterionComponent; @@ -555,15 +556,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDateTime)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDateTime)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DateCriterionComponent()); + var instance = new DateCriterionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -712,7 +714,7 @@ public List R List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImmunizationRecommendation; @@ -721,18 +723,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.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(Recommendation.Any()) dest.Recommendation = new List(Recommendation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopyInternal(); + if(Recommendation.Any()) dest.Recommendation = new List(Recommendation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImmunizationRecommendation()); + var instance = new ImmunizationRecommendation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ImplementationGuide.cs b/src/Hl7.Fhir.R5/Model/Generated/ImplementationGuide.cs index c187ba936e..f5347e13db 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ImplementationGuide.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ImplementationGuide.cs @@ -2320,7 +2320,7 @@ public string Reason } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DependsOnComponent; @@ -2329,17 +2329,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.Canonical)UriElement.DeepCopy(); - if(PackageIdElement != null) dest.PackageIdElement = (Hl7.Fhir.Model.Id)PackageIdElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(ReasonElement != null) dest.ReasonElement = (Hl7.Fhir.Model.Markdown)ReasonElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.Canonical)UriElement.DeepCopyInternal(); + if(PackageIdElement != null) dest.PackageIdElement = (Hl7.Fhir.Model.Id)PackageIdElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(ReasonElement != null) dest.ReasonElement = (Hl7.Fhir.Model.Markdown)ReasonElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DependsOnComponent()); + var instance = new DependsOnComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2494,7 +2495,7 @@ public string Profile } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GlobalComponent; @@ -2503,15 +2504,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GlobalComponent()); + var instance = new GlobalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2653,7 +2655,7 @@ public List Template private List _Template; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DefinitionComponent; @@ -2662,18 +2664,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Grouping.Any()) dest.Grouping = new List(Grouping.DeepCopy()); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - if(Page != null) dest.Page = (Hl7.Fhir.Model.ImplementationGuide.PageComponent)Page.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Template.Any()) dest.Template = new List(Template.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Grouping.Any()) dest.Grouping = new List(Grouping.DeepCopyInternal()); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); + if(Page != null) dest.Page = (Hl7.Fhir.Model.ImplementationGuide.PageComponent)Page.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Template.Any()) dest.Template = new List(Template.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DefinitionComponent()); + var instance = new DefinitionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2833,7 +2836,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupingComponent; @@ -2842,15 +2845,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupingComponent()); + var instance = new GroupingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3128,7 +3132,7 @@ public string GroupingId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceComponent; @@ -3137,20 +3141,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(FhirVersionElement.Any()) dest.FhirVersionElement = new List>(FhirVersionElement.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(IsExampleElement != null) dest.IsExampleElement = (Hl7.Fhir.Model.FhirBoolean)IsExampleElement.DeepCopy(); - if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopy()); - if(GroupingIdElement != null) dest.GroupingIdElement = (Hl7.Fhir.Model.Id)GroupingIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(FhirVersionElement.Any()) dest.FhirVersionElement = new List>(FhirVersionElement.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(IsExampleElement != null) dest.IsExampleElement = (Hl7.Fhir.Model.FhirBoolean)IsExampleElement.DeepCopyInternal(); + if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopyInternal()); + if(GroupingIdElement != null) dest.GroupingIdElement = (Hl7.Fhir.Model.Id)GroupingIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceComponent()); + var instance = new ResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3390,7 +3395,7 @@ public List Page private List _Page; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PageComponent; @@ -3399,18 +3404,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirUrl)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(GenerationElement != null) dest.GenerationElement = (Code)GenerationElement.DeepCopy(); - if(Page.Any()) dest.Page = new List(Page.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirUrl)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(GenerationElement != null) dest.GenerationElement = (Code)GenerationElement.DeepCopyInternal(); + if(Page.Any()) dest.Page = new List(Page.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PageComponent()); + var instance = new PageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3553,7 +3559,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -3562,15 +3568,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.Coding)Code.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.Coding)Code.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3734,7 +3741,7 @@ public string Scope } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TemplateComponent; @@ -3743,16 +3750,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopy(); - if(ScopeElement != null) dest.ScopeElement = (Hl7.Fhir.Model.FhirString)ScopeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopyInternal(); + if(ScopeElement != null) dest.ScopeElement = (Hl7.Fhir.Model.FhirString)ScopeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TemplateComponent()); + var instance = new TemplateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3955,7 +3963,7 @@ public IEnumerable Other } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManifestComponent; @@ -3964,18 +3972,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RenderingElement != null) dest.RenderingElement = (Hl7.Fhir.Model.FhirUrl)RenderingElement.DeepCopy(); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - if(Page.Any()) dest.Page = new List(Page.DeepCopy()); - if(ImageElement.Any()) dest.ImageElement = new List(ImageElement.DeepCopy()); - if(OtherElement.Any()) dest.OtherElement = new List(OtherElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RenderingElement != null) dest.RenderingElement = (Hl7.Fhir.Model.FhirUrl)RenderingElement.DeepCopyInternal(); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); + if(Page.Any()) dest.Page = new List(Page.DeepCopyInternal()); + if(ImageElement.Any()) dest.ImageElement = new List(ImageElement.DeepCopyInternal()); + if(OtherElement.Any()) dest.OtherElement = new List(OtherElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManifestComponent()); + var instance = new ManifestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4181,7 +4190,7 @@ public string RelativePath } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManifestResourceComponent; @@ -4190,17 +4199,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(IsExampleElement != null) dest.IsExampleElement = (Hl7.Fhir.Model.FhirBoolean)IsExampleElement.DeepCopy(); - if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopy()); - if(RelativePathElement != null) dest.RelativePathElement = (Hl7.Fhir.Model.FhirUrl)RelativePathElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(IsExampleElement != null) dest.IsExampleElement = (Hl7.Fhir.Model.FhirBoolean)IsExampleElement.DeepCopyInternal(); + if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopyInternal()); + if(RelativePathElement != null) dest.RelativePathElement = (Hl7.Fhir.Model.FhirUrl)RelativePathElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManifestResourceComponent()); + var instance = new ManifestResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4383,7 +4393,7 @@ public IEnumerable Anchor } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManifestPageComponent; @@ -4392,16 +4402,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(AnchorElement.Any()) dest.AnchorElement = new List(AnchorElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(AnchorElement.Any()) dest.AnchorElement = new List(AnchorElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManifestPageComponent()); + var instance = new ManifestPageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5069,7 +5080,7 @@ public Hl7.Fhir.Model.ImplementationGuide.ManifestComponent Manifest List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImplementationGuide; @@ -5078,37 +5089,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(PackageIdElement != null) dest.PackageIdElement = (Hl7.Fhir.Model.Id)PackageIdElement.DeepCopy(); - if(LicenseElement != null) dest.LicenseElement = (Code)LicenseElement.DeepCopy(); - if(FhirVersionElement.Any()) dest.FhirVersionElement = new List>(FhirVersionElement.DeepCopy()); - if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopy()); - if(Global.Any()) dest.Global = new List(Global.DeepCopy()); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ImplementationGuide.DefinitionComponent)Definition.DeepCopy(); - if(Manifest != null) dest.Manifest = (Hl7.Fhir.Model.ImplementationGuide.ManifestComponent)Manifest.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(PackageIdElement != null) dest.PackageIdElement = (Hl7.Fhir.Model.Id)PackageIdElement.DeepCopyInternal(); + if(LicenseElement != null) dest.LicenseElement = (Code)LicenseElement.DeepCopyInternal(); + if(FhirVersionElement.Any()) dest.FhirVersionElement = new List>(FhirVersionElement.DeepCopyInternal()); + if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopyInternal()); + if(Global.Any()) dest.Global = new List(Global.DeepCopyInternal()); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ImplementationGuide.DefinitionComponent)Definition.DeepCopyInternal(); + if(Manifest != null) dest.Manifest = (Hl7.Fhir.Model.ImplementationGuide.ManifestComponent)Manifest.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImplementationGuide()); + var instance = new ImplementationGuide(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Ingredient.cs b/src/Hl7.Fhir.R5/Model/Generated/Ingredient.cs index 77ce4f6098..49bfe775ee 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Ingredient.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Ingredient.cs @@ -149,7 +149,7 @@ public Hl7.Fhir.Model.ResourceReference Manufacturer private Hl7.Fhir.Model.ResourceReference _Manufacturer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManufacturerComponent; @@ -158,15 +158,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RoleElement != null) dest.RoleElement = (Code)RoleElement.DeepCopy(); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RoleElement != null) dest.RoleElement = (Code)RoleElement.DeepCopyInternal(); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManufacturerComponent()); + var instance = new ManufacturerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -264,7 +265,7 @@ public List Strength private List _Strength; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceComponent; @@ -273,15 +274,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableReference)Code.DeepCopy(); - if(Strength.Any()) dest.Strength = new List(Strength.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableReference)Code.DeepCopyInternal(); + if(Strength.Any()) dest.Strength = new List(Strength.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceComponent()); + var instance = new SubstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -518,7 +520,7 @@ public List ReferenceStren private List _ReferenceStrength; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StrengthComponent; @@ -527,21 +529,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Presentation != null) dest.Presentation = (Hl7.Fhir.Model.DataType)Presentation.DeepCopy(); - if(TextPresentationElement != null) dest.TextPresentationElement = (Hl7.Fhir.Model.FhirString)TextPresentationElement.DeepCopy(); - if(Concentration != null) dest.Concentration = (Hl7.Fhir.Model.DataType)Concentration.DeepCopy(); - if(TextConcentrationElement != null) dest.TextConcentrationElement = (Hl7.Fhir.Model.FhirString)TextConcentrationElement.DeepCopy(); - if(Basis != null) dest.Basis = (Hl7.Fhir.Model.CodeableConcept)Basis.DeepCopy(); - if(MeasurementPointElement != null) dest.MeasurementPointElement = (Hl7.Fhir.Model.FhirString)MeasurementPointElement.DeepCopy(); - if(Country.Any()) dest.Country = new List(Country.DeepCopy()); - if(ReferenceStrength.Any()) dest.ReferenceStrength = new List(ReferenceStrength.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Presentation != null) dest.Presentation = (Hl7.Fhir.Model.DataType)Presentation.DeepCopyInternal(); + if(TextPresentationElement != null) dest.TextPresentationElement = (Hl7.Fhir.Model.FhirString)TextPresentationElement.DeepCopyInternal(); + if(Concentration != null) dest.Concentration = (Hl7.Fhir.Model.DataType)Concentration.DeepCopyInternal(); + if(TextConcentrationElement != null) dest.TextConcentrationElement = (Hl7.Fhir.Model.FhirString)TextConcentrationElement.DeepCopyInternal(); + if(Basis != null) dest.Basis = (Hl7.Fhir.Model.CodeableConcept)Basis.DeepCopyInternal(); + if(MeasurementPointElement != null) dest.MeasurementPointElement = (Hl7.Fhir.Model.FhirString)MeasurementPointElement.DeepCopyInternal(); + if(Country.Any()) dest.Country = new List(Country.DeepCopyInternal()); + if(ReferenceStrength.Any()) dest.ReferenceStrength = new List(ReferenceStrength.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StrengthComponent()); + var instance = new StrengthComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -738,7 +741,7 @@ public List Country private List _Country; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferenceStrengthComponent; @@ -747,17 +750,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableReference)Substance.DeepCopy(); - if(Strength != null) dest.Strength = (Hl7.Fhir.Model.DataType)Strength.DeepCopy(); - if(MeasurementPointElement != null) dest.MeasurementPointElement = (Hl7.Fhir.Model.FhirString)MeasurementPointElement.DeepCopy(); - if(Country.Any()) dest.Country = new List(Country.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableReference)Substance.DeepCopyInternal(); + if(Strength != null) dest.Strength = (Hl7.Fhir.Model.DataType)Strength.DeepCopyInternal(); + if(MeasurementPointElement != null) dest.MeasurementPointElement = (Hl7.Fhir.Model.FhirString)MeasurementPointElement.DeepCopyInternal(); + if(Country.Any()) dest.Country = new List(Country.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferenceStrengthComponent()); + var instance = new ReferenceStrengthComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1027,7 +1031,7 @@ public Hl7.Fhir.Model.Ingredient.SubstanceComponent Substance Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Ingredient; @@ -1036,23 +1040,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(For.Any()) dest.For = new List(For.DeepCopy()); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Function.Any()) dest.Function = new List(Function.DeepCopy()); - if(Group != null) dest.Group = (Hl7.Fhir.Model.CodeableConcept)Group.DeepCopy(); - if(AllergenicIndicatorElement != null) dest.AllergenicIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)AllergenicIndicatorElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopy(); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.Ingredient.SubstanceComponent)Substance.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(For.Any()) dest.For = new List(For.DeepCopyInternal()); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Function.Any()) dest.Function = new List(Function.DeepCopyInternal()); + if(Group != null) dest.Group = (Hl7.Fhir.Model.CodeableConcept)Group.DeepCopyInternal(); + if(AllergenicIndicatorElement != null) dest.AllergenicIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)AllergenicIndicatorElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopyInternal(); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.Ingredient.SubstanceComponent)Substance.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Ingredient()); + var instance = new Ingredient(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/InsurancePlan.cs b/src/Hl7.Fhir.R5/Model/Generated/InsurancePlan.cs index 2caff6e43d..605844ed6f 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/InsurancePlan.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/InsurancePlan.cs @@ -144,7 +144,7 @@ public List Benefit private List _Benefit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageComponent; @@ -153,16 +153,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Network.Any()) dest.Network = new List(Network.DeepCopy()); - if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Network.Any()) dest.Network = new List(Network.DeepCopyInternal()); + if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageComponent()); + var instance = new CoverageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -301,7 +302,7 @@ public List Limit private List _Limit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageBenefitComponent; @@ -310,16 +311,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.FhirString)RequirementElement.DeepCopy(); - if(Limit.Any()) dest.Limit = new List(Limit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.FhirString)RequirementElement.DeepCopyInternal(); + if(Limit.Any()) dest.Limit = new List(Limit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageBenefitComponent()); + var instance = new CoverageBenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -425,7 +427,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LimitComponent; @@ -434,15 +436,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LimitComponent()); + var instance = new LimitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -601,7 +604,7 @@ public List SpecificCost private List _SpecificCost; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PlanComponent; @@ -610,19 +613,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopy()); - if(Network.Any()) dest.Network = new List(Network.DeepCopy()); - if(GeneralCost.Any()) dest.GeneralCost = new List(GeneralCost.DeepCopy()); - if(SpecificCost.Any()) dest.SpecificCost = new List(SpecificCost.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopyInternal()); + if(Network.Any()) dest.Network = new List(Network.DeepCopyInternal()); + if(GeneralCost.Any()) dest.GeneralCost = new List(GeneralCost.DeepCopyInternal()); + if(SpecificCost.Any()) dest.SpecificCost = new List(SpecificCost.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PlanComponent()); + var instance = new PlanComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -814,7 +818,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GeneralCostComponent; @@ -823,17 +827,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(GroupSizeElement != null) dest.GroupSizeElement = (Hl7.Fhir.Model.PositiveInt)GroupSizeElement.DeepCopy(); - if(Cost != null) dest.Cost = (Hl7.Fhir.Model.Money)Cost.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(GroupSizeElement != null) dest.GroupSizeElement = (Hl7.Fhir.Model.PositiveInt)GroupSizeElement.DeepCopyInternal(); + if(Cost != null) dest.Cost = (Hl7.Fhir.Model.Money)Cost.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GeneralCostComponent()); + var instance = new GeneralCostComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -949,7 +954,7 @@ public List Benefit private List _Benefit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SpecificCostComponent; @@ -958,15 +963,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Benefit.Any()) dest.Benefit = new List(Benefit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SpecificCostComponent()); + var instance = new SpecificCostComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1066,7 +1072,7 @@ public List Cost private List _Cost; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PlanBenefitComponent; @@ -1075,15 +1081,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Cost.Any()) dest.Cost = new List(Cost.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Cost.Any()) dest.Cost = new List(Cost.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PlanBenefitComponent()); + var instance = new PlanBenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1210,7 +1217,7 @@ public Hl7.Fhir.Model.Quantity Value private Hl7.Fhir.Model.Quantity _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CostComponent; @@ -1219,17 +1226,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Applicability != null) dest.Applicability = (Hl7.Fhir.Model.CodeableConcept)Applicability.DeepCopy(); - if(Qualifiers.Any()) dest.Qualifiers = new List(Qualifiers.DeepCopy()); - if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Applicability != null) dest.Applicability = (Hl7.Fhir.Model.CodeableConcept)Applicability.DeepCopyInternal(); + if(Qualifiers.Any()) dest.Qualifiers = new List(Qualifiers.DeepCopyInternal()); + if(Value != null) dest.Value = (Hl7.Fhir.Model.Quantity)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CostComponent()); + var instance = new CostComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1561,7 +1569,7 @@ public List Plan List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsurancePlan; @@ -1570,27 +1578,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(OwnedBy != null) dest.OwnedBy = (Hl7.Fhir.Model.ResourceReference)OwnedBy.DeepCopy(); - if(AdministeredBy != null) dest.AdministeredBy = (Hl7.Fhir.Model.ResourceReference)AdministeredBy.DeepCopy(); - if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(Network.Any()) dest.Network = new List(Network.DeepCopy()); - if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopy()); - if(Plan.Any()) dest.Plan = new List(Plan.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(OwnedBy != null) dest.OwnedBy = (Hl7.Fhir.Model.ResourceReference)OwnedBy.DeepCopyInternal(); + if(AdministeredBy != null) dest.AdministeredBy = (Hl7.Fhir.Model.ResourceReference)AdministeredBy.DeepCopyInternal(); + if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(Network.Any()) dest.Network = new List(Network.DeepCopyInternal()); + if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopyInternal()); + if(Plan.Any()) dest.Plan = new List(Plan.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsurancePlan()); + var instance = new InsurancePlan(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/InventoryItem.cs b/src/Hl7.Fhir.R5/Model/Generated/InventoryItem.cs index 622b06f444..46c1fe6240 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/InventoryItem.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/InventoryItem.cs @@ -187,7 +187,7 @@ public string Name } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NameComponent; @@ -196,16 +196,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameType != null) dest.NameType = (Hl7.Fhir.Model.Coding)NameType.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Code)LanguageElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameType != null) dest.NameType = (Hl7.Fhir.Model.Coding)NameType.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Code)LanguageElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NameComponent()); + var instance = new NameComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -312,7 +313,7 @@ public Hl7.Fhir.Model.ResourceReference Organization private Hl7.Fhir.Model.ResourceReference _Organization; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResponsibleOrganizationComponent; @@ -321,15 +322,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResponsibleOrganizationComponent()); + var instance = new ResponsibleOrganizationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -465,7 +467,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DescriptionComponent; @@ -474,15 +476,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LanguageElement != null) dest.LanguageElement = (Code)LanguageElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LanguageElement != null) dest.LanguageElement = (Code)LanguageElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DescriptionComponent()); + var instance = new DescriptionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -595,7 +598,7 @@ public Hl7.Fhir.Model.Ratio Quantity private Hl7.Fhir.Model.Ratio _Quantity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssociationComponent; @@ -604,16 +607,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AssociationType != null) dest.AssociationType = (Hl7.Fhir.Model.CodeableConcept)AssociationType.DeepCopy(); - if(RelatedItem != null) dest.RelatedItem = (Hl7.Fhir.Model.ResourceReference)RelatedItem.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Ratio)Quantity.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AssociationType != null) dest.AssociationType = (Hl7.Fhir.Model.CodeableConcept)AssociationType.DeepCopyInternal(); + if(RelatedItem != null) dest.RelatedItem = (Hl7.Fhir.Model.ResourceReference)RelatedItem.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Ratio)Quantity.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AssociationComponent()); + var instance = new AssociationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -723,7 +727,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -732,15 +736,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CharacteristicType != null) dest.CharacteristicType = (Hl7.Fhir.Model.CodeableConcept)CharacteristicType.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CharacteristicType != null) dest.CharacteristicType = (Hl7.Fhir.Model.CodeableConcept)CharacteristicType.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -915,7 +920,7 @@ public Hl7.Fhir.Model.ResourceReference Location private Hl7.Fhir.Model.ResourceReference _Location; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -924,18 +929,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1230,7 +1236,7 @@ public Hl7.Fhir.Model.ResourceReference ProductReference List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InventoryItem; @@ -1239,27 +1245,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(ResponsibleOrganization.Any()) dest.ResponsibleOrganization = new List(ResponsibleOrganization.DeepCopy()); - if(Description != null) dest.Description = (Hl7.Fhir.Model.InventoryItem.DescriptionComponent)Description.DeepCopy(); - if(InventoryStatus.Any()) dest.InventoryStatus = new List(InventoryStatus.DeepCopy()); - if(BaseUnit != null) dest.BaseUnit = (Hl7.Fhir.Model.CodeableConcept)BaseUnit.DeepCopy(); - if(NetContent != null) dest.NetContent = (Hl7.Fhir.Model.Quantity)NetContent.DeepCopy(); - if(Association.Any()) dest.Association = new List(Association.DeepCopy()); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(Instance != null) dest.Instance = (Hl7.Fhir.Model.InventoryItem.InstanceComponent)Instance.DeepCopy(); - if(ProductReference != null) dest.ProductReference = (Hl7.Fhir.Model.ResourceReference)ProductReference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(ResponsibleOrganization.Any()) dest.ResponsibleOrganization = new List(ResponsibleOrganization.DeepCopyInternal()); + if(Description != null) dest.Description = (Hl7.Fhir.Model.InventoryItem.DescriptionComponent)Description.DeepCopyInternal(); + if(InventoryStatus.Any()) dest.InventoryStatus = new List(InventoryStatus.DeepCopyInternal()); + if(BaseUnit != null) dest.BaseUnit = (Hl7.Fhir.Model.CodeableConcept)BaseUnit.DeepCopyInternal(); + if(NetContent != null) dest.NetContent = (Hl7.Fhir.Model.Quantity)NetContent.DeepCopyInternal(); + if(Association.Any()) dest.Association = new List(Association.DeepCopyInternal()); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(Instance != null) dest.Instance = (Hl7.Fhir.Model.InventoryItem.InstanceComponent)Instance.DeepCopyInternal(); + if(ProductReference != null) dest.ProductReference = (Hl7.Fhir.Model.ResourceReference)ProductReference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InventoryItem()); + var instance = new InventoryItem(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/InventoryReport.cs b/src/Hl7.Fhir.R5/Model/Generated/InventoryReport.cs index a442151d1c..cc2ffc7585 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/InventoryReport.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/InventoryReport.cs @@ -198,7 +198,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InventoryListingComponent; @@ -207,17 +207,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(ItemStatus != null) dest.ItemStatus = (Hl7.Fhir.Model.CodeableConcept)ItemStatus.DeepCopy(); - if(CountingDateTimeElement != null) dest.CountingDateTimeElement = (Hl7.Fhir.Model.FhirDateTime)CountingDateTimeElement.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(ItemStatus != null) dest.ItemStatus = (Hl7.Fhir.Model.CodeableConcept)ItemStatus.DeepCopyInternal(); + if(CountingDateTimeElement != null) dest.CountingDateTimeElement = (Hl7.Fhir.Model.FhirDateTime)CountingDateTimeElement.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InventoryListingComponent()); + var instance = new InventoryListingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -343,7 +344,7 @@ public Hl7.Fhir.Model.CodeableReference Item private Hl7.Fhir.Model.CodeableReference _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -352,16 +353,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -623,7 +625,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InventoryReport; @@ -632,23 +634,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CountTypeElement != null) dest.CountTypeElement = (Code)CountTypeElement.DeepCopy(); - if(OperationType != null) dest.OperationType = (Hl7.Fhir.Model.CodeableConcept)OperationType.DeepCopy(); - if(OperationTypeReason != null) dest.OperationTypeReason = (Hl7.Fhir.Model.CodeableConcept)OperationTypeReason.DeepCopy(); - if(ReportedDateTimeElement != null) dest.ReportedDateTimeElement = (Hl7.Fhir.Model.FhirDateTime)ReportedDateTimeElement.DeepCopy(); - if(Reporter != null) dest.Reporter = (Hl7.Fhir.Model.ResourceReference)Reporter.DeepCopy(); - if(ReportingPeriod != null) dest.ReportingPeriod = (Hl7.Fhir.Model.Period)ReportingPeriod.DeepCopy(); - if(InventoryListing.Any()) dest.InventoryListing = new List(InventoryListing.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CountTypeElement != null) dest.CountTypeElement = (Code)CountTypeElement.DeepCopyInternal(); + if(OperationType != null) dest.OperationType = (Hl7.Fhir.Model.CodeableConcept)OperationType.DeepCopyInternal(); + if(OperationTypeReason != null) dest.OperationTypeReason = (Hl7.Fhir.Model.CodeableConcept)OperationTypeReason.DeepCopyInternal(); + if(ReportedDateTimeElement != null) dest.ReportedDateTimeElement = (Hl7.Fhir.Model.FhirDateTime)ReportedDateTimeElement.DeepCopyInternal(); + if(Reporter != null) dest.Reporter = (Hl7.Fhir.Model.ResourceReference)Reporter.DeepCopyInternal(); + if(ReportingPeriod != null) dest.ReportingPeriod = (Hl7.Fhir.Model.Period)ReportingPeriod.DeepCopyInternal(); + if(InventoryListing.Any()) dest.InventoryListing = new List(InventoryListing.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InventoryReport()); + var instance = new InventoryReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Invoice.cs b/src/Hl7.Fhir.R5/Model/Generated/Invoice.cs index 8cce7b0b08..f909c20a51 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Invoice.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Invoice.cs @@ -144,7 +144,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -153,15 +153,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -310,7 +311,7 @@ public List PriceComponent private List _PriceComponent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LineItemComponent; @@ -319,17 +320,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(ChargeItem != null) dest.ChargeItem = (Hl7.Fhir.Model.DataType)ChargeItem.DeepCopy(); - if(PriceComponent.Any()) dest.PriceComponent = new List(PriceComponent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(ChargeItem != null) dest.ChargeItem = (Hl7.Fhir.Model.DataType)ChargeItem.DeepCopyInternal(); + if(PriceComponent.Any()) dest.PriceComponent = new List(PriceComponent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LineItemComponent()); + var instance = new LineItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -745,7 +747,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Invoice; @@ -754,31 +756,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CancelledReasonElement != null) dest.CancelledReasonElement = (Hl7.Fhir.Model.FhirString)CancelledReasonElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(CreationElement != null) dest.CreationElement = (Hl7.Fhir.Model.FhirDateTime)CreationElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.DataType)Period.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopy(); - if(Account != null) dest.Account = (Hl7.Fhir.Model.ResourceReference)Account.DeepCopy(); - if(LineItem.Any()) dest.LineItem = new List(LineItem.DeepCopy()); - if(TotalPriceComponent.Any()) dest.TotalPriceComponent = new List(TotalPriceComponent.DeepCopy()); - if(TotalNet != null) dest.TotalNet = (Hl7.Fhir.Model.Money)TotalNet.DeepCopy(); - if(TotalGross != null) dest.TotalGross = (Hl7.Fhir.Model.Money)TotalGross.DeepCopy(); - if(PaymentTermsElement != null) dest.PaymentTermsElement = (Hl7.Fhir.Model.Markdown)PaymentTermsElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Invoice()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CancelledReasonElement != null) dest.CancelledReasonElement = (Hl7.Fhir.Model.FhirString)CancelledReasonElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(CreationElement != null) dest.CreationElement = (Hl7.Fhir.Model.FhirDateTime)CreationElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.DataType)Period.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopyInternal(); + if(Account != null) dest.Account = (Hl7.Fhir.Model.ResourceReference)Account.DeepCopyInternal(); + if(LineItem.Any()) dest.LineItem = new List(LineItem.DeepCopyInternal()); + if(TotalPriceComponent.Any()) dest.TotalPriceComponent = new List(TotalPriceComponent.DeepCopyInternal()); + if(TotalNet != null) dest.TotalNet = (Hl7.Fhir.Model.Money)TotalNet.DeepCopyInternal(); + if(TotalGross != null) dest.TotalGross = (Hl7.Fhir.Model.Money)TotalGross.DeepCopyInternal(); + if(PaymentTermsElement != null) dest.PaymentTermsElement = (Hl7.Fhir.Model.Markdown)PaymentTermsElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Invoice(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Library.cs b/src/Hl7.Fhir.R5/Model/Generated/Library.cs index 3cce87e18d..4742d28f51 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Library.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Library.cs @@ -804,7 +804,7 @@ public List Content List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Library; @@ -813,46 +813,47 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.Markdown)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopy()); - if(Content.Any()) dest.Content = new List(Content.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.Markdown)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopyInternal()); + if(Content.Any()) dest.Content = new List(Content.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Library()); + var instance = new Library(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Linkage.cs b/src/Hl7.Fhir.R5/Model/Generated/Linkage.cs index 1b19ec1cc1..4ea4e5bb43 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Linkage.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Linkage.cs @@ -153,7 +153,7 @@ public Hl7.Fhir.Model.ResourceReference Resource private Hl7.Fhir.Model.ResourceReference _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -162,15 +162,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -286,7 +287,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Linkage; @@ -295,16 +296,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Linkage()); + var instance = new Linkage(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/List.cs b/src/Hl7.Fhir.R5/Model/Generated/List.cs index 0ba8864b8c..07d4a544fc 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/List.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/List.cs @@ -196,7 +196,7 @@ public Hl7.Fhir.Model.ResourceReference Item private Hl7.Fhir.Model.ResourceReference _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EntryComponent; @@ -205,17 +205,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Flag != null) dest.Flag = (Hl7.Fhir.Model.CodeableConcept)Flag.DeepCopy(); - if(DeletedElement != null) dest.DeletedElement = (Hl7.Fhir.Model.FhirBoolean)DeletedElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.ResourceReference)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Flag != null) dest.Flag = (Hl7.Fhir.Model.CodeableConcept)Flag.DeepCopyInternal(); + if(DeletedElement != null) dest.DeletedElement = (Hl7.Fhir.Model.FhirBoolean)DeletedElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.ResourceReference)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EntryComponent()); + var instance = new EntryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -549,7 +550,7 @@ public Hl7.Fhir.Model.CodeableConcept EmptyReason List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as List; @@ -558,26 +559,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Entry.Any()) dest.Entry = new List(Entry.DeepCopy()); - if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Entry.Any()) dest.Entry = new List(Entry.DeepCopyInternal()); + if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new List()); + var instance = new List(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Location.cs b/src/Hl7.Fhir.R5/Model/Generated/Location.cs index ce3a9e789e..1cd9ad9a6b 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Location.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Location.cs @@ -221,7 +221,7 @@ public decimal? Altitude } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PositionComponent; @@ -230,16 +230,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LongitudeElement != null) dest.LongitudeElement = (Hl7.Fhir.Model.FhirDecimal)LongitudeElement.DeepCopy(); - if(LatitudeElement != null) dest.LatitudeElement = (Hl7.Fhir.Model.FhirDecimal)LatitudeElement.DeepCopy(); - if(AltitudeElement != null) dest.AltitudeElement = (Hl7.Fhir.Model.FhirDecimal)AltitudeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LongitudeElement != null) dest.LongitudeElement = (Hl7.Fhir.Model.FhirDecimal)LongitudeElement.DeepCopyInternal(); + if(LatitudeElement != null) dest.LatitudeElement = (Hl7.Fhir.Model.FhirDecimal)LatitudeElement.DeepCopyInternal(); + if(AltitudeElement != null) dest.AltitudeElement = (Hl7.Fhir.Model.FhirDecimal)AltitudeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PositionComponent()); + var instance = new PositionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -651,7 +652,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Location; @@ -660,31 +661,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(OperationalStatus != null) dest.OperationalStatus = (Hl7.Fhir.Model.Coding)OperationalStatus.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(Position != null) dest.Position = (Hl7.Fhir.Model.Location.PositionComponent)Position.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(HoursOfOperation.Any()) dest.HoursOfOperation = new List(HoursOfOperation.DeepCopy()); - if(VirtualService.Any()) dest.VirtualService = new List(VirtualService.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Location()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(OperationalStatus != null) dest.OperationalStatus = (Hl7.Fhir.Model.Coding)OperationalStatus.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(Position != null) dest.Position = (Hl7.Fhir.Model.Location.PositionComponent)Position.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(HoursOfOperation.Any()) dest.HoursOfOperation = new List(HoursOfOperation.DeepCopyInternal()); + if(VirtualService.Any()) dest.VirtualService = new List(VirtualService.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Location(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ManufacturedItemDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/ManufacturedItemDefinition.cs index 43b2277954..4320007e93 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ManufacturedItemDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ManufacturedItemDefinition.cs @@ -100,7 +100,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -109,15 +109,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -270,7 +271,7 @@ public List Compon private List _Component; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -279,19 +280,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Function.Any()) dest.Function = new List(Function.DeepCopy()); - if(Amount.Any()) dest.Amount = new List(Amount.DeepCopy()); - if(Constituent.Any()) dest.Constituent = new List(Constituent.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Function.Any()) dest.Function = new List(Function.DeepCopyInternal()); + if(Amount.Any()) dest.Amount = new List(Amount.DeepCopyInternal()); + if(Constituent.Any()) dest.Constituent = new List(Constituent.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -448,7 +450,7 @@ public List HasIngredient private List _HasIngredient; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConstituentComponent; @@ -457,17 +459,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Amount.Any()) dest.Amount = new List(Amount.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(Function.Any()) dest.Function = new List(Function.DeepCopy()); - if(HasIngredient.Any()) dest.HasIngredient = new List(HasIngredient.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Amount.Any()) dest.Amount = new List(Amount.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(Function.Any()) dest.Function = new List(Function.DeepCopyInternal()); + if(HasIngredient.Any()) dest.HasIngredient = new List(HasIngredient.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConstituentComponent()); + var instance = new ConstituentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -722,7 +725,7 @@ public List Compon List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ManufacturedItemDefinition; @@ -731,23 +734,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(ManufacturedDoseForm != null) dest.ManufacturedDoseForm = (Hl7.Fhir.Model.CodeableConcept)ManufacturedDoseForm.DeepCopy(); - if(UnitOfPresentation != null) dest.UnitOfPresentation = (Hl7.Fhir.Model.CodeableConcept)UnitOfPresentation.DeepCopy(); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(ManufacturedDoseForm != null) dest.ManufacturedDoseForm = (Hl7.Fhir.Model.CodeableConcept)ManufacturedDoseForm.DeepCopyInternal(); + if(UnitOfPresentation != null) dest.UnitOfPresentation = (Hl7.Fhir.Model.CodeableConcept)UnitOfPresentation.DeepCopyInternal(); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ManufacturedItemDefinition()); + var instance = new ManufacturedItemDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/MarketingStatus.cs b/src/Hl7.Fhir.R5/Model/Generated/MarketingStatus.cs index a6c908b4c7..a5b2bee823 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/MarketingStatus.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/MarketingStatus.cs @@ -140,7 +140,7 @@ public string RestoreDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MarketingStatus; @@ -149,18 +149,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopy(); - if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(DateRange != null) dest.DateRange = (Hl7.Fhir.Model.Period)DateRange.DeepCopy(); - if(RestoreDateElement != null) dest.RestoreDateElement = (Hl7.Fhir.Model.FhirDateTime)RestoreDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopyInternal(); + if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(DateRange != null) dest.DateRange = (Hl7.Fhir.Model.Period)DateRange.DeepCopyInternal(); + if(RestoreDateElement != null) dest.RestoreDateElement = (Hl7.Fhir.Model.FhirDateTime)RestoreDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MarketingStatus()); + var instance = new MarketingStatus(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Measure.cs b/src/Hl7.Fhir.R5/Model/Generated/Measure.cs index c8788123a1..fce7cf26c9 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Measure.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Measure.cs @@ -120,7 +120,7 @@ public string Definition } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TermComponent; @@ -129,15 +129,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Markdown)DefinitionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Markdown)DefinitionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TermComponent()); + var instance = new TermComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -483,7 +484,7 @@ public List Stratifier private List _Stratifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -492,26 +493,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(BasisElement != null) dest.BasisElement = (Code)BasisElement.DeepCopy(); - if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopy(); - if(ScoringUnit != null) dest.ScoringUnit = (Hl7.Fhir.Model.CodeableConcept)ScoringUnit.DeepCopy(); - if(RateAggregationElement != null) dest.RateAggregationElement = (Hl7.Fhir.Model.Markdown)RateAggregationElement.DeepCopy(); - if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopy(); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(BasisElement != null) dest.BasisElement = (Code)BasisElement.DeepCopyInternal(); + if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopyInternal(); + if(ScoringUnit != null) dest.ScoringUnit = (Hl7.Fhir.Model.CodeableConcept)ScoringUnit.DeepCopyInternal(); + if(RateAggregationElement != null) dest.RateAggregationElement = (Hl7.Fhir.Model.Markdown)RateAggregationElement.DeepCopyInternal(); + if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopyInternal(); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -820,7 +822,7 @@ public Hl7.Fhir.Model.CodeableConcept AggregateMethod private Hl7.Fhir.Model.CodeableConcept _AggregateMethod; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PopulationComponent; @@ -829,20 +831,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopy(); - if(GroupDefinition != null) dest.GroupDefinition = (Hl7.Fhir.Model.ResourceReference)GroupDefinition.DeepCopy(); - if(InputPopulationIdElement != null) dest.InputPopulationIdElement = (Hl7.Fhir.Model.FhirString)InputPopulationIdElement.DeepCopy(); - if(AggregateMethod != null) dest.AggregateMethod = (Hl7.Fhir.Model.CodeableConcept)AggregateMethod.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopyInternal(); + if(GroupDefinition != null) dest.GroupDefinition = (Hl7.Fhir.Model.ResourceReference)GroupDefinition.DeepCopyInternal(); + if(InputPopulationIdElement != null) dest.InputPopulationIdElement = (Hl7.Fhir.Model.FhirString)InputPopulationIdElement.DeepCopyInternal(); + if(AggregateMethod != null) dest.AggregateMethod = (Hl7.Fhir.Model.CodeableConcept)AggregateMethod.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PopulationComponent()); + var instance = new PopulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1072,7 +1075,7 @@ public List Component private List _Component; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierComponent; @@ -1081,19 +1084,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopy(); - if(GroupDefinition != null) dest.GroupDefinition = (Hl7.Fhir.Model.ResourceReference)GroupDefinition.DeepCopy(); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopyInternal(); + if(GroupDefinition != null) dest.GroupDefinition = (Hl7.Fhir.Model.ResourceReference)GroupDefinition.DeepCopyInternal(); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierComponent()); + var instance = new StratifierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1302,7 +1306,7 @@ public Hl7.Fhir.Model.ResourceReference GroupDefinition private Hl7.Fhir.Model.ResourceReference _GroupDefinition; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -1311,18 +1315,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopy(); - if(GroupDefinition != null) dest.GroupDefinition = (Hl7.Fhir.Model.ResourceReference)GroupDefinition.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopyInternal(); + if(GroupDefinition != null) dest.GroupDefinition = (Hl7.Fhir.Model.ResourceReference)GroupDefinition.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1524,7 +1529,7 @@ public Hl7.Fhir.Model.Expression Criteria private Hl7.Fhir.Model.Expression _Criteria; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplementalDataComponent; @@ -1533,18 +1538,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Usage.Any()) dest.Usage = new List(Usage.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Usage.Any()) dest.Usage = new List(Usage.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Criteria != null) dest.Criteria = (Hl7.Fhir.Model.Expression)Criteria.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplementalDataComponent()); + var instance = new SupplementalDataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2676,7 +2682,7 @@ public List SupplementalData List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Measure; @@ -2685,58 +2691,59 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(BasisElement != null) dest.BasisElement = (Code)BasisElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.Markdown)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(DisclaimerElement != null) dest.DisclaimerElement = (Hl7.Fhir.Model.Markdown)DisclaimerElement.DeepCopy(); - if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopy(); - if(ScoringUnit != null) dest.ScoringUnit = (Hl7.Fhir.Model.CodeableConcept)ScoringUnit.DeepCopy(); - if(CompositeScoring != null) dest.CompositeScoring = (Hl7.Fhir.Model.CodeableConcept)CompositeScoring.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(RiskAdjustmentElement != null) dest.RiskAdjustmentElement = (Hl7.Fhir.Model.Markdown)RiskAdjustmentElement.DeepCopy(); - if(RateAggregationElement != null) dest.RateAggregationElement = (Hl7.Fhir.Model.Markdown)RateAggregationElement.DeepCopy(); - if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.Markdown)RationaleElement.DeepCopy(); - if(ClinicalRecommendationStatementElement != null) dest.ClinicalRecommendationStatementElement = (Hl7.Fhir.Model.Markdown)ClinicalRecommendationStatementElement.DeepCopy(); - if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopy(); - if(Term.Any()) dest.Term = new List(Term.DeepCopy()); - if(GuidanceElement != null) dest.GuidanceElement = (Hl7.Fhir.Model.Markdown)GuidanceElement.DeepCopy(); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - if(SupplementalData.Any()) dest.SupplementalData = new List(SupplementalData.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Measure()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(BasisElement != null) dest.BasisElement = (Code)BasisElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.Markdown)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(DisclaimerElement != null) dest.DisclaimerElement = (Hl7.Fhir.Model.Markdown)DisclaimerElement.DeepCopyInternal(); + if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopyInternal(); + if(ScoringUnit != null) dest.ScoringUnit = (Hl7.Fhir.Model.CodeableConcept)ScoringUnit.DeepCopyInternal(); + if(CompositeScoring != null) dest.CompositeScoring = (Hl7.Fhir.Model.CodeableConcept)CompositeScoring.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(RiskAdjustmentElement != null) dest.RiskAdjustmentElement = (Hl7.Fhir.Model.Markdown)RiskAdjustmentElement.DeepCopyInternal(); + if(RateAggregationElement != null) dest.RateAggregationElement = (Hl7.Fhir.Model.Markdown)RateAggregationElement.DeepCopyInternal(); + if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.Markdown)RationaleElement.DeepCopyInternal(); + if(ClinicalRecommendationStatementElement != null) dest.ClinicalRecommendationStatementElement = (Hl7.Fhir.Model.Markdown)ClinicalRecommendationStatementElement.DeepCopyInternal(); + if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopyInternal(); + if(Term.Any()) dest.Term = new List(Term.DeepCopyInternal()); + if(GuidanceElement != null) dest.GuidanceElement = (Hl7.Fhir.Model.Markdown)GuidanceElement.DeepCopyInternal(); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); + if(SupplementalData.Any()) dest.SupplementalData = new List(SupplementalData.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Measure(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/MeasureReport.cs b/src/Hl7.Fhir.R5/Model/Generated/MeasureReport.cs index 01f14216c5..40c514795c 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/MeasureReport.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/MeasureReport.cs @@ -262,7 +262,7 @@ public List Stratifier private List _Stratifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -271,19 +271,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(MeasureScore != null) dest.MeasureScore = (Hl7.Fhir.Model.DataType)MeasureScore.DeepCopy(); - if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(MeasureScore != null) dest.MeasureScore = (Hl7.Fhir.Model.DataType)MeasureScore.DeepCopyInternal(); + if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -509,7 +510,7 @@ public Hl7.Fhir.Model.ResourceReference Subjects private Hl7.Fhir.Model.ResourceReference _Subjects; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PopulationComponent; @@ -518,19 +519,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy(); - if(SubjectResults != null) dest.SubjectResults = (Hl7.Fhir.Model.ResourceReference)SubjectResults.DeepCopy(); - if(SubjectReport.Any()) dest.SubjectReport = new List(SubjectReport.DeepCopy()); - if(Subjects != null) dest.Subjects = (Hl7.Fhir.Model.ResourceReference)Subjects.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopyInternal(); + if(SubjectResults != null) dest.SubjectResults = (Hl7.Fhir.Model.ResourceReference)SubjectResults.DeepCopyInternal(); + if(SubjectReport.Any()) dest.SubjectReport = new List(SubjectReport.DeepCopyInternal()); + if(Subjects != null) dest.Subjects = (Hl7.Fhir.Model.ResourceReference)Subjects.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PopulationComponent()); + var instance = new PopulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -693,7 +695,7 @@ public List Stratum private List _Stratum; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierComponent; @@ -702,16 +704,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Stratum.Any()) dest.Stratum = new List(Stratum.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Stratum.Any()) dest.Stratum = new List(Stratum.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierComponent()); + var instance = new StratifierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -850,7 +853,7 @@ public Hl7.Fhir.Model.DataType MeasureScore private Hl7.Fhir.Model.DataType _MeasureScore; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierGroupComponent; @@ -859,17 +862,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(MeasureScore != null) dest.MeasureScore = (Hl7.Fhir.Model.DataType)MeasureScore.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(MeasureScore != null) dest.MeasureScore = (Hl7.Fhir.Model.DataType)MeasureScore.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierGroupComponent()); + var instance = new StratifierGroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1020,7 +1024,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -1029,16 +1033,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1240,7 +1245,7 @@ public Hl7.Fhir.Model.ResourceReference Subjects private Hl7.Fhir.Model.ResourceReference _Subjects; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierGroupPopulationComponent; @@ -1249,19 +1254,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy(); - if(SubjectResults != null) dest.SubjectResults = (Hl7.Fhir.Model.ResourceReference)SubjectResults.DeepCopy(); - if(SubjectReport.Any()) dest.SubjectReport = new List(SubjectReport.DeepCopy()); - if(Subjects != null) dest.Subjects = (Hl7.Fhir.Model.ResourceReference)Subjects.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopyInternal(); + if(SubjectResults != null) dest.SubjectResults = (Hl7.Fhir.Model.ResourceReference)SubjectResults.DeepCopyInternal(); + if(SubjectReport.Any()) dest.SubjectReport = new List(SubjectReport.DeepCopyInternal()); + if(Subjects != null) dest.Subjects = (Hl7.Fhir.Model.ResourceReference)Subjects.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierGroupPopulationComponent()); + var instance = new StratifierGroupPopulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1691,7 +1697,7 @@ public List EvaluatedResource List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MeasureReport; @@ -1700,30 +1706,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(DataUpdateTypeElement != null) dest.DataUpdateTypeElement = (Code)DataUpdateTypeElement.DeepCopy(); - if(MeasureElement != null) dest.MeasureElement = (Hl7.Fhir.Model.Canonical)MeasureElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Reporter != null) dest.Reporter = (Hl7.Fhir.Model.ResourceReference)Reporter.DeepCopy(); - if(ReportingVendor != null) dest.ReportingVendor = (Hl7.Fhir.Model.ResourceReference)ReportingVendor.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(InputParameters != null) dest.InputParameters = (Hl7.Fhir.Model.ResourceReference)InputParameters.DeepCopy(); - if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopy(); - if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopy(); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - if(SupplementalData.Any()) dest.SupplementalData = new List(SupplementalData.DeepCopy()); - if(EvaluatedResource.Any()) dest.EvaluatedResource = new List(EvaluatedResource.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(DataUpdateTypeElement != null) dest.DataUpdateTypeElement = (Code)DataUpdateTypeElement.DeepCopyInternal(); + if(MeasureElement != null) dest.MeasureElement = (Hl7.Fhir.Model.Canonical)MeasureElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Reporter != null) dest.Reporter = (Hl7.Fhir.Model.ResourceReference)Reporter.DeepCopyInternal(); + if(ReportingVendor != null) dest.ReportingVendor = (Hl7.Fhir.Model.ResourceReference)ReportingVendor.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(InputParameters != null) dest.InputParameters = (Hl7.Fhir.Model.ResourceReference)InputParameters.DeepCopyInternal(); + if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopyInternal(); + if(ImprovementNotation != null) dest.ImprovementNotation = (Hl7.Fhir.Model.CodeableConcept)ImprovementNotation.DeepCopyInternal(); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); + if(SupplementalData.Any()) dest.SupplementalData = new List(SupplementalData.DeepCopyInternal()); + if(EvaluatedResource.Any()) dest.EvaluatedResource = new List(EvaluatedResource.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MeasureReport()); + var instance = new MeasureReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Medication.cs b/src/Hl7.Fhir.R5/Model/Generated/Medication.cs index 9fde31bd3d..e2c58b4503 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Medication.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Medication.cs @@ -166,7 +166,7 @@ public Hl7.Fhir.Model.DataType Strength private Hl7.Fhir.Model.DataType _Strength; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientComponent; @@ -175,16 +175,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopy(); - if(IsActiveElement != null) dest.IsActiveElement = (Hl7.Fhir.Model.FhirBoolean)IsActiveElement.DeepCopy(); - if(Strength != null) dest.Strength = (Hl7.Fhir.Model.DataType)Strength.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopyInternal(); + if(IsActiveElement != null) dest.IsActiveElement = (Hl7.Fhir.Model.FhirBoolean)IsActiveElement.DeepCopyInternal(); + if(Strength != null) dest.Strength = (Hl7.Fhir.Model.DataType)Strength.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientComponent()); + var instance = new IngredientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -326,7 +327,7 @@ public string ExpirationDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BatchComponent; @@ -335,15 +336,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BatchComponent()); + var instance = new BatchComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -546,7 +548,7 @@ public Hl7.Fhir.Model.ResourceReference Definition List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Medication; @@ -555,22 +557,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(MarketingAuthorizationHolder != null) dest.MarketingAuthorizationHolder = (Hl7.Fhir.Model.ResourceReference)MarketingAuthorizationHolder.DeepCopy(); - if(DoseForm != null) dest.DoseForm = (Hl7.Fhir.Model.CodeableConcept)DoseForm.DeepCopy(); - if(TotalVolume != null) dest.TotalVolume = (Hl7.Fhir.Model.Quantity)TotalVolume.DeepCopy(); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(Batch != null) dest.Batch = (Hl7.Fhir.Model.Medication.BatchComponent)Batch.DeepCopy(); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(MarketingAuthorizationHolder != null) dest.MarketingAuthorizationHolder = (Hl7.Fhir.Model.ResourceReference)MarketingAuthorizationHolder.DeepCopyInternal(); + if(DoseForm != null) dest.DoseForm = (Hl7.Fhir.Model.CodeableConcept)DoseForm.DeepCopyInternal(); + if(TotalVolume != null) dest.TotalVolume = (Hl7.Fhir.Model.Quantity)TotalVolume.DeepCopyInternal(); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(Batch != null) dest.Batch = (Hl7.Fhir.Model.Medication.BatchComponent)Batch.DeepCopyInternal(); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Medication()); + var instance = new Medication(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/MedicationAdministration.cs b/src/Hl7.Fhir.R5/Model/Generated/MedicationAdministration.cs index 19b7958191..14176ffea8 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/MedicationAdministration.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/MedicationAdministration.cs @@ -155,7 +155,7 @@ public Hl7.Fhir.Model.CodeableReference Actor private Hl7.Fhir.Model.CodeableReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -164,15 +164,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.CodeableReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.CodeableReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -345,7 +346,7 @@ public Hl7.Fhir.Model.DataType Rate private Hl7.Fhir.Model.DataType _Rate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DosageComponent; @@ -354,19 +355,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy(); - if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Dose != null) dest.Dose = (Hl7.Fhir.Model.Quantity)Dose.DeepCopy(); - if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopyInternal(); + if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Dose != null) dest.Dose = (Hl7.Fhir.Model.Quantity)Dose.DeepCopyInternal(); + if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DosageComponent()); + var instance = new DosageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -822,7 +824,7 @@ public List EventHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationAdministration; @@ -831,34 +833,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopy()); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.CodeableReference)Medication.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(Occurence != null) dest.Occurence = (Hl7.Fhir.Model.DataType)Occurence.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.FhirDateTime)RecordedElement.DeepCopy(); - if(IsSubPotentElement != null) dest.IsSubPotentElement = (Hl7.Fhir.Model.FhirBoolean)IsSubPotentElement.DeepCopy(); - if(SubPotentReason.Any()) dest.SubPotentReason = new List(SubPotentReason.DeepCopy()); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Device.Any()) dest.Device = new List(Device.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Dosage != null) dest.Dosage = (Hl7.Fhir.Model.MedicationAdministration.DosageComponent)Dosage.DeepCopy(); - if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopyInternal()); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.CodeableReference)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(Occurence != null) dest.Occurence = (Hl7.Fhir.Model.DataType)Occurence.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.FhirDateTime)RecordedElement.DeepCopyInternal(); + if(IsSubPotentElement != null) dest.IsSubPotentElement = (Hl7.Fhir.Model.FhirBoolean)IsSubPotentElement.DeepCopyInternal(); + if(SubPotentReason.Any()) dest.SubPotentReason = new List(SubPotentReason.DeepCopyInternal()); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Device.Any()) dest.Device = new List(Device.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Dosage != null) dest.Dosage = (Hl7.Fhir.Model.MedicationAdministration.DosageComponent)Dosage.DeepCopyInternal(); + if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationAdministration()); + var instance = new MedicationAdministration(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/MedicationDispense.cs b/src/Hl7.Fhir.R5/Model/Generated/MedicationDispense.cs index 5089733754..b3e928e3a7 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/MedicationDispense.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/MedicationDispense.cs @@ -169,7 +169,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -178,15 +178,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -334,7 +335,7 @@ public Hl7.Fhir.Model.ResourceReference ResponsibleParty private Hl7.Fhir.Model.ResourceReference _ResponsibleParty; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstitutionComponent; @@ -343,17 +344,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(WasSubstitutedElement != null) dest.WasSubstitutedElement = (Hl7.Fhir.Model.FhirBoolean)WasSubstitutedElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(ResponsibleParty != null) dest.ResponsibleParty = (Hl7.Fhir.Model.ResourceReference)ResponsibleParty.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(WasSubstitutedElement != null) dest.WasSubstitutedElement = (Hl7.Fhir.Model.FhirBoolean)WasSubstitutedElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(ResponsibleParty != null) dest.ResponsibleParty = (Hl7.Fhir.Model.ResourceReference)ResponsibleParty.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstitutionComponent()); + var instance = new SubstitutionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -926,7 +928,7 @@ public List EventHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationDispense; @@ -935,40 +937,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(NotPerformedReason != null) dest.NotPerformedReason = (Hl7.Fhir.Model.CodeableReference)NotPerformedReason.DeepCopy(); - if(StatusChangedElement != null) dest.StatusChangedElement = (Hl7.Fhir.Model.FhirDateTime)StatusChangedElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.CodeableReference)Medication.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(AuthorizingPrescription.Any()) dest.AuthorizingPrescription = new List(AuthorizingPrescription.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(DaysSupply != null) dest.DaysSupply = (Hl7.Fhir.Model.Quantity)DaysSupply.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.FhirDateTime)RecordedElement.DeepCopy(); - if(WhenPreparedElement != null) dest.WhenPreparedElement = (Hl7.Fhir.Model.FhirDateTime)WhenPreparedElement.DeepCopy(); - if(WhenHandedOverElement != null) dest.WhenHandedOverElement = (Hl7.Fhir.Model.FhirDateTime)WhenHandedOverElement.DeepCopy(); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RenderedDosageInstructionElement != null) dest.RenderedDosageInstructionElement = (Hl7.Fhir.Model.Markdown)RenderedDosageInstructionElement.DeepCopy(); - if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopy()); - if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationDispense.SubstitutionComponent)Substitution.DeepCopy(); - if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(NotPerformedReason != null) dest.NotPerformedReason = (Hl7.Fhir.Model.CodeableReference)NotPerformedReason.DeepCopyInternal(); + if(StatusChangedElement != null) dest.StatusChangedElement = (Hl7.Fhir.Model.FhirDateTime)StatusChangedElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.CodeableReference)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(AuthorizingPrescription.Any()) dest.AuthorizingPrescription = new List(AuthorizingPrescription.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(DaysSupply != null) dest.DaysSupply = (Hl7.Fhir.Model.Quantity)DaysSupply.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.FhirDateTime)RecordedElement.DeepCopyInternal(); + if(WhenPreparedElement != null) dest.WhenPreparedElement = (Hl7.Fhir.Model.FhirDateTime)WhenPreparedElement.DeepCopyInternal(); + if(WhenHandedOverElement != null) dest.WhenHandedOverElement = (Hl7.Fhir.Model.FhirDateTime)WhenHandedOverElement.DeepCopyInternal(); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RenderedDosageInstructionElement != null) dest.RenderedDosageInstructionElement = (Hl7.Fhir.Model.Markdown)RenderedDosageInstructionElement.DeepCopyInternal(); + if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopyInternal()); + if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationDispense.SubstitutionComponent)Substitution.DeepCopyInternal(); + if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationDispense()); + var instance = new MedicationDispense(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/MedicationKnowledge.cs b/src/Hl7.Fhir.R5/Model/Generated/MedicationKnowledge.cs index fc732682ee..d2fd048b47 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/MedicationKnowledge.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/MedicationKnowledge.cs @@ -133,7 +133,7 @@ public List Reference private List _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedMedicationKnowledgeComponent; @@ -142,15 +142,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Reference.Any()) dest.Reference = new List(Reference.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Reference.Any()) dest.Reference = new List(Reference.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedMedicationKnowledgeComponent()); + var instance = new RelatedMedicationKnowledgeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -247,7 +248,7 @@ public Hl7.Fhir.Model.ResourceReference Source private Hl7.Fhir.Model.ResourceReference _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MonographComponent; @@ -256,15 +257,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MonographComponent()); + var instance = new MonographComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -412,7 +414,7 @@ public Hl7.Fhir.Model.DataType Cost private Hl7.Fhir.Model.DataType _Cost; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CostComponent; @@ -421,17 +423,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(EffectiveDate.Any()) dest.EffectiveDate = new List(EffectiveDate.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopy(); - if(Cost != null) dest.Cost = (Hl7.Fhir.Model.DataType)Cost.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(EffectiveDate.Any()) dest.EffectiveDate = new List(EffectiveDate.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopyInternal(); + if(Cost != null) dest.Cost = (Hl7.Fhir.Model.DataType)Cost.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CostComponent()); + var instance = new CostComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -563,7 +566,7 @@ public string Name } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MonitoringProgramComponent; @@ -572,15 +575,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MonitoringProgramComponent()); + var instance = new MonitoringProgramComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -680,7 +684,7 @@ public List DosingG private List _DosingGuideline; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IndicationGuidelineComponent; @@ -689,15 +693,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Indication.Any()) dest.Indication = new List(Indication.DeepCopy()); - if(DosingGuideline.Any()) dest.DosingGuideline = new List(DosingGuideline.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Indication.Any()) dest.Indication = new List(Indication.DeepCopyInternal()); + if(DosingGuideline.Any()) dest.DosingGuideline = new List(DosingGuideline.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IndicationGuidelineComponent()); + var instance = new IndicationGuidelineComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -823,7 +828,7 @@ public List P private List _PatientCharacteristic; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DosingGuidelineComponent; @@ -832,17 +837,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TreatmentIntent != null) dest.TreatmentIntent = (Hl7.Fhir.Model.CodeableConcept)TreatmentIntent.DeepCopy(); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - if(AdministrationTreatment != null) dest.AdministrationTreatment = (Hl7.Fhir.Model.CodeableConcept)AdministrationTreatment.DeepCopy(); - if(PatientCharacteristic.Any()) dest.PatientCharacteristic = new List(PatientCharacteristic.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TreatmentIntent != null) dest.TreatmentIntent = (Hl7.Fhir.Model.CodeableConcept)TreatmentIntent.DeepCopyInternal(); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); + if(AdministrationTreatment != null) dest.AdministrationTreatment = (Hl7.Fhir.Model.CodeableConcept)AdministrationTreatment.DeepCopyInternal(); + if(PatientCharacteristic.Any()) dest.PatientCharacteristic = new List(PatientCharacteristic.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DosingGuidelineComponent()); + var instance = new DosingGuidelineComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -955,7 +961,7 @@ public List Dosage private List _Dosage; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DosageComponent; @@ -964,15 +970,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DosageComponent()); + var instance = new DosageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1073,7 +1080,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PatientCharacteristicComponent; @@ -1082,15 +1089,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PatientCharacteristicComponent()); + var instance = new PatientCharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1202,7 +1210,7 @@ public List Classification private List _Classification; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicineClassificationComponent; @@ -1211,16 +1219,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopy(); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopyInternal(); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicineClassificationComponent()); + var instance = new MedicineClassificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1329,7 +1338,7 @@ public Hl7.Fhir.Model.ResourceReference PackagedProduct private Hl7.Fhir.Model.ResourceReference _PackagedProduct; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PackagingComponent; @@ -1338,15 +1347,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Cost.Any()) dest.Cost = new List(Cost.DeepCopy()); - if(PackagedProduct != null) dest.PackagedProduct = (Hl7.Fhir.Model.ResourceReference)PackagedProduct.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Cost.Any()) dest.Cost = new List(Cost.DeepCopyInternal()); + if(PackagedProduct != null) dest.PackagedProduct = (Hl7.Fhir.Model.ResourceReference)PackagedProduct.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PackagingComponent()); + var instance = new PackagingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1490,7 +1500,7 @@ public List En private List _EnvironmentalSetting; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StorageGuidelineComponent; @@ -1499,17 +1509,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(StabilityDuration != null) dest.StabilityDuration = (Hl7.Fhir.Model.Duration)StabilityDuration.DeepCopy(); - if(EnvironmentalSetting.Any()) dest.EnvironmentalSetting = new List(EnvironmentalSetting.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(StabilityDuration != null) dest.StabilityDuration = (Hl7.Fhir.Model.Duration)StabilityDuration.DeepCopyInternal(); + if(EnvironmentalSetting.Any()) dest.EnvironmentalSetting = new List(EnvironmentalSetting.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StorageGuidelineComponent()); + var instance = new StorageGuidelineComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1627,7 +1638,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnvironmentalSettingComponent; @@ -1636,15 +1647,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnvironmentalSettingComponent()); + var instance = new EnvironmentalSettingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1770,7 +1782,7 @@ public Hl7.Fhir.Model.MedicationKnowledge.MaxDispenseComponent MaxDispense private Hl7.Fhir.Model.MedicationKnowledge.MaxDispenseComponent _MaxDispense; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RegulatoryComponent; @@ -1779,17 +1791,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RegulatoryAuthority != null) dest.RegulatoryAuthority = (Hl7.Fhir.Model.ResourceReference)RegulatoryAuthority.DeepCopy(); - if(Substitution.Any()) dest.Substitution = new List(Substitution.DeepCopy()); - if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopy()); - if(MaxDispense != null) dest.MaxDispense = (Hl7.Fhir.Model.MedicationKnowledge.MaxDispenseComponent)MaxDispense.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RegulatoryAuthority != null) dest.RegulatoryAuthority = (Hl7.Fhir.Model.ResourceReference)RegulatoryAuthority.DeepCopyInternal(); + if(Substitution.Any()) dest.Substitution = new List(Substitution.DeepCopyInternal()); + if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopyInternal()); + if(MaxDispense != null) dest.MaxDispense = (Hl7.Fhir.Model.MedicationKnowledge.MaxDispenseComponent)MaxDispense.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RegulatoryComponent()); + var instance = new RegulatoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1920,7 +1933,7 @@ public bool? Allowed } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstitutionComponent; @@ -1929,15 +1942,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(AllowedElement != null) dest.AllowedElement = (Hl7.Fhir.Model.FhirBoolean)AllowedElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(AllowedElement != null) dest.AllowedElement = (Hl7.Fhir.Model.FhirBoolean)AllowedElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstitutionComponent()); + var instance = new SubstitutionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2033,7 +2047,7 @@ public Hl7.Fhir.Model.Duration Period private Hl7.Fhir.Model.Duration _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MaxDispenseComponent; @@ -2042,15 +2056,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Duration)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Duration)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MaxDispenseComponent()); + var instance = new MaxDispenseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2195,7 +2210,7 @@ public List Drug private List _DrugCharacteristic; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DefinitionalComponent; @@ -2204,18 +2219,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Definition.Any()) dest.Definition = new List(Definition.DeepCopy()); - if(DoseForm != null) dest.DoseForm = (Hl7.Fhir.Model.CodeableConcept)DoseForm.DeepCopy(); - if(IntendedRoute.Any()) dest.IntendedRoute = new List(IntendedRoute.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(DrugCharacteristic.Any()) dest.DrugCharacteristic = new List(DrugCharacteristic.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Definition.Any()) dest.Definition = new List(Definition.DeepCopyInternal()); + if(DoseForm != null) dest.DoseForm = (Hl7.Fhir.Model.CodeableConcept)DoseForm.DeepCopyInternal(); + if(IntendedRoute.Any()) dest.IntendedRoute = new List(IntendedRoute.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(DrugCharacteristic.Any()) dest.DrugCharacteristic = new List(DrugCharacteristic.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DefinitionalComponent()); + var instance = new DefinitionalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2355,7 +2371,7 @@ public Hl7.Fhir.Model.DataType Strength private Hl7.Fhir.Model.DataType _Strength; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientComponent; @@ -2364,16 +2380,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Strength != null) dest.Strength = (Hl7.Fhir.Model.DataType)Strength.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Strength != null) dest.Strength = (Hl7.Fhir.Model.DataType)Strength.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientComponent()); + var instance = new IngredientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2482,7 +2499,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DrugCharacteristicComponent; @@ -2491,15 +2508,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DrugCharacteristicComponent()); + var instance = new DrugCharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2895,7 +2913,7 @@ public Hl7.Fhir.Model.MedicationKnowledge.DefinitionalComponent Definitional List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationKnowledge; @@ -2904,33 +2922,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(IntendedJurisdiction.Any()) dest.IntendedJurisdiction = new List(IntendedJurisdiction.DeepCopy()); - if(NameElement.Any()) dest.NameElement = new List(NameElement.DeepCopy()); - if(RelatedMedicationKnowledge.Any()) dest.RelatedMedicationKnowledge = new List(RelatedMedicationKnowledge.DeepCopy()); - if(AssociatedMedication.Any()) dest.AssociatedMedication = new List(AssociatedMedication.DeepCopy()); - if(ProductType.Any()) dest.ProductType = new List(ProductType.DeepCopy()); - if(Monograph.Any()) dest.Monograph = new List(Monograph.DeepCopy()); - if(PreparationInstructionElement != null) dest.PreparationInstructionElement = (Hl7.Fhir.Model.Markdown)PreparationInstructionElement.DeepCopy(); - if(Cost.Any()) dest.Cost = new List(Cost.DeepCopy()); - if(MonitoringProgram.Any()) dest.MonitoringProgram = new List(MonitoringProgram.DeepCopy()); - if(IndicationGuideline.Any()) dest.IndicationGuideline = new List(IndicationGuideline.DeepCopy()); - if(MedicineClassification.Any()) dest.MedicineClassification = new List(MedicineClassification.DeepCopy()); - if(Packaging.Any()) dest.Packaging = new List(Packaging.DeepCopy()); - if(ClinicalUseIssue.Any()) dest.ClinicalUseIssue = new List(ClinicalUseIssue.DeepCopy()); - if(StorageGuideline.Any()) dest.StorageGuideline = new List(StorageGuideline.DeepCopy()); - if(Regulatory.Any()) dest.Regulatory = new List(Regulatory.DeepCopy()); - if(Definitional != null) dest.Definitional = (Hl7.Fhir.Model.MedicationKnowledge.DefinitionalComponent)Definitional.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(IntendedJurisdiction.Any()) dest.IntendedJurisdiction = new List(IntendedJurisdiction.DeepCopyInternal()); + if(NameElement.Any()) dest.NameElement = new List(NameElement.DeepCopyInternal()); + if(RelatedMedicationKnowledge.Any()) dest.RelatedMedicationKnowledge = new List(RelatedMedicationKnowledge.DeepCopyInternal()); + if(AssociatedMedication.Any()) dest.AssociatedMedication = new List(AssociatedMedication.DeepCopyInternal()); + if(ProductType.Any()) dest.ProductType = new List(ProductType.DeepCopyInternal()); + if(Monograph.Any()) dest.Monograph = new List(Monograph.DeepCopyInternal()); + if(PreparationInstructionElement != null) dest.PreparationInstructionElement = (Hl7.Fhir.Model.Markdown)PreparationInstructionElement.DeepCopyInternal(); + if(Cost.Any()) dest.Cost = new List(Cost.DeepCopyInternal()); + if(MonitoringProgram.Any()) dest.MonitoringProgram = new List(MonitoringProgram.DeepCopyInternal()); + if(IndicationGuideline.Any()) dest.IndicationGuideline = new List(IndicationGuideline.DeepCopyInternal()); + if(MedicineClassification.Any()) dest.MedicineClassification = new List(MedicineClassification.DeepCopyInternal()); + if(Packaging.Any()) dest.Packaging = new List(Packaging.DeepCopyInternal()); + if(ClinicalUseIssue.Any()) dest.ClinicalUseIssue = new List(ClinicalUseIssue.DeepCopyInternal()); + if(StorageGuideline.Any()) dest.StorageGuideline = new List(StorageGuideline.DeepCopyInternal()); + if(Regulatory.Any()) dest.Regulatory = new List(Regulatory.DeepCopyInternal()); + if(Definitional != null) dest.Definitional = (Hl7.Fhir.Model.MedicationKnowledge.DefinitionalComponent)Definitional.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationKnowledge()); + var instance = new MedicationKnowledge(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/MedicationRequest.cs b/src/Hl7.Fhir.R5/Model/Generated/MedicationRequest.cs index 19ed4992f3..c263a2d025 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/MedicationRequest.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/MedicationRequest.cs @@ -336,7 +336,7 @@ public Hl7.Fhir.Model.CodeableConcept DoseAdministrationAid private Hl7.Fhir.Model.CodeableConcept _DoseAdministrationAid; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DispenseRequestComponent; @@ -345,22 +345,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(InitialFill != null) dest.InitialFill = (Hl7.Fhir.Model.MedicationRequest.InitialFillComponent)InitialFill.DeepCopy(); - if(DispenseInterval != null) dest.DispenseInterval = (Hl7.Fhir.Model.Duration)DispenseInterval.DeepCopy(); - if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopy(); - if(NumberOfRepeatsAllowedElement != null) dest.NumberOfRepeatsAllowedElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfRepeatsAllowedElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(ExpectedSupplyDuration != null) dest.ExpectedSupplyDuration = (Hl7.Fhir.Model.Duration)ExpectedSupplyDuration.DeepCopy(); - if(Dispenser != null) dest.Dispenser = (Hl7.Fhir.Model.ResourceReference)Dispenser.DeepCopy(); - if(DispenserInstruction.Any()) dest.DispenserInstruction = new List(DispenserInstruction.DeepCopy()); - if(DoseAdministrationAid != null) dest.DoseAdministrationAid = (Hl7.Fhir.Model.CodeableConcept)DoseAdministrationAid.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(InitialFill != null) dest.InitialFill = (Hl7.Fhir.Model.MedicationRequest.InitialFillComponent)InitialFill.DeepCopyInternal(); + if(DispenseInterval != null) dest.DispenseInterval = (Hl7.Fhir.Model.Duration)DispenseInterval.DeepCopyInternal(); + if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopyInternal(); + if(NumberOfRepeatsAllowedElement != null) dest.NumberOfRepeatsAllowedElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfRepeatsAllowedElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(ExpectedSupplyDuration != null) dest.ExpectedSupplyDuration = (Hl7.Fhir.Model.Duration)ExpectedSupplyDuration.DeepCopyInternal(); + if(Dispenser != null) dest.Dispenser = (Hl7.Fhir.Model.ResourceReference)Dispenser.DeepCopyInternal(); + if(DispenserInstruction.Any()) dest.DispenserInstruction = new List(DispenserInstruction.DeepCopyInternal()); + if(DoseAdministrationAid != null) dest.DoseAdministrationAid = (Hl7.Fhir.Model.CodeableConcept)DoseAdministrationAid.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DispenseRequestComponent()); + var instance = new DispenseRequestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -515,7 +516,7 @@ public Hl7.Fhir.Model.Duration Duration private Hl7.Fhir.Model.Duration _Duration; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InitialFillComponent; @@ -524,15 +525,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InitialFillComponent()); + var instance = new InitialFillComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -635,7 +637,7 @@ public Hl7.Fhir.Model.CodeableConcept Reason private Hl7.Fhir.Model.CodeableConcept _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstitutionComponent; @@ -644,15 +646,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstitutionComponent()); + var instance = new SubstitutionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1333,7 +1336,7 @@ public List EventHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationRequest; @@ -1342,46 +1345,47 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PriorPrescription != null) dest.PriorPrescription = (Hl7.Fhir.Model.ResourceReference)PriorPrescription.DeepCopy(); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(StatusChangedElement != null) dest.StatusChangedElement = (Hl7.Fhir.Model.FhirDateTime)StatusChangedElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.CodeableReference)Medication.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(InformationSource.Any()) dest.InformationSource = new List(InformationSource.DeepCopy()); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(ReportedElement != null) dest.ReportedElement = (Hl7.Fhir.Model.FhirBoolean)ReportedElement.DeepCopy(); - if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Device.Any()) dest.Device = new List(Device.DeepCopy()); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(CourseOfTherapyType != null) dest.CourseOfTherapyType = (Hl7.Fhir.Model.CodeableConcept)CourseOfTherapyType.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RenderedDosageInstructionElement != null) dest.RenderedDosageInstructionElement = (Hl7.Fhir.Model.Markdown)RenderedDosageInstructionElement.DeepCopy(); - if(EffectiveDosePeriod != null) dest.EffectiveDosePeriod = (Hl7.Fhir.Model.Period)EffectiveDosePeriod.DeepCopy(); - if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopy()); - if(DispenseRequest != null) dest.DispenseRequest = (Hl7.Fhir.Model.MedicationRequest.DispenseRequestComponent)DispenseRequest.DeepCopy(); - if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationRequest.SubstitutionComponent)Substitution.DeepCopy(); - if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PriorPrescription != null) dest.PriorPrescription = (Hl7.Fhir.Model.ResourceReference)PriorPrescription.DeepCopyInternal(); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(StatusChangedElement != null) dest.StatusChangedElement = (Hl7.Fhir.Model.FhirDateTime)StatusChangedElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.CodeableReference)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(InformationSource.Any()) dest.InformationSource = new List(InformationSource.DeepCopyInternal()); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(ReportedElement != null) dest.ReportedElement = (Hl7.Fhir.Model.FhirBoolean)ReportedElement.DeepCopyInternal(); + if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Device.Any()) dest.Device = new List(Device.DeepCopyInternal()); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(CourseOfTherapyType != null) dest.CourseOfTherapyType = (Hl7.Fhir.Model.CodeableConcept)CourseOfTherapyType.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RenderedDosageInstructionElement != null) dest.RenderedDosageInstructionElement = (Hl7.Fhir.Model.Markdown)RenderedDosageInstructionElement.DeepCopyInternal(); + if(EffectiveDosePeriod != null) dest.EffectiveDosePeriod = (Hl7.Fhir.Model.Period)EffectiveDosePeriod.DeepCopyInternal(); + if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopyInternal()); + if(DispenseRequest != null) dest.DispenseRequest = (Hl7.Fhir.Model.MedicationRequest.DispenseRequestComponent)DispenseRequest.DeepCopyInternal(); + if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationRequest.SubstitutionComponent)Substitution.DeepCopyInternal(); + if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationRequest()); + var instance = new MedicationRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/MedicationStatement.cs b/src/Hl7.Fhir.R5/Model/Generated/MedicationStatement.cs index 5da590dc64..21ef577f74 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/MedicationStatement.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/MedicationStatement.cs @@ -134,7 +134,7 @@ public Hl7.Fhir.Model.CodeableConcept Reason private Hl7.Fhir.Model.CodeableConcept _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdherenceComponent; @@ -143,15 +143,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdherenceComponent()); + var instance = new AdherenceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -515,7 +516,7 @@ public Hl7.Fhir.Model.MedicationStatement.AdherenceComponent Adherence List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationStatement; @@ -524,30 +525,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.CodeableReference)Medication.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.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.Any()) dest.InformationSource = new List(InformationSource.DeepCopy()); - if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelatedClinicalInformation.Any()) dest.RelatedClinicalInformation = new List(RelatedClinicalInformation.DeepCopy()); - if(RenderedDosageInstructionElement != null) dest.RenderedDosageInstructionElement = (Hl7.Fhir.Model.Markdown)RenderedDosageInstructionElement.DeepCopy(); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - if(Adherence != null) dest.Adherence = (Hl7.Fhir.Model.MedicationStatement.AdherenceComponent)Adherence.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.CodeableReference)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(DateAssertedElement != null) dest.DateAssertedElement = (Hl7.Fhir.Model.FhirDateTime)DateAssertedElement.DeepCopyInternal(); + if(InformationSource.Any()) dest.InformationSource = new List(InformationSource.DeepCopyInternal()); + if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelatedClinicalInformation.Any()) dest.RelatedClinicalInformation = new List(RelatedClinicalInformation.DeepCopyInternal()); + if(RenderedDosageInstructionElement != null) dest.RenderedDosageInstructionElement = (Hl7.Fhir.Model.Markdown)RenderedDosageInstructionElement.DeepCopyInternal(); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); + if(Adherence != null) dest.Adherence = (Hl7.Fhir.Model.MedicationStatement.AdherenceComponent)Adherence.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationStatement()); + var instance = new MedicationStatement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/MedicinalProductDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/MedicinalProductDefinition.cs index d4ac1c6c2f..7c5741a936 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/MedicinalProductDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/MedicinalProductDefinition.cs @@ -102,7 +102,7 @@ public Hl7.Fhir.Model.ResourceReference Contact private Hl7.Fhir.Model.ResourceReference _Contact; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContactComponent; @@ -111,15 +111,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Contact != null) dest.Contact = (Hl7.Fhir.Model.ResourceReference)Contact.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Contact != null) dest.Contact = (Hl7.Fhir.Model.ResourceReference)Contact.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContactComponent()); + var instance = new ContactComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -262,7 +263,7 @@ public List Usage private List _Usage; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NameComponent; @@ -271,17 +272,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Part.Any()) dest.Part = new List(Part.DeepCopy()); - if(Usage.Any()) dest.Usage = new List(Usage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Part.Any()) dest.Part = new List(Part.DeepCopyInternal()); + if(Usage.Any()) dest.Usage = new List(Usage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NameComponent()); + var instance = new NameComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -413,7 +415,7 @@ public Hl7.Fhir.Model.CodeableConcept Type private Hl7.Fhir.Model.CodeableConcept _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PartComponent; @@ -422,15 +424,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PartElement != null) dest.PartElement = (Hl7.Fhir.Model.FhirString)PartElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PartElement != null) dest.PartElement = (Hl7.Fhir.Model.FhirString)PartElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PartComponent()); + var instance = new PartComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -546,7 +549,7 @@ public Hl7.Fhir.Model.CodeableConcept Language private Hl7.Fhir.Model.CodeableConcept _Language; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UsageComponent; @@ -555,16 +558,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopy(); - if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopy(); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Country != null) dest.Country = (Hl7.Fhir.Model.CodeableConcept)Country.DeepCopyInternal(); + if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopyInternal(); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UsageComponent()); + var instance = new UsageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -672,7 +676,7 @@ public Hl7.Fhir.Model.CodeableConcept Type private Hl7.Fhir.Model.CodeableConcept _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CrossReferenceComponent; @@ -681,15 +685,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Product != null) dest.Product = (Hl7.Fhir.Model.CodeableReference)Product.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Product != null) dest.Product = (Hl7.Fhir.Model.CodeableReference)Product.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CrossReferenceComponent()); + var instance = new CrossReferenceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -817,7 +822,7 @@ public Hl7.Fhir.Model.CodeableConcept ConfidentialityIndicator private Hl7.Fhir.Model.CodeableConcept _ConfidentialityIndicator; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -826,17 +831,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableReference)Type.DeepCopy(); - if(EffectiveDate != null) dest.EffectiveDate = (Hl7.Fhir.Model.Period)EffectiveDate.DeepCopy(); - if(Organization.Any()) dest.Organization = new List(Organization.DeepCopy()); - if(ConfidentialityIndicator != null) dest.ConfidentialityIndicator = (Hl7.Fhir.Model.CodeableConcept)ConfidentialityIndicator.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableReference)Type.DeepCopyInternal(); + if(EffectiveDate != null) dest.EffectiveDate = (Hl7.Fhir.Model.Period)EffectiveDate.DeepCopyInternal(); + if(Organization.Any()) dest.Organization = new List(Organization.DeepCopyInternal()); + if(ConfidentialityIndicator != null) dest.ConfidentialityIndicator = (Hl7.Fhir.Model.CodeableConcept)ConfidentialityIndicator.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationComponent()); + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -954,7 +960,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -963,15 +969,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1518,7 +1525,7 @@ public List C List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicinalProductDefinition; @@ -1527,42 +1534,43 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Domain != null) dest.Domain = (Hl7.Fhir.Model.CodeableConcept)Domain.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(CombinedPharmaceuticalDoseForm != null) dest.CombinedPharmaceuticalDoseForm = (Hl7.Fhir.Model.CodeableConcept)CombinedPharmaceuticalDoseForm.DeepCopy(); - if(Route.Any()) dest.Route = new List(Route.DeepCopy()); - if(IndicationElement != null) dest.IndicationElement = (Hl7.Fhir.Model.Markdown)IndicationElement.DeepCopy(); - if(LegalStatusOfSupply != null) dest.LegalStatusOfSupply = (Hl7.Fhir.Model.CodeableConcept)LegalStatusOfSupply.DeepCopy(); - if(AdditionalMonitoringIndicator != null) dest.AdditionalMonitoringIndicator = (Hl7.Fhir.Model.CodeableConcept)AdditionalMonitoringIndicator.DeepCopy(); - if(SpecialMeasures.Any()) dest.SpecialMeasures = new List(SpecialMeasures.DeepCopy()); - if(PediatricUseIndicator != null) dest.PediatricUseIndicator = (Hl7.Fhir.Model.CodeableConcept)PediatricUseIndicator.DeepCopy(); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopy()); - if(PackagedMedicinalProduct.Any()) dest.PackagedMedicinalProduct = new List(PackagedMedicinalProduct.DeepCopy()); - if(ComprisedOf.Any()) dest.ComprisedOf = new List(ComprisedOf.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(Impurity.Any()) dest.Impurity = new List(Impurity.DeepCopy()); - if(AttachedDocument.Any()) dest.AttachedDocument = new List(AttachedDocument.DeepCopy()); - if(MasterFile.Any()) dest.MasterFile = new List(MasterFile.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(ClinicalTrial.Any()) dest.ClinicalTrial = new List(ClinicalTrial.DeepCopy()); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(CrossReference.Any()) dest.CrossReference = new List(CrossReference.DeepCopy()); - if(Operation.Any()) dest.Operation = new List(Operation.DeepCopy()); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Domain != null) dest.Domain = (Hl7.Fhir.Model.CodeableConcept)Domain.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(CombinedPharmaceuticalDoseForm != null) dest.CombinedPharmaceuticalDoseForm = (Hl7.Fhir.Model.CodeableConcept)CombinedPharmaceuticalDoseForm.DeepCopyInternal(); + if(Route.Any()) dest.Route = new List(Route.DeepCopyInternal()); + if(IndicationElement != null) dest.IndicationElement = (Hl7.Fhir.Model.Markdown)IndicationElement.DeepCopyInternal(); + if(LegalStatusOfSupply != null) dest.LegalStatusOfSupply = (Hl7.Fhir.Model.CodeableConcept)LegalStatusOfSupply.DeepCopyInternal(); + if(AdditionalMonitoringIndicator != null) dest.AdditionalMonitoringIndicator = (Hl7.Fhir.Model.CodeableConcept)AdditionalMonitoringIndicator.DeepCopyInternal(); + if(SpecialMeasures.Any()) dest.SpecialMeasures = new List(SpecialMeasures.DeepCopyInternal()); + if(PediatricUseIndicator != null) dest.PediatricUseIndicator = (Hl7.Fhir.Model.CodeableConcept)PediatricUseIndicator.DeepCopyInternal(); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); + if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopyInternal()); + if(PackagedMedicinalProduct.Any()) dest.PackagedMedicinalProduct = new List(PackagedMedicinalProduct.DeepCopyInternal()); + if(ComprisedOf.Any()) dest.ComprisedOf = new List(ComprisedOf.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(Impurity.Any()) dest.Impurity = new List(Impurity.DeepCopyInternal()); + if(AttachedDocument.Any()) dest.AttachedDocument = new List(AttachedDocument.DeepCopyInternal()); + if(MasterFile.Any()) dest.MasterFile = new List(MasterFile.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(ClinicalTrial.Any()) dest.ClinicalTrial = new List(ClinicalTrial.DeepCopyInternal()); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(CrossReference.Any()) dest.CrossReference = new List(CrossReference.DeepCopyInternal()); + if(Operation.Any()) dest.Operation = new List(Operation.DeepCopyInternal()); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicinalProductDefinition()); + var instance = new MedicinalProductDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/MessageDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/MessageDefinition.cs index d11e074912..6b7f9ebeef 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/MessageDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/MessageDefinition.cs @@ -266,7 +266,7 @@ public string Max } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FocusComponent; @@ -275,17 +275,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FocusComponent()); + var instance = new FocusComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -437,7 +438,7 @@ public string Situation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AllowedResponseComponent; @@ -446,15 +447,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Canonical)MessageElement.DeepCopy(); - if(SituationElement != null) dest.SituationElement = (Hl7.Fhir.Model.Markdown)SituationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Canonical)MessageElement.DeepCopyInternal(); + if(SituationElement != null) dest.SituationElement = (Hl7.Fhir.Model.Markdown)SituationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AllowedResponseComponent()); + var instance = new AllowedResponseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1197,7 +1199,7 @@ public string Graph List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageDefinition; @@ -1206,39 +1208,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ReplacesElement.Any()) dest.ReplacesElement = new List(ReplacesElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(BaseElement != null) dest.BaseElement = (Hl7.Fhir.Model.Canonical)BaseElement.DeepCopy(); - if(ParentElement.Any()) dest.ParentElement = new List(ParentElement.DeepCopy()); - if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopy(); - if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(ResponseRequiredElement != null) dest.ResponseRequiredElement = (Code)ResponseRequiredElement.DeepCopy(); - if(AllowedResponse.Any()) dest.AllowedResponse = new List(AllowedResponse.DeepCopy()); - if(GraphElement != null) dest.GraphElement = (Hl7.Fhir.Model.Canonical)GraphElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ReplacesElement.Any()) dest.ReplacesElement = new List(ReplacesElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(BaseElement != null) dest.BaseElement = (Hl7.Fhir.Model.Canonical)BaseElement.DeepCopyInternal(); + if(ParentElement.Any()) dest.ParentElement = new List(ParentElement.DeepCopyInternal()); + if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopyInternal(); + if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(ResponseRequiredElement != null) dest.ResponseRequiredElement = (Code)ResponseRequiredElement.DeepCopyInternal(); + if(AllowedResponse.Any()) dest.AllowedResponse = new List(AllowedResponse.DeepCopyInternal()); + if(GraphElement != null) dest.GraphElement = (Hl7.Fhir.Model.Canonical)GraphElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageDefinition()); + var instance = new MessageDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/MessageHeader.cs b/src/Hl7.Fhir.R5/Model/Generated/MessageHeader.cs index 1cc45cb6b1..6b46f67bfe 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/MessageHeader.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/MessageHeader.cs @@ -181,7 +181,7 @@ public Hl7.Fhir.Model.ResourceReference Receiver private Hl7.Fhir.Model.ResourceReference _Receiver; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageDestinationComponent; @@ -190,17 +190,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Endpoint != null) dest.Endpoint = (Hl7.Fhir.Model.DataType)Endpoint.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - if(Receiver != null) dest.Receiver = (Hl7.Fhir.Model.ResourceReference)Receiver.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Endpoint != null) dest.Endpoint = (Hl7.Fhir.Model.DataType)Endpoint.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); + if(Receiver != null) dest.Receiver = (Hl7.Fhir.Model.ResourceReference)Receiver.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageDestinationComponent()); + var instance = new MessageDestinationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -410,7 +411,7 @@ public Hl7.Fhir.Model.ContactPoint Contact private Hl7.Fhir.Model.ContactPoint _Contact; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageSourceComponent; @@ -419,18 +420,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Endpoint != null) dest.Endpoint = (Hl7.Fhir.Model.DataType)Endpoint.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(SoftwareElement != null) dest.SoftwareElement = (Hl7.Fhir.Model.FhirString)SoftwareElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(Contact != null) dest.Contact = (Hl7.Fhir.Model.ContactPoint)Contact.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Endpoint != null) dest.Endpoint = (Hl7.Fhir.Model.DataType)Endpoint.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(SoftwareElement != null) dest.SoftwareElement = (Hl7.Fhir.Model.FhirString)SoftwareElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(Contact != null) dest.Contact = (Hl7.Fhir.Model.ContactPoint)Contact.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageSourceComponent()); + var instance = new MessageSourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -589,7 +591,7 @@ public Hl7.Fhir.Model.ResourceReference Details private Hl7.Fhir.Model.ResourceReference _Details; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResponseComponent; @@ -598,16 +600,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Details != null) dest.Details = (Hl7.Fhir.Model.ResourceReference)Details.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Details != null) dest.Details = (Hl7.Fhir.Model.ResourceReference)Details.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResponseComponent()); + var instance = new ResponseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -835,7 +838,7 @@ public string Definition } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageHeader; @@ -844,23 +847,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopy(); - if(Destination.Any()) dest.Destination = new List(Destination.DeepCopy()); - if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.MessageHeader.MessageSourceComponent)Source.DeepCopy(); - if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.MessageHeader.ResponseComponent)Response.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Event != null) dest.Event = (Hl7.Fhir.Model.DataType)Event.DeepCopyInternal(); + if(Destination.Any()) dest.Destination = new List(Destination.DeepCopyInternal()); + if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.MessageHeader.MessageSourceComponent)Source.DeepCopyInternal(); + if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.MessageHeader.ResponseComponent)Response.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageHeader()); + var instance = new MessageHeader(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/MolecularSequence.cs b/src/Hl7.Fhir.R5/Model/Generated/MolecularSequence.cs index 42d53ae21d..e0bd68489d 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/MolecularSequence.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/MolecularSequence.cs @@ -227,7 +227,7 @@ public List Edit private List _Edit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelativeComponent; @@ -236,18 +236,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CoordinateSystem != null) dest.CoordinateSystem = (Hl7.Fhir.Model.CodeableConcept)CoordinateSystem.DeepCopy(); - if(OrdinalPositionElement != null) dest.OrdinalPositionElement = (Hl7.Fhir.Model.Integer)OrdinalPositionElement.DeepCopy(); - if(SequenceRange != null) dest.SequenceRange = (Hl7.Fhir.Model.Range)SequenceRange.DeepCopy(); - if(StartingSequence != null) dest.StartingSequence = (Hl7.Fhir.Model.MolecularSequence.StartingSequenceComponent)StartingSequence.DeepCopy(); - if(Edit.Any()) dest.Edit = new List(Edit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CoordinateSystem != null) dest.CoordinateSystem = (Hl7.Fhir.Model.CodeableConcept)CoordinateSystem.DeepCopyInternal(); + if(OrdinalPositionElement != null) dest.OrdinalPositionElement = (Hl7.Fhir.Model.Integer)OrdinalPositionElement.DeepCopyInternal(); + if(SequenceRange != null) dest.SequenceRange = (Hl7.Fhir.Model.Range)SequenceRange.DeepCopyInternal(); + if(StartingSequence != null) dest.StartingSequence = (Hl7.Fhir.Model.MolecularSequence.StartingSequenceComponent)StartingSequence.DeepCopyInternal(); + if(Edit.Any()) dest.Edit = new List(Edit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelativeComponent()); + var instance = new RelativeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -516,7 +517,7 @@ public Hl7.Fhir.Model.MolecularSequence.StrandType? Strand } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StartingSequenceComponent; @@ -525,20 +526,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(GenomeAssembly != null) dest.GenomeAssembly = (Hl7.Fhir.Model.CodeableConcept)GenomeAssembly.DeepCopy(); - if(Chromosome != null) dest.Chromosome = (Hl7.Fhir.Model.CodeableConcept)Chromosome.DeepCopy(); - if(Sequence != null) dest.Sequence = (Hl7.Fhir.Model.DataType)Sequence.DeepCopy(); - if(WindowStartElement != null) dest.WindowStartElement = (Hl7.Fhir.Model.Integer)WindowStartElement.DeepCopy(); - if(WindowEndElement != null) dest.WindowEndElement = (Hl7.Fhir.Model.Integer)WindowEndElement.DeepCopy(); - if(OrientationElement != null) dest.OrientationElement = (Code)OrientationElement.DeepCopy(); - if(StrandElement != null) dest.StrandElement = (Code)StrandElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(GenomeAssembly != null) dest.GenomeAssembly = (Hl7.Fhir.Model.CodeableConcept)GenomeAssembly.DeepCopyInternal(); + if(Chromosome != null) dest.Chromosome = (Hl7.Fhir.Model.CodeableConcept)Chromosome.DeepCopyInternal(); + if(Sequence != null) dest.Sequence = (Hl7.Fhir.Model.DataType)Sequence.DeepCopyInternal(); + if(WindowStartElement != null) dest.WindowStartElement = (Hl7.Fhir.Model.Integer)WindowStartElement.DeepCopyInternal(); + if(WindowEndElement != null) dest.WindowEndElement = (Hl7.Fhir.Model.Integer)WindowEndElement.DeepCopyInternal(); + if(OrientationElement != null) dest.OrientationElement = (Code)OrientationElement.DeepCopyInternal(); + if(StrandElement != null) dest.StrandElement = (Code)StrandElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StartingSequenceComponent()); + var instance = new StartingSequenceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -771,7 +773,7 @@ public string ReplacedSequence } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EditComponent; @@ -780,17 +782,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopy(); - if(ReplacementSequenceElement != null) dest.ReplacementSequenceElement = (Hl7.Fhir.Model.FhirString)ReplacementSequenceElement.DeepCopy(); - if(ReplacedSequenceElement != null) dest.ReplacedSequenceElement = (Hl7.Fhir.Model.FhirString)ReplacedSequenceElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopyInternal(); + if(ReplacementSequenceElement != null) dest.ReplacementSequenceElement = (Hl7.Fhir.Model.FhirString)ReplacementSequenceElement.DeepCopyInternal(); + if(ReplacedSequenceElement != null) dest.ReplacedSequenceElement = (Hl7.Fhir.Model.FhirString)ReplacedSequenceElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EditComponent()); + var instance = new EditComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1046,7 +1049,7 @@ public List Relative List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MolecularSequence; @@ -1055,23 +1058,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(LiteralElement != null) dest.LiteralElement = (Hl7.Fhir.Model.FhirString)LiteralElement.DeepCopy(); - if(Formatted.Any()) dest.Formatted = new List(Formatted.DeepCopy()); - if(Relative.Any()) dest.Relative = new List(Relative.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(LiteralElement != null) dest.LiteralElement = (Hl7.Fhir.Model.FhirString)LiteralElement.DeepCopyInternal(); + if(Formatted.Any()) dest.Formatted = new List(Formatted.DeepCopyInternal()); + if(Relative.Any()) dest.Relative = new List(Relative.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MolecularSequence()); + var instance = new MolecularSequence(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/MonetaryComponent.cs b/src/Hl7.Fhir.R5/Model/Generated/MonetaryComponent.cs index 54fed46fd4..fc0526b178 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/MonetaryComponent.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/MonetaryComponent.cs @@ -194,7 +194,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MonetaryComponent; @@ -203,17 +203,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MonetaryComponent()); + var instance = new MonetaryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Money.cs b/src/Hl7.Fhir.R5/Model/Generated/Money.cs index ca97ec11ad..6b527e42b3 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Money.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Money.cs @@ -120,7 +120,7 @@ public Hl7.Fhir.Model.Currencies? Currency } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Money; @@ -129,15 +129,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy(); - if(CurrencyElement != null) dest.CurrencyElement = (Code)CurrencyElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopyInternal(); + if(CurrencyElement != null) dest.CurrencyElement = (Code)CurrencyElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Money()); + var instance = new Money(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/NamingSystem.cs b/src/Hl7.Fhir.R5/Model/Generated/NamingSystem.cs index c997ff1fd7..6c489f8d16 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/NamingSystem.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/NamingSystem.cs @@ -322,7 +322,7 @@ public bool? Authoritative } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UniqueIdComponent; @@ -331,19 +331,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(AuthoritativeElement != null) dest.AuthoritativeElement = (Hl7.Fhir.Model.FhirBoolean)AuthoritativeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(AuthoritativeElement != null) dest.AuthoritativeElement = (Hl7.Fhir.Model.FhirBoolean)AuthoritativeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UniqueIdComponent()); + var instance = new UniqueIdComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1166,7 +1167,7 @@ public List UniqueId List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NamingSystem; @@ -1175,44 +1176,45 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirString)ResponsibleElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(UniqueId.Any()) dest.UniqueId = new List(UniqueId.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirString)ResponsibleElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(UniqueId.Any()) dest.UniqueId = new List(UniqueId.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NamingSystem()); + var instance = new NamingSystem(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/NutritionIntake.cs b/src/Hl7.Fhir.R5/Model/Generated/NutritionIntake.cs index bf0267f9ea..1235294bd7 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/NutritionIntake.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/NutritionIntake.cs @@ -186,7 +186,7 @@ public Hl7.Fhir.Model.CodeableConcept NotConsumedReason private Hl7.Fhir.Model.CodeableConcept _NotConsumedReason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConsumedItemComponent; @@ -195,20 +195,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(NutritionProduct != null) dest.NutritionProduct = (Hl7.Fhir.Model.CodeableReference)NutritionProduct.DeepCopy(); - if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.Timing)Schedule.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - if(Rate != null) dest.Rate = (Hl7.Fhir.Model.Quantity)Rate.DeepCopy(); - if(NotConsumedElement != null) dest.NotConsumedElement = (Hl7.Fhir.Model.FhirBoolean)NotConsumedElement.DeepCopy(); - if(NotConsumedReason != null) dest.NotConsumedReason = (Hl7.Fhir.Model.CodeableConcept)NotConsumedReason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(NutritionProduct != null) dest.NutritionProduct = (Hl7.Fhir.Model.CodeableReference)NutritionProduct.DeepCopyInternal(); + if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.Timing)Schedule.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); + if(Rate != null) dest.Rate = (Hl7.Fhir.Model.Quantity)Rate.DeepCopyInternal(); + if(NotConsumedElement != null) dest.NotConsumedElement = (Hl7.Fhir.Model.FhirBoolean)NotConsumedElement.DeepCopyInternal(); + if(NotConsumedReason != null) dest.NotConsumedReason = (Hl7.Fhir.Model.CodeableConcept)NotConsumedReason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConsumedItemComponent()); + var instance = new ConsumedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -350,7 +351,7 @@ public Hl7.Fhir.Model.Quantity Amount private Hl7.Fhir.Model.Quantity _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientLabelComponent; @@ -359,15 +360,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Nutrient != null) dest.Nutrient = (Hl7.Fhir.Model.CodeableReference)Nutrient.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Nutrient != null) dest.Nutrient = (Hl7.Fhir.Model.CodeableReference)Nutrient.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientLabelComponent()); + var instance = new IngredientLabelComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -469,7 +471,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -478,15 +480,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -912,7 +915,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NutritionIntake; @@ -921,33 +924,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.FhirDateTime)RecordedElement.DeepCopy(); - if(Reported != null) dest.Reported = (Hl7.Fhir.Model.DataType)Reported.DeepCopy(); - if(ConsumedItem.Any()) dest.ConsumedItem = new List(ConsumedItem.DeepCopy()); - if(IngredientLabel.Any()) dest.IngredientLabel = new List(IngredientLabel.DeepCopy()); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason.Any()) dest.StatusReason = new List(StatusReason.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.FhirDateTime)RecordedElement.DeepCopyInternal(); + if(Reported != null) dest.Reported = (Hl7.Fhir.Model.DataType)Reported.DeepCopyInternal(); + if(ConsumedItem.Any()) dest.ConsumedItem = new List(ConsumedItem.DeepCopyInternal()); + if(IngredientLabel.Any()) dest.IngredientLabel = new List(IngredientLabel.DeepCopyInternal()); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NutritionIntake()); + var instance = new NutritionIntake(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/NutritionOrder.cs b/src/Hl7.Fhir.R5/Model/Generated/NutritionOrder.cs index c54d084cc0..5e02fbba6b 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/NutritionOrder.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/NutritionOrder.cs @@ -178,7 +178,7 @@ public string Instruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OralDietComponent; @@ -187,19 +187,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.NutritionOrder.OralDietScheduleComponent)Schedule.DeepCopy(); - if(Nutrient.Any()) dest.Nutrient = new List(Nutrient.DeepCopy()); - if(Texture.Any()) dest.Texture = new List(Texture.DeepCopy()); - if(FluidConsistencyType.Any()) dest.FluidConsistencyType = new List(FluidConsistencyType.DeepCopy()); - if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.NutritionOrder.OralDietScheduleComponent)Schedule.DeepCopyInternal(); + if(Nutrient.Any()) dest.Nutrient = new List(Nutrient.DeepCopyInternal()); + if(Texture.Any()) dest.Texture = new List(Texture.DeepCopyInternal()); + if(FluidConsistencyType.Any()) dest.FluidConsistencyType = new List(FluidConsistencyType.DeepCopyInternal()); + if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OralDietComponent()); + var instance = new OralDietComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -362,7 +363,7 @@ public Hl7.Fhir.Model.CodeableConcept AsNeededFor private Hl7.Fhir.Model.CodeableConcept _AsNeededFor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OralDietScheduleComponent; @@ -371,16 +372,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Timing.Any()) dest.Timing = new List(Timing.DeepCopy()); - if(AsNeededElement != null) dest.AsNeededElement = (Hl7.Fhir.Model.FhirBoolean)AsNeededElement.DeepCopy(); - if(AsNeededFor != null) dest.AsNeededFor = (Hl7.Fhir.Model.CodeableConcept)AsNeededFor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Timing.Any()) dest.Timing = new List(Timing.DeepCopyInternal()); + if(AsNeededElement != null) dest.AsNeededElement = (Hl7.Fhir.Model.FhirBoolean)AsNeededElement.DeepCopyInternal(); + if(AsNeededFor != null) dest.AsNeededFor = (Hl7.Fhir.Model.CodeableConcept)AsNeededFor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OralDietScheduleComponent()); + var instance = new OralDietScheduleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -487,7 +489,7 @@ public Hl7.Fhir.Model.Quantity Amount private Hl7.Fhir.Model.Quantity _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NutrientComponent; @@ -496,15 +498,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NutrientComponent()); + var instance = new NutrientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -604,7 +607,7 @@ public Hl7.Fhir.Model.CodeableConcept FoodType private Hl7.Fhir.Model.CodeableConcept _FoodType; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TextureComponent; @@ -613,15 +616,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopy(); - if(FoodType != null) dest.FoodType = (Hl7.Fhir.Model.CodeableConcept)FoodType.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopyInternal(); + if(FoodType != null) dest.FoodType = (Hl7.Fhir.Model.CodeableConcept)FoodType.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TextureComponent()); + var instance = new TextureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -795,7 +799,7 @@ public string Instruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplementComponent; @@ -804,18 +808,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableReference)Type.DeepCopy(); - if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopy(); - if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.NutritionOrder.SupplementScheduleComponent)Schedule.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableReference)Type.DeepCopyInternal(); + if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopyInternal(); + if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.NutritionOrder.SupplementScheduleComponent)Schedule.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplementComponent()); + var instance = new SupplementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -970,7 +975,7 @@ public Hl7.Fhir.Model.CodeableConcept AsNeededFor private Hl7.Fhir.Model.CodeableConcept _AsNeededFor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplementScheduleComponent; @@ -979,16 +984,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Timing.Any()) dest.Timing = new List(Timing.DeepCopy()); - if(AsNeededElement != null) dest.AsNeededElement = (Hl7.Fhir.Model.FhirBoolean)AsNeededElement.DeepCopy(); - if(AsNeededFor != null) dest.AsNeededFor = (Hl7.Fhir.Model.CodeableConcept)AsNeededFor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Timing.Any()) dest.Timing = new List(Timing.DeepCopyInternal()); + if(AsNeededElement != null) dest.AsNeededElement = (Hl7.Fhir.Model.FhirBoolean)AsNeededElement.DeepCopyInternal(); + if(AsNeededFor != null) dest.AsNeededFor = (Hl7.Fhir.Model.CodeableConcept)AsNeededFor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplementScheduleComponent()); + var instance = new SupplementScheduleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1226,7 +1232,7 @@ public string AdministrationInstruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnteralFormulaComponent; @@ -1235,22 +1241,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(BaseFormulaType != null) dest.BaseFormulaType = (Hl7.Fhir.Model.CodeableReference)BaseFormulaType.DeepCopy(); - if(BaseFormulaProductNameElement != null) dest.BaseFormulaProductNameElement = (Hl7.Fhir.Model.FhirString)BaseFormulaProductNameElement.DeepCopy(); - if(DeliveryDevice.Any()) dest.DeliveryDevice = new List(DeliveryDevice.DeepCopy()); - if(Additive.Any()) dest.Additive = new List(Additive.DeepCopy()); - if(CaloricDensity != null) dest.CaloricDensity = (Hl7.Fhir.Model.Quantity)CaloricDensity.DeepCopy(); - if(RouteOfAdministration != null) dest.RouteOfAdministration = (Hl7.Fhir.Model.CodeableConcept)RouteOfAdministration.DeepCopy(); - if(Administration.Any()) dest.Administration = new List(Administration.DeepCopy()); - if(MaxVolumeToDeliver != null) dest.MaxVolumeToDeliver = (Hl7.Fhir.Model.Quantity)MaxVolumeToDeliver.DeepCopy(); - if(AdministrationInstructionElement != null) dest.AdministrationInstructionElement = (Hl7.Fhir.Model.Markdown)AdministrationInstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(BaseFormulaType != null) dest.BaseFormulaType = (Hl7.Fhir.Model.CodeableReference)BaseFormulaType.DeepCopyInternal(); + if(BaseFormulaProductNameElement != null) dest.BaseFormulaProductNameElement = (Hl7.Fhir.Model.FhirString)BaseFormulaProductNameElement.DeepCopyInternal(); + if(DeliveryDevice.Any()) dest.DeliveryDevice = new List(DeliveryDevice.DeepCopyInternal()); + if(Additive.Any()) dest.Additive = new List(Additive.DeepCopyInternal()); + if(CaloricDensity != null) dest.CaloricDensity = (Hl7.Fhir.Model.Quantity)CaloricDensity.DeepCopyInternal(); + if(RouteOfAdministration != null) dest.RouteOfAdministration = (Hl7.Fhir.Model.CodeableConcept)RouteOfAdministration.DeepCopyInternal(); + if(Administration.Any()) dest.Administration = new List(Administration.DeepCopyInternal()); + if(MaxVolumeToDeliver != null) dest.MaxVolumeToDeliver = (Hl7.Fhir.Model.Quantity)MaxVolumeToDeliver.DeepCopyInternal(); + if(AdministrationInstructionElement != null) dest.AdministrationInstructionElement = (Hl7.Fhir.Model.Markdown)AdministrationInstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnteralFormulaComponent()); + var instance = new EnteralFormulaComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1436,7 +1443,7 @@ public Hl7.Fhir.Model.Quantity Quantity private Hl7.Fhir.Model.Quantity _Quantity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdditiveComponent; @@ -1445,16 +1452,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableReference)Type.DeepCopy(); - if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableReference)Type.DeepCopyInternal(); + if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdditiveComponent()); + var instance = new AdditiveComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1576,7 +1584,7 @@ public Hl7.Fhir.Model.DataType Rate private Hl7.Fhir.Model.DataType _Rate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdministrationComponent; @@ -1585,16 +1593,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.NutritionOrder.EnteralFormulaScheduleComponent)Schedule.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.NutritionOrder.EnteralFormulaScheduleComponent)Schedule.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdministrationComponent()); + var instance = new AdministrationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1733,7 +1742,7 @@ public Hl7.Fhir.Model.CodeableConcept AsNeededFor private Hl7.Fhir.Model.CodeableConcept _AsNeededFor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnteralFormulaScheduleComponent; @@ -1742,16 +1751,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Timing.Any()) dest.Timing = new List(Timing.DeepCopy()); - if(AsNeededElement != null) dest.AsNeededElement = (Hl7.Fhir.Model.FhirBoolean)AsNeededElement.DeepCopy(); - if(AsNeededFor != null) dest.AsNeededFor = (Hl7.Fhir.Model.CodeableConcept)AsNeededFor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Timing.Any()) dest.Timing = new List(Timing.DeepCopyInternal()); + if(AsNeededElement != null) dest.AsNeededElement = (Hl7.Fhir.Model.FhirBoolean)AsNeededElement.DeepCopyInternal(); + if(AsNeededFor != null) dest.AsNeededFor = (Hl7.Fhir.Model.CodeableConcept)AsNeededFor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnteralFormulaScheduleComponent()); + var instance = new EnteralFormulaScheduleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2296,7 +2306,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NutritionOrder; @@ -2305,36 +2315,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopy(); - if(Orderer != null) dest.Orderer = (Hl7.Fhir.Model.ResourceReference)Orderer.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(AllergyIntolerance.Any()) dest.AllergyIntolerance = new List(AllergyIntolerance.DeepCopy()); - if(FoodPreferenceModifier.Any()) dest.FoodPreferenceModifier = new List(FoodPreferenceModifier.DeepCopy()); - if(ExcludeFoodModifier.Any()) dest.ExcludeFoodModifier = new List(ExcludeFoodModifier.DeepCopy()); - if(OutsideFoodAllowedElement != null) dest.OutsideFoodAllowedElement = (Hl7.Fhir.Model.FhirBoolean)OutsideFoodAllowedElement.DeepCopy(); - if(OralDiet != null) dest.OralDiet = (Hl7.Fhir.Model.NutritionOrder.OralDietComponent)OralDiet.DeepCopy(); - if(Supplement.Any()) dest.Supplement = new List(Supplement.DeepCopy()); - if(EnteralFormula != null) dest.EnteralFormula = (Hl7.Fhir.Model.NutritionOrder.EnteralFormulaComponent)EnteralFormula.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopyInternal(); + if(Orderer != null) dest.Orderer = (Hl7.Fhir.Model.ResourceReference)Orderer.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(AllergyIntolerance.Any()) dest.AllergyIntolerance = new List(AllergyIntolerance.DeepCopyInternal()); + if(FoodPreferenceModifier.Any()) dest.FoodPreferenceModifier = new List(FoodPreferenceModifier.DeepCopyInternal()); + if(ExcludeFoodModifier.Any()) dest.ExcludeFoodModifier = new List(ExcludeFoodModifier.DeepCopyInternal()); + if(OutsideFoodAllowedElement != null) dest.OutsideFoodAllowedElement = (Hl7.Fhir.Model.FhirBoolean)OutsideFoodAllowedElement.DeepCopyInternal(); + if(OralDiet != null) dest.OralDiet = (Hl7.Fhir.Model.NutritionOrder.OralDietComponent)OralDiet.DeepCopyInternal(); + if(Supplement.Any()) dest.Supplement = new List(Supplement.DeepCopyInternal()); + if(EnteralFormula != null) dest.EnteralFormula = (Hl7.Fhir.Model.NutritionOrder.EnteralFormulaComponent)EnteralFormula.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NutritionOrder()); + var instance = new NutritionOrder(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/NutritionProduct.cs b/src/Hl7.Fhir.R5/Model/Generated/NutritionProduct.cs index 90db237b23..eb9c6bc973 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/NutritionProduct.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/NutritionProduct.cs @@ -131,7 +131,7 @@ public List Amount private List _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NutrientComponent; @@ -140,15 +140,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopy(); - if(Amount.Any()) dest.Amount = new List(Amount.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopyInternal(); + if(Amount.Any()) dest.Amount = new List(Amount.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NutrientComponent()); + var instance = new NutrientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -245,7 +246,7 @@ public List Amount private List _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientComponent; @@ -254,15 +255,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopy(); - if(Amount.Any()) dest.Amount = new List(Amount.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopyInternal(); + if(Amount.Any()) dest.Amount = new List(Amount.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientComponent()); + var instance = new IngredientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -362,7 +364,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -371,15 +373,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -615,7 +618,7 @@ public Hl7.Fhir.Model.Identifier BiologicalSourceEvent private Hl7.Fhir.Model.Identifier _BiologicalSourceEvent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -624,20 +627,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopy(); - if(UseByElement != null) dest.UseByElement = (Hl7.Fhir.Model.FhirDateTime)UseByElement.DeepCopy(); - if(BiologicalSourceEvent != null) dest.BiologicalSourceEvent = (Hl7.Fhir.Model.Identifier)BiologicalSourceEvent.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopyInternal(); + if(UseByElement != null) dest.UseByElement = (Hl7.Fhir.Model.FhirDateTime)UseByElement.DeepCopyInternal(); + if(BiologicalSourceEvent != null) dest.BiologicalSourceEvent = (Hl7.Fhir.Model.Identifier)BiologicalSourceEvent.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -897,7 +901,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NutritionProduct; @@ -906,23 +910,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(Nutrient.Any()) dest.Nutrient = new List(Nutrient.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(KnownAllergen.Any()) dest.KnownAllergen = new List(KnownAllergen.DeepCopy()); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(Nutrient.Any()) dest.Nutrient = new List(Nutrient.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(KnownAllergen.Any()) dest.KnownAllergen = new List(KnownAllergen.DeepCopyInternal()); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NutritionProduct()); + var instance = new NutritionProduct(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Observation.cs b/src/Hl7.Fhir.R5/Model/Generated/Observation.cs index f742626994..dc1eb6747a 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Observation.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Observation.cs @@ -185,7 +185,7 @@ public string Reason } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TriggeredByComponent; @@ -194,16 +194,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Observation != null) dest.Observation = (Hl7.Fhir.Model.ResourceReference)Observation.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ReasonElement != null) dest.ReasonElement = (Hl7.Fhir.Model.FhirString)ReasonElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Observation != null) dest.Observation = (Hl7.Fhir.Model.ResourceReference)Observation.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ReasonElement != null) dest.ReasonElement = (Hl7.Fhir.Model.FhirString)ReasonElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TriggeredByComponent()); + var instance = new TriggeredByComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -397,7 +398,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferenceRangeComponent; @@ -406,20 +407,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Low != null) dest.Low = (Hl7.Fhir.Model.Quantity)Low.DeepCopy(); - if(High != null) dest.High = (Hl7.Fhir.Model.Quantity)High.DeepCopy(); - if(NormalValue != null) dest.NormalValue = (Hl7.Fhir.Model.CodeableConcept)NormalValue.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopy()); - if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Low != null) dest.Low = (Hl7.Fhir.Model.Quantity)Low.DeepCopyInternal(); + if(High != null) dest.High = (Hl7.Fhir.Model.Quantity)High.DeepCopyInternal(); + if(NormalValue != null) dest.NormalValue = (Hl7.Fhir.Model.CodeableConcept)NormalValue.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopyInternal()); + if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.Markdown)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferenceRangeComponent()); + var instance = new ReferenceRangeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -606,7 +608,7 @@ public List ReferenceRange private List _ReferenceRange; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -615,18 +617,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy(); - if(Interpretation.Any()) dest.Interpretation = new List(Interpretation.DeepCopy()); - if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopyInternal(); + if(Interpretation.Any()) dest.Interpretation = new List(Interpretation.DeepCopyInternal()); + if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1148,7 +1151,7 @@ public List Component List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Observation; @@ -1157,40 +1160,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Instantiates != null) dest.Instantiates = (Hl7.Fhir.Model.DataType)Instantiates.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(TriggeredBy.Any()) dest.TriggeredBy = new List(TriggeredBy.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopy(); - if(Interpretation.Any()) dest.Interpretation = new List(Interpretation.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(BodyStructure != null) dest.BodyStructure = (Hl7.Fhir.Model.ResourceReference)BodyStructure.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopy()); - if(HasMember.Any()) dest.HasMember = new List(HasMember.DeepCopy()); - if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopy()); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Instantiates != null) dest.Instantiates = (Hl7.Fhir.Model.DataType)Instantiates.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(TriggeredBy.Any()) dest.TriggeredBy = new List(TriggeredBy.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopyInternal(); + if(Interpretation.Any()) dest.Interpretation = new List(Interpretation.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(BodyStructure != null) dest.BodyStructure = (Hl7.Fhir.Model.ResourceReference)BodyStructure.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopyInternal()); + if(HasMember.Any()) dest.HasMember = new List(HasMember.DeepCopyInternal()); + if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopyInternal()); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Observation()); + var instance = new Observation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ObservationDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/ObservationDefinition.cs index fca513d124..60baf25f4c 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ObservationDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ObservationDefinition.cs @@ -469,7 +469,7 @@ public string CriticalCodedValueSet } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QualifiedValueComponent; @@ -478,25 +478,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Context != null) dest.Context = (Hl7.Fhir.Model.CodeableConcept)Context.DeepCopy(); - if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopy(); - if(GestationalAge != null) dest.GestationalAge = (Hl7.Fhir.Model.Range)GestationalAge.DeepCopy(); - if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopy(); - if(RangeCategoryElement != null) dest.RangeCategoryElement = (Code)RangeCategoryElement.DeepCopy(); - if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopy(); - if(ValidCodedValueSetElement != null) dest.ValidCodedValueSetElement = (Hl7.Fhir.Model.Canonical)ValidCodedValueSetElement.DeepCopy(); - if(NormalCodedValueSetElement != null) dest.NormalCodedValueSetElement = (Hl7.Fhir.Model.Canonical)NormalCodedValueSetElement.DeepCopy(); - if(AbnormalCodedValueSetElement != null) dest.AbnormalCodedValueSetElement = (Hl7.Fhir.Model.Canonical)AbnormalCodedValueSetElement.DeepCopy(); - if(CriticalCodedValueSetElement != null) dest.CriticalCodedValueSetElement = (Hl7.Fhir.Model.Canonical)CriticalCodedValueSetElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Context != null) dest.Context = (Hl7.Fhir.Model.CodeableConcept)Context.DeepCopyInternal(); + if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopyInternal(); + if(GestationalAge != null) dest.GestationalAge = (Hl7.Fhir.Model.Range)GestationalAge.DeepCopyInternal(); + if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopyInternal(); + if(RangeCategoryElement != null) dest.RangeCategoryElement = (Code)RangeCategoryElement.DeepCopyInternal(); + if(Range != null) dest.Range = (Hl7.Fhir.Model.Range)Range.DeepCopyInternal(); + if(ValidCodedValueSetElement != null) dest.ValidCodedValueSetElement = (Hl7.Fhir.Model.Canonical)ValidCodedValueSetElement.DeepCopyInternal(); + if(NormalCodedValueSetElement != null) dest.NormalCodedValueSetElement = (Hl7.Fhir.Model.Canonical)NormalCodedValueSetElement.DeepCopyInternal(); + if(AbnormalCodedValueSetElement != null) dest.AbnormalCodedValueSetElement = (Hl7.Fhir.Model.Canonical)AbnormalCodedValueSetElement.DeepCopyInternal(); + if(CriticalCodedValueSetElement != null) dest.CriticalCodedValueSetElement = (Hl7.Fhir.Model.Canonical)CriticalCodedValueSetElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QualifiedValueComponent()); + var instance = new QualifiedValueComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -726,7 +727,7 @@ public List Qualif private List _QualifiedValue; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -735,17 +736,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(PermittedDataTypeElement.Any()) dest.PermittedDataTypeElement = new List>(PermittedDataTypeElement.DeepCopy()); - if(PermittedUnit.Any()) dest.PermittedUnit = new List(PermittedUnit.DeepCopy()); - if(QualifiedValue.Any()) dest.QualifiedValue = new List(QualifiedValue.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(PermittedDataTypeElement.Any()) dest.PermittedDataTypeElement = new List>(PermittedDataTypeElement.DeepCopyInternal()); + if(PermittedUnit.Any()) dest.PermittedUnit = new List(PermittedUnit.DeepCopyInternal()); + if(QualifiedValue.Any()) dest.QualifiedValue = new List(QualifiedValue.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1676,7 +1678,7 @@ public List Component Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ObservationDefinition; @@ -1685,50 +1687,51 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(DerivedFromCanonicalElement.Any()) dest.DerivedFromCanonicalElement = new List(DerivedFromCanonicalElement.DeepCopy()); - if(DerivedFromUriElement.Any()) dest.DerivedFromUriElement = new List(DerivedFromUriElement.DeepCopy()); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(PermittedDataTypeElement.Any()) dest.PermittedDataTypeElement = new List>(PermittedDataTypeElement.DeepCopy()); - if(MultipleResultsAllowedElement != null) dest.MultipleResultsAllowedElement = (Hl7.Fhir.Model.FhirBoolean)MultipleResultsAllowedElement.DeepCopy(); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopy()); - if(Device.Any()) dest.Device = new List(Device.DeepCopy()); - if(PreferredReportNameElement != null) dest.PreferredReportNameElement = (Hl7.Fhir.Model.FhirString)PreferredReportNameElement.DeepCopy(); - if(PermittedUnit.Any()) dest.PermittedUnit = new List(PermittedUnit.DeepCopy()); - if(QualifiedValue.Any()) dest.QualifiedValue = new List(QualifiedValue.DeepCopy()); - if(HasMember.Any()) dest.HasMember = new List(HasMember.DeepCopy()); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ObservationDefinition()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(DerivedFromCanonicalElement.Any()) dest.DerivedFromCanonicalElement = new List(DerivedFromCanonicalElement.DeepCopyInternal()); + if(DerivedFromUriElement.Any()) dest.DerivedFromUriElement = new List(DerivedFromUriElement.DeepCopyInternal()); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(PermittedDataTypeElement.Any()) dest.PermittedDataTypeElement = new List>(PermittedDataTypeElement.DeepCopyInternal()); + if(MultipleResultsAllowedElement != null) dest.MultipleResultsAllowedElement = (Hl7.Fhir.Model.FhirBoolean)MultipleResultsAllowedElement.DeepCopyInternal(); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopyInternal()); + if(Device.Any()) dest.Device = new List(Device.DeepCopyInternal()); + if(PreferredReportNameElement != null) dest.PreferredReportNameElement = (Hl7.Fhir.Model.FhirString)PreferredReportNameElement.DeepCopyInternal(); + if(PermittedUnit.Any()) dest.PermittedUnit = new List(PermittedUnit.DeepCopyInternal()); + if(QualifiedValue.Any()) dest.QualifiedValue = new List(QualifiedValue.DeepCopyInternal()); + if(HasMember.Any()) dest.HasMember = new List(HasMember.DeepCopyInternal()); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ObservationDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/OperationDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/OperationDefinition.cs index 7d2aa9606f..554fe71731 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/OperationDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/OperationDefinition.cs @@ -494,7 +494,7 @@ public List Part private List _Part; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -503,26 +503,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(ScopeElement.Any()) dest.ScopeElement = new List>(ScopeElement.DeepCopy()); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(AllowedTypeElement.Any()) dest.AllowedTypeElement = new List>(AllowedTypeElement.DeepCopy()); - if(TargetProfileElement.Any()) dest.TargetProfileElement = new List(TargetProfileElement.DeepCopy()); - if(SearchTypeElement != null) dest.SearchTypeElement = (Code)SearchTypeElement.DeepCopy(); - if(Binding != null) dest.Binding = (Hl7.Fhir.Model.OperationDefinition.BindingComponent)Binding.DeepCopy(); - if(ReferencedFrom.Any()) dest.ReferencedFrom = new List(ReferencedFrom.DeepCopy()); - if(Part.Any()) dest.Part = new List(Part.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(ScopeElement.Any()) dest.ScopeElement = new List>(ScopeElement.DeepCopyInternal()); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(AllowedTypeElement.Any()) dest.AllowedTypeElement = new List>(AllowedTypeElement.DeepCopyInternal()); + if(TargetProfileElement.Any()) dest.TargetProfileElement = new List(TargetProfileElement.DeepCopyInternal()); + if(SearchTypeElement != null) dest.SearchTypeElement = (Code)SearchTypeElement.DeepCopyInternal(); + if(Binding != null) dest.Binding = (Hl7.Fhir.Model.OperationDefinition.BindingComponent)Binding.DeepCopyInternal(); + if(ReferencedFrom.Any()) dest.ReferencedFrom = new List(ReferencedFrom.DeepCopyInternal()); + if(Part.Any()) dest.Part = new List(Part.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -748,7 +749,7 @@ public string ValueSet } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BindingComponent; @@ -757,15 +758,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StrengthElement != null) dest.StrengthElement = (Code)StrengthElement.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StrengthElement != null) dest.StrengthElement = (Code)StrengthElement.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.Canonical)ValueSetElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BindingComponent()); + var instance = new BindingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -901,7 +903,7 @@ public string SourceId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferencedFromComponent; @@ -910,15 +912,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.FhirString)SourceIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirString)SourceElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.FhirString)SourceIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferencedFromComponent()); + var instance = new ReferencedFromComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1054,7 +1057,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OverloadComponent; @@ -1063,15 +1066,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ParameterNameElement.Any()) dest.ParameterNameElement = new List(ParameterNameElement.DeepCopy()); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ParameterNameElement.Any()) dest.ParameterNameElement = new List(ParameterNameElement.DeepCopyInternal()); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OverloadComponent()); + var instance = new OverloadComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1956,7 +1960,7 @@ public List Overload List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationDefinition; @@ -1965,43 +1969,44 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(AffectsStateElement != null) dest.AffectsStateElement = (Hl7.Fhir.Model.FhirBoolean)AffectsStateElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopy(); - if(BaseElement != null) dest.BaseElement = (Hl7.Fhir.Model.Canonical)BaseElement.DeepCopy(); - if(ResourceElement.Any()) dest.ResourceElement = new List>(ResourceElement.DeepCopy()); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirBoolean)SystemElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirBoolean)TypeElement.DeepCopy(); - if(InstanceElement != null) dest.InstanceElement = (Hl7.Fhir.Model.FhirBoolean)InstanceElement.DeepCopy(); - if(InputProfileElement != null) dest.InputProfileElement = (Hl7.Fhir.Model.Canonical)InputProfileElement.DeepCopy(); - if(OutputProfileElement != null) dest.OutputProfileElement = (Hl7.Fhir.Model.Canonical)OutputProfileElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Overload.Any()) dest.Overload = new List(Overload.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new OperationDefinition()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(AffectsStateElement != null) dest.AffectsStateElement = (Hl7.Fhir.Model.FhirBoolean)AffectsStateElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopyInternal(); + if(BaseElement != null) dest.BaseElement = (Hl7.Fhir.Model.Canonical)BaseElement.DeepCopyInternal(); + if(ResourceElement.Any()) dest.ResourceElement = new List>(ResourceElement.DeepCopyInternal()); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirBoolean)SystemElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirBoolean)TypeElement.DeepCopyInternal(); + if(InstanceElement != null) dest.InstanceElement = (Hl7.Fhir.Model.FhirBoolean)InstanceElement.DeepCopyInternal(); + if(InputProfileElement != null) dest.InputProfileElement = (Hl7.Fhir.Model.Canonical)InputProfileElement.DeepCopyInternal(); + if(OutputProfileElement != null) dest.OutputProfileElement = (Hl7.Fhir.Model.Canonical)OutputProfileElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Overload.Any()) dest.Overload = new List(Overload.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new OperationDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Organization.cs b/src/Hl7.Fhir.R5/Model/Generated/Organization.cs index 6a44c811fd..2a98247722 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Organization.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Organization.cs @@ -133,7 +133,7 @@ public Hl7.Fhir.Model.ResourceReference Issuer private Hl7.Fhir.Model.ResourceReference _Issuer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QualificationComponent; @@ -142,17 +142,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QualificationComponent()); + var instance = new QualificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -439,7 +440,7 @@ public List Qualification List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Organization; @@ -448,23 +449,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(Qualification.Any()) dest.Qualification = new List(Qualification.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(Qualification.Any()) dest.Qualification = new List(Qualification.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Organization()); + var instance = new Organization(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/OrganizationAffiliation.cs b/src/Hl7.Fhir.R5/Model/Generated/OrganizationAffiliation.cs index a15d0844d4..f44d9f0caf 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/OrganizationAffiliation.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/OrganizationAffiliation.cs @@ -254,7 +254,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OrganizationAffiliation; @@ -263,25 +263,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(ParticipatingOrganization != null) dest.ParticipatingOrganization = (Hl7.Fhir.Model.ResourceReference)ParticipatingOrganization.DeepCopy(); - if(Network.Any()) dest.Network = new List(Network.DeepCopy()); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(ParticipatingOrganization != null) dest.ParticipatingOrganization = (Hl7.Fhir.Model.ResourceReference)ParticipatingOrganization.DeepCopyInternal(); + if(Network.Any()) dest.Network = new List(Network.DeepCopyInternal()); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OrganizationAffiliation()); + var instance = new OrganizationAffiliation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/PackagedProductDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/PackagedProductDefinition.cs index 26806f3e27..b6f185680e 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/PackagedProductDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/PackagedProductDefinition.cs @@ -97,7 +97,7 @@ public Hl7.Fhir.Model.CodeableConcept Jurisdiction private Hl7.Fhir.Model.CodeableConcept _Jurisdiction; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LegalStatusOfSupplyComponent; @@ -106,15 +106,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Jurisdiction != null) dest.Jurisdiction = (Hl7.Fhir.Model.CodeableConcept)Jurisdiction.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LegalStatusOfSupplyComponent()); + var instance = new LegalStatusOfSupplyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -378,7 +379,7 @@ public List Packagi private List _Packaging; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PackagingComponent; @@ -387,24 +388,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ComponentPartElement != null) dest.ComponentPartElement = (Hl7.Fhir.Model.FhirBoolean)ComponentPartElement.DeepCopy(); - if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.Integer)QuantityElement.DeepCopy(); - if(Material.Any()) dest.Material = new List(Material.DeepCopy()); - if(AlternateMaterial.Any()) dest.AlternateMaterial = new List(AlternateMaterial.DeepCopy()); - if(ShelfLifeStorage.Any()) dest.ShelfLifeStorage = new List(ShelfLifeStorage.DeepCopy()); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(ContainedItem.Any()) dest.ContainedItem = new List(ContainedItem.DeepCopy()); - if(Packaging.Any()) dest.Packaging = new List(Packaging.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ComponentPartElement != null) dest.ComponentPartElement = (Hl7.Fhir.Model.FhirBoolean)ComponentPartElement.DeepCopyInternal(); + if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.Integer)QuantityElement.DeepCopyInternal(); + if(Material.Any()) dest.Material = new List(Material.DeepCopyInternal()); + if(AlternateMaterial.Any()) dest.AlternateMaterial = new List(AlternateMaterial.DeepCopyInternal()); + if(ShelfLifeStorage.Any()) dest.ShelfLifeStorage = new List(ShelfLifeStorage.DeepCopyInternal()); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(ContainedItem.Any()) dest.ContainedItem = new List(ContainedItem.DeepCopyInternal()); + if(Packaging.Any()) dest.Packaging = new List(Packaging.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PackagingComponent()); + var instance = new PackagingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -575,7 +577,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -584,15 +586,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -688,7 +691,7 @@ public Hl7.Fhir.Model.Quantity Amount private Hl7.Fhir.Model.Quantity _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainedItemComponent; @@ -697,15 +700,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainedItemComponent()); + var instance = new ContainedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1046,7 +1050,7 @@ public List Characte List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PackagedProductDefinition; @@ -1055,28 +1059,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(PackageFor.Any()) dest.PackageFor = new List(PackageFor.DeepCopy()); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopy(); - if(ContainedItemQuantity.Any()) dest.ContainedItemQuantity = new List(ContainedItemQuantity.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(LegalStatusOfSupply.Any()) dest.LegalStatusOfSupply = new List(LegalStatusOfSupply.DeepCopy()); - if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopy()); - if(CopackagedIndicatorElement != null) dest.CopackagedIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)CopackagedIndicatorElement.DeepCopy(); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(AttachedDocument.Any()) dest.AttachedDocument = new List(AttachedDocument.DeepCopy()); - if(Packaging != null) dest.Packaging = (Hl7.Fhir.Model.PackagedProductDefinition.PackagingComponent)Packaging.DeepCopy(); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(PackageFor.Any()) dest.PackageFor = new List(PackageFor.DeepCopyInternal()); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopyInternal(); + if(ContainedItemQuantity.Any()) dest.ContainedItemQuantity = new List(ContainedItemQuantity.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(LegalStatusOfSupply.Any()) dest.LegalStatusOfSupply = new List(LegalStatusOfSupply.DeepCopyInternal()); + if(MarketingStatus.Any()) dest.MarketingStatus = new List(MarketingStatus.DeepCopyInternal()); + if(CopackagedIndicatorElement != null) dest.CopackagedIndicatorElement = (Hl7.Fhir.Model.FhirBoolean)CopackagedIndicatorElement.DeepCopyInternal(); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(AttachedDocument.Any()) dest.AttachedDocument = new List(AttachedDocument.DeepCopyInternal()); + if(Packaging != null) dest.Packaging = (Hl7.Fhir.Model.PackagedProductDefinition.PackagingComponent)Packaging.DeepCopyInternal(); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PackagedProductDefinition()); + var instance = new PackagedProductDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ParameterDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/ParameterDefinition.cs index 9febb672cb..380640e4eb 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ParameterDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ParameterDefinition.cs @@ -282,7 +282,7 @@ public string Profile } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterDefinition; @@ -291,20 +291,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.Canonical)ProfileElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterDefinition()); + var instance = new ParameterDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Patient.cs b/src/Hl7.Fhir.R5/Model/Generated/Patient.cs index 81a1a441a7..b66eeafc42 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Patient.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Patient.cs @@ -225,7 +225,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContactComponent; @@ -234,20 +234,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopy()); - if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopyInternal()); + if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContactComponent()); + var instance = new ContactComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -405,7 +406,7 @@ public bool? Preferred } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CommunicationComponent; @@ -414,15 +415,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CommunicationComponent()); + var instance = new CommunicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -544,7 +546,7 @@ public Hl7.Fhir.Model.Patient.LinkType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -553,15 +555,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Other != null) dest.Other = (Hl7.Fhir.Model.ResourceReference)Other.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Other != null) dest.Other = (Hl7.Fhir.Model.ResourceReference)Other.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -901,7 +904,7 @@ public List Link List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Patient; @@ -910,29 +913,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy(); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(MaritalStatus != null) dest.MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)MaritalStatus.DeepCopy(); - if(MultipleBirth != null) dest.MultipleBirth = (Hl7.Fhir.Model.DataType)MultipleBirth.DeepCopy(); - if(Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - if(GeneralPractitioner.Any()) dest.GeneralPractitioner = new List(GeneralPractitioner.DeepCopy()); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopyInternal(); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(MaritalStatus != null) dest.MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)MaritalStatus.DeepCopyInternal(); + if(MultipleBirth != null) dest.MultipleBirth = (Hl7.Fhir.Model.DataType)MultipleBirth.DeepCopyInternal(); + if(Photo.Any()) dest.Photo = new List(Photo.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); + if(GeneralPractitioner.Any()) dest.GeneralPractitioner = new List(GeneralPractitioner.DeepCopyInternal()); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Patient()); + var instance = new Patient(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/PaymentNotice.cs b/src/Hl7.Fhir.R5/Model/Generated/PaymentNotice.cs index 4d045cb806..180261b4be 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/PaymentNotice.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/PaymentNotice.cs @@ -291,7 +291,7 @@ public Hl7.Fhir.Model.CodeableConcept PaymentStatus List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentNotice; @@ -300,25 +300,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Reporter != null) dest.Reporter = (Hl7.Fhir.Model.ResourceReference)Reporter.DeepCopy(); - if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ResourceReference)Payment.DeepCopy(); - if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.Date)PaymentDateElement.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopy(); - if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(PaymentStatus != null) dest.PaymentStatus = (Hl7.Fhir.Model.CodeableConcept)PaymentStatus.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Reporter != null) dest.Reporter = (Hl7.Fhir.Model.ResourceReference)Reporter.DeepCopyInternal(); + if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ResourceReference)Payment.DeepCopyInternal(); + if(PaymentDateElement != null) dest.PaymentDateElement = (Hl7.Fhir.Model.Date)PaymentDateElement.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopyInternal(); + if(Recipient != null) dest.Recipient = (Hl7.Fhir.Model.ResourceReference)Recipient.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(PaymentStatus != null) dest.PaymentStatus = (Hl7.Fhir.Model.CodeableConcept)PaymentStatus.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentNotice()); + var instance = new PaymentNotice(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/PaymentReconciliation.cs b/src/Hl7.Fhir.R5/Model/Generated/PaymentReconciliation.cs index 0cc0bb18be..7ac17a2819 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/PaymentReconciliation.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/PaymentReconciliation.cs @@ -313,7 +313,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AllocationComponent; @@ -322,26 +322,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Predecessor != null) dest.Predecessor = (Hl7.Fhir.Model.Identifier)Predecessor.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - if(TargetItem != null) dest.TargetItem = (Hl7.Fhir.Model.DataType)TargetItem.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Account != null) dest.Account = (Hl7.Fhir.Model.ResourceReference)Account.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Submitter != null) dest.Submitter = (Hl7.Fhir.Model.ResourceReference)Submitter.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Predecessor != null) dest.Predecessor = (Hl7.Fhir.Model.Identifier)Predecessor.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); + if(TargetItem != null) dest.TargetItem = (Hl7.Fhir.Model.DataType)TargetItem.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Account != null) dest.Account = (Hl7.Fhir.Model.ResourceReference)Account.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Submitter != null) dest.Submitter = (Hl7.Fhir.Model.ResourceReference)Submitter.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AllocationComponent()); + var instance = new AllocationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -565,7 +566,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotesComponent; @@ -574,15 +575,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotesComponent()); + var instance = new NotesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1242,7 +1244,7 @@ public List ProcessNote List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentReconciliation; @@ -1251,42 +1253,43 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Kind != null) dest.Kind = (Hl7.Fhir.Model.CodeableConcept)Kind.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(IssuerType != null) dest.IssuerType = (Hl7.Fhir.Model.CodeableConcept)IssuerType.DeepCopy(); - if(PaymentIssuer != null) dest.PaymentIssuer = (Hl7.Fhir.Model.ResourceReference)PaymentIssuer.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(CardBrandElement != null) dest.CardBrandElement = (Hl7.Fhir.Model.FhirString)CardBrandElement.DeepCopy(); - if(AccountNumberElement != null) dest.AccountNumberElement = (Hl7.Fhir.Model.FhirString)AccountNumberElement.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.Date)ExpirationDateElement.DeepCopy(); - if(ProcessorElement != null) dest.ProcessorElement = (Hl7.Fhir.Model.FhirString)ProcessorElement.DeepCopy(); - if(ReferenceNumberElement != null) dest.ReferenceNumberElement = (Hl7.Fhir.Model.FhirString)ReferenceNumberElement.DeepCopy(); - if(AuthorizationElement != null) dest.AuthorizationElement = (Hl7.Fhir.Model.FhirString)AuthorizationElement.DeepCopy(); - if(TenderedAmount != null) dest.TenderedAmount = (Hl7.Fhir.Model.Money)TenderedAmount.DeepCopy(); - if(ReturnedAmount != null) dest.ReturnedAmount = (Hl7.Fhir.Model.Money)ReturnedAmount.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(PaymentIdentifier != null) dest.PaymentIdentifier = (Hl7.Fhir.Model.Identifier)PaymentIdentifier.DeepCopy(); - if(Allocation.Any()) dest.Allocation = new List(Allocation.DeepCopy()); - if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopy(); - if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Kind != null) dest.Kind = (Hl7.Fhir.Model.CodeableConcept)Kind.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(IssuerType != null) dest.IssuerType = (Hl7.Fhir.Model.CodeableConcept)IssuerType.DeepCopyInternal(); + if(PaymentIssuer != null) dest.PaymentIssuer = (Hl7.Fhir.Model.ResourceReference)PaymentIssuer.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Requestor != null) dest.Requestor = (Hl7.Fhir.Model.ResourceReference)Requestor.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(CardBrandElement != null) dest.CardBrandElement = (Hl7.Fhir.Model.FhirString)CardBrandElement.DeepCopyInternal(); + if(AccountNumberElement != null) dest.AccountNumberElement = (Hl7.Fhir.Model.FhirString)AccountNumberElement.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.Date)ExpirationDateElement.DeepCopyInternal(); + if(ProcessorElement != null) dest.ProcessorElement = (Hl7.Fhir.Model.FhirString)ProcessorElement.DeepCopyInternal(); + if(ReferenceNumberElement != null) dest.ReferenceNumberElement = (Hl7.Fhir.Model.FhirString)ReferenceNumberElement.DeepCopyInternal(); + if(AuthorizationElement != null) dest.AuthorizationElement = (Hl7.Fhir.Model.FhirString)AuthorizationElement.DeepCopyInternal(); + if(TenderedAmount != null) dest.TenderedAmount = (Hl7.Fhir.Model.Money)TenderedAmount.DeepCopyInternal(); + if(ReturnedAmount != null) dest.ReturnedAmount = (Hl7.Fhir.Model.Money)ReturnedAmount.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(PaymentIdentifier != null) dest.PaymentIdentifier = (Hl7.Fhir.Model.Identifier)PaymentIdentifier.DeepCopyInternal(); + if(Allocation.Any()) dest.Allocation = new List(Allocation.DeepCopyInternal()); + if(FormCode != null) dest.FormCode = (Hl7.Fhir.Model.CodeableConcept)FormCode.DeepCopyInternal(); + if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentReconciliation()); + var instance = new PaymentReconciliation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Permission.cs b/src/Hl7.Fhir.R5/Model/Generated/Permission.cs index bf07b475f3..0e9837a795 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Permission.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Permission.cs @@ -183,7 +183,7 @@ public List Evidence private List _Evidence; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as JustificationComponent; @@ -192,15 +192,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Basis.Any()) dest.Basis = new List(Basis.DeepCopy()); - if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Basis.Any()) dest.Basis = new List(Basis.DeepCopyInternal()); + if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new JustificationComponent()); + var instance = new JustificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -348,7 +349,7 @@ public List Limit private List _Limit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RuleComponent; @@ -357,17 +358,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Data.Any()) dest.Data = new List(Data.DeepCopy()); - if(Activity.Any()) dest.Activity = new List(Activity.DeepCopy()); - if(Limit.Any()) dest.Limit = new List(Limit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Data.Any()) dest.Data = new List(Data.DeepCopyInternal()); + if(Activity.Any()) dest.Activity = new List(Activity.DeepCopyInternal()); + if(Limit.Any()) dest.Limit = new List(Limit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RuleComponent()); + var instance = new RuleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -510,7 +512,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DataComponent; @@ -519,17 +521,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - if(Security.Any()) dest.Security = new List(Security.DeepCopy()); - if(Period.Any()) dest.Period = new List(Period.DeepCopy()); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); + if(Security.Any()) dest.Security = new List(Security.DeepCopyInternal()); + if(Period.Any()) dest.Period = new List(Period.DeepCopyInternal()); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DataComponent()); + var instance = new DataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -664,7 +667,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceComponent; @@ -673,15 +676,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MeaningElement != null) dest.MeaningElement = (Code)MeaningElement.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MeaningElement != null) dest.MeaningElement = (Code)MeaningElement.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceComponent()); + var instance = new ResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -796,7 +800,7 @@ public List Purpose private List _Purpose; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActivityComponent; @@ -805,16 +809,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - if(Purpose.Any()) dest.Purpose = new List(Purpose.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + if(Purpose.Any()) dest.Purpose = new List(Purpose.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActivityComponent()); + var instance = new ActivityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1033,7 +1038,7 @@ public List Rule private List _Rule; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Permission; @@ -1042,20 +1047,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy(); - if(DateElement.Any()) dest.DateElement = new List(DateElement.DeepCopy()); - if(Validity != null) dest.Validity = (Hl7.Fhir.Model.Period)Validity.DeepCopy(); - if(Justification != null) dest.Justification = (Hl7.Fhir.Model.Permission.JustificationComponent)Justification.DeepCopy(); - if(CombiningElement != null) dest.CombiningElement = (Code)CombiningElement.DeepCopy(); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopyInternal(); + if(DateElement.Any()) dest.DateElement = new List(DateElement.DeepCopyInternal()); + if(Validity != null) dest.Validity = (Hl7.Fhir.Model.Period)Validity.DeepCopyInternal(); + if(Justification != null) dest.Justification = (Hl7.Fhir.Model.Permission.JustificationComponent)Justification.DeepCopyInternal(); + if(CombiningElement != null) dest.CombiningElement = (Code)CombiningElement.DeepCopyInternal(); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Permission()); + var instance = new Permission(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Person.cs b/src/Hl7.Fhir.R5/Model/Generated/Person.cs index 0896d55692..95bba67337 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Person.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Person.cs @@ -157,7 +157,7 @@ public bool? Preferred } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CommunicationComponent; @@ -166,15 +166,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CommunicationComponent()); + var instance = new CommunicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -292,7 +293,7 @@ public Hl7.Fhir.Model.Person.IdentityAssuranceLevel? Assurance } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -301,15 +302,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - if(AssuranceElement != null) dest.AssuranceElement = (Code)AssuranceElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); + if(AssuranceElement != null) dest.AssuranceElement = (Code)AssuranceElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -604,7 +606,7 @@ public List Link List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Person; @@ -613,26 +615,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy(); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(MaritalStatus != null) dest.MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)MaritalStatus.DeepCopy(); - if(Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopyInternal(); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(MaritalStatus != null) dest.MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)MaritalStatus.DeepCopyInternal(); + if(Photo.Any()) dest.Photo = new List(Photo.DeepCopyInternal()); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Person()); + var instance = new Person(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/PlanDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/PlanDefinition.cs index 98a5e8b575..87524bf090 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/PlanDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/PlanDefinition.cs @@ -175,7 +175,7 @@ public List Target private List _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GoalComponent; @@ -184,20 +184,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(Start != null) dest.Start = (Hl7.Fhir.Model.CodeableConcept)Start.DeepCopy(); - if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopy()); - if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopy()); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(Start != null) dest.Start = (Hl7.Fhir.Model.CodeableConcept)Start.DeepCopyInternal(); + if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopyInternal()); + if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopyInternal()); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GoalComponent()); + var instance = new GoalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -351,7 +352,7 @@ public Hl7.Fhir.Model.Duration Due private Hl7.Fhir.Model.Duration _Due; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -360,16 +361,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopy(); - if(Due != null) dest.Due = (Hl7.Fhir.Model.Duration)Due.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopyInternal(); + if(Due != null) dest.Due = (Hl7.Fhir.Model.Duration)Due.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -525,7 +527,7 @@ public List Option private List _Option; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActorComponent; @@ -534,16 +536,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Option.Any()) dest.Option = new List(Option.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Option.Any()) dest.Option = new List(Option.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActorComponent()); + var instance = new ActorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -716,7 +719,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OptionComponent; @@ -725,17 +728,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TypeCanonicalElement != null) dest.TypeCanonicalElement = (Hl7.Fhir.Model.Canonical)TypeCanonicalElement.DeepCopy(); - if(TypeReference != null) dest.TypeReference = (Hl7.Fhir.Model.ResourceReference)TypeReference.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TypeCanonicalElement != null) dest.TypeCanonicalElement = (Hl7.Fhir.Model.Canonical)TypeCanonicalElement.DeepCopyInternal(); + if(TypeReference != null) dest.TypeReference = (Hl7.Fhir.Model.ResourceReference)TypeReference.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OptionComponent()); + var instance = new OptionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1469,7 +1473,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionComponent; @@ -1478,42 +1482,43 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.Markdown)TextEquivalentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopy()); - if(GoalIdElement.Any()) dest.GoalIdElement = new List(GoalIdElement.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Output.Any()) dest.Output = new List(Output.DeepCopy()); - if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopy()); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.CodeableReference)Location.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopy(); - if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopy(); - if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopy(); - if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopy(); - if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopy(); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopy(); - if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopy(); - if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActionComponent()); + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.Markdown)TextEquivalentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopyInternal()); + if(GoalIdElement.Any()) dest.GoalIdElement = new List(GoalIdElement.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Output.Any()) dest.Output = new List(Output.DeepCopyInternal()); + if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopyInternal()); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.CodeableReference)Location.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopyInternal(); + if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopyInternal(); + if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopyInternal(); + if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopyInternal(); + if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopyInternal(); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopyInternal(); + if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopyInternal(); + if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1849,7 +1854,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConditionComponent; @@ -1858,15 +1863,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConditionComponent()); + var instance = new ConditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2013,7 +2019,7 @@ public string RelatedData } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InputComponent; @@ -2022,16 +2028,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Requirement != null) dest.Requirement = (Hl7.Fhir.Model.DataRequirement)Requirement.DeepCopy(); - if(RelatedDataElement != null) dest.RelatedDataElement = (Hl7.Fhir.Model.Id)RelatedDataElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Requirement != null) dest.Requirement = (Hl7.Fhir.Model.DataRequirement)Requirement.DeepCopyInternal(); + if(RelatedDataElement != null) dest.RelatedDataElement = (Hl7.Fhir.Model.Id)RelatedDataElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InputComponent()); + var instance = new InputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2186,7 +2193,7 @@ public string RelatedData } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OutputComponent; @@ -2195,16 +2202,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Requirement != null) dest.Requirement = (Hl7.Fhir.Model.DataRequirement)Requirement.DeepCopy(); - if(RelatedDataElement != null) dest.RelatedDataElement = (Hl7.Fhir.Model.FhirString)RelatedDataElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Requirement != null) dest.Requirement = (Hl7.Fhir.Model.DataRequirement)Requirement.DeepCopyInternal(); + if(RelatedDataElement != null) dest.RelatedDataElement = (Hl7.Fhir.Model.FhirString)RelatedDataElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OutputComponent()); + var instance = new OutputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2399,7 +2407,7 @@ public Hl7.Fhir.Model.DataType Offset private Hl7.Fhir.Model.DataType _Offset; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedActionComponent; @@ -2408,17 +2416,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopy(); - if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopy(); - if(EndRelationshipElement != null) dest.EndRelationshipElement = (Code)EndRelationshipElement.DeepCopy(); - if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopyInternal(); + if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopyInternal(); + if(EndRelationshipElement != null) dest.EndRelationshipElement = (Code)EndRelationshipElement.DeepCopyInternal(); + if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedActionComponent()); + var instance = new RelatedActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2644,7 +2653,7 @@ public Hl7.Fhir.Model.CodeableConcept Function private Hl7.Fhir.Model.CodeableConcept _Function; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -2653,19 +2662,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ActorIdElement != null) dest.ActorIdElement = (Hl7.Fhir.Model.FhirString)ActorIdElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TypeCanonicalElement != null) dest.TypeCanonicalElement = (Hl7.Fhir.Model.Canonical)TypeCanonicalElement.DeepCopy(); - if(TypeReference != null) dest.TypeReference = (Hl7.Fhir.Model.ResourceReference)TypeReference.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ActorIdElement != null) dest.ActorIdElement = (Hl7.Fhir.Model.FhirString)ActorIdElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TypeCanonicalElement != null) dest.TypeCanonicalElement = (Hl7.Fhir.Model.Canonical)TypeCanonicalElement.DeepCopyInternal(); + if(TypeReference != null) dest.TypeReference = (Hl7.Fhir.Model.ResourceReference)TypeReference.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2814,7 +2824,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DynamicValueComponent; @@ -2823,15 +2833,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DynamicValueComponent()); + var instance = new DynamicValueComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3679,7 +3690,7 @@ public Hl7.Fhir.Model.DataType AsNeeded List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PlanDefinition; @@ -3688,48 +3699,49 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.Markdown)UsageElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Editor.Any()) dest.Editor = new List(Editor.DeepCopy()); - if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopy()); - if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopy()); - if(Goal.Any()) dest.Goal = new List(Goal.DeepCopy()); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new PlanDefinition()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(SubtitleElement != null) dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.Markdown)UsageElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Editor.Any()) dest.Editor = new List(Editor.DeepCopyInternal()); + if(Reviewer.Any()) dest.Reviewer = new List(Reviewer.DeepCopyInternal()); + if(Endorser.Any()) dest.Endorser = new List(Endorser.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(LibraryElement.Any()) dest.LibraryElement = new List(LibraryElement.DeepCopyInternal()); + if(Goal.Any()) dest.Goal = new List(Goal.DeepCopyInternal()); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopyInternal(); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new PlanDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Practitioner.cs b/src/Hl7.Fhir.R5/Model/Generated/Practitioner.cs index 63bef88009..d62bbcad68 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Practitioner.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Practitioner.cs @@ -134,7 +134,7 @@ public Hl7.Fhir.Model.ResourceReference Issuer private Hl7.Fhir.Model.ResourceReference _Issuer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QualificationComponent; @@ -143,17 +143,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QualificationComponent()); + var instance = new QualificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -290,7 +291,7 @@ public bool? Preferred } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CommunicationComponent; @@ -299,15 +300,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CommunicationComponent()); + var instance = new CommunicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -573,7 +575,7 @@ public List Communication List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Practitioner; @@ -582,24 +584,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy(); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if(Qualification.Any()) dest.Qualification = new List(Qualification.DeepCopy()); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopyInternal(); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(Photo.Any()) dest.Photo = new List(Photo.DeepCopyInternal()); + if(Qualification.Any()) dest.Qualification = new List(Qualification.DeepCopyInternal()); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Practitioner()); + var instance = new Practitioner(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/PractitionerRole.cs b/src/Hl7.Fhir.R5/Model/Generated/PractitionerRole.cs index 5edb57fb68..010007f53e 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/PractitionerRole.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/PractitionerRole.cs @@ -285,7 +285,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PractitionerRole; @@ -294,27 +294,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Practitioner != null) dest.Practitioner = (Hl7.Fhir.Model.ResourceReference)Practitioner.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - if(Availability.Any()) dest.Availability = new List(Availability.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Practitioner != null) dest.Practitioner = (Hl7.Fhir.Model.ResourceReference)Practitioner.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); + if(Availability.Any()) dest.Availability = new List(Availability.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PractitionerRole()); + var instance = new PractitionerRole(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Procedure.cs b/src/Hl7.Fhir.R5/Model/Generated/Procedure.cs index 582e257b8e..d4c0d8a9a7 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Procedure.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Procedure.cs @@ -133,7 +133,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -142,17 +142,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -270,7 +271,7 @@ public Hl7.Fhir.Model.ResourceReference Manipulated private Hl7.Fhir.Model.ResourceReference _Manipulated; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FocalDeviceComponent; @@ -279,15 +280,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopy(); - if(Manipulated != null) dest.Manipulated = (Hl7.Fhir.Model.ResourceReference)Manipulated.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopyInternal(); + if(Manipulated != null) dest.Manipulated = (Hl7.Fhir.Model.ResourceReference)Manipulated.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FocalDeviceComponent()); + var instance = new FocalDeviceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -833,7 +835,7 @@ public List SupportingInfo List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Procedure; @@ -842,41 +844,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.FhirDateTime)RecordedElement.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(Reported != null) dest.Reported = (Hl7.Fhir.Model.DataType)Reported.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(Report.Any()) dest.Report = new List(Report.DeepCopy()); - if(Complication.Any()) dest.Complication = new List(Complication.DeepCopy()); - if(FollowUp.Any()) dest.FollowUp = new List(FollowUp.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(FocalDevice.Any()) dest.FocalDevice = new List(FocalDevice.DeepCopy()); - if(Used.Any()) dest.Used = new List(Used.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.FhirDateTime)RecordedElement.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(Reported != null) dest.Reported = (Hl7.Fhir.Model.DataType)Reported.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(Report.Any()) dest.Report = new List(Report.DeepCopyInternal()); + if(Complication.Any()) dest.Complication = new List(Complication.DeepCopyInternal()); + if(FollowUp.Any()) dest.FollowUp = new List(FollowUp.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(FocalDevice.Any()) dest.FocalDevice = new List(FocalDevice.DeepCopyInternal()); + if(Used.Any()) dest.Used = new List(Used.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Procedure()); + var instance = new Procedure(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ProductShelfLife.cs b/src/Hl7.Fhir.R5/Model/Generated/ProductShelfLife.cs index b6456ca645..3495aa2fb2 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ProductShelfLife.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ProductShelfLife.cs @@ -98,7 +98,7 @@ public List SpecialPrecautionsForStorage private List _SpecialPrecautionsForStorage; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProductShelfLife; @@ -107,16 +107,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.DataType)Period.DeepCopy(); - if(SpecialPrecautionsForStorage.Any()) dest.SpecialPrecautionsForStorage = new List(SpecialPrecautionsForStorage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.DataType)Period.DeepCopyInternal(); + if(SpecialPrecautionsForStorage.Any()) dest.SpecialPrecautionsForStorage = new List(SpecialPrecautionsForStorage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProductShelfLife()); + var instance = new ProductShelfLife(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Provenance.cs b/src/Hl7.Fhir.R5/Model/Generated/Provenance.cs index 61a028d7ee..761d728cc5 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Provenance.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Provenance.cs @@ -177,7 +177,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AgentComponent; @@ -186,17 +186,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Role.Any()) dest.Role = new List(Role.DeepCopy()); - if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Role.Any()) dest.Role = new List(Role.DeepCopyInternal()); + if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AgentComponent()); + var instance = new AgentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -345,7 +346,7 @@ public List Agent private List _Agent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EntityComponent; @@ -354,16 +355,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RoleElement != null) dest.RoleElement = (Code)RoleElement.DeepCopy(); - if(What != null) dest.What = (Hl7.Fhir.Model.ResourceReference)What.DeepCopy(); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RoleElement != null) dest.RoleElement = (Code)RoleElement.DeepCopyInternal(); + if(What != null) dest.What = (Hl7.Fhir.Model.ResourceReference)What.DeepCopyInternal(); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EntityComponent()); + var instance = new EntityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -653,7 +655,7 @@ public List Signature private List _Signature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Provenance; @@ -662,26 +664,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(Occurred != null) dest.Occurred = (Hl7.Fhir.Model.DataType)Occurred.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopy(); - if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Authorization.Any()) dest.Authorization = new List(Authorization.DeepCopy()); - if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - if(Entity.Any()) dest.Entity = new List(Entity.DeepCopy()); - if(Signature.Any()) dest.Signature = new List(Signature.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(Occurred != null) dest.Occurred = (Hl7.Fhir.Model.DataType)Occurred.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopyInternal(); + if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Authorization.Any()) dest.Authorization = new List(Authorization.DeepCopyInternal()); + if(Activity != null) dest.Activity = (Hl7.Fhir.Model.CodeableConcept)Activity.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); + if(Entity.Any()) dest.Entity = new List(Entity.DeepCopyInternal()); + if(Signature.Any()) dest.Signature = new List(Signature.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Provenance()); + var instance = new Provenance(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Questionnaire.cs b/src/Hl7.Fhir.R5/Model/Generated/Questionnaire.cs index 0451a7916e..219d5153cb 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Questionnaire.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Questionnaire.cs @@ -790,7 +790,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -799,31 +799,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(EnableWhen.Any()) dest.EnableWhen = new List(EnableWhen.DeepCopy()); - if(EnableBehaviorElement != null) dest.EnableBehaviorElement = (Code)EnableBehaviorElement.DeepCopy(); - if(DisabledDisplayElement != null) dest.DisabledDisplayElement = (Code)DisabledDisplayElement.DeepCopy(); - if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopy(); - if(RepeatsElement != null) dest.RepeatsElement = (Hl7.Fhir.Model.FhirBoolean)RepeatsElement.DeepCopy(); - if(ReadOnlyElement != null) dest.ReadOnlyElement = (Hl7.Fhir.Model.FhirBoolean)ReadOnlyElement.DeepCopy(); - if(MaxLengthElement != null) dest.MaxLengthElement = (Hl7.Fhir.Model.Integer)MaxLengthElement.DeepCopy(); - if(AnswerConstraintElement != null) dest.AnswerConstraintElement = (Code)AnswerConstraintElement.DeepCopy(); - if(AnswerValueSetElement != null) dest.AnswerValueSetElement = (Hl7.Fhir.Model.Canonical)AnswerValueSetElement.DeepCopy(); - if(AnswerOption.Any()) dest.AnswerOption = new List(AnswerOption.DeepCopy()); - if(Initial.Any()) dest.Initial = new List(Initial.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ItemComponent()); + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(EnableWhen.Any()) dest.EnableWhen = new List(EnableWhen.DeepCopyInternal()); + if(EnableBehaviorElement != null) dest.EnableBehaviorElement = (Code)EnableBehaviorElement.DeepCopyInternal(); + if(DisabledDisplayElement != null) dest.DisabledDisplayElement = (Code)DisabledDisplayElement.DeepCopyInternal(); + if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopyInternal(); + if(RepeatsElement != null) dest.RepeatsElement = (Hl7.Fhir.Model.FhirBoolean)RepeatsElement.DeepCopyInternal(); + if(ReadOnlyElement != null) dest.ReadOnlyElement = (Hl7.Fhir.Model.FhirBoolean)ReadOnlyElement.DeepCopyInternal(); + if(MaxLengthElement != null) dest.MaxLengthElement = (Hl7.Fhir.Model.Integer)MaxLengthElement.DeepCopyInternal(); + if(AnswerConstraintElement != null) dest.AnswerConstraintElement = (Code)AnswerConstraintElement.DeepCopyInternal(); + if(AnswerValueSetElement != null) dest.AnswerValueSetElement = (Hl7.Fhir.Model.Canonical)AnswerValueSetElement.DeepCopyInternal(); + if(AnswerOption.Any()) dest.AnswerOption = new List(AnswerOption.DeepCopyInternal()); + if(Initial.Any()) dest.Initial = new List(Initial.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1108,7 +1109,7 @@ public Hl7.Fhir.Model.DataType Answer private Hl7.Fhir.Model.DataType _Answer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnableWhenComponent; @@ -1117,16 +1118,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(QuestionElement != null) dest.QuestionElement = (Hl7.Fhir.Model.FhirString)QuestionElement.DeepCopy(); - if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopy(); - if(Answer != null) dest.Answer = (Hl7.Fhir.Model.DataType)Answer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(QuestionElement != null) dest.QuestionElement = (Hl7.Fhir.Model.FhirString)QuestionElement.DeepCopyInternal(); + if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopyInternal(); + if(Answer != null) dest.Answer = (Hl7.Fhir.Model.DataType)Answer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnableWhenComponent()); + var instance = new EnableWhenComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1256,7 +1258,7 @@ public bool? InitialSelected } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AnswerOptionComponent; @@ -1265,15 +1267,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(InitialSelectedElement != null) dest.InitialSelectedElement = (Hl7.Fhir.Model.FhirBoolean)InitialSelectedElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(InitialSelectedElement != null) dest.InitialSelectedElement = (Hl7.Fhir.Model.FhirBoolean)InitialSelectedElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AnswerOptionComponent()); + var instance = new AnswerOptionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1364,7 +1367,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InitialComponent; @@ -1373,14 +1376,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InitialComponent()); + var instance = new InitialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2047,7 +2051,7 @@ public List Item List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Questionnaire; @@ -2056,37 +2060,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(SubjectTypeElement.Any()) dest.SubjectTypeElement = new List>(SubjectTypeElement.DeepCopy()); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(SubjectTypeElement.Any()) dest.SubjectTypeElement = new List>(SubjectTypeElement.DeepCopyInternal()); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Questionnaire()); + var instance = new Questionnaire(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/QuestionnaireResponse.cs b/src/Hl7.Fhir.R5/Model/Generated/QuestionnaireResponse.cs index 236860c659..fa2af5a19a 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/QuestionnaireResponse.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/QuestionnaireResponse.cs @@ -239,7 +239,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -248,18 +248,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Answer.Any()) dest.Answer = new List(Answer.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Answer.Any()) dest.Answer = new List(Answer.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -388,7 +389,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AnswerComponent; @@ -397,15 +398,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AnswerComponent()); + var instance = new AnswerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -680,7 +682,7 @@ public List Item List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QuestionnaireResponse; @@ -689,24 +691,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(QuestionnaireElement != null) dest.QuestionnaireElement = (Hl7.Fhir.Model.Canonical)QuestionnaireElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(AuthoredElement != null) dest.AuthoredElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(QuestionnaireElement != null) dest.QuestionnaireElement = (Hl7.Fhir.Model.Canonical)QuestionnaireElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(AuthoredElement != null) dest.AuthoredElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QuestionnaireResponse()); + var instance = new QuestionnaireResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Ratio.cs b/src/Hl7.Fhir.R5/Model/Generated/Ratio.cs index 08f0e3e572..63266396e3 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Ratio.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Ratio.cs @@ -86,7 +86,7 @@ public Hl7.Fhir.Model.Quantity Denominator private Hl7.Fhir.Model.Quantity _Denominator; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Ratio; @@ -95,15 +95,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Numerator != null) dest.Numerator = (Hl7.Fhir.Model.Quantity)Numerator.DeepCopy(); - if(Denominator != null) dest.Denominator = (Hl7.Fhir.Model.Quantity)Denominator.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Numerator != null) dest.Numerator = (Hl7.Fhir.Model.Quantity)Numerator.DeepCopyInternal(); + if(Denominator != null) dest.Denominator = (Hl7.Fhir.Model.Quantity)Denominator.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Ratio()); + var instance = new Ratio(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/RatioRange.cs b/src/Hl7.Fhir.R5/Model/Generated/RatioRange.cs index 194d8b9988..f0c3aaa501 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/RatioRange.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/RatioRange.cs @@ -99,7 +99,7 @@ public Hl7.Fhir.Model.Quantity Denominator private Hl7.Fhir.Model.Quantity _Denominator; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RatioRange; @@ -108,16 +108,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LowNumerator != null) dest.LowNumerator = (Hl7.Fhir.Model.Quantity)LowNumerator.DeepCopy(); - if(HighNumerator != null) dest.HighNumerator = (Hl7.Fhir.Model.Quantity)HighNumerator.DeepCopy(); - if(Denominator != null) dest.Denominator = (Hl7.Fhir.Model.Quantity)Denominator.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LowNumerator != null) dest.LowNumerator = (Hl7.Fhir.Model.Quantity)LowNumerator.DeepCopyInternal(); + if(HighNumerator != null) dest.HighNumerator = (Hl7.Fhir.Model.Quantity)HighNumerator.DeepCopyInternal(); + if(Denominator != null) dest.Denominator = (Hl7.Fhir.Model.Quantity)Denominator.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RatioRange()); + var instance = new RatioRange(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/RegulatedAuthorization.cs b/src/Hl7.Fhir.R5/Model/Generated/RegulatedAuthorization.cs index 3f22706d76..7f38c9bfd7 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/RegulatedAuthorization.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/RegulatedAuthorization.cs @@ -145,7 +145,7 @@ public List Application private List _Application; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CaseComponent; @@ -154,18 +154,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(Date != null) dest.Date = (Hl7.Fhir.Model.DataType)Date.DeepCopy(); - if(Application.Any()) dest.Application = new List(Application.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(Date != null) dest.Date = (Hl7.Fhir.Model.DataType)Date.DeepCopyInternal(); + if(Application.Any()) dest.Application = new List(Application.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CaseComponent()); + var instance = new CaseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -497,7 +498,7 @@ public Hl7.Fhir.Model.RegulatedAuthorization.CaseComponent Case List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RegulatedAuthorization; @@ -506,28 +507,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Region.Any()) dest.Region = new List(Region.DeepCopy()); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopy(); - if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopy(); - if(Indication.Any()) dest.Indication = new List(Indication.DeepCopy()); - if(IntendedUse != null) dest.IntendedUse = (Hl7.Fhir.Model.CodeableConcept)IntendedUse.DeepCopy(); - if(Basis.Any()) dest.Basis = new List(Basis.DeepCopy()); - if(Holder != null) dest.Holder = (Hl7.Fhir.Model.ResourceReference)Holder.DeepCopy(); - if(Regulator != null) dest.Regulator = (Hl7.Fhir.Model.ResourceReference)Regulator.DeepCopy(); - if(AttachedDocument.Any()) dest.AttachedDocument = new List(AttachedDocument.DeepCopy()); - if(Case != null) dest.Case = (Hl7.Fhir.Model.RegulatedAuthorization.CaseComponent)Case.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Region.Any()) dest.Region = new List(Region.DeepCopyInternal()); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopyInternal(); + if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopyInternal(); + if(Indication.Any()) dest.Indication = new List(Indication.DeepCopyInternal()); + if(IntendedUse != null) dest.IntendedUse = (Hl7.Fhir.Model.CodeableConcept)IntendedUse.DeepCopyInternal(); + if(Basis.Any()) dest.Basis = new List(Basis.DeepCopyInternal()); + if(Holder != null) dest.Holder = (Hl7.Fhir.Model.ResourceReference)Holder.DeepCopyInternal(); + if(Regulator != null) dest.Regulator = (Hl7.Fhir.Model.ResourceReference)Regulator.DeepCopyInternal(); + if(AttachedDocument.Any()) dest.AttachedDocument = new List(AttachedDocument.DeepCopyInternal()); + if(Case != null) dest.Case = (Hl7.Fhir.Model.RegulatedAuthorization.CaseComponent)Case.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RegulatedAuthorization()); + var instance = new RegulatedAuthorization(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/RelatedPerson.cs b/src/Hl7.Fhir.R5/Model/Generated/RelatedPerson.cs index 2bd06cc74b..480543d8ab 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/RelatedPerson.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/RelatedPerson.cs @@ -121,7 +121,7 @@ public bool? Preferred } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CommunicationComponent; @@ -130,15 +130,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CommunicationComponent()); + var instance = new CommunicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -419,7 +420,7 @@ public List Communication List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedPerson; @@ -428,25 +429,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopy()); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopyInternal()); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(Photo.Any()) dest.Photo = new List(Photo.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedPerson()); + var instance = new RelatedPerson(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/RequestOrchestration.cs b/src/Hl7.Fhir.R5/Model/Generated/RequestOrchestration.cs index b55f112a94..1d236f2084 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/RequestOrchestration.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/RequestOrchestration.cs @@ -674,7 +674,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionComponent; @@ -683,40 +683,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.Markdown)TextEquivalentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopy()); - if(Goal.Any()) dest.Goal = new List(Goal.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Output.Any()) dest.Output = new List(Output.DeepCopy()); - if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopy()); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.CodeableReference)Location.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopy(); - if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopy(); - if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopy(); - if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopy(); - if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopy(); - if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopy(); - if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActionComponent()); + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.Markdown)TextEquivalentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopyInternal()); + if(Goal.Any()) dest.Goal = new List(Goal.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Output.Any()) dest.Output = new List(Output.DeepCopyInternal()); + if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopyInternal()); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.CodeableReference)Location.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopyInternal(); + if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopyInternal(); + if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopyInternal(); + if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopyInternal(); + if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopyInternal(); + if(TransformElement != null) dest.TransformElement = (Hl7.Fhir.Model.Canonical)TransformElement.DeepCopyInternal(); + if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1036,7 +1037,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConditionComponent; @@ -1045,15 +1046,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConditionComponent()); + var instance = new ConditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1200,7 +1202,7 @@ public string RelatedData } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InputComponent; @@ -1209,16 +1211,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Requirement != null) dest.Requirement = (Hl7.Fhir.Model.DataRequirement)Requirement.DeepCopy(); - if(RelatedDataElement != null) dest.RelatedDataElement = (Hl7.Fhir.Model.Id)RelatedDataElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Requirement != null) dest.Requirement = (Hl7.Fhir.Model.DataRequirement)Requirement.DeepCopyInternal(); + if(RelatedDataElement != null) dest.RelatedDataElement = (Hl7.Fhir.Model.Id)RelatedDataElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InputComponent()); + var instance = new InputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1373,7 +1376,7 @@ public string RelatedData } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OutputComponent; @@ -1382,16 +1385,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Requirement != null) dest.Requirement = (Hl7.Fhir.Model.DataRequirement)Requirement.DeepCopy(); - if(RelatedDataElement != null) dest.RelatedDataElement = (Hl7.Fhir.Model.FhirString)RelatedDataElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Requirement != null) dest.Requirement = (Hl7.Fhir.Model.DataRequirement)Requirement.DeepCopyInternal(); + if(RelatedDataElement != null) dest.RelatedDataElement = (Hl7.Fhir.Model.FhirString)RelatedDataElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OutputComponent()); + var instance = new OutputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1585,7 +1589,7 @@ public Hl7.Fhir.Model.DataType Offset private Hl7.Fhir.Model.DataType _Offset; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedActionComponent; @@ -1594,17 +1598,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopy(); - if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopy(); - if(EndRelationshipElement != null) dest.EndRelationshipElement = (Code)EndRelationshipElement.DeepCopy(); - if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopyInternal(); + if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopyInternal(); + if(EndRelationshipElement != null) dest.EndRelationshipElement = (Code)EndRelationshipElement.DeepCopyInternal(); + if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedActionComponent()); + var instance = new RelatedActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1816,7 +1821,7 @@ public Hl7.Fhir.Model.DataType Actor private Hl7.Fhir.Model.DataType _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -1825,19 +1830,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TypeCanonicalElement != null) dest.TypeCanonicalElement = (Hl7.Fhir.Model.Canonical)TypeCanonicalElement.DeepCopy(); - if(TypeReference != null) dest.TypeReference = (Hl7.Fhir.Model.ResourceReference)TypeReference.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.DataType)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TypeCanonicalElement != null) dest.TypeCanonicalElement = (Hl7.Fhir.Model.Canonical)TypeCanonicalElement.DeepCopyInternal(); + if(TypeReference != null) dest.TypeReference = (Hl7.Fhir.Model.ResourceReference)TypeReference.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.DataType)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1986,7 +1992,7 @@ public Hl7.Fhir.Model.Expression Expression private Hl7.Fhir.Model.Expression _Expression; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DynamicValueComponent; @@ -1995,15 +2001,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(Expression != null) dest.Expression = (Hl7.Fhir.Model.Expression)Expression.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DynamicValueComponent()); + var instance = new DynamicValueComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2434,7 +2441,7 @@ public List Action List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequestOrchestration; @@ -2443,31 +2450,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Goal.Any()) dest.Goal = new List(Goal.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Goal.Any()) dest.Goal = new List(Goal.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequestOrchestration()); + var instance = new RequestOrchestration(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Requirements.cs b/src/Hl7.Fhir.R5/Model/Generated/Requirements.cs index ba7af5b2d1..30604c06fc 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Requirements.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Requirements.cs @@ -411,7 +411,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StatementComponent; @@ -420,23 +420,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KeyElement != null) dest.KeyElement = (Hl7.Fhir.Model.Id)KeyElement.DeepCopy(); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(ConformanceElement.Any()) dest.ConformanceElement = new List>(ConformanceElement.DeepCopy()); - if(ConditionalityElement != null) dest.ConditionalityElement = (Hl7.Fhir.Model.FhirBoolean)ConditionalityElement.DeepCopy(); - if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.Markdown)RequirementElement.DeepCopy(); - if(DerivedFromElement != null) dest.DerivedFromElement = (Hl7.Fhir.Model.FhirString)DerivedFromElement.DeepCopy(); - if(ParentElement != null) dest.ParentElement = (Hl7.Fhir.Model.FhirString)ParentElement.DeepCopy(); - if(SatisfiedByElement.Any()) dest.SatisfiedByElement = new List(SatisfiedByElement.DeepCopy()); - if(ReferenceElement.Any()) dest.ReferenceElement = new List(ReferenceElement.DeepCopy()); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(KeyElement != null) dest.KeyElement = (Hl7.Fhir.Model.Id)KeyElement.DeepCopyInternal(); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(ConformanceElement.Any()) dest.ConformanceElement = new List>(ConformanceElement.DeepCopyInternal()); + if(ConditionalityElement != null) dest.ConditionalityElement = (Hl7.Fhir.Model.FhirBoolean)ConditionalityElement.DeepCopyInternal(); + if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.Markdown)RequirementElement.DeepCopyInternal(); + if(DerivedFromElement != null) dest.DerivedFromElement = (Hl7.Fhir.Model.FhirString)DerivedFromElement.DeepCopyInternal(); + if(ParentElement != null) dest.ParentElement = (Hl7.Fhir.Model.FhirString)ParentElement.DeepCopyInternal(); + if(SatisfiedByElement.Any()) dest.SatisfiedByElement = new List(SatisfiedByElement.DeepCopyInternal()); + if(ReferenceElement.Any()) dest.ReferenceElement = new List(ReferenceElement.DeepCopyInternal()); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StatementComponent()); + var instance = new StatementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1115,7 +1116,7 @@ public List Statement List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Requirements; @@ -1124,34 +1125,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopy()); - if(ReferenceElement.Any()) dest.ReferenceElement = new List(ReferenceElement.DeepCopy()); - if(ActorElement.Any()) dest.ActorElement = new List(ActorElement.DeepCopy()); - if(Statement.Any()) dest.Statement = new List(Statement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopyInternal()); + if(ReferenceElement.Any()) dest.ReferenceElement = new List(ReferenceElement.DeepCopyInternal()); + if(ActorElement.Any()) dest.ActorElement = new List(ActorElement.DeepCopyInternal()); + if(Statement.Any()) dest.Statement = new List(Statement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Requirements()); + var instance = new Requirements(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ResearchStudy.cs b/src/Hl7.Fhir.R5/Model/Generated/ResearchStudy.cs index 0679c8b22b..33b1d07419 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ResearchStudy.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ResearchStudy.cs @@ -118,7 +118,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LabelComponent; @@ -127,15 +127,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LabelComponent()); + var instance = new LabelComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -297,7 +298,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssociatedPartyComponent; @@ -306,18 +307,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Period.Any()) dest.Period = new List(Period.DeepCopy()); - if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopy()); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Period.Any()) dest.Period = new List(Period.DeepCopyInternal()); + if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopyInternal()); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AssociatedPartyComponent()); + var instance = new AssociatedPartyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -469,7 +471,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProgressStatusComponent; @@ -478,16 +480,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(State != null) dest.State = (Hl7.Fhir.Model.CodeableConcept)State.DeepCopy(); - if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(State != null) dest.State = (Hl7.Fhir.Model.CodeableConcept)State.DeepCopyInternal(); + if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProgressStatusComponent()); + var instance = new ProgressStatusComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -656,7 +659,7 @@ public Hl7.Fhir.Model.ResourceReference ActualGroup private Hl7.Fhir.Model.ResourceReference _ActualGroup; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RecruitmentComponent; @@ -665,17 +668,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TargetNumberElement != null) dest.TargetNumberElement = (Hl7.Fhir.Model.UnsignedInt)TargetNumberElement.DeepCopy(); - if(ActualNumberElement != null) dest.ActualNumberElement = (Hl7.Fhir.Model.UnsignedInt)ActualNumberElement.DeepCopy(); - if(Eligibility != null) dest.Eligibility = (Hl7.Fhir.Model.ResourceReference)Eligibility.DeepCopy(); - if(ActualGroup != null) dest.ActualGroup = (Hl7.Fhir.Model.ResourceReference)ActualGroup.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TargetNumberElement != null) dest.TargetNumberElement = (Hl7.Fhir.Model.UnsignedInt)TargetNumberElement.DeepCopyInternal(); + if(ActualNumberElement != null) dest.ActualNumberElement = (Hl7.Fhir.Model.UnsignedInt)ActualNumberElement.DeepCopyInternal(); + if(Eligibility != null) dest.Eligibility = (Hl7.Fhir.Model.ResourceReference)Eligibility.DeepCopyInternal(); + if(ActualGroup != null) dest.ActualGroup = (Hl7.Fhir.Model.ResourceReference)ActualGroup.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RecruitmentComponent()); + var instance = new RecruitmentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -903,7 +907,7 @@ public Hl7.Fhir.Model.ResourceReference ObservedGroup private Hl7.Fhir.Model.ResourceReference _ObservedGroup; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComparisonGroupComponent; @@ -912,19 +916,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.Id)LinkIdElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(IntendedExposure.Any()) dest.IntendedExposure = new List(IntendedExposure.DeepCopy()); - if(ObservedGroup != null) dest.ObservedGroup = (Hl7.Fhir.Model.ResourceReference)ObservedGroup.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.Id)LinkIdElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(IntendedExposure.Any()) dest.IntendedExposure = new List(IntendedExposure.DeepCopyInternal()); + if(ObservedGroup != null) dest.ObservedGroup = (Hl7.Fhir.Model.ResourceReference)ObservedGroup.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComparisonGroupComponent()); + var instance = new ComparisonGroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1104,7 +1109,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ObjectiveComponent; @@ -1113,16 +1118,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ObjectiveComponent()); + var instance = new ObjectiveComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1295,7 +1301,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OutcomeMeasureComponent; @@ -1304,17 +1310,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OutcomeMeasureComponent()); + var instance = new OutcomeMeasureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1987,7 +1994,7 @@ public List Result List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResearchStudy; @@ -1996,45 +2003,46 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Label.Any()) dest.Label = new List(Label.DeepCopy()); - if(Protocol.Any()) dest.Protocol = new List(Protocol.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(PrimaryPurposeType != null) dest.PrimaryPurposeType = (Hl7.Fhir.Model.CodeableConcept)PrimaryPurposeType.DeepCopy(); - if(Phase != null) dest.Phase = (Hl7.Fhir.Model.CodeableConcept)Phase.DeepCopy(); - if(StudyDesign.Any()) dest.StudyDesign = new List(StudyDesign.DeepCopy()); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Keyword.Any()) dest.Keyword = new List(Keyword.DeepCopy()); - if(Region.Any()) dest.Region = new List(Region.DeepCopy()); - if(DescriptionSummaryElement != null) dest.DescriptionSummaryElement = (Hl7.Fhir.Model.Markdown)DescriptionSummaryElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Site.Any()) dest.Site = new List(Site.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopy()); - if(AssociatedParty.Any()) dest.AssociatedParty = new List(AssociatedParty.DeepCopy()); - if(ProgressStatus.Any()) dest.ProgressStatus = new List(ProgressStatus.DeepCopy()); - if(WhyStopped != null) dest.WhyStopped = (Hl7.Fhir.Model.CodeableConcept)WhyStopped.DeepCopy(); - if(Recruitment != null) dest.Recruitment = (Hl7.Fhir.Model.ResearchStudy.RecruitmentComponent)Recruitment.DeepCopy(); - if(ComparisonGroup.Any()) dest.ComparisonGroup = new List(ComparisonGroup.DeepCopy()); - if(Objective.Any()) dest.Objective = new List(Objective.DeepCopy()); - if(OutcomeMeasure.Any()) dest.OutcomeMeasure = new List(OutcomeMeasure.DeepCopy()); - if(Result.Any()) dest.Result = new List(Result.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Label.Any()) dest.Label = new List(Label.DeepCopyInternal()); + if(Protocol.Any()) dest.Protocol = new List(Protocol.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(PrimaryPurposeType != null) dest.PrimaryPurposeType = (Hl7.Fhir.Model.CodeableConcept)PrimaryPurposeType.DeepCopyInternal(); + if(Phase != null) dest.Phase = (Hl7.Fhir.Model.CodeableConcept)Phase.DeepCopyInternal(); + if(StudyDesign.Any()) dest.StudyDesign = new List(StudyDesign.DeepCopyInternal()); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Keyword.Any()) dest.Keyword = new List(Keyword.DeepCopyInternal()); + if(Region.Any()) dest.Region = new List(Region.DeepCopyInternal()); + if(DescriptionSummaryElement != null) dest.DescriptionSummaryElement = (Hl7.Fhir.Model.Markdown)DescriptionSummaryElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Site.Any()) dest.Site = new List(Site.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Classifier.Any()) dest.Classifier = new List(Classifier.DeepCopyInternal()); + if(AssociatedParty.Any()) dest.AssociatedParty = new List(AssociatedParty.DeepCopyInternal()); + if(ProgressStatus.Any()) dest.ProgressStatus = new List(ProgressStatus.DeepCopyInternal()); + if(WhyStopped != null) dest.WhyStopped = (Hl7.Fhir.Model.CodeableConcept)WhyStopped.DeepCopyInternal(); + if(Recruitment != null) dest.Recruitment = (Hl7.Fhir.Model.ResearchStudy.RecruitmentComponent)Recruitment.DeepCopyInternal(); + if(ComparisonGroup.Any()) dest.ComparisonGroup = new List(ComparisonGroup.DeepCopyInternal()); + if(Objective.Any()) dest.Objective = new List(Objective.DeepCopyInternal()); + if(OutcomeMeasure.Any()) dest.OutcomeMeasure = new List(OutcomeMeasure.DeepCopyInternal()); + if(Result.Any()) dest.Result = new List(Result.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResearchStudy()); + var instance = new ResearchStudy(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ResearchSubject.cs b/src/Hl7.Fhir.R5/Model/Generated/ResearchSubject.cs index 468d2d788a..cfc61638df 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ResearchSubject.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ResearchSubject.cs @@ -284,7 +284,7 @@ public string EndDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProgressComponent; @@ -293,19 +293,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubjectState != null) dest.SubjectState = (Hl7.Fhir.Model.CodeableConcept)SubjectState.DeepCopy(); - if(Milestone != null) dest.Milestone = (Hl7.Fhir.Model.CodeableConcept)Milestone.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(StartDateElement != null) dest.StartDateElement = (Hl7.Fhir.Model.FhirDateTime)StartDateElement.DeepCopy(); - if(EndDateElement != null) dest.EndDateElement = (Hl7.Fhir.Model.FhirDateTime)EndDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubjectState != null) dest.SubjectState = (Hl7.Fhir.Model.CodeableConcept)SubjectState.DeepCopyInternal(); + if(Milestone != null) dest.Milestone = (Hl7.Fhir.Model.CodeableConcept)Milestone.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(StartDateElement != null) dest.StartDateElement = (Hl7.Fhir.Model.FhirDateTime)StartDateElement.DeepCopyInternal(); + if(EndDateElement != null) dest.EndDateElement = (Hl7.Fhir.Model.FhirDateTime)EndDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProgressComponent()); + var instance = new ProgressComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -580,7 +581,7 @@ public List Consent List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResearchSubject; @@ -589,22 +590,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Progress.Any()) dest.Progress = new List(Progress.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Study != null) dest.Study = (Hl7.Fhir.Model.ResourceReference)Study.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(AssignedComparisonGroupElement != null) dest.AssignedComparisonGroupElement = (Hl7.Fhir.Model.Id)AssignedComparisonGroupElement.DeepCopy(); - if(ActualComparisonGroupElement != null) dest.ActualComparisonGroupElement = (Hl7.Fhir.Model.Id)ActualComparisonGroupElement.DeepCopy(); - if(Consent.Any()) dest.Consent = new List(Consent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Progress.Any()) dest.Progress = new List(Progress.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Study != null) dest.Study = (Hl7.Fhir.Model.ResourceReference)Study.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(AssignedComparisonGroupElement != null) dest.AssignedComparisonGroupElement = (Hl7.Fhir.Model.Id)AssignedComparisonGroupElement.DeepCopyInternal(); + if(ActualComparisonGroupElement != null) dest.ActualComparisonGroupElement = (Hl7.Fhir.Model.Id)ActualComparisonGroupElement.DeepCopyInternal(); + if(Consent.Any()) dest.Consent = new List(Consent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResearchSubject()); + var instance = new ResearchSubject(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/RiskAssessment.cs b/src/Hl7.Fhir.R5/Model/Generated/RiskAssessment.cs index fc67181a35..ed14611ea7 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/RiskAssessment.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/RiskAssessment.cs @@ -196,7 +196,7 @@ public string Rationale } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PredictionComponent; @@ -205,19 +205,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(Probability != null) dest.Probability = (Hl7.Fhir.Model.DataType)Probability.DeepCopy(); - if(QualitativeRisk != null) dest.QualitativeRisk = (Hl7.Fhir.Model.CodeableConcept)QualitativeRisk.DeepCopy(); - if(RelativeRiskElement != null) dest.RelativeRiskElement = (Hl7.Fhir.Model.FhirDecimal)RelativeRiskElement.DeepCopy(); - if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopy(); - if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.FhirString)RationaleElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(Probability != null) dest.Probability = (Hl7.Fhir.Model.DataType)Probability.DeepCopyInternal(); + if(QualitativeRisk != null) dest.QualitativeRisk = (Hl7.Fhir.Model.CodeableConcept)QualitativeRisk.DeepCopyInternal(); + if(RelativeRiskElement != null) dest.RelativeRiskElement = (Hl7.Fhir.Model.FhirDecimal)RelativeRiskElement.DeepCopyInternal(); + if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopyInternal(); + if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.FhirString)RationaleElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PredictionComponent()); + var instance = new PredictionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -577,7 +578,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RiskAssessment; @@ -586,29 +587,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn != null) dest.BasedOn = (Hl7.Fhir.Model.ResourceReference)BasedOn.DeepCopy(); - if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Basis.Any()) dest.Basis = new List(Basis.DeepCopy()); - if(Prediction.Any()) dest.Prediction = new List(Prediction.DeepCopy()); - if(MitigationElement != null) dest.MitigationElement = (Hl7.Fhir.Model.FhirString)MitigationElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn != null) dest.BasedOn = (Hl7.Fhir.Model.ResourceReference)BasedOn.DeepCopyInternal(); + if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Basis.Any()) dest.Basis = new List(Basis.DeepCopyInternal()); + if(Prediction.Any()) dest.Prediction = new List(Prediction.DeepCopyInternal()); + if(MitigationElement != null) dest.MitigationElement = (Hl7.Fhir.Model.FhirString)MitigationElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RiskAssessment()); + var instance = new RiskAssessment(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/SampledData.cs b/src/Hl7.Fhir.R5/Model/Generated/SampledData.cs index 8d1cffcd45..02044e175e 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/SampledData.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/SampledData.cs @@ -356,7 +356,7 @@ public string Data } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SampledData; @@ -365,23 +365,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Origin != null) dest.Origin = (Hl7.Fhir.Model.Quantity)Origin.DeepCopy(); - if(IntervalElement != null) dest.IntervalElement = (Hl7.Fhir.Model.FhirDecimal)IntervalElement.DeepCopy(); - if(IntervalUnitElement != null) dest.IntervalUnitElement = (Hl7.Fhir.Model.Code)IntervalUnitElement.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(LowerLimitElement != null) dest.LowerLimitElement = (Hl7.Fhir.Model.FhirDecimal)LowerLimitElement.DeepCopy(); - if(UpperLimitElement != null) dest.UpperLimitElement = (Hl7.Fhir.Model.FhirDecimal)UpperLimitElement.DeepCopy(); - if(DimensionsElement != null) dest.DimensionsElement = (Hl7.Fhir.Model.PositiveInt)DimensionsElement.DeepCopy(); - if(CodeMapElement != null) dest.CodeMapElement = (Hl7.Fhir.Model.Canonical)CodeMapElement.DeepCopy(); - if(OffsetsElement != null) dest.OffsetsElement = (Hl7.Fhir.Model.FhirString)OffsetsElement.DeepCopy(); - if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.FhirString)DataElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Origin != null) dest.Origin = (Hl7.Fhir.Model.Quantity)Origin.DeepCopyInternal(); + if(IntervalElement != null) dest.IntervalElement = (Hl7.Fhir.Model.FhirDecimal)IntervalElement.DeepCopyInternal(); + if(IntervalUnitElement != null) dest.IntervalUnitElement = (Hl7.Fhir.Model.Code)IntervalUnitElement.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(LowerLimitElement != null) dest.LowerLimitElement = (Hl7.Fhir.Model.FhirDecimal)LowerLimitElement.DeepCopyInternal(); + if(UpperLimitElement != null) dest.UpperLimitElement = (Hl7.Fhir.Model.FhirDecimal)UpperLimitElement.DeepCopyInternal(); + if(DimensionsElement != null) dest.DimensionsElement = (Hl7.Fhir.Model.PositiveInt)DimensionsElement.DeepCopyInternal(); + if(CodeMapElement != null) dest.CodeMapElement = (Hl7.Fhir.Model.Canonical)CodeMapElement.DeepCopyInternal(); + if(OffsetsElement != null) dest.OffsetsElement = (Hl7.Fhir.Model.FhirString)OffsetsElement.DeepCopyInternal(); + if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.FhirString)DataElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SampledData()); + var instance = new SampledData(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Schedule.cs b/src/Hl7.Fhir.R5/Model/Generated/Schedule.cs index 772b4616eb..745d961add 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Schedule.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Schedule.cs @@ -239,7 +239,7 @@ public string Comment List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Schedule; @@ -248,22 +248,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopy()); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(PlanningHorizon != null) dest.PlanningHorizon = (Hl7.Fhir.Model.Period)PlanningHorizon.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopyInternal()); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(PlanningHorizon != null) dest.PlanningHorizon = (Hl7.Fhir.Model.Period)PlanningHorizon.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Schedule()); + var instance = new Schedule(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/SearchParameter.cs b/src/Hl7.Fhir.R5/Model/Generated/SearchParameter.cs index b62f4dc798..149fa27967 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/SearchParameter.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/SearchParameter.cs @@ -168,7 +168,7 @@ public string Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -177,15 +177,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1129,7 +1130,7 @@ public List Component List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SearchParameter; @@ -1138,44 +1139,45 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DerivedFromElement != null) dest.DerivedFromElement = (Hl7.Fhir.Model.Canonical)DerivedFromElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(BaseElement.Any()) dest.BaseElement = new List>(BaseElement.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(ProcessingModeElement != null) dest.ProcessingModeElement = (Code)ProcessingModeElement.DeepCopy(); - if(ConstraintElement != null) dest.ConstraintElement = (Hl7.Fhir.Model.FhirString)ConstraintElement.DeepCopy(); - if(TargetElement.Any()) dest.TargetElement = new List>(TargetElement.DeepCopy()); - if(MultipleOrElement != null) dest.MultipleOrElement = (Hl7.Fhir.Model.FhirBoolean)MultipleOrElement.DeepCopy(); - if(MultipleAndElement != null) dest.MultipleAndElement = (Hl7.Fhir.Model.FhirBoolean)MultipleAndElement.DeepCopy(); - if(ComparatorElement.Any()) dest.ComparatorElement = new List>(ComparatorElement.DeepCopy()); - if(ModifierElement.Any()) dest.ModifierElement = new List>(ModifierElement.DeepCopy()); - if(ChainElement.Any()) dest.ChainElement = new List(ChainElement.DeepCopy()); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new SearchParameter()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DerivedFromElement != null) dest.DerivedFromElement = (Hl7.Fhir.Model.Canonical)DerivedFromElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(BaseElement.Any()) dest.BaseElement = new List>(BaseElement.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(ProcessingModeElement != null) dest.ProcessingModeElement = (Code)ProcessingModeElement.DeepCopyInternal(); + if(ConstraintElement != null) dest.ConstraintElement = (Hl7.Fhir.Model.FhirString)ConstraintElement.DeepCopyInternal(); + if(TargetElement.Any()) dest.TargetElement = new List>(TargetElement.DeepCopyInternal()); + if(MultipleOrElement != null) dest.MultipleOrElement = (Hl7.Fhir.Model.FhirBoolean)MultipleOrElement.DeepCopyInternal(); + if(MultipleAndElement != null) dest.MultipleAndElement = (Hl7.Fhir.Model.FhirBoolean)MultipleAndElement.DeepCopyInternal(); + if(ComparatorElement.Any()) dest.ComparatorElement = new List>(ComparatorElement.DeepCopyInternal()); + if(ModifierElement.Any()) dest.ModifierElement = new List>(ModifierElement.DeepCopyInternal()); + if(ChainElement.Any()) dest.ChainElement = new List(ChainElement.DeepCopyInternal()); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new SearchParameter(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/ServiceRequest.cs b/src/Hl7.Fhir.R5/Model/Generated/ServiceRequest.cs index 2ebdf339af..54c8a14ff1 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/ServiceRequest.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/ServiceRequest.cs @@ -103,7 +103,7 @@ public List Parameter private List _Parameter; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OrderDetailComponent; @@ -112,15 +112,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ParameterFocus != null) dest.ParameterFocus = (Hl7.Fhir.Model.CodeableReference)ParameterFocus.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ParameterFocus != null) dest.ParameterFocus = (Hl7.Fhir.Model.CodeableReference)ParameterFocus.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OrderDetailComponent()); + var instance = new OrderDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -220,7 +221,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -229,15 +230,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -325,7 +327,7 @@ public Hl7.Fhir.Model.DataType Instruction private Hl7.Fhir.Model.DataType _Instruction; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PatientInstructionComponent; @@ -334,14 +336,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Instruction != null) dest.Instruction = (Hl7.Fhir.Model.DataType)Instruction.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Instruction != null) dest.Instruction = (Hl7.Fhir.Model.DataType)Instruction.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PatientInstructionComponent()); + var instance = new PatientInstructionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1008,7 +1011,7 @@ public List RelevantHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ServiceRequest; @@ -1017,46 +1020,47 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopy()); - if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(Requisition != null) dest.Requisition = (Hl7.Fhir.Model.Identifier)Requisition.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableReference)Code.DeepCopy(); - if(OrderDetail.Any()) dest.OrderDetail = new List(OrderDetail.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.DataType)Quantity.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(BodyStructure != null) dest.BodyStructure = (Hl7.Fhir.Model.ResourceReference)BodyStructure.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(PatientInstruction.Any()) dest.PatientInstruction = new List(PatientInstruction.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement.Any()) dest.InstantiatesCanonicalElement = new List(InstantiatesCanonicalElement.DeepCopyInternal()); + if(InstantiatesUriElement.Any()) dest.InstantiatesUriElement = new List(InstantiatesUriElement.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(Requisition != null) dest.Requisition = (Hl7.Fhir.Model.Identifier)Requisition.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableReference)Code.DeepCopyInternal(); + if(OrderDetail.Any()) dest.OrderDetail = new List(OrderDetail.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.DataType)Quantity.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(BodyStructure != null) dest.BodyStructure = (Hl7.Fhir.Model.ResourceReference)BodyStructure.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(PatientInstruction.Any()) dest.PatientInstruction = new List(PatientInstruction.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ServiceRequest()); + var instance = new ServiceRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Slot.cs b/src/Hl7.Fhir.R5/Model/Generated/Slot.cs index 432430f9fc..60f5877874 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Slot.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Slot.cs @@ -348,7 +348,7 @@ public string Comment List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Slot; @@ -357,24 +357,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopy()); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(AppointmentType.Any()) dest.AppointmentType = new List(AppointmentType.DeepCopy()); - if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.ResourceReference)Schedule.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(OverbookedElement != null) dest.OverbookedElement = (Hl7.Fhir.Model.FhirBoolean)OverbookedElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ServiceCategory.Any()) dest.ServiceCategory = new List(ServiceCategory.DeepCopyInternal()); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(AppointmentType.Any()) dest.AppointmentType = new List(AppointmentType.DeepCopyInternal()); + if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.ResourceReference)Schedule.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(OverbookedElement != null) dest.OverbookedElement = (Hl7.Fhir.Model.FhirBoolean)OverbookedElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Slot()); + var instance = new Slot(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Specimen.cs b/src/Hl7.Fhir.R5/Model/Generated/Specimen.cs index 4669f43428..90552c4721 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Specimen.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Specimen.cs @@ -178,7 +178,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FeatureComponent; @@ -187,15 +187,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FeatureComponent()); + var instance = new FeatureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -396,7 +397,7 @@ public Hl7.Fhir.Model.DataType FastingStatus private Hl7.Fhir.Model.DataType _FastingStatus; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CollectionComponent; @@ -405,22 +406,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopy(); - if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.CodeableReference)Device.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.ResourceReference)Procedure.DeepCopy(); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableReference)BodySite.DeepCopy(); - if(FastingStatus != null) dest.FastingStatus = (Hl7.Fhir.Model.DataType)FastingStatus.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopyInternal(); + if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Duration)Duration.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.CodeableReference)Device.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.ResourceReference)Procedure.DeepCopyInternal(); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableReference)BodySite.DeepCopyInternal(); + if(FastingStatus != null) dest.FastingStatus = (Hl7.Fhir.Model.DataType)FastingStatus.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CollectionComponent()); + var instance = new CollectionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -624,7 +626,7 @@ public Hl7.Fhir.Model.DataType Time private Hl7.Fhir.Model.DataType _Time; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcessingComponent; @@ -633,17 +635,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Additive.Any()) dest.Additive = new List(Additive.DeepCopy()); - if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Additive.Any()) dest.Additive = new List(Additive.DeepCopyInternal()); + if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcessingComponent()); + var instance = new ProcessingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -775,7 +778,7 @@ public Hl7.Fhir.Model.Quantity SpecimenQuantity private Hl7.Fhir.Model.Quantity _SpecimenQuantity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainerComponent; @@ -784,16 +787,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(SpecimenQuantity != null) dest.SpecimenQuantity = (Hl7.Fhir.Model.Quantity)SpecimenQuantity.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(SpecimenQuantity != null) dest.SpecimenQuantity = (Hl7.Fhir.Model.Quantity)SpecimenQuantity.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainerComponent()); + var instance = new ContainerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1143,7 +1147,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Specimen; @@ -1152,29 +1156,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(AccessionIdentifier != null) dest.AccessionIdentifier = (Hl7.Fhir.Model.Identifier)AccessionIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(ReceivedTimeElement != null) dest.ReceivedTimeElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedTimeElement.DeepCopy(); - if(Parent.Any()) dest.Parent = new List(Parent.DeepCopy()); - if(Request.Any()) dest.Request = new List(Request.DeepCopy()); - if(CombinedElement != null) dest.CombinedElement = (Code)CombinedElement.DeepCopy(); - if(Role.Any()) dest.Role = new List(Role.DeepCopy()); - if(Feature.Any()) dest.Feature = new List(Feature.DeepCopy()); - if(Collection != null) dest.Collection = (Hl7.Fhir.Model.Specimen.CollectionComponent)Collection.DeepCopy(); - if(Processing.Any()) dest.Processing = new List(Processing.DeepCopy()); - if(Container.Any()) dest.Container = new List(Container.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(AccessionIdentifier != null) dest.AccessionIdentifier = (Hl7.Fhir.Model.Identifier)AccessionIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(ReceivedTimeElement != null) dest.ReceivedTimeElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedTimeElement.DeepCopyInternal(); + if(Parent.Any()) dest.Parent = new List(Parent.DeepCopyInternal()); + if(Request.Any()) dest.Request = new List(Request.DeepCopyInternal()); + if(CombinedElement != null) dest.CombinedElement = (Code)CombinedElement.DeepCopyInternal(); + if(Role.Any()) dest.Role = new List(Role.DeepCopyInternal()); + if(Feature.Any()) dest.Feature = new List(Feature.DeepCopyInternal()); + if(Collection != null) dest.Collection = (Hl7.Fhir.Model.Specimen.CollectionComponent)Collection.DeepCopyInternal(); + if(Processing.Any()) dest.Processing = new List(Processing.DeepCopyInternal()); + if(Container.Any()) dest.Container = new List(Container.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Specimen()); + var instance = new Specimen(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/SpecimenDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/SpecimenDefinition.cs index b55b6ec76a..dfe5abd312 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/SpecimenDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/SpecimenDefinition.cs @@ -308,7 +308,7 @@ public List TestingDestination private List _TestingDestination; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TypeTestedComponent; @@ -317,23 +317,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IsDerivedElement != null) dest.IsDerivedElement = (Hl7.Fhir.Model.FhirBoolean)IsDerivedElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(PreferenceElement != null) dest.PreferenceElement = (Code)PreferenceElement.DeepCopy(); - if(Container != null) dest.Container = (Hl7.Fhir.Model.SpecimenDefinition.ContainerComponent)Container.DeepCopy(); - if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.Markdown)RequirementElement.DeepCopy(); - if(RetentionTime != null) dest.RetentionTime = (Hl7.Fhir.Model.Duration)RetentionTime.DeepCopy(); - if(SingleUseElement != null) dest.SingleUseElement = (Hl7.Fhir.Model.FhirBoolean)SingleUseElement.DeepCopy(); - if(RejectionCriterion.Any()) dest.RejectionCriterion = new List(RejectionCriterion.DeepCopy()); - if(Handling.Any()) dest.Handling = new List(Handling.DeepCopy()); - if(TestingDestination.Any()) dest.TestingDestination = new List(TestingDestination.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(IsDerivedElement != null) dest.IsDerivedElement = (Hl7.Fhir.Model.FhirBoolean)IsDerivedElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(PreferenceElement != null) dest.PreferenceElement = (Code)PreferenceElement.DeepCopyInternal(); + if(Container != null) dest.Container = (Hl7.Fhir.Model.SpecimenDefinition.ContainerComponent)Container.DeepCopyInternal(); + if(RequirementElement != null) dest.RequirementElement = (Hl7.Fhir.Model.Markdown)RequirementElement.DeepCopyInternal(); + if(RetentionTime != null) dest.RetentionTime = (Hl7.Fhir.Model.Duration)RetentionTime.DeepCopyInternal(); + if(SingleUseElement != null) dest.SingleUseElement = (Hl7.Fhir.Model.FhirBoolean)SingleUseElement.DeepCopyInternal(); + if(RejectionCriterion.Any()) dest.RejectionCriterion = new List(RejectionCriterion.DeepCopyInternal()); + if(Handling.Any()) dest.Handling = new List(Handling.DeepCopyInternal()); + if(TestingDestination.Any()) dest.TestingDestination = new List(TestingDestination.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TypeTestedComponent()); + var instance = new TypeTestedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -612,7 +613,7 @@ public string Preparation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainerComponent; @@ -621,21 +622,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Material != null) dest.Material = (Hl7.Fhir.Model.CodeableConcept)Material.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Cap != null) dest.Cap = (Hl7.Fhir.Model.CodeableConcept)Cap.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Capacity != null) dest.Capacity = (Hl7.Fhir.Model.Quantity)Capacity.DeepCopy(); - if(MinimumVolume != null) dest.MinimumVolume = (Hl7.Fhir.Model.DataType)MinimumVolume.DeepCopy(); - if(Additive.Any()) dest.Additive = new List(Additive.DeepCopy()); - if(PreparationElement != null) dest.PreparationElement = (Hl7.Fhir.Model.Markdown)PreparationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Material != null) dest.Material = (Hl7.Fhir.Model.CodeableConcept)Material.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Cap != null) dest.Cap = (Hl7.Fhir.Model.CodeableConcept)Cap.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Capacity != null) dest.Capacity = (Hl7.Fhir.Model.Quantity)Capacity.DeepCopyInternal(); + if(MinimumVolume != null) dest.MinimumVolume = (Hl7.Fhir.Model.DataType)MinimumVolume.DeepCopyInternal(); + if(Additive.Any()) dest.Additive = new List(Additive.DeepCopyInternal()); + if(PreparationElement != null) dest.PreparationElement = (Hl7.Fhir.Model.Markdown)PreparationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainerComponent()); + var instance = new ContainerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -773,7 +775,7 @@ public Hl7.Fhir.Model.DataType Additive private Hl7.Fhir.Model.DataType _Additive; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdditiveComponent; @@ -782,14 +784,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Additive != null) dest.Additive = (Hl7.Fhir.Model.DataType)Additive.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Additive != null) dest.Additive = (Hl7.Fhir.Model.DataType)Additive.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdditiveComponent()); + var instance = new AdditiveComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -924,7 +927,7 @@ public string Instruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HandlingComponent; @@ -933,17 +936,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TemperatureQualifier != null) dest.TemperatureQualifier = (Hl7.Fhir.Model.CodeableConcept)TemperatureQualifier.DeepCopy(); - if(TemperatureRange != null) dest.TemperatureRange = (Hl7.Fhir.Model.Range)TemperatureRange.DeepCopy(); - if(MaxDuration != null) dest.MaxDuration = (Hl7.Fhir.Model.Duration)MaxDuration.DeepCopy(); - if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.Markdown)InstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TemperatureQualifier != null) dest.TemperatureQualifier = (Hl7.Fhir.Model.CodeableConcept)TemperatureQualifier.DeepCopyInternal(); + if(TemperatureRange != null) dest.TemperatureRange = (Hl7.Fhir.Model.Range)TemperatureRange.DeepCopyInternal(); + if(MaxDuration != null) dest.MaxDuration = (Hl7.Fhir.Model.Duration)MaxDuration.DeepCopyInternal(); + if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.Markdown)InstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HandlingComponent()); + var instance = new HandlingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1707,7 +1711,7 @@ public List TypeTested Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SpecimenDefinition; @@ -1716,41 +1720,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DerivedFromCanonicalElement.Any()) dest.DerivedFromCanonicalElement = new List(DerivedFromCanonicalElement.DeepCopy()); - if(DerivedFromUriElement.Any()) dest.DerivedFromUriElement = new List(DerivedFromUriElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(TypeCollected != null) dest.TypeCollected = (Hl7.Fhir.Model.CodeableConcept)TypeCollected.DeepCopy(); - if(PatientPreparation.Any()) dest.PatientPreparation = new List(PatientPreparation.DeepCopy()); - if(TimeAspectElement != null) dest.TimeAspectElement = (Hl7.Fhir.Model.FhirString)TimeAspectElement.DeepCopy(); - if(Collection.Any()) dest.Collection = new List(Collection.DeepCopy()); - if(TypeTested.Any()) dest.TypeTested = new List(TypeTested.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DerivedFromCanonicalElement.Any()) dest.DerivedFromCanonicalElement = new List(DerivedFromCanonicalElement.DeepCopyInternal()); + if(DerivedFromUriElement.Any()) dest.DerivedFromUriElement = new List(DerivedFromUriElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(TypeCollected != null) dest.TypeCollected = (Hl7.Fhir.Model.CodeableConcept)TypeCollected.DeepCopyInternal(); + if(PatientPreparation.Any()) dest.PatientPreparation = new List(PatientPreparation.DeepCopyInternal()); + if(TimeAspectElement != null) dest.TimeAspectElement = (Hl7.Fhir.Model.FhirString)TimeAspectElement.DeepCopyInternal(); + if(Collection.Any()) dest.Collection = new List(Collection.DeepCopyInternal()); + if(TypeTested.Any()) dest.TypeTested = new List(TypeTested.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SpecimenDefinition()); + var instance = new SpecimenDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/StructureMap.cs b/src/Hl7.Fhir.R5/Model/Generated/StructureMap.cs index d389fa016f..eb57135a65 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/StructureMap.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/StructureMap.cs @@ -465,7 +465,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureComponent; @@ -474,17 +474,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.Canonical)UrlElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(AliasElement != null) dest.AliasElement = (Hl7.Fhir.Model.FhirString)AliasElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.Canonical)UrlElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(AliasElement != null) dest.AliasElement = (Hl7.Fhir.Model.FhirString)AliasElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureComponent()); + var instance = new StructureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -634,7 +635,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConstComponent; @@ -643,15 +644,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConstComponent()); + var instance = new ConstComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -878,7 +880,7 @@ public List Rule private List _Rule; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -887,19 +889,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(ExtendsElement != null) dest.ExtendsElement = (Hl7.Fhir.Model.Id)ExtendsElement.DeepCopy(); - if(TypeModeElement != null) dest.TypeModeElement = (Code)TypeModeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(ExtendsElement != null) dest.ExtendsElement = (Hl7.Fhir.Model.Id)ExtendsElement.DeepCopyInternal(); + if(TypeModeElement != null) dest.TypeModeElement = (Code)TypeModeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1132,7 +1135,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InputComponent; @@ -1141,17 +1144,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InputComponent()); + var instance = new InputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1354,7 +1358,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RuleComponent; @@ -1363,19 +1367,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - if(Dependent.Any()) dest.Dependent = new List(Dependent.DeepCopy()); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); + if(Dependent.Any()) dest.Dependent = new List(Dependent.DeepCopyInternal()); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RuleComponent()); + var instance = new RuleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1820,7 +1825,7 @@ public string LogMessage } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceComponent; @@ -1829,24 +1834,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopy(); - if(DefaultValueElement != null) dest.DefaultValueElement = (Hl7.Fhir.Model.FhirString)DefaultValueElement.DeepCopy(); - if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopy(); - if(ListModeElement != null) dest.ListModeElement = (Code)ListModeElement.DeepCopy(); - if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopy(); - if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopy(); - if(CheckElement != null) dest.CheckElement = (Hl7.Fhir.Model.FhirString)CheckElement.DeepCopy(); - if(LogMessageElement != null) dest.LogMessageElement = (Hl7.Fhir.Model.FhirString)LogMessageElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopyInternal(); + if(DefaultValueElement != null) dest.DefaultValueElement = (Hl7.Fhir.Model.FhirString)DefaultValueElement.DeepCopyInternal(); + if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopyInternal(); + if(ListModeElement != null) dest.ListModeElement = (Code)ListModeElement.DeepCopyInternal(); + if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopyInternal(); + if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopyInternal(); + if(CheckElement != null) dest.CheckElement = (Hl7.Fhir.Model.FhirString)CheckElement.DeepCopyInternal(); + if(LogMessageElement != null) dest.LogMessageElement = (Hl7.Fhir.Model.FhirString)LogMessageElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceComponent()); + var instance = new SourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2192,7 +2198,7 @@ public List Parameter private List _Parameter; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -2201,20 +2207,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.FhirString)ContextElement.DeepCopy(); - if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopy(); - if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopy(); - if(ListModeElement.Any()) dest.ListModeElement = new List>(ListModeElement.DeepCopy()); - if(ListRuleIdElement != null) dest.ListRuleIdElement = (Hl7.Fhir.Model.Id)ListRuleIdElement.DeepCopy(); - if(TransformElement != null) dest.TransformElement = (Code)TransformElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.FhirString)ContextElement.DeepCopyInternal(); + if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopyInternal(); + if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopyInternal(); + if(ListModeElement.Any()) dest.ListModeElement = new List>(ListModeElement.DeepCopyInternal()); + if(ListRuleIdElement != null) dest.ListRuleIdElement = (Hl7.Fhir.Model.Id)ListRuleIdElement.DeepCopyInternal(); + if(TransformElement != null) dest.TransformElement = (Code)TransformElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2339,7 +2346,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -2348,14 +2355,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2462,7 +2470,7 @@ public List Parameter private List _Parameter; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DependentComponent; @@ -2471,15 +2479,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DependentComponent()); + var instance = new DependentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3060,7 +3069,7 @@ public List Group List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureMap; @@ -3069,34 +3078,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(Structure.Any()) dest.Structure = new List(Structure.DeepCopy()); - if(ImportElement.Any()) dest.ImportElement = new List(ImportElement.DeepCopy()); - if(Const.Any()) dest.Const = new List(Const.DeepCopy()); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(Structure.Any()) dest.Structure = new List(Structure.DeepCopyInternal()); + if(ImportElement.Any()) dest.ImportElement = new List(ImportElement.DeepCopyInternal()); + if(Const.Any()) dest.Const = new List(Const.DeepCopyInternal()); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureMap()); + var instance = new StructureMap(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Subscription.cs b/src/Hl7.Fhir.R5/Model/Generated/Subscription.cs index 82e8dc238e..7a7853bac1 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Subscription.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Subscription.cs @@ -265,7 +265,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FilterByComponent; @@ -274,18 +274,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResourceTypeElement != null) dest.ResourceTypeElement = (Hl7.Fhir.Model.FhirUri)ResourceTypeElement.DeepCopy(); - if(FilterParameterElement != null) dest.FilterParameterElement = (Hl7.Fhir.Model.FhirString)FilterParameterElement.DeepCopy(); - if(ComparatorElement != null) dest.ComparatorElement = (Code)ComparatorElement.DeepCopy(); - if(ModifierElement != null) dest.ModifierElement = (Code)ModifierElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ResourceTypeElement != null) dest.ResourceTypeElement = (Hl7.Fhir.Model.FhirUri)ResourceTypeElement.DeepCopyInternal(); + if(FilterParameterElement != null) dest.FilterParameterElement = (Hl7.Fhir.Model.FhirString)FilterParameterElement.DeepCopyInternal(); + if(ComparatorElement != null) dest.ComparatorElement = (Code)ComparatorElement.DeepCopyInternal(); + if(ModifierElement != null) dest.ModifierElement = (Code)ModifierElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FilterByComponent()); + var instance = new FilterByComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -446,7 +447,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -455,15 +456,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -955,7 +957,7 @@ public int? MaxCount List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Subscription; @@ -964,30 +966,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(TopicElement != null) dest.TopicElement = (Hl7.Fhir.Model.Canonical)TopicElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(ManagingEntity != null) dest.ManagingEntity = (Hl7.Fhir.Model.ResourceReference)ManagingEntity.DeepCopy(); - if(ReasonElement != null) dest.ReasonElement = (Hl7.Fhir.Model.FhirString)ReasonElement.DeepCopy(); - if(FilterBy.Any()) dest.FilterBy = new List(FilterBy.DeepCopy()); - if(ChannelType != null) dest.ChannelType = (Hl7.Fhir.Model.Coding)ChannelType.DeepCopy(); - if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(HeartbeatPeriodElement != null) dest.HeartbeatPeriodElement = (Hl7.Fhir.Model.UnsignedInt)HeartbeatPeriodElement.DeepCopy(); - if(TimeoutElement != null) dest.TimeoutElement = (Hl7.Fhir.Model.UnsignedInt)TimeoutElement.DeepCopy(); - if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopy(); - if(ContentElement != null) dest.ContentElement = (Code)ContentElement.DeepCopy(); - if(MaxCountElement != null) dest.MaxCountElement = (Hl7.Fhir.Model.PositiveInt)MaxCountElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(TopicElement != null) dest.TopicElement = (Hl7.Fhir.Model.Canonical)TopicElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(ManagingEntity != null) dest.ManagingEntity = (Hl7.Fhir.Model.ResourceReference)ManagingEntity.DeepCopyInternal(); + if(ReasonElement != null) dest.ReasonElement = (Hl7.Fhir.Model.FhirString)ReasonElement.DeepCopyInternal(); + if(FilterBy.Any()) dest.FilterBy = new List(FilterBy.DeepCopyInternal()); + if(ChannelType != null) dest.ChannelType = (Hl7.Fhir.Model.Coding)ChannelType.DeepCopyInternal(); + if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(HeartbeatPeriodElement != null) dest.HeartbeatPeriodElement = (Hl7.Fhir.Model.UnsignedInt)HeartbeatPeriodElement.DeepCopyInternal(); + if(TimeoutElement != null) dest.TimeoutElement = (Hl7.Fhir.Model.UnsignedInt)TimeoutElement.DeepCopyInternal(); + if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopyInternal(); + if(ContentElement != null) dest.ContentElement = (Code)ContentElement.DeepCopyInternal(); + if(MaxCountElement != null) dest.MaxCountElement = (Hl7.Fhir.Model.PositiveInt)MaxCountElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Subscription()); + var instance = new Subscription(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/SubscriptionStatus.cs b/src/Hl7.Fhir.R5/Model/Generated/SubscriptionStatus.cs index 12209ffdf4..243d429dce 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/SubscriptionStatus.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/SubscriptionStatus.cs @@ -209,7 +209,7 @@ public List AdditionalContext private List _AdditionalContext; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotificationEventComponent; @@ -218,17 +218,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(EventNumberElement != null) dest.EventNumberElement = (Hl7.Fhir.Model.Integer64)EventNumberElement.DeepCopy(); - if(TimestampElement != null) dest.TimestampElement = (Hl7.Fhir.Model.Instant)TimestampElement.DeepCopy(); - if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopy(); - if(AdditionalContext.Any()) dest.AdditionalContext = new List(AdditionalContext.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(EventNumberElement != null) dest.EventNumberElement = (Hl7.Fhir.Model.Integer64)EventNumberElement.DeepCopyInternal(); + if(TimestampElement != null) dest.TimestampElement = (Hl7.Fhir.Model.Instant)TimestampElement.DeepCopyInternal(); + if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopyInternal(); + if(AdditionalContext.Any()) dest.AdditionalContext = new List(AdditionalContext.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotificationEventComponent()); + var instance = new NotificationEventComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -474,7 +475,7 @@ public List Error private List _Error; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubscriptionStatus; @@ -483,20 +484,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(EventsSinceSubscriptionStartElement != null) dest.EventsSinceSubscriptionStartElement = (Hl7.Fhir.Model.Integer64)EventsSinceSubscriptionStartElement.DeepCopy(); - if(NotificationEvent.Any()) dest.NotificationEvent = new List(NotificationEvent.DeepCopy()); - if(Subscription != null) dest.Subscription = (Hl7.Fhir.Model.ResourceReference)Subscription.DeepCopy(); - if(TopicElement != null) dest.TopicElement = (Hl7.Fhir.Model.Canonical)TopicElement.DeepCopy(); - if(Error.Any()) dest.Error = new List(Error.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(EventsSinceSubscriptionStartElement != null) dest.EventsSinceSubscriptionStartElement = (Hl7.Fhir.Model.Integer64)EventsSinceSubscriptionStartElement.DeepCopyInternal(); + if(NotificationEvent.Any()) dest.NotificationEvent = new List(NotificationEvent.DeepCopyInternal()); + if(Subscription != null) dest.Subscription = (Hl7.Fhir.Model.ResourceReference)Subscription.DeepCopyInternal(); + if(TopicElement != null) dest.TopicElement = (Hl7.Fhir.Model.Canonical)TopicElement.DeepCopyInternal(); + if(Error.Any()) dest.Error = new List(Error.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubscriptionStatus()); + var instance = new SubscriptionStatus(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/SubscriptionTopic.cs b/src/Hl7.Fhir.R5/Model/Generated/SubscriptionTopic.cs index a295d4a618..ff2e723a6f 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/SubscriptionTopic.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/SubscriptionTopic.cs @@ -267,7 +267,7 @@ public string FhirPathCriteria } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceTriggerComponent; @@ -276,18 +276,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopy(); - if(SupportedInteractionElement.Any()) dest.SupportedInteractionElement = new List>(SupportedInteractionElement.DeepCopy()); - if(QueryCriteria != null) dest.QueryCriteria = (Hl7.Fhir.Model.SubscriptionTopic.QueryCriteriaComponent)QueryCriteria.DeepCopy(); - if(FhirPathCriteriaElement != null) dest.FhirPathCriteriaElement = (Hl7.Fhir.Model.FhirString)FhirPathCriteriaElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopyInternal(); + if(SupportedInteractionElement.Any()) dest.SupportedInteractionElement = new List>(SupportedInteractionElement.DeepCopyInternal()); + if(QueryCriteria != null) dest.QueryCriteria = (Hl7.Fhir.Model.SubscriptionTopic.QueryCriteriaComponent)QueryCriteria.DeepCopyInternal(); + if(FhirPathCriteriaElement != null) dest.FhirPathCriteriaElement = (Hl7.Fhir.Model.FhirString)FhirPathCriteriaElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceTriggerComponent()); + var instance = new ResourceTriggerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -542,7 +543,7 @@ public bool? RequireBoth } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QueryCriteriaComponent; @@ -551,18 +552,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PreviousElement != null) dest.PreviousElement = (Hl7.Fhir.Model.FhirString)PreviousElement.DeepCopy(); - if(ResultForCreateElement != null) dest.ResultForCreateElement = (Code)ResultForCreateElement.DeepCopy(); - if(CurrentElement != null) dest.CurrentElement = (Hl7.Fhir.Model.FhirString)CurrentElement.DeepCopy(); - if(ResultForDeleteElement != null) dest.ResultForDeleteElement = (Code)ResultForDeleteElement.DeepCopy(); - if(RequireBothElement != null) dest.RequireBothElement = (Hl7.Fhir.Model.FhirBoolean)RequireBothElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PreviousElement != null) dest.PreviousElement = (Hl7.Fhir.Model.FhirString)PreviousElement.DeepCopyInternal(); + if(ResultForCreateElement != null) dest.ResultForCreateElement = (Code)ResultForCreateElement.DeepCopyInternal(); + if(CurrentElement != null) dest.CurrentElement = (Hl7.Fhir.Model.FhirString)CurrentElement.DeepCopyInternal(); + if(ResultForDeleteElement != null) dest.ResultForDeleteElement = (Code)ResultForDeleteElement.DeepCopyInternal(); + if(RequireBothElement != null) dest.RequireBothElement = (Hl7.Fhir.Model.FhirBoolean)RequireBothElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QueryCriteriaComponent()); + var instance = new QueryCriteriaComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -737,7 +739,7 @@ public string Resource } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventTriggerComponent; @@ -746,16 +748,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Event != null) dest.Event = (Hl7.Fhir.Model.CodeableConcept)Event.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Event != null) dest.Event = (Hl7.Fhir.Model.CodeableConcept)Event.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventTriggerComponent()); + var instance = new EventTriggerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1029,7 +1032,7 @@ public IEnumerable Modifier } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CanFilterByComponent; @@ -1038,19 +1041,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopy(); - if(FilterParameterElement != null) dest.FilterParameterElement = (Hl7.Fhir.Model.FhirString)FilterParameterElement.DeepCopy(); - if(FilterDefinitionElement != null) dest.FilterDefinitionElement = (Hl7.Fhir.Model.FhirUri)FilterDefinitionElement.DeepCopy(); - if(ComparatorElement.Any()) dest.ComparatorElement = new List>(ComparatorElement.DeepCopy()); - if(ModifierElement.Any()) dest.ModifierElement = new List>(ModifierElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopyInternal(); + if(FilterParameterElement != null) dest.FilterParameterElement = (Hl7.Fhir.Model.FhirString)FilterParameterElement.DeepCopyInternal(); + if(FilterDefinitionElement != null) dest.FilterDefinitionElement = (Hl7.Fhir.Model.FhirUri)FilterDefinitionElement.DeepCopyInternal(); + if(ComparatorElement.Any()) dest.ComparatorElement = new List>(ComparatorElement.DeepCopyInternal()); + if(ModifierElement.Any()) dest.ModifierElement = new List>(ModifierElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CanFilterByComponent()); + var instance = new CanFilterByComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1251,7 +1255,7 @@ public IEnumerable RevInclude } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotificationShapeComponent; @@ -1260,16 +1264,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopy(); - if(IncludeElement.Any()) dest.IncludeElement = new List(IncludeElement.DeepCopy()); - if(RevIncludeElement.Any()) dest.RevIncludeElement = new List(RevIncludeElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopyInternal(); + if(IncludeElement.Any()) dest.IncludeElement = new List(IncludeElement.DeepCopyInternal()); + if(RevIncludeElement.Any()) dest.RevIncludeElement = new List(RevIncludeElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotificationShapeComponent()); + var instance = new NotificationShapeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1946,7 +1951,7 @@ public List Notific List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubscriptionTopic; @@ -1955,38 +1960,39 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(ResourceTrigger.Any()) dest.ResourceTrigger = new List(ResourceTrigger.DeepCopy()); - if(EventTrigger.Any()) dest.EventTrigger = new List(EventTrigger.DeepCopy()); - if(CanFilterBy.Any()) dest.CanFilterBy = new List(CanFilterBy.DeepCopy()); - if(NotificationShape.Any()) dest.NotificationShape = new List(NotificationShape.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DerivedFromElement.Any()) dest.DerivedFromElement = new List(DerivedFromElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(ResourceTrigger.Any()) dest.ResourceTrigger = new List(ResourceTrigger.DeepCopyInternal()); + if(EventTrigger.Any()) dest.EventTrigger = new List(EventTrigger.DeepCopyInternal()); + if(CanFilterBy.Any()) dest.CanFilterBy = new List(CanFilterBy.DeepCopyInternal()); + if(NotificationShape.Any()) dest.NotificationShape = new List(NotificationShape.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubscriptionTopic()); + var instance = new SubscriptionTopic(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Substance.cs b/src/Hl7.Fhir.R5/Model/Generated/Substance.cs index 7ef051fc68..c92b924ce3 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Substance.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Substance.cs @@ -131,7 +131,7 @@ public Hl7.Fhir.Model.DataType Substance private Hl7.Fhir.Model.DataType _Substance; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientComponent; @@ -140,15 +140,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Ratio)Quantity.DeepCopy(); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.DataType)Substance.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Ratio)Quantity.DeepCopyInternal(); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.DataType)Substance.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientComponent()); + var instance = new IngredientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -404,7 +405,7 @@ public List Ingredient List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Substance; @@ -413,22 +414,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstanceElement != null) dest.InstanceElement = (Hl7.Fhir.Model.FhirBoolean)InstanceElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableReference)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstanceElement != null) dest.InstanceElement = (Hl7.Fhir.Model.FhirBoolean)InstanceElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableReference)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Substance()); + var instance = new Substance(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/SubstanceDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/SubstanceDefinition.cs index c6fe69e86e..25ece50b6a 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/SubstanceDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/SubstanceDefinition.cs @@ -214,7 +214,7 @@ public Hl7.Fhir.Model.CodeableConcept MeasurementType private Hl7.Fhir.Model.CodeableConcept _MeasurementType; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MoietyComponent; @@ -223,21 +223,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Stereochemistry != null) dest.Stereochemistry = (Hl7.Fhir.Model.CodeableConcept)Stereochemistry.DeepCopy(); - if(OpticalActivity != null) dest.OpticalActivity = (Hl7.Fhir.Model.CodeableConcept)OpticalActivity.DeepCopy(); - if(MolecularFormulaElement != null) dest.MolecularFormulaElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopy(); - if(MeasurementType != null) dest.MeasurementType = (Hl7.Fhir.Model.CodeableConcept)MeasurementType.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Stereochemistry != null) dest.Stereochemistry = (Hl7.Fhir.Model.CodeableConcept)Stereochemistry.DeepCopyInternal(); + if(OpticalActivity != null) dest.OpticalActivity = (Hl7.Fhir.Model.CodeableConcept)OpticalActivity.DeepCopyInternal(); + if(MolecularFormulaElement != null) dest.MolecularFormulaElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopyInternal(); + if(MeasurementType != null) dest.MeasurementType = (Hl7.Fhir.Model.CodeableConcept)MeasurementType.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MoietyComponent()); + var instance = new MoietyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -427,7 +428,7 @@ public List File private List _File; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacterizationComponent; @@ -436,17 +437,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Technique != null) dest.Technique = (Hl7.Fhir.Model.CodeableConcept)Technique.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(File.Any()) dest.File = new List(File.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Technique != null) dest.Technique = (Hl7.Fhir.Model.CodeableConcept)Technique.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(File.Any()) dest.File = new List(File.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacterizationComponent()); + var instance = new CharacterizationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -561,7 +563,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -570,15 +572,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -692,7 +695,7 @@ public Hl7.Fhir.Model.Quantity Amount private Hl7.Fhir.Model.Quantity _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MolecularWeightComponent; @@ -701,16 +704,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MolecularWeightComponent()); + var instance = new MolecularWeightComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -935,7 +939,7 @@ public List Represen private List _Representation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureComponent; @@ -944,21 +948,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Stereochemistry != null) dest.Stereochemistry = (Hl7.Fhir.Model.CodeableConcept)Stereochemistry.DeepCopy(); - if(OpticalActivity != null) dest.OpticalActivity = (Hl7.Fhir.Model.CodeableConcept)OpticalActivity.DeepCopy(); - if(MolecularFormulaElement != null) dest.MolecularFormulaElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaElement.DeepCopy(); - if(MolecularFormulaByMoietyElement != null) dest.MolecularFormulaByMoietyElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaByMoietyElement.DeepCopy(); - if(MolecularWeight != null) dest.MolecularWeight = (Hl7.Fhir.Model.SubstanceDefinition.MolecularWeightComponent)MolecularWeight.DeepCopy(); - if(Technique.Any()) dest.Technique = new List(Technique.DeepCopy()); - if(SourceDocument.Any()) dest.SourceDocument = new List(SourceDocument.DeepCopy()); - if(Representation.Any()) dest.Representation = new List(Representation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Stereochemistry != null) dest.Stereochemistry = (Hl7.Fhir.Model.CodeableConcept)Stereochemistry.DeepCopyInternal(); + if(OpticalActivity != null) dest.OpticalActivity = (Hl7.Fhir.Model.CodeableConcept)OpticalActivity.DeepCopyInternal(); + if(MolecularFormulaElement != null) dest.MolecularFormulaElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaElement.DeepCopyInternal(); + if(MolecularFormulaByMoietyElement != null) dest.MolecularFormulaByMoietyElement = (Hl7.Fhir.Model.FhirString)MolecularFormulaByMoietyElement.DeepCopyInternal(); + if(MolecularWeight != null) dest.MolecularWeight = (Hl7.Fhir.Model.SubstanceDefinition.MolecularWeightComponent)MolecularWeight.DeepCopyInternal(); + if(Technique.Any()) dest.Technique = new List(Technique.DeepCopyInternal()); + if(SourceDocument.Any()) dest.SourceDocument = new List(SourceDocument.DeepCopyInternal()); + if(Representation.Any()) dest.Representation = new List(Representation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureComponent()); + var instance = new StructureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1149,7 +1154,7 @@ public Hl7.Fhir.Model.ResourceReference Document private Hl7.Fhir.Model.ResourceReference _Document; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepresentationComponent; @@ -1158,17 +1163,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(RepresentationElement != null) dest.RepresentationElement = (Hl7.Fhir.Model.FhirString)RepresentationElement.DeepCopy(); - if(Format != null) dest.Format = (Hl7.Fhir.Model.CodeableConcept)Format.DeepCopy(); - if(Document != null) dest.Document = (Hl7.Fhir.Model.ResourceReference)Document.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(RepresentationElement != null) dest.RepresentationElement = (Hl7.Fhir.Model.FhirString)RepresentationElement.DeepCopyInternal(); + if(Format != null) dest.Format = (Hl7.Fhir.Model.CodeableConcept)Format.DeepCopyInternal(); + if(Document != null) dest.Document = (Hl7.Fhir.Model.ResourceReference)Document.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepresentationComponent()); + var instance = new RepresentationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1341,7 +1347,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeComponent; @@ -1350,18 +1356,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CodeComponent()); + var instance = new CodeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1648,7 +1655,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NameComponent; @@ -1657,24 +1664,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - if(Language.Any()) dest.Language = new List(Language.DeepCopy()); - if(Domain.Any()) dest.Domain = new List(Domain.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(Synonym.Any()) dest.Synonym = new List(Synonym.DeepCopy()); - if(Translation.Any()) dest.Translation = new List(Translation.DeepCopy()); - if(Official.Any()) dest.Official = new List(Official.DeepCopy()); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); + if(Language.Any()) dest.Language = new List(Language.DeepCopyInternal()); + if(Domain.Any()) dest.Domain = new List(Domain.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(Synonym.Any()) dest.Synonym = new List(Synonym.DeepCopyInternal()); + if(Translation.Any()) dest.Translation = new List(Translation.DeepCopyInternal()); + if(Official.Any()) dest.Official = new List(Official.DeepCopyInternal()); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NameComponent()); + var instance = new NameComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1874,7 +1882,7 @@ public string Date } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OfficialComponent; @@ -1883,16 +1891,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Authority != null) dest.Authority = (Hl7.Fhir.Model.CodeableConcept)Authority.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.CodeableConcept)Authority.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OfficialComponent()); + var instance = new OfficialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2092,7 +2101,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelationshipComponent; @@ -2101,20 +2110,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SubstanceDefinition != null) dest.SubstanceDefinition = (Hl7.Fhir.Model.DataType)SubstanceDefinition.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(IsDefiningElement != null) dest.IsDefiningElement = (Hl7.Fhir.Model.FhirBoolean)IsDefiningElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopy(); - if(RatioHighLimitAmount != null) dest.RatioHighLimitAmount = (Hl7.Fhir.Model.Ratio)RatioHighLimitAmount.DeepCopy(); - if(Comparator != null) dest.Comparator = (Hl7.Fhir.Model.CodeableConcept)Comparator.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SubstanceDefinition != null) dest.SubstanceDefinition = (Hl7.Fhir.Model.DataType)SubstanceDefinition.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(IsDefiningElement != null) dest.IsDefiningElement = (Hl7.Fhir.Model.FhirBoolean)IsDefiningElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopyInternal(); + if(RatioHighLimitAmount != null) dest.RatioHighLimitAmount = (Hl7.Fhir.Model.Ratio)RatioHighLimitAmount.DeepCopyInternal(); + if(Comparator != null) dest.Comparator = (Hl7.Fhir.Model.CodeableConcept)Comparator.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelationshipComponent()); + var instance = new RelationshipComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2297,7 +2307,7 @@ public List CountryOfOrigin private List _CountryOfOrigin; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceMaterialComponent; @@ -2306,18 +2316,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Genus != null) dest.Genus = (Hl7.Fhir.Model.CodeableConcept)Genus.DeepCopy(); - if(Species != null) dest.Species = (Hl7.Fhir.Model.CodeableConcept)Species.DeepCopy(); - if(Part != null) dest.Part = (Hl7.Fhir.Model.CodeableConcept)Part.DeepCopy(); - if(CountryOfOrigin.Any()) dest.CountryOfOrigin = new List(CountryOfOrigin.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Genus != null) dest.Genus = (Hl7.Fhir.Model.CodeableConcept)Genus.DeepCopyInternal(); + if(Species != null) dest.Species = (Hl7.Fhir.Model.CodeableConcept)Species.DeepCopyInternal(); + if(Part != null) dest.Part = (Hl7.Fhir.Model.CodeableConcept)Part.DeepCopyInternal(); + if(CountryOfOrigin.Any()) dest.CountryOfOrigin = new List(CountryOfOrigin.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceMaterialComponent()); + var instance = new SourceMaterialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2778,7 +2789,7 @@ public Hl7.Fhir.Model.SubstanceDefinition.SourceMaterialComponent SourceMaterial List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceDefinition; @@ -2787,37 +2798,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopy(); - if(Classification.Any()) dest.Classification = new List(Classification.DeepCopy()); - if(Domain != null) dest.Domain = (Hl7.Fhir.Model.CodeableConcept)Domain.DeepCopy(); - if(Grade.Any()) dest.Grade = new List(Grade.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(InformationSource.Any()) dest.InformationSource = new List(InformationSource.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopy()); - if(Supplier.Any()) dest.Supplier = new List(Supplier.DeepCopy()); - if(Moiety.Any()) dest.Moiety = new List(Moiety.DeepCopy()); - if(Characterization.Any()) dest.Characterization = new List(Characterization.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(ReferenceInformation != null) dest.ReferenceInformation = (Hl7.Fhir.Model.ResourceReference)ReferenceInformation.DeepCopy(); - if(MolecularWeight.Any()) dest.MolecularWeight = new List(MolecularWeight.DeepCopy()); - if(Structure != null) dest.Structure = (Hl7.Fhir.Model.SubstanceDefinition.StructureComponent)Structure.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopy()); - if(NucleicAcid != null) dest.NucleicAcid = (Hl7.Fhir.Model.ResourceReference)NucleicAcid.DeepCopy(); - if(Polymer != null) dest.Polymer = (Hl7.Fhir.Model.ResourceReference)Polymer.DeepCopy(); - if(Protein != null) dest.Protein = (Hl7.Fhir.Model.ResourceReference)Protein.DeepCopy(); - if(SourceMaterial != null) dest.SourceMaterial = (Hl7.Fhir.Model.SubstanceDefinition.SourceMaterialComponent)SourceMaterial.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(Status != null) dest.Status = (Hl7.Fhir.Model.CodeableConcept)Status.DeepCopyInternal(); + if(Classification.Any()) dest.Classification = new List(Classification.DeepCopyInternal()); + if(Domain != null) dest.Domain = (Hl7.Fhir.Model.CodeableConcept)Domain.DeepCopyInternal(); + if(Grade.Any()) dest.Grade = new List(Grade.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(InformationSource.Any()) dest.InformationSource = new List(InformationSource.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Manufacturer.Any()) dest.Manufacturer = new List(Manufacturer.DeepCopyInternal()); + if(Supplier.Any()) dest.Supplier = new List(Supplier.DeepCopyInternal()); + if(Moiety.Any()) dest.Moiety = new List(Moiety.DeepCopyInternal()); + if(Characterization.Any()) dest.Characterization = new List(Characterization.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(ReferenceInformation != null) dest.ReferenceInformation = (Hl7.Fhir.Model.ResourceReference)ReferenceInformation.DeepCopyInternal(); + if(MolecularWeight.Any()) dest.MolecularWeight = new List(MolecularWeight.DeepCopyInternal()); + if(Structure != null) dest.Structure = (Hl7.Fhir.Model.SubstanceDefinition.StructureComponent)Structure.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopyInternal()); + if(NucleicAcid != null) dest.NucleicAcid = (Hl7.Fhir.Model.ResourceReference)NucleicAcid.DeepCopyInternal(); + if(Polymer != null) dest.Polymer = (Hl7.Fhir.Model.ResourceReference)Polymer.DeepCopyInternal(); + if(Protein != null) dest.Protein = (Hl7.Fhir.Model.ResourceReference)Protein.DeepCopyInternal(); + if(SourceMaterial != null) dest.SourceMaterial = (Hl7.Fhir.Model.SubstanceDefinition.SourceMaterialComponent)SourceMaterial.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceDefinition()); + var instance = new SubstanceDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/SubstanceNucleicAcid.cs b/src/Hl7.Fhir.R5/Model/Generated/SubstanceNucleicAcid.cs index ec555681ce..e184dd78d0 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/SubstanceNucleicAcid.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/SubstanceNucleicAcid.cs @@ -229,7 +229,7 @@ public List Sugar private List _Sugar; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubunitComponent; @@ -238,21 +238,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SubunitElement != null) dest.SubunitElement = (Hl7.Fhir.Model.Integer)SubunitElement.DeepCopy(); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.FhirString)SequenceElement.DeepCopy(); - if(LengthElement != null) dest.LengthElement = (Hl7.Fhir.Model.Integer)LengthElement.DeepCopy(); - if(SequenceAttachment != null) dest.SequenceAttachment = (Hl7.Fhir.Model.Attachment)SequenceAttachment.DeepCopy(); - if(FivePrime != null) dest.FivePrime = (Hl7.Fhir.Model.CodeableConcept)FivePrime.DeepCopy(); - if(ThreePrime != null) dest.ThreePrime = (Hl7.Fhir.Model.CodeableConcept)ThreePrime.DeepCopy(); - if(Linkage.Any()) dest.Linkage = new List(Linkage.DeepCopy()); - if(Sugar.Any()) dest.Sugar = new List(Sugar.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SubunitElement != null) dest.SubunitElement = (Hl7.Fhir.Model.Integer)SubunitElement.DeepCopyInternal(); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.FhirString)SequenceElement.DeepCopyInternal(); + if(LengthElement != null) dest.LengthElement = (Hl7.Fhir.Model.Integer)LengthElement.DeepCopyInternal(); + if(SequenceAttachment != null) dest.SequenceAttachment = (Hl7.Fhir.Model.Attachment)SequenceAttachment.DeepCopyInternal(); + if(FivePrime != null) dest.FivePrime = (Hl7.Fhir.Model.CodeableConcept)FivePrime.DeepCopyInternal(); + if(ThreePrime != null) dest.ThreePrime = (Hl7.Fhir.Model.CodeableConcept)ThreePrime.DeepCopyInternal(); + if(Linkage.Any()) dest.Linkage = new List(Linkage.DeepCopyInternal()); + if(Sugar.Any()) dest.Sugar = new List(Sugar.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubunitComponent()); + var instance = new SubunitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -475,7 +476,7 @@ public string ResidueSite } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkageComponent; @@ -484,17 +485,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ConnectivityElement != null) dest.ConnectivityElement = (Hl7.Fhir.Model.FhirString)ConnectivityElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(ResidueSiteElement != null) dest.ResidueSiteElement = (Hl7.Fhir.Model.FhirString)ResidueSiteElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ConnectivityElement != null) dest.ConnectivityElement = (Hl7.Fhir.Model.FhirString)ConnectivityElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(ResidueSiteElement != null) dest.ResidueSiteElement = (Hl7.Fhir.Model.FhirString)ResidueSiteElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkageComponent()); + var instance = new LinkageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -654,7 +656,7 @@ public string ResidueSite } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SugarComponent; @@ -663,16 +665,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(ResidueSiteElement != null) dest.ResidueSiteElement = (Hl7.Fhir.Model.FhirString)ResidueSiteElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(ResidueSiteElement != null) dest.ResidueSiteElement = (Hl7.Fhir.Model.FhirString)ResidueSiteElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SugarComponent()); + var instance = new SugarComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -838,7 +841,7 @@ public List Subunit private List _Subunit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceNucleicAcid; @@ -847,18 +850,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceType != null) dest.SequenceType = (Hl7.Fhir.Model.CodeableConcept)SequenceType.DeepCopy(); - if(NumberOfSubunitsElement != null) dest.NumberOfSubunitsElement = (Hl7.Fhir.Model.Integer)NumberOfSubunitsElement.DeepCopy(); - if(AreaOfHybridisationElement != null) dest.AreaOfHybridisationElement = (Hl7.Fhir.Model.FhirString)AreaOfHybridisationElement.DeepCopy(); - if(OligoNucleotideType != null) dest.OligoNucleotideType = (Hl7.Fhir.Model.CodeableConcept)OligoNucleotideType.DeepCopy(); - if(Subunit.Any()) dest.Subunit = new List(Subunit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceType != null) dest.SequenceType = (Hl7.Fhir.Model.CodeableConcept)SequenceType.DeepCopyInternal(); + if(NumberOfSubunitsElement != null) dest.NumberOfSubunitsElement = (Hl7.Fhir.Model.Integer)NumberOfSubunitsElement.DeepCopyInternal(); + if(AreaOfHybridisationElement != null) dest.AreaOfHybridisationElement = (Hl7.Fhir.Model.FhirString)AreaOfHybridisationElement.DeepCopyInternal(); + if(OligoNucleotideType != null) dest.OligoNucleotideType = (Hl7.Fhir.Model.CodeableConcept)OligoNucleotideType.DeepCopyInternal(); + if(Subunit.Any()) dest.Subunit = new List(Subunit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceNucleicAcid()); + var instance = new SubstanceNucleicAcid(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/SubstancePolymer.cs b/src/Hl7.Fhir.R5/Model/Generated/SubstancePolymer.cs index 21e9229f79..99db66b9b7 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/SubstancePolymer.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/SubstancePolymer.cs @@ -96,7 +96,7 @@ public List StartingM private List _StartingMaterial; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MonomerSetComponent; @@ -105,15 +105,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RatioType != null) dest.RatioType = (Hl7.Fhir.Model.CodeableConcept)RatioType.DeepCopy(); - if(StartingMaterial.Any()) dest.StartingMaterial = new List(StartingMaterial.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RatioType != null) dest.RatioType = (Hl7.Fhir.Model.CodeableConcept)RatioType.DeepCopyInternal(); + if(StartingMaterial.Any()) dest.StartingMaterial = new List(StartingMaterial.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MonomerSetComponent()); + var instance = new MonomerSetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -252,7 +253,7 @@ public Hl7.Fhir.Model.Quantity Amount private Hl7.Fhir.Model.Quantity _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StartingMaterialComponent; @@ -261,17 +262,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(IsDefiningElement != null) dest.IsDefiningElement = (Hl7.Fhir.Model.FhirBoolean)IsDefiningElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(IsDefiningElement != null) dest.IsDefiningElement = (Hl7.Fhir.Model.FhirBoolean)IsDefiningElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StartingMaterialComponent()); + var instance = new StartingMaterialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -414,7 +416,7 @@ public List RepeatUnit private List _RepeatUnit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepeatComponent; @@ -423,16 +425,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AverageMolecularFormulaElement != null) dest.AverageMolecularFormulaElement = (Hl7.Fhir.Model.FhirString)AverageMolecularFormulaElement.DeepCopy(); - if(RepeatUnitAmountType != null) dest.RepeatUnitAmountType = (Hl7.Fhir.Model.CodeableConcept)RepeatUnitAmountType.DeepCopy(); - if(RepeatUnit.Any()) dest.RepeatUnit = new List(RepeatUnit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(AverageMolecularFormulaElement != null) dest.AverageMolecularFormulaElement = (Hl7.Fhir.Model.FhirString)AverageMolecularFormulaElement.DeepCopyInternal(); + if(RepeatUnitAmountType != null) dest.RepeatUnitAmountType = (Hl7.Fhir.Model.CodeableConcept)RepeatUnitAmountType.DeepCopyInternal(); + if(RepeatUnit.Any()) dest.RepeatUnit = new List(RepeatUnit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepeatComponent()); + var instance = new RepeatComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -612,7 +615,7 @@ public List S private List _StructuralRepresentation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepeatUnitComponent; @@ -621,18 +624,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UnitElement != null) dest.UnitElement = (Hl7.Fhir.Model.FhirString)UnitElement.DeepCopy(); - if(Orientation != null) dest.Orientation = (Hl7.Fhir.Model.CodeableConcept)Orientation.DeepCopy(); - if(AmountElement != null) dest.AmountElement = (Hl7.Fhir.Model.Integer)AmountElement.DeepCopy(); - if(DegreeOfPolymerisation.Any()) dest.DegreeOfPolymerisation = new List(DegreeOfPolymerisation.DeepCopy()); - if(StructuralRepresentation.Any()) dest.StructuralRepresentation = new List(StructuralRepresentation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UnitElement != null) dest.UnitElement = (Hl7.Fhir.Model.FhirString)UnitElement.DeepCopyInternal(); + if(Orientation != null) dest.Orientation = (Hl7.Fhir.Model.CodeableConcept)Orientation.DeepCopyInternal(); + if(AmountElement != null) dest.AmountElement = (Hl7.Fhir.Model.Integer)AmountElement.DeepCopyInternal(); + if(DegreeOfPolymerisation.Any()) dest.DegreeOfPolymerisation = new List(DegreeOfPolymerisation.DeepCopyInternal()); + if(StructuralRepresentation.Any()) dest.StructuralRepresentation = new List(StructuralRepresentation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepeatUnitComponent()); + var instance = new RepeatUnitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -831,7 +835,7 @@ public int? High } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DegreeOfPolymerisationComponent; @@ -840,17 +844,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(AverageElement != null) dest.AverageElement = (Hl7.Fhir.Model.Integer)AverageElement.DeepCopy(); - if(LowElement != null) dest.LowElement = (Hl7.Fhir.Model.Integer)LowElement.DeepCopy(); - if(HighElement != null) dest.HighElement = (Hl7.Fhir.Model.Integer)HighElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(AverageElement != null) dest.AverageElement = (Hl7.Fhir.Model.Integer)AverageElement.DeepCopyInternal(); + if(LowElement != null) dest.LowElement = (Hl7.Fhir.Model.Integer)LowElement.DeepCopyInternal(); + if(HighElement != null) dest.HighElement = (Hl7.Fhir.Model.Integer)HighElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DegreeOfPolymerisationComponent()); + var instance = new DegreeOfPolymerisationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1005,7 +1010,7 @@ public Hl7.Fhir.Model.Attachment Attachment private Hl7.Fhir.Model.Attachment _Attachment; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructuralRepresentationComponent; @@ -1014,17 +1019,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(RepresentationElement != null) dest.RepresentationElement = (Hl7.Fhir.Model.FhirString)RepresentationElement.DeepCopy(); - if(Format != null) dest.Format = (Hl7.Fhir.Model.CodeableConcept)Format.DeepCopy(); - if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(RepresentationElement != null) dest.RepresentationElement = (Hl7.Fhir.Model.FhirString)RepresentationElement.DeepCopyInternal(); + if(Format != null) dest.Format = (Hl7.Fhir.Model.CodeableConcept)Format.DeepCopyInternal(); + if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructuralRepresentationComponent()); + var instance = new StructuralRepresentationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1210,7 +1216,7 @@ public List Repeat Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstancePolymer; @@ -1219,20 +1225,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy(); - if(Geometry != null) dest.Geometry = (Hl7.Fhir.Model.CodeableConcept)Geometry.DeepCopy(); - if(CopolymerConnectivity.Any()) dest.CopolymerConnectivity = new List(CopolymerConnectivity.DeepCopy()); - if(ModificationElement != null) dest.ModificationElement = (Hl7.Fhir.Model.FhirString)ModificationElement.DeepCopy(); - if(MonomerSet.Any()) dest.MonomerSet = new List(MonomerSet.DeepCopy()); - if(Repeat.Any()) dest.Repeat = new List(Repeat.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopyInternal(); + if(Geometry != null) dest.Geometry = (Hl7.Fhir.Model.CodeableConcept)Geometry.DeepCopyInternal(); + if(CopolymerConnectivity.Any()) dest.CopolymerConnectivity = new List(CopolymerConnectivity.DeepCopyInternal()); + if(ModificationElement != null) dest.ModificationElement = (Hl7.Fhir.Model.FhirString)ModificationElement.DeepCopyInternal(); + if(MonomerSet.Any()) dest.MonomerSet = new List(MonomerSet.DeepCopyInternal()); + if(Repeat.Any()) dest.Repeat = new List(Repeat.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstancePolymer()); + var instance = new SubstancePolymer(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/SubstanceProtein.cs b/src/Hl7.Fhir.R5/Model/Generated/SubstanceProtein.cs index 09177b353f..c59ff8e463 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/SubstanceProtein.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/SubstanceProtein.cs @@ -263,7 +263,7 @@ public string CTerminalModification } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubunitComponent; @@ -272,21 +272,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SubunitElement != null) dest.SubunitElement = (Hl7.Fhir.Model.Integer)SubunitElement.DeepCopy(); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.FhirString)SequenceElement.DeepCopy(); - if(LengthElement != null) dest.LengthElement = (Hl7.Fhir.Model.Integer)LengthElement.DeepCopy(); - if(SequenceAttachment != null) dest.SequenceAttachment = (Hl7.Fhir.Model.Attachment)SequenceAttachment.DeepCopy(); - if(NTerminalModificationId != null) dest.NTerminalModificationId = (Hl7.Fhir.Model.Identifier)NTerminalModificationId.DeepCopy(); - if(NTerminalModificationElement != null) dest.NTerminalModificationElement = (Hl7.Fhir.Model.FhirString)NTerminalModificationElement.DeepCopy(); - if(CTerminalModificationId != null) dest.CTerminalModificationId = (Hl7.Fhir.Model.Identifier)CTerminalModificationId.DeepCopy(); - if(CTerminalModificationElement != null) dest.CTerminalModificationElement = (Hl7.Fhir.Model.FhirString)CTerminalModificationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SubunitElement != null) dest.SubunitElement = (Hl7.Fhir.Model.Integer)SubunitElement.DeepCopyInternal(); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.FhirString)SequenceElement.DeepCopyInternal(); + if(LengthElement != null) dest.LengthElement = (Hl7.Fhir.Model.Integer)LengthElement.DeepCopyInternal(); + if(SequenceAttachment != null) dest.SequenceAttachment = (Hl7.Fhir.Model.Attachment)SequenceAttachment.DeepCopyInternal(); + if(NTerminalModificationId != null) dest.NTerminalModificationId = (Hl7.Fhir.Model.Identifier)NTerminalModificationId.DeepCopyInternal(); + if(NTerminalModificationElement != null) dest.NTerminalModificationElement = (Hl7.Fhir.Model.FhirString)NTerminalModificationElement.DeepCopyInternal(); + if(CTerminalModificationId != null) dest.CTerminalModificationId = (Hl7.Fhir.Model.Identifier)CTerminalModificationId.DeepCopyInternal(); + if(CTerminalModificationElement != null) dest.CTerminalModificationElement = (Hl7.Fhir.Model.FhirString)CTerminalModificationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubunitComponent()); + var instance = new SubunitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -480,7 +481,7 @@ public List Subunit private List _Subunit; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceProtein; @@ -489,17 +490,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceType != null) dest.SequenceType = (Hl7.Fhir.Model.CodeableConcept)SequenceType.DeepCopy(); - if(NumberOfSubunitsElement != null) dest.NumberOfSubunitsElement = (Hl7.Fhir.Model.Integer)NumberOfSubunitsElement.DeepCopy(); - if(DisulfideLinkageElement.Any()) dest.DisulfideLinkageElement = new List(DisulfideLinkageElement.DeepCopy()); - if(Subunit.Any()) dest.Subunit = new List(Subunit.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceType != null) dest.SequenceType = (Hl7.Fhir.Model.CodeableConcept)SequenceType.DeepCopyInternal(); + if(NumberOfSubunitsElement != null) dest.NumberOfSubunitsElement = (Hl7.Fhir.Model.Integer)NumberOfSubunitsElement.DeepCopyInternal(); + if(DisulfideLinkageElement.Any()) dest.DisulfideLinkageElement = new List(DisulfideLinkageElement.DeepCopyInternal()); + if(Subunit.Any()) dest.Subunit = new List(Subunit.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceProtein()); + var instance = new SubstanceProtein(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/SubstanceReferenceInformation.cs b/src/Hl7.Fhir.R5/Model/Generated/SubstanceReferenceInformation.cs index 244216b2ff..031e75a50d 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/SubstanceReferenceInformation.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/SubstanceReferenceInformation.cs @@ -111,7 +111,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GeneComponent; @@ -120,16 +120,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(GeneSequenceOrigin != null) dest.GeneSequenceOrigin = (Hl7.Fhir.Model.CodeableConcept)GeneSequenceOrigin.DeepCopy(); - if(Gene != null) dest.Gene = (Hl7.Fhir.Model.CodeableConcept)Gene.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(GeneSequenceOrigin != null) dest.GeneSequenceOrigin = (Hl7.Fhir.Model.CodeableConcept)GeneSequenceOrigin.DeepCopyInternal(); + if(Gene != null) dest.Gene = (Hl7.Fhir.Model.CodeableConcept)Gene.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GeneComponent()); + var instance = new GeneComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -248,7 +249,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GeneElementComponent; @@ -257,16 +258,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Element != null) dest.Element = (Hl7.Fhir.Model.Identifier)Element.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Element != null) dest.Element = (Hl7.Fhir.Model.Identifier)Element.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GeneElementComponent()); + var instance = new GeneElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -452,7 +454,7 @@ public List Source private List _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -461,21 +463,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Target != null) dest.Target = (Hl7.Fhir.Model.Identifier)Target.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Interaction != null) dest.Interaction = (Hl7.Fhir.Model.CodeableConcept)Interaction.DeepCopy(); - if(Organism != null) dest.Organism = (Hl7.Fhir.Model.CodeableConcept)Organism.DeepCopy(); - if(OrganismType != null) dest.OrganismType = (Hl7.Fhir.Model.CodeableConcept)OrganismType.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopy(); - if(AmountType != null) dest.AmountType = (Hl7.Fhir.Model.CodeableConcept)AmountType.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Target != null) dest.Target = (Hl7.Fhir.Model.Identifier)Target.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Interaction != null) dest.Interaction = (Hl7.Fhir.Model.CodeableConcept)Interaction.DeepCopyInternal(); + if(Organism != null) dest.Organism = (Hl7.Fhir.Model.CodeableConcept)Organism.DeepCopyInternal(); + if(OrganismType != null) dest.OrganismType = (Hl7.Fhir.Model.CodeableConcept)OrganismType.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopyInternal(); + if(AmountType != null) dest.AmountType = (Hl7.Fhir.Model.CodeableConcept)AmountType.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -652,7 +655,7 @@ public List Target private List _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceReferenceInformation; @@ -661,17 +664,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Gene.Any()) dest.Gene = new List(Gene.DeepCopy()); - if(GeneElement.Any()) dest.GeneElement = new List(GeneElement.DeepCopy()); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Gene.Any()) dest.Gene = new List(Gene.DeepCopyInternal()); + if(GeneElement.Any()) dest.GeneElement = new List(GeneElement.DeepCopyInternal()); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceReferenceInformation()); + var instance = new SubstanceReferenceInformation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/SubstanceSourceMaterial.cs b/src/Hl7.Fhir.R5/Model/Generated/SubstanceSourceMaterial.cs index c476295a07..ffc6598f64 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/SubstanceSourceMaterial.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/SubstanceSourceMaterial.cs @@ -113,7 +113,7 @@ public Hl7.Fhir.Model.CodeableConcept MaterialType private Hl7.Fhir.Model.CodeableConcept _MaterialType; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FractionDescriptionComponent; @@ -122,15 +122,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(FractionElement != null) dest.FractionElement = (Hl7.Fhir.Model.FhirString)FractionElement.DeepCopy(); - if(MaterialType != null) dest.MaterialType = (Hl7.Fhir.Model.CodeableConcept)MaterialType.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(FractionElement != null) dest.FractionElement = (Hl7.Fhir.Model.FhirString)FractionElement.DeepCopyInternal(); + if(MaterialType != null) dest.MaterialType = (Hl7.Fhir.Model.CodeableConcept)MaterialType.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FractionDescriptionComponent()); + var instance = new FractionDescriptionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -322,7 +323,7 @@ public Hl7.Fhir.Model.SubstanceSourceMaterial.OrganismGeneralComponent OrganismG private Hl7.Fhir.Model.SubstanceSourceMaterial.OrganismGeneralComponent _OrganismGeneral; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OrganismComponent; @@ -331,21 +332,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Family != null) dest.Family = (Hl7.Fhir.Model.CodeableConcept)Family.DeepCopy(); - if(Genus != null) dest.Genus = (Hl7.Fhir.Model.CodeableConcept)Genus.DeepCopy(); - if(Species != null) dest.Species = (Hl7.Fhir.Model.CodeableConcept)Species.DeepCopy(); - if(IntraspecificType != null) dest.IntraspecificType = (Hl7.Fhir.Model.CodeableConcept)IntraspecificType.DeepCopy(); - if(IntraspecificDescriptionElement != null) dest.IntraspecificDescriptionElement = (Hl7.Fhir.Model.FhirString)IntraspecificDescriptionElement.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Hybrid != null) dest.Hybrid = (Hl7.Fhir.Model.SubstanceSourceMaterial.HybridComponent)Hybrid.DeepCopy(); - if(OrganismGeneral != null) dest.OrganismGeneral = (Hl7.Fhir.Model.SubstanceSourceMaterial.OrganismGeneralComponent)OrganismGeneral.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Family != null) dest.Family = (Hl7.Fhir.Model.CodeableConcept)Family.DeepCopyInternal(); + if(Genus != null) dest.Genus = (Hl7.Fhir.Model.CodeableConcept)Genus.DeepCopyInternal(); + if(Species != null) dest.Species = (Hl7.Fhir.Model.CodeableConcept)Species.DeepCopyInternal(); + if(IntraspecificType != null) dest.IntraspecificType = (Hl7.Fhir.Model.CodeableConcept)IntraspecificType.DeepCopyInternal(); + if(IntraspecificDescriptionElement != null) dest.IntraspecificDescriptionElement = (Hl7.Fhir.Model.FhirString)IntraspecificDescriptionElement.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Hybrid != null) dest.Hybrid = (Hl7.Fhir.Model.SubstanceSourceMaterial.HybridComponent)Hybrid.DeepCopyInternal(); + if(OrganismGeneral != null) dest.OrganismGeneral = (Hl7.Fhir.Model.SubstanceSourceMaterial.OrganismGeneralComponent)OrganismGeneral.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OrganismComponent()); + var instance = new OrganismComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -506,7 +508,7 @@ public string AuthorDescription } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AuthorComponent; @@ -515,15 +517,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AuthorType != null) dest.AuthorType = (Hl7.Fhir.Model.CodeableConcept)AuthorType.DeepCopy(); - if(AuthorDescriptionElement != null) dest.AuthorDescriptionElement = (Hl7.Fhir.Model.FhirString)AuthorDescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AuthorType != null) dest.AuthorType = (Hl7.Fhir.Model.CodeableConcept)AuthorType.DeepCopyInternal(); + if(AuthorDescriptionElement != null) dest.AuthorDescriptionElement = (Hl7.Fhir.Model.FhirString)AuthorDescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AuthorComponent()); + var instance = new AuthorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -729,7 +732,7 @@ public Hl7.Fhir.Model.CodeableConcept HybridType private Hl7.Fhir.Model.CodeableConcept _HybridType; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HybridComponent; @@ -738,18 +741,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MaternalOrganismIdElement != null) dest.MaternalOrganismIdElement = (Hl7.Fhir.Model.FhirString)MaternalOrganismIdElement.DeepCopy(); - if(MaternalOrganismNameElement != null) dest.MaternalOrganismNameElement = (Hl7.Fhir.Model.FhirString)MaternalOrganismNameElement.DeepCopy(); - if(PaternalOrganismIdElement != null) dest.PaternalOrganismIdElement = (Hl7.Fhir.Model.FhirString)PaternalOrganismIdElement.DeepCopy(); - if(PaternalOrganismNameElement != null) dest.PaternalOrganismNameElement = (Hl7.Fhir.Model.FhirString)PaternalOrganismNameElement.DeepCopy(); - if(HybridType != null) dest.HybridType = (Hl7.Fhir.Model.CodeableConcept)HybridType.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MaternalOrganismIdElement != null) dest.MaternalOrganismIdElement = (Hl7.Fhir.Model.FhirString)MaternalOrganismIdElement.DeepCopyInternal(); + if(MaternalOrganismNameElement != null) dest.MaternalOrganismNameElement = (Hl7.Fhir.Model.FhirString)MaternalOrganismNameElement.DeepCopyInternal(); + if(PaternalOrganismIdElement != null) dest.PaternalOrganismIdElement = (Hl7.Fhir.Model.FhirString)PaternalOrganismIdElement.DeepCopyInternal(); + if(PaternalOrganismNameElement != null) dest.PaternalOrganismNameElement = (Hl7.Fhir.Model.FhirString)PaternalOrganismNameElement.DeepCopyInternal(); + if(HybridType != null) dest.HybridType = (Hl7.Fhir.Model.CodeableConcept)HybridType.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HybridComponent()); + var instance = new HybridComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -894,7 +898,7 @@ public Hl7.Fhir.Model.CodeableConcept Order private Hl7.Fhir.Model.CodeableConcept _Order; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OrganismGeneralComponent; @@ -903,17 +907,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Kingdom != null) dest.Kingdom = (Hl7.Fhir.Model.CodeableConcept)Kingdom.DeepCopy(); - if(Phylum != null) dest.Phylum = (Hl7.Fhir.Model.CodeableConcept)Phylum.DeepCopy(); - if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy(); - if(Order != null) dest.Order = (Hl7.Fhir.Model.CodeableConcept)Order.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Kingdom != null) dest.Kingdom = (Hl7.Fhir.Model.CodeableConcept)Kingdom.DeepCopyInternal(); + if(Phylum != null) dest.Phylum = (Hl7.Fhir.Model.CodeableConcept)Phylum.DeepCopyInternal(); + if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopyInternal(); + if(Order != null) dest.Order = (Hl7.Fhir.Model.CodeableConcept)Order.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OrganismGeneralComponent()); + var instance = new OrganismGeneralComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1024,7 +1029,7 @@ public Hl7.Fhir.Model.CodeableConcept PartLocation private Hl7.Fhir.Model.CodeableConcept _PartLocation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PartDescriptionComponent; @@ -1033,15 +1038,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Part != null) dest.Part = (Hl7.Fhir.Model.CodeableConcept)Part.DeepCopy(); - if(PartLocation != null) dest.PartLocation = (Hl7.Fhir.Model.CodeableConcept)PartLocation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Part != null) dest.Part = (Hl7.Fhir.Model.CodeableConcept)Part.DeepCopyInternal(); + if(PartLocation != null) dest.PartLocation = (Hl7.Fhir.Model.CodeableConcept)PartLocation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PartDescriptionComponent()); + var instance = new PartDescriptionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1326,7 +1332,7 @@ public List Par private List _PartDescription; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstanceSourceMaterial; @@ -1335,26 +1341,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SourceMaterialClass != null) dest.SourceMaterialClass = (Hl7.Fhir.Model.CodeableConcept)SourceMaterialClass.DeepCopy(); - if(SourceMaterialType != null) dest.SourceMaterialType = (Hl7.Fhir.Model.CodeableConcept)SourceMaterialType.DeepCopy(); - if(SourceMaterialState != null) dest.SourceMaterialState = (Hl7.Fhir.Model.CodeableConcept)SourceMaterialState.DeepCopy(); - if(OrganismId != null) dest.OrganismId = (Hl7.Fhir.Model.Identifier)OrganismId.DeepCopy(); - if(OrganismNameElement != null) dest.OrganismNameElement = (Hl7.Fhir.Model.FhirString)OrganismNameElement.DeepCopy(); - if(ParentSubstanceId.Any()) dest.ParentSubstanceId = new List(ParentSubstanceId.DeepCopy()); - if(ParentSubstanceNameElement.Any()) dest.ParentSubstanceNameElement = new List(ParentSubstanceNameElement.DeepCopy()); - if(CountryOfOrigin.Any()) dest.CountryOfOrigin = new List(CountryOfOrigin.DeepCopy()); - if(GeographicalLocationElement.Any()) dest.GeographicalLocationElement = new List(GeographicalLocationElement.DeepCopy()); - if(DevelopmentStage != null) dest.DevelopmentStage = (Hl7.Fhir.Model.CodeableConcept)DevelopmentStage.DeepCopy(); - if(FractionDescription.Any()) dest.FractionDescription = new List(FractionDescription.DeepCopy()); - if(Organism != null) dest.Organism = (Hl7.Fhir.Model.SubstanceSourceMaterial.OrganismComponent)Organism.DeepCopy(); - if(PartDescription.Any()) dest.PartDescription = new List(PartDescription.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SourceMaterialClass != null) dest.SourceMaterialClass = (Hl7.Fhir.Model.CodeableConcept)SourceMaterialClass.DeepCopyInternal(); + if(SourceMaterialType != null) dest.SourceMaterialType = (Hl7.Fhir.Model.CodeableConcept)SourceMaterialType.DeepCopyInternal(); + if(SourceMaterialState != null) dest.SourceMaterialState = (Hl7.Fhir.Model.CodeableConcept)SourceMaterialState.DeepCopyInternal(); + if(OrganismId != null) dest.OrganismId = (Hl7.Fhir.Model.Identifier)OrganismId.DeepCopyInternal(); + if(OrganismNameElement != null) dest.OrganismNameElement = (Hl7.Fhir.Model.FhirString)OrganismNameElement.DeepCopyInternal(); + if(ParentSubstanceId.Any()) dest.ParentSubstanceId = new List(ParentSubstanceId.DeepCopyInternal()); + if(ParentSubstanceNameElement.Any()) dest.ParentSubstanceNameElement = new List(ParentSubstanceNameElement.DeepCopyInternal()); + if(CountryOfOrigin.Any()) dest.CountryOfOrigin = new List(CountryOfOrigin.DeepCopyInternal()); + if(GeographicalLocationElement.Any()) dest.GeographicalLocationElement = new List(GeographicalLocationElement.DeepCopyInternal()); + if(DevelopmentStage != null) dest.DevelopmentStage = (Hl7.Fhir.Model.CodeableConcept)DevelopmentStage.DeepCopyInternal(); + if(FractionDescription.Any()) dest.FractionDescription = new List(FractionDescription.DeepCopyInternal()); + if(Organism != null) dest.Organism = (Hl7.Fhir.Model.SubstanceSourceMaterial.OrganismComponent)Organism.DeepCopyInternal(); + if(PartDescription.Any()) dest.PartDescription = new List(PartDescription.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstanceSourceMaterial()); + var instance = new SubstanceSourceMaterial(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/SupplyDelivery.cs b/src/Hl7.Fhir.R5/Model/Generated/SupplyDelivery.cs index b07a6c8c22..f042a7497a 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/SupplyDelivery.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/SupplyDelivery.cs @@ -167,7 +167,7 @@ public Hl7.Fhir.Model.DataType Item private Hl7.Fhir.Model.DataType _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SuppliedItemComponent; @@ -176,15 +176,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SuppliedItemComponent()); + var instance = new SuppliedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -425,7 +426,7 @@ public List Receiver List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplyDelivery; @@ -434,24 +435,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SuppliedItem.Any()) dest.SuppliedItem = new List(SuppliedItem.DeepCopy()); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Supplier != null) dest.Supplier = (Hl7.Fhir.Model.ResourceReference)Supplier.DeepCopy(); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SuppliedItem.Any()) dest.SuppliedItem = new List(SuppliedItem.DeepCopyInternal()); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Supplier != null) dest.Supplier = (Hl7.Fhir.Model.ResourceReference)Supplier.DeepCopyInternal(); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplyDelivery()); + var instance = new SupplyDelivery(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/SupplyRequest.cs b/src/Hl7.Fhir.R5/Model/Generated/SupplyRequest.cs index b81630dec7..ea6b4f1394 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/SupplyRequest.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/SupplyRequest.cs @@ -156,7 +156,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -165,15 +165,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -521,7 +522,7 @@ public Hl7.Fhir.Model.ResourceReference DeliverTo List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplyRequest; @@ -530,29 +531,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DeliverFor != null) dest.DeliverFor = (Hl7.Fhir.Model.ResourceReference)DeliverFor.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(Supplier.Any()) dest.Supplier = new List(Supplier.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(DeliverFrom != null) dest.DeliverFrom = (Hl7.Fhir.Model.ResourceReference)DeliverFrom.DeepCopy(); - if(DeliverTo != null) dest.DeliverTo = (Hl7.Fhir.Model.ResourceReference)DeliverTo.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DeliverFor != null) dest.DeliverFor = (Hl7.Fhir.Model.ResourceReference)DeliverFor.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.CodeableReference)Item.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(Supplier.Any()) dest.Supplier = new List(Supplier.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(DeliverFrom != null) dest.DeliverFrom = (Hl7.Fhir.Model.ResourceReference)DeliverFrom.DeepCopyInternal(); + if(DeliverTo != null) dest.DeliverTo = (Hl7.Fhir.Model.ResourceReference)DeliverTo.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplyRequest()); + var instance = new SupplyRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Task.cs b/src/Hl7.Fhir.R5/Model/Generated/Task.cs index 6d354d57bb..36e90a54d1 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Task.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Task.cs @@ -248,7 +248,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -257,15 +257,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Function != null) dest.Function = (Hl7.Fhir.Model.CodeableConcept)Function.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -398,7 +399,7 @@ public List Recipient private List _Recipient; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RestrictionComponent; @@ -407,16 +408,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RepetitionsElement != null) dest.RepetitionsElement = (Hl7.Fhir.Model.PositiveInt)RepetitionsElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RepetitionsElement != null) dest.RepetitionsElement = (Hl7.Fhir.Model.PositiveInt)RepetitionsElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RestrictionComponent()); + var instance = new RestrictionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -527,7 +529,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InputComponent; @@ -536,15 +538,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InputComponent()); + var instance = new InputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -647,7 +650,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OutputComponent; @@ -656,15 +659,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OutputComponent()); + var instance = new OutputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1357,7 +1361,7 @@ public List Output List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Task; @@ -1366,46 +1370,47 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement != null) dest.InstantiatesCanonicalElement = (Hl7.Fhir.Model.Canonical)InstantiatesCanonicalElement.DeepCopy(); - if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableReference)StatusReason.DeepCopy(); - if(BusinessStatus != null) dest.BusinessStatus = (Hl7.Fhir.Model.CodeableConcept)BusinessStatus.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopy(); - if(For != null) dest.For = (Hl7.Fhir.Model.ResourceReference)For.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(RequestedPeriod != null) dest.RequestedPeriod = (Hl7.Fhir.Model.Period)RequestedPeriod.DeepCopy(); - if(ExecutionPeriod != null) dest.ExecutionPeriod = (Hl7.Fhir.Model.Period)ExecutionPeriod.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(LastModifiedElement != null) dest.LastModifiedElement = (Hl7.Fhir.Model.FhirDateTime)LastModifiedElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(RequestedPerformer.Any()) dest.RequestedPerformer = new List(RequestedPerformer.DeepCopy()); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - if(Restriction != null) dest.Restriction = (Hl7.Fhir.Model.Task.RestrictionComponent)Restriction.DeepCopy(); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Output.Any()) dest.Output = new List(Output.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement != null) dest.InstantiatesCanonicalElement = (Hl7.Fhir.Model.Canonical)InstantiatesCanonicalElement.DeepCopyInternal(); + if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableReference)StatusReason.DeepCopyInternal(); + if(BusinessStatus != null) dest.BusinessStatus = (Hl7.Fhir.Model.CodeableConcept)BusinessStatus.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopyInternal(); + if(For != null) dest.For = (Hl7.Fhir.Model.ResourceReference)For.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(RequestedPeriod != null) dest.RequestedPeriod = (Hl7.Fhir.Model.Period)RequestedPeriod.DeepCopyInternal(); + if(ExecutionPeriod != null) dest.ExecutionPeriod = (Hl7.Fhir.Model.Period)ExecutionPeriod.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(LastModifiedElement != null) dest.LastModifiedElement = (Hl7.Fhir.Model.FhirDateTime)LastModifiedElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(RequestedPerformer.Any()) dest.RequestedPerformer = new List(RequestedPerformer.DeepCopyInternal()); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); + if(Restriction != null) dest.Restriction = (Hl7.Fhir.Model.Task.RestrictionComponent)Restriction.DeepCopyInternal(); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Output.Any()) dest.Output = new List(Output.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Task()); + var instance = new Task(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/TerminologyCapabilities.cs b/src/Hl7.Fhir.R5/Model/Generated/TerminologyCapabilities.cs index 0b144a11c4..719db496b3 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/TerminologyCapabilities.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/TerminologyCapabilities.cs @@ -166,7 +166,7 @@ public string Version } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SoftwareComponent; @@ -175,15 +175,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SoftwareComponent()); + var instance = new SoftwareComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -318,7 +319,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImplementationComponent; @@ -327,15 +328,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImplementationComponent()); + var instance = new ImplementationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -518,7 +520,7 @@ public bool? Subsumption } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeSystemComponent; @@ -527,17 +529,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.Canonical)UriElement.DeepCopy(); - if(Version.Any()) dest.Version = new List(Version.DeepCopy()); - if(ContentElement != null) dest.ContentElement = (Code)ContentElement.DeepCopy(); - if(SubsumptionElement != null) dest.SubsumptionElement = (Hl7.Fhir.Model.FhirBoolean)SubsumptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.Canonical)UriElement.DeepCopyInternal(); + if(Version.Any()) dest.Version = new List(Version.DeepCopyInternal()); + if(ContentElement != null) dest.ContentElement = (Code)ContentElement.DeepCopyInternal(); + if(SubsumptionElement != null) dest.SubsumptionElement = (Hl7.Fhir.Model.FhirBoolean)SubsumptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CodeSystemComponent()); + var instance = new CodeSystemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -799,7 +802,7 @@ public IEnumerable Property } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VersionComponent; @@ -808,19 +811,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.FhirString)CodeElement.DeepCopy(); - if(IsDefaultElement != null) dest.IsDefaultElement = (Hl7.Fhir.Model.FhirBoolean)IsDefaultElement.DeepCopy(); - if(CompositionalElement != null) dest.CompositionalElement = (Hl7.Fhir.Model.FhirBoolean)CompositionalElement.DeepCopy(); - if(LanguageElement.Any()) dest.LanguageElement = new List>(LanguageElement.DeepCopy()); - if(Filter.Any()) dest.Filter = new List(Filter.DeepCopy()); - if(PropertyElement.Any()) dest.PropertyElement = new List(PropertyElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.FhirString)CodeElement.DeepCopyInternal(); + if(IsDefaultElement != null) dest.IsDefaultElement = (Hl7.Fhir.Model.FhirBoolean)IsDefaultElement.DeepCopyInternal(); + if(CompositionalElement != null) dest.CompositionalElement = (Hl7.Fhir.Model.FhirBoolean)CompositionalElement.DeepCopyInternal(); + if(LanguageElement.Any()) dest.LanguageElement = new List>(LanguageElement.DeepCopyInternal()); + if(Filter.Any()) dest.Filter = new List(Filter.DeepCopyInternal()); + if(PropertyElement.Any()) dest.PropertyElement = new List(PropertyElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VersionComponent()); + var instance = new VersionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -985,7 +989,7 @@ public IEnumerable Op } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FilterComponent; @@ -994,15 +998,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(OpElement.Any()) dest.OpElement = new List(OpElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(OpElement.Any()) dest.OpElement = new List(OpElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FilterComponent()); + var instance = new FilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1209,7 +1214,7 @@ public string TextFilter } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExpansionComponent; @@ -1218,18 +1223,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(HierarchicalElement != null) dest.HierarchicalElement = (Hl7.Fhir.Model.FhirBoolean)HierarchicalElement.DeepCopy(); - if(PagingElement != null) dest.PagingElement = (Hl7.Fhir.Model.FhirBoolean)PagingElement.DeepCopy(); - if(IncompleteElement != null) dest.IncompleteElement = (Hl7.Fhir.Model.FhirBoolean)IncompleteElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(TextFilterElement != null) dest.TextFilterElement = (Hl7.Fhir.Model.Markdown)TextFilterElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(HierarchicalElement != null) dest.HierarchicalElement = (Hl7.Fhir.Model.FhirBoolean)HierarchicalElement.DeepCopyInternal(); + if(PagingElement != null) dest.PagingElement = (Hl7.Fhir.Model.FhirBoolean)PagingElement.DeepCopyInternal(); + if(IncompleteElement != null) dest.IncompleteElement = (Hl7.Fhir.Model.FhirBoolean)IncompleteElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(TextFilterElement != null) dest.TextFilterElement = (Hl7.Fhir.Model.Markdown)TextFilterElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExpansionComponent()); + var instance = new ExpansionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1385,7 +1391,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -1394,15 +1400,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1503,7 +1510,7 @@ public bool? Translations } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ValidateCodeComponent; @@ -1512,14 +1519,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TranslationsElement != null) dest.TranslationsElement = (Hl7.Fhir.Model.FhirBoolean)TranslationsElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TranslationsElement != null) dest.TranslationsElement = (Hl7.Fhir.Model.FhirBoolean)TranslationsElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ValidateCodeComponent()); + var instance = new ValidateCodeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1612,7 +1620,7 @@ public bool? NeedsMap } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TranslationComponent; @@ -1621,14 +1629,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NeedsMapElement != null) dest.NeedsMapElement = (Hl7.Fhir.Model.FhirBoolean)NeedsMapElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NeedsMapElement != null) dest.NeedsMapElement = (Hl7.Fhir.Model.FhirBoolean)NeedsMapElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TranslationComponent()); + var instance = new TranslationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1723,7 +1732,7 @@ public bool? Translation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClosureComponent; @@ -1732,14 +1741,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TranslationElement != null) dest.TranslationElement = (Hl7.Fhir.Model.FhirBoolean)TranslationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TranslationElement != null) dest.TranslationElement = (Hl7.Fhir.Model.FhirBoolean)TranslationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClosureComponent()); + var instance = new ClosureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2427,7 +2437,7 @@ public Hl7.Fhir.Model.TerminologyCapabilities.ClosureComponent Closure List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TerminologyCapabilities; @@ -2436,40 +2446,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(Software != null) dest.Software = (Hl7.Fhir.Model.TerminologyCapabilities.SoftwareComponent)Software.DeepCopy(); - if(Implementation != null) dest.Implementation = (Hl7.Fhir.Model.TerminologyCapabilities.ImplementationComponent)Implementation.DeepCopy(); - if(LockedDateElement != null) dest.LockedDateElement = (Hl7.Fhir.Model.FhirBoolean)LockedDateElement.DeepCopy(); - if(CodeSystem.Any()) dest.CodeSystem = new List(CodeSystem.DeepCopy()); - if(Expansion != null) dest.Expansion = (Hl7.Fhir.Model.TerminologyCapabilities.ExpansionComponent)Expansion.DeepCopy(); - if(CodeSearchElement != null) dest.CodeSearchElement = (Code)CodeSearchElement.DeepCopy(); - if(ValidateCode != null) dest.ValidateCode = (Hl7.Fhir.Model.TerminologyCapabilities.ValidateCodeComponent)ValidateCode.DeepCopy(); - if(Translation != null) dest.Translation = (Hl7.Fhir.Model.TerminologyCapabilities.TranslationComponent)Translation.DeepCopy(); - if(Closure != null) dest.Closure = (Hl7.Fhir.Model.TerminologyCapabilities.ClosureComponent)Closure.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(Software != null) dest.Software = (Hl7.Fhir.Model.TerminologyCapabilities.SoftwareComponent)Software.DeepCopyInternal(); + if(Implementation != null) dest.Implementation = (Hl7.Fhir.Model.TerminologyCapabilities.ImplementationComponent)Implementation.DeepCopyInternal(); + if(LockedDateElement != null) dest.LockedDateElement = (Hl7.Fhir.Model.FhirBoolean)LockedDateElement.DeepCopyInternal(); + if(CodeSystem.Any()) dest.CodeSystem = new List(CodeSystem.DeepCopyInternal()); + if(Expansion != null) dest.Expansion = (Hl7.Fhir.Model.TerminologyCapabilities.ExpansionComponent)Expansion.DeepCopyInternal(); + if(CodeSearchElement != null) dest.CodeSearchElement = (Code)CodeSearchElement.DeepCopyInternal(); + if(ValidateCode != null) dest.ValidateCode = (Hl7.Fhir.Model.TerminologyCapabilities.ValidateCodeComponent)ValidateCode.DeepCopyInternal(); + if(Translation != null) dest.Translation = (Hl7.Fhir.Model.TerminologyCapabilities.TranslationComponent)Translation.DeepCopyInternal(); + if(Closure != null) dest.Closure = (Hl7.Fhir.Model.TerminologyCapabilities.ClosureComponent)Closure.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TerminologyCapabilities()); + var instance = new TerminologyCapabilities(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/TestPlan.cs b/src/Hl7.Fhir.R5/Model/Generated/TestPlan.cs index 6c1d1d9538..3b6effc70a 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/TestPlan.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/TestPlan.cs @@ -119,7 +119,7 @@ public Hl7.Fhir.Model.ResourceReference Predecessor private Hl7.Fhir.Model.ResourceReference _Predecessor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DependencyComponent; @@ -128,15 +128,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Predecessor != null) dest.Predecessor = (Hl7.Fhir.Model.ResourceReference)Predecessor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Predecessor != null) dest.Predecessor = (Hl7.Fhir.Model.ResourceReference)Predecessor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DependencyComponent()); + var instance = new DependencyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -309,7 +310,7 @@ public List Assertion private List _Assertion; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestCaseComponent; @@ -318,19 +319,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.Integer)SequenceElement.DeepCopy(); - if(Scope.Any()) dest.Scope = new List(Scope.DeepCopy()); - if(Dependency.Any()) dest.Dependency = new List(Dependency.DeepCopy()); - if(TestRun.Any()) dest.TestRun = new List(TestRun.DeepCopy()); - if(TestData.Any()) dest.TestData = new List(TestData.DeepCopy()); - if(Assertion.Any()) dest.Assertion = new List(Assertion.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.Integer)SequenceElement.DeepCopyInternal(); + if(Scope.Any()) dest.Scope = new List(Scope.DeepCopyInternal()); + if(Dependency.Any()) dest.Dependency = new List(Dependency.DeepCopyInternal()); + if(TestRun.Any()) dest.TestRun = new List(TestRun.DeepCopyInternal()); + if(TestData.Any()) dest.TestData = new List(TestData.DeepCopyInternal()); + if(Assertion.Any()) dest.Assertion = new List(Assertion.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestCaseComponent()); + var instance = new TestCaseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -478,7 +480,7 @@ public Hl7.Fhir.Model.ResourceReference Predecessor private Hl7.Fhir.Model.ResourceReference _Predecessor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestCaseDependencyComponent; @@ -487,15 +489,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Predecessor != null) dest.Predecessor = (Hl7.Fhir.Model.ResourceReference)Predecessor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Predecessor != null) dest.Predecessor = (Hl7.Fhir.Model.ResourceReference)Predecessor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestCaseDependencyComponent()); + var instance = new TestCaseDependencyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -608,7 +611,7 @@ public Hl7.Fhir.Model.TestPlan.ScriptComponent Script private Hl7.Fhir.Model.TestPlan.ScriptComponent _Script; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestRunComponent; @@ -617,15 +620,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NarrativeElement != null) dest.NarrativeElement = (Hl7.Fhir.Model.Markdown)NarrativeElement.DeepCopy(); - if(Script != null) dest.Script = (Hl7.Fhir.Model.TestPlan.ScriptComponent)Script.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NarrativeElement != null) dest.NarrativeElement = (Hl7.Fhir.Model.Markdown)NarrativeElement.DeepCopyInternal(); + if(Script != null) dest.Script = (Hl7.Fhir.Model.TestPlan.ScriptComponent)Script.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestRunComponent()); + var instance = new TestRunComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -722,7 +726,7 @@ public Hl7.Fhir.Model.DataType Source private Hl7.Fhir.Model.DataType _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ScriptComponent; @@ -731,15 +735,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ScriptComponent()); + var instance = new ScriptComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -850,7 +855,7 @@ public Hl7.Fhir.Model.DataType Source private Hl7.Fhir.Model.DataType _Source; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestDataComponent; @@ -859,16 +864,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(Content != null) dest.Content = (Hl7.Fhir.Model.ResourceReference)Content.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(Content != null) dest.Content = (Hl7.Fhir.Model.ResourceReference)Content.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestDataComponent()); + var instance = new TestDataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -990,7 +996,7 @@ public List Result private List _Result; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssertionComponent; @@ -999,16 +1005,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Object.Any()) dest.Object = new List(Object.DeepCopy()); - if(Result.Any()) dest.Result = new List(Result.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Object.Any()) dest.Object = new List(Object.DeepCopyInternal()); + if(Result.Any()) dest.Result = new List(Result.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AssertionComponent()); + var instance = new AssertionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1640,7 +1647,7 @@ public List TestCase List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestPlan; @@ -1649,36 +1656,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Scope.Any()) dest.Scope = new List(Scope.DeepCopy()); - if(TestToolsElement != null) dest.TestToolsElement = (Hl7.Fhir.Model.Markdown)TestToolsElement.DeepCopy(); - if(Dependency.Any()) dest.Dependency = new List(Dependency.DeepCopy()); - if(ExitCriteriaElement != null) dest.ExitCriteriaElement = (Hl7.Fhir.Model.Markdown)ExitCriteriaElement.DeepCopy(); - if(TestCase.Any()) dest.TestCase = new List(TestCase.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Scope.Any()) dest.Scope = new List(Scope.DeepCopyInternal()); + if(TestToolsElement != null) dest.TestToolsElement = (Hl7.Fhir.Model.Markdown)TestToolsElement.DeepCopyInternal(); + if(Dependency.Any()) dest.Dependency = new List(Dependency.DeepCopyInternal()); + if(ExitCriteriaElement != null) dest.ExitCriteriaElement = (Hl7.Fhir.Model.Markdown)ExitCriteriaElement.DeepCopyInternal(); + if(TestCase.Any()) dest.TestCase = new List(TestCase.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestPlan()); + var instance = new TestPlan(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/TestReport.cs b/src/Hl7.Fhir.R5/Model/Generated/TestReport.cs index f3054ddd42..ac00c5b39f 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/TestReport.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/TestReport.cs @@ -305,7 +305,7 @@ public string Display } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -314,16 +314,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -414,7 +415,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupComponent; @@ -423,14 +424,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupComponent()); + var instance = new SetupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -521,7 +523,7 @@ public Hl7.Fhir.Model.TestReport.AssertComponent Assert private Hl7.Fhir.Model.TestReport.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupActionComponent; @@ -530,15 +532,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupActionComponent()); + var instance = new SetupActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -706,7 +709,7 @@ public string Detail } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -715,16 +718,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopy(); - if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopy(); - if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirUri)DetailElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopyInternal(); + if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopyInternal(); + if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirUri)DetailElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationComponent()); + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -914,7 +918,7 @@ public List Requirement private List _Requirement; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssertComponent; @@ -923,17 +927,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopy(); - if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopy(); - if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopy(); - if(Requirement.Any()) dest.Requirement = new List(Requirement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopyInternal(); + if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopyInternal(); + if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopyInternal(); + if(Requirement.Any()) dest.Requirement = new List(Requirement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AssertComponent()); + var instance = new AssertComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1037,7 +1042,7 @@ public Hl7.Fhir.Model.DataType Link private Hl7.Fhir.Model.DataType _Link; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequirementComponent; @@ -1046,14 +1051,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Link != null) dest.Link = (Hl7.Fhir.Model.DataType)Link.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Link != null) dest.Link = (Hl7.Fhir.Model.DataType)Link.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequirementComponent()); + var instance = new RequirementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1190,7 +1196,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestComponent; @@ -1199,16 +1205,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestComponent()); + var instance = new TestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1315,7 +1322,7 @@ public Hl7.Fhir.Model.TestReport.AssertComponent Assert private Hl7.Fhir.Model.TestReport.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestActionComponent; @@ -1324,15 +1331,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestActionComponent()); + var instance = new TestActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1418,7 +1426,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownComponent; @@ -1427,14 +1435,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownComponent()); + var instance = new TeardownComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1513,7 +1522,7 @@ public Hl7.Fhir.Model.TestReport.OperationComponent Operation private Hl7.Fhir.Model.TestReport.OperationComponent _Operation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownActionComponent; @@ -1522,14 +1531,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownActionComponent()); + var instance = new TeardownActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1870,7 +1880,7 @@ public Hl7.Fhir.Model.TestReport.TeardownComponent Teardown Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestReport; @@ -1879,25 +1889,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(TestScriptElement != null) dest.TestScriptElement = (Hl7.Fhir.Model.Canonical)TestScriptElement.DeepCopy(); - if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopy(); - if(ScoreElement != null) dest.ScoreElement = (Hl7.Fhir.Model.FhirDecimal)ScoreElement.DeepCopy(); - if(TesterElement != null) dest.TesterElement = (Hl7.Fhir.Model.FhirString)TesterElement.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestReport.SetupComponent)Setup.DeepCopy(); - if(Test.Any()) dest.Test = new List(Test.DeepCopy()); - if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestReport.TeardownComponent)Teardown.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(TestScriptElement != null) dest.TestScriptElement = (Hl7.Fhir.Model.Canonical)TestScriptElement.DeepCopyInternal(); + if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopyInternal(); + if(ScoreElement != null) dest.ScoreElement = (Hl7.Fhir.Model.FhirDecimal)ScoreElement.DeepCopyInternal(); + if(TesterElement != null) dest.TesterElement = (Hl7.Fhir.Model.FhirString)TesterElement.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestReport.SetupComponent)Setup.DeepCopyInternal(); + if(Test.Any()) dest.Test = new List(Test.DeepCopyInternal()); + if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestReport.TeardownComponent)Teardown.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestReport()); + var instance = new TestReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/TestScript.cs b/src/Hl7.Fhir.R5/Model/Generated/TestScript.cs index 8558f55fba..5df7afa6f7 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/TestScript.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/TestScript.cs @@ -618,7 +618,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OriginComponent; @@ -627,16 +627,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OriginComponent()); + var instance = new OriginComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -795,7 +796,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DestinationComponent; @@ -804,16 +805,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DestinationComponent()); + var instance = new DestinationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -921,7 +923,7 @@ public List Capability private List _Capability; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MetadataComponent; @@ -930,15 +932,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - if(Capability.Any()) dest.Capability = new List(Capability.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); + if(Capability.Any()) dest.Capability = new List(Capability.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MetadataComponent()); + var instance = new MetadataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1073,7 +1076,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -1082,15 +1085,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1385,7 +1389,7 @@ public string Capabilities } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CapabilityComponent; @@ -1394,20 +1398,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopy(); - if(ValidatedElement != null) dest.ValidatedElement = (Hl7.Fhir.Model.FhirBoolean)ValidatedElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(OriginElement.Any()) dest.OriginElement = new List(OriginElement.DeepCopy()); - if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopy(); - if(LinkElement.Any()) dest.LinkElement = new List(LinkElement.DeepCopy()); - if(CapabilitiesElement != null) dest.CapabilitiesElement = (Hl7.Fhir.Model.Canonical)CapabilitiesElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopyInternal(); + if(ValidatedElement != null) dest.ValidatedElement = (Hl7.Fhir.Model.FhirBoolean)ValidatedElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(OriginElement.Any()) dest.OriginElement = new List(OriginElement.DeepCopyInternal()); + if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopyInternal(); + if(LinkElement.Any()) dest.LinkElement = new List(LinkElement.DeepCopyInternal()); + if(CapabilitiesElement != null) dest.CapabilitiesElement = (Hl7.Fhir.Model.Canonical)CapabilitiesElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CapabilityComponent()); + var instance = new CapabilityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1579,7 +1584,7 @@ public Hl7.Fhir.Model.CodeableConcept Phase private Hl7.Fhir.Model.CodeableConcept _Phase; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ScopeComponent; @@ -1588,16 +1593,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ArtifactElement != null) dest.ArtifactElement = (Hl7.Fhir.Model.Canonical)ArtifactElement.DeepCopy(); - if(Conformance != null) dest.Conformance = (Hl7.Fhir.Model.CodeableConcept)Conformance.DeepCopy(); - if(Phase != null) dest.Phase = (Hl7.Fhir.Model.CodeableConcept)Phase.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ArtifactElement != null) dest.ArtifactElement = (Hl7.Fhir.Model.Canonical)ArtifactElement.DeepCopyInternal(); + if(Conformance != null) dest.Conformance = (Hl7.Fhir.Model.CodeableConcept)Conformance.DeepCopyInternal(); + if(Phase != null) dest.Phase = (Hl7.Fhir.Model.CodeableConcept)Phase.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ScopeComponent()); + var instance = new ScopeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1756,7 +1762,7 @@ public Hl7.Fhir.Model.ResourceReference Resource private Hl7.Fhir.Model.ResourceReference _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FixtureComponent; @@ -1765,16 +1771,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AutocreateElement != null) dest.AutocreateElement = (Hl7.Fhir.Model.FhirBoolean)AutocreateElement.DeepCopy(); - if(AutodeleteElement != null) dest.AutodeleteElement = (Hl7.Fhir.Model.FhirBoolean)AutodeleteElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AutocreateElement != null) dest.AutocreateElement = (Hl7.Fhir.Model.FhirBoolean)AutocreateElement.DeepCopyInternal(); + if(AutodeleteElement != null) dest.AutodeleteElement = (Hl7.Fhir.Model.FhirBoolean)AutodeleteElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FixtureComponent()); + var instance = new FixtureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2104,7 +2111,7 @@ public string SourceId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VariableComponent; @@ -2113,21 +2120,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DefaultValueElement != null) dest.DefaultValueElement = (Hl7.Fhir.Model.FhirString)DefaultValueElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopy(); - if(HintElement != null) dest.HintElement = (Hl7.Fhir.Model.FhirString)HintElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DefaultValueElement != null) dest.DefaultValueElement = (Hl7.Fhir.Model.FhirString)DefaultValueElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopyInternal(); + if(HintElement != null) dest.HintElement = (Hl7.Fhir.Model.FhirString)HintElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VariableComponent()); + var instance = new VariableComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2258,7 +2266,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupComponent; @@ -2267,14 +2275,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupComponent()); + var instance = new SetupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2365,7 +2374,7 @@ public Hl7.Fhir.Model.TestScript.AssertComponent Assert private Hl7.Fhir.Model.TestScript.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupActionComponent; @@ -2374,15 +2383,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupActionComponent()); + var instance = new SetupActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2953,7 +2963,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -2962,30 +2972,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopy(); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(AcceptElement != null) dest.AcceptElement = (Hl7.Fhir.Model.Code)AcceptElement.DeepCopy(); - if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopy(); - if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopy(); - if(EncodeRequestUrlElement != null) dest.EncodeRequestUrlElement = (Hl7.Fhir.Model.FhirBoolean)EncodeRequestUrlElement.DeepCopy(); - if(MethodElement != null) dest.MethodElement = (Code)MethodElement.DeepCopy(); - if(OriginElement != null) dest.OriginElement = (Hl7.Fhir.Model.Integer)OriginElement.DeepCopy(); - if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopy(); - if(RequestHeader.Any()) dest.RequestHeader = new List(RequestHeader.DeepCopy()); - if(RequestIdElement != null) dest.RequestIdElement = (Hl7.Fhir.Model.Id)RequestIdElement.DeepCopy(); - if(ResponseIdElement != null) dest.ResponseIdElement = (Hl7.Fhir.Model.Id)ResponseIdElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopy(); - if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirString)UrlElement.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new OperationComponent()); + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopyInternal(); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(AcceptElement != null) dest.AcceptElement = (Hl7.Fhir.Model.Code)AcceptElement.DeepCopyInternal(); + if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopyInternal(); + if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopyInternal(); + if(EncodeRequestUrlElement != null) dest.EncodeRequestUrlElement = (Hl7.Fhir.Model.FhirBoolean)EncodeRequestUrlElement.DeepCopyInternal(); + if(MethodElement != null) dest.MethodElement = (Code)MethodElement.DeepCopyInternal(); + if(OriginElement != null) dest.OriginElement = (Hl7.Fhir.Model.Integer)OriginElement.DeepCopyInternal(); + if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopyInternal(); + if(RequestHeader.Any()) dest.RequestHeader = new List(RequestHeader.DeepCopyInternal()); + if(RequestIdElement != null) dest.RequestIdElement = (Hl7.Fhir.Model.Id)RequestIdElement.DeepCopyInternal(); + if(ResponseIdElement != null) dest.ResponseIdElement = (Hl7.Fhir.Model.Id)ResponseIdElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopyInternal(); + if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirString)UrlElement.DeepCopyInternal(); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3242,7 +3253,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequestHeaderComponent; @@ -3251,15 +3262,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(FieldElement != null) dest.FieldElement = (Hl7.Fhir.Model.FhirString)FieldElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(FieldElement != null) dest.FieldElement = (Hl7.Fhir.Model.FhirString)FieldElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequestHeaderComponent()); + var instance = new RequestHeaderComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4104,7 +4116,7 @@ public List Requirement private List _Requirement; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssertComponent; @@ -4113,38 +4125,39 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopy(); - if(CompareToSourceIdElement != null) dest.CompareToSourceIdElement = (Hl7.Fhir.Model.FhirString)CompareToSourceIdElement.DeepCopy(); - if(CompareToSourceExpressionElement != null) dest.CompareToSourceExpressionElement = (Hl7.Fhir.Model.FhirString)CompareToSourceExpressionElement.DeepCopy(); - if(CompareToSourcePathElement != null) dest.CompareToSourcePathElement = (Hl7.Fhir.Model.FhirString)CompareToSourcePathElement.DeepCopy(); - if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopy(); - if(DefaultManualCompletionElement != null) dest.DefaultManualCompletionElement = (Code)DefaultManualCompletionElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopy(); - if(MinimumIdElement != null) dest.MinimumIdElement = (Hl7.Fhir.Model.FhirString)MinimumIdElement.DeepCopy(); - if(NavigationLinksElement != null) dest.NavigationLinksElement = (Hl7.Fhir.Model.FhirBoolean)NavigationLinksElement.DeepCopy(); - if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(RequestMethodElement != null) dest.RequestMethodElement = (Code)RequestMethodElement.DeepCopy(); - if(RequestURLElement != null) dest.RequestURLElement = (Hl7.Fhir.Model.FhirString)RequestURLElement.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopy(); - if(ResponseElement != null) dest.ResponseElement = (Code)ResponseElement.DeepCopy(); - if(ResponseCodeElement != null) dest.ResponseCodeElement = (Hl7.Fhir.Model.FhirString)ResponseCodeElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopy(); - if(StopTestOnFailElement != null) dest.StopTestOnFailElement = (Hl7.Fhir.Model.FhirBoolean)StopTestOnFailElement.DeepCopy(); - if(ValidateProfileIdElement != null) dest.ValidateProfileIdElement = (Hl7.Fhir.Model.Id)ValidateProfileIdElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(WarningOnlyElement != null) dest.WarningOnlyElement = (Hl7.Fhir.Model.FhirBoolean)WarningOnlyElement.DeepCopy(); - if(Requirement.Any()) dest.Requirement = new List(Requirement.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new AssertComponent()); + base.CopyToInternal(dest); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopyInternal(); + if(CompareToSourceIdElement != null) dest.CompareToSourceIdElement = (Hl7.Fhir.Model.FhirString)CompareToSourceIdElement.DeepCopyInternal(); + if(CompareToSourceExpressionElement != null) dest.CompareToSourceExpressionElement = (Hl7.Fhir.Model.FhirString)CompareToSourceExpressionElement.DeepCopyInternal(); + if(CompareToSourcePathElement != null) dest.CompareToSourcePathElement = (Hl7.Fhir.Model.FhirString)CompareToSourcePathElement.DeepCopyInternal(); + if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopyInternal(); + if(DefaultManualCompletionElement != null) dest.DefaultManualCompletionElement = (Code)DefaultManualCompletionElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopyInternal(); + if(MinimumIdElement != null) dest.MinimumIdElement = (Hl7.Fhir.Model.FhirString)MinimumIdElement.DeepCopyInternal(); + if(NavigationLinksElement != null) dest.NavigationLinksElement = (Hl7.Fhir.Model.FhirBoolean)NavigationLinksElement.DeepCopyInternal(); + if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(RequestMethodElement != null) dest.RequestMethodElement = (Code)RequestMethodElement.DeepCopyInternal(); + if(RequestURLElement != null) dest.RequestURLElement = (Hl7.Fhir.Model.FhirString)RequestURLElement.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Hl7.Fhir.Model.FhirUri)ResourceElement.DeepCopyInternal(); + if(ResponseElement != null) dest.ResponseElement = (Code)ResponseElement.DeepCopyInternal(); + if(ResponseCodeElement != null) dest.ResponseCodeElement = (Hl7.Fhir.Model.FhirString)ResponseCodeElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopyInternal(); + if(StopTestOnFailElement != null) dest.StopTestOnFailElement = (Hl7.Fhir.Model.FhirBoolean)StopTestOnFailElement.DeepCopyInternal(); + if(ValidateProfileIdElement != null) dest.ValidateProfileIdElement = (Hl7.Fhir.Model.Id)ValidateProfileIdElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(WarningOnlyElement != null) dest.WarningOnlyElement = (Hl7.Fhir.Model.FhirBoolean)WarningOnlyElement.DeepCopyInternal(); + if(Requirement.Any()) dest.Requirement = new List(Requirement.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new AssertComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4416,7 +4429,7 @@ public Hl7.Fhir.Model.DataType Link private Hl7.Fhir.Model.DataType _Link; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequirementComponent; @@ -4425,14 +4438,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Link != null) dest.Link = (Hl7.Fhir.Model.DataType)Link.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Link != null) dest.Link = (Hl7.Fhir.Model.DataType)Link.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequirementComponent()); + var instance = new RequirementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4569,7 +4583,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestComponent; @@ -4578,16 +4592,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestComponent()); + var instance = new TestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4694,7 +4709,7 @@ public Hl7.Fhir.Model.TestScript.AssertComponent Assert private Hl7.Fhir.Model.TestScript.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestActionComponent; @@ -4703,15 +4718,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestActionComponent()); + var instance = new TestActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4797,7 +4813,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownComponent; @@ -4806,14 +4822,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownComponent()); + var instance = new TeardownComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4892,7 +4909,7 @@ public Hl7.Fhir.Model.TestScript.OperationComponent Operation private Hl7.Fhir.Model.TestScript.OperationComponent _Operation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownActionComponent; @@ -4901,14 +4918,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownActionComponent()); + var instance = new TeardownActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5561,7 +5579,7 @@ public Hl7.Fhir.Model.TestScript.TeardownComponent Teardown List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestScript; @@ -5570,40 +5588,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopy(); - if(Origin.Any()) dest.Origin = new List(Origin.DeepCopy()); - if(Destination.Any()) dest.Destination = new List(Destination.DeepCopy()); - if(Metadata != null) dest.Metadata = (Hl7.Fhir.Model.TestScript.MetadataComponent)Metadata.DeepCopy(); - if(Scope.Any()) dest.Scope = new List(Scope.DeepCopy()); - if(Fixture.Any()) dest.Fixture = new List(Fixture.DeepCopy()); - if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopy()); - if(Variable.Any()) dest.Variable = new List(Variable.DeepCopy()); - if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestScript.SetupComponent)Setup.DeepCopy(); - if(Test.Any()) dest.Test = new List(Test.DeepCopy()); - if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestScript.TeardownComponent)Teardown.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(VersionAlgorithm != null) dest.VersionAlgorithm = (Hl7.Fhir.Model.DataType)VersionAlgorithm.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CopyrightLabelElement != null) dest.CopyrightLabelElement = (Hl7.Fhir.Model.FhirString)CopyrightLabelElement.DeepCopyInternal(); + if(Origin.Any()) dest.Origin = new List(Origin.DeepCopyInternal()); + if(Destination.Any()) dest.Destination = new List(Destination.DeepCopyInternal()); + if(Metadata != null) dest.Metadata = (Hl7.Fhir.Model.TestScript.MetadataComponent)Metadata.DeepCopyInternal(); + if(Scope.Any()) dest.Scope = new List(Scope.DeepCopyInternal()); + if(Fixture.Any()) dest.Fixture = new List(Fixture.DeepCopyInternal()); + if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopyInternal()); + if(Variable.Any()) dest.Variable = new List(Variable.DeepCopyInternal()); + if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestScript.SetupComponent)Setup.DeepCopyInternal(); + if(Test.Any()) dest.Test = new List(Test.DeepCopyInternal()); + if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestScript.TeardownComponent)Teardown.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestScript()); + var instance = new TestScript(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Timing.cs b/src/Hl7.Fhir.R5/Model/Generated/Timing.cs index 70bdb074f3..321fa9e1e9 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Timing.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Timing.cs @@ -761,7 +761,7 @@ public int? Offset } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepeatComponent; @@ -770,28 +770,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Bounds != null) dest.Bounds = (Hl7.Fhir.Model.DataType)Bounds.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.PositiveInt)CountElement.DeepCopy(); - if(CountMaxElement != null) dest.CountMaxElement = (Hl7.Fhir.Model.PositiveInt)CountMaxElement.DeepCopy(); - if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopy(); - if(DurationMaxElement != null) dest.DurationMaxElement = (Hl7.Fhir.Model.FhirDecimal)DurationMaxElement.DeepCopy(); - if(DurationUnitElement != null) dest.DurationUnitElement = (Code)DurationUnitElement.DeepCopy(); - if(FrequencyElement != null) dest.FrequencyElement = (Hl7.Fhir.Model.PositiveInt)FrequencyElement.DeepCopy(); - if(FrequencyMaxElement != null) dest.FrequencyMaxElement = (Hl7.Fhir.Model.PositiveInt)FrequencyMaxElement.DeepCopy(); - if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopy(); - if(PeriodMaxElement != null) dest.PeriodMaxElement = (Hl7.Fhir.Model.FhirDecimal)PeriodMaxElement.DeepCopy(); - if(PeriodUnitElement != null) dest.PeriodUnitElement = (Code)PeriodUnitElement.DeepCopy(); - if(DayOfWeekElement.Any()) dest.DayOfWeekElement = new List>(DayOfWeekElement.DeepCopy()); - if(TimeOfDayElement.Any()) dest.TimeOfDayElement = new List(TimeOfDayElement.DeepCopy()); - if(WhenElement.Any()) dest.WhenElement = new List>(WhenElement.DeepCopy()); - if(OffsetElement != null) dest.OffsetElement = (Hl7.Fhir.Model.UnsignedInt)OffsetElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Bounds != null) dest.Bounds = (Hl7.Fhir.Model.DataType)Bounds.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.PositiveInt)CountElement.DeepCopyInternal(); + if(CountMaxElement != null) dest.CountMaxElement = (Hl7.Fhir.Model.PositiveInt)CountMaxElement.DeepCopyInternal(); + if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopyInternal(); + if(DurationMaxElement != null) dest.DurationMaxElement = (Hl7.Fhir.Model.FhirDecimal)DurationMaxElement.DeepCopyInternal(); + if(DurationUnitElement != null) dest.DurationUnitElement = (Code)DurationUnitElement.DeepCopyInternal(); + if(FrequencyElement != null) dest.FrequencyElement = (Hl7.Fhir.Model.PositiveInt)FrequencyElement.DeepCopyInternal(); + if(FrequencyMaxElement != null) dest.FrequencyMaxElement = (Hl7.Fhir.Model.PositiveInt)FrequencyMaxElement.DeepCopyInternal(); + if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopyInternal(); + if(PeriodMaxElement != null) dest.PeriodMaxElement = (Hl7.Fhir.Model.FhirDecimal)PeriodMaxElement.DeepCopyInternal(); + if(PeriodUnitElement != null) dest.PeriodUnitElement = (Code)PeriodUnitElement.DeepCopyInternal(); + if(DayOfWeekElement.Any()) dest.DayOfWeekElement = new List>(DayOfWeekElement.DeepCopyInternal()); + if(TimeOfDayElement.Any()) dest.TimeOfDayElement = new List(TimeOfDayElement.DeepCopyInternal()); + if(WhenElement.Any()) dest.WhenElement = new List>(WhenElement.DeepCopyInternal()); + if(OffsetElement != null) dest.OffsetElement = (Hl7.Fhir.Model.UnsignedInt)OffsetElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepeatComponent()); + var instance = new RepeatComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1010,7 +1011,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Timing; @@ -1019,16 +1020,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(EventElement.Any()) dest.EventElement = new List(EventElement.DeepCopy()); - if(Repeat != null) dest.Repeat = (Hl7.Fhir.Model.Timing.RepeatComponent)Repeat.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(EventElement.Any()) dest.EventElement = new List(EventElement.DeepCopyInternal()); + if(Repeat != null) dest.Repeat = (Hl7.Fhir.Model.Timing.RepeatComponent)Repeat.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Timing()); + var instance = new Timing(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/Transport.cs b/src/Hl7.Fhir.R5/Model/Generated/Transport.cs index c59d9f09d5..52517062ab 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/Transport.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/Transport.cs @@ -245,7 +245,7 @@ public List Recipient private List _Recipient; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RestrictionComponent; @@ -254,16 +254,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RepetitionsElement != null) dest.RepetitionsElement = (Hl7.Fhir.Model.PositiveInt)RepetitionsElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RepetitionsElement != null) dest.RepetitionsElement = (Hl7.Fhir.Model.PositiveInt)RepetitionsElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RestrictionComponent()); + var instance = new RestrictionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -374,7 +375,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -383,15 +384,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -494,7 +496,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OutputComponent; @@ -503,15 +505,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OutputComponent()); + var instance = new OutputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1195,7 +1198,7 @@ public Hl7.Fhir.Model.ResourceReference History List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Transport; @@ -1204,45 +1207,46 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(InstantiatesCanonicalElement != null) dest.InstantiatesCanonicalElement = (Hl7.Fhir.Model.Canonical)InstantiatesCanonicalElement.DeepCopy(); - if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopy(); - if(For != null) dest.For = (Hl7.Fhir.Model.ResourceReference)For.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(CompletionTimeElement != null) dest.CompletionTimeElement = (Hl7.Fhir.Model.FhirDateTime)CompletionTimeElement.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(LastModifiedElement != null) dest.LastModifiedElement = (Hl7.Fhir.Model.FhirDateTime)LastModifiedElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopy(); - if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopy()); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - if(Restriction != null) dest.Restriction = (Hl7.Fhir.Model.Transport.RestrictionComponent)Restriction.DeepCopy(); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Output.Any()) dest.Output = new List(Output.DeepCopy()); - if(RequestedLocation != null) dest.RequestedLocation = (Hl7.Fhir.Model.ResourceReference)RequestedLocation.DeepCopy(); - if(CurrentLocation != null) dest.CurrentLocation = (Hl7.Fhir.Model.ResourceReference)CurrentLocation.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableReference)Reason.DeepCopy(); - if(History != null) dest.History = (Hl7.Fhir.Model.ResourceReference)History.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(InstantiatesCanonicalElement != null) dest.InstantiatesCanonicalElement = (Hl7.Fhir.Model.Canonical)InstantiatesCanonicalElement.DeepCopyInternal(); + if(InstantiatesUriElement != null) dest.InstantiatesUriElement = (Hl7.Fhir.Model.FhirUri)InstantiatesUriElement.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopyInternal(); + if(For != null) dest.For = (Hl7.Fhir.Model.ResourceReference)For.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(CompletionTimeElement != null) dest.CompletionTimeElement = (Hl7.Fhir.Model.FhirDateTime)CompletionTimeElement.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(LastModifiedElement != null) dest.LastModifiedElement = (Hl7.Fhir.Model.FhirDateTime)LastModifiedElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ResourceReference)Requester.DeepCopyInternal(); + if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopyInternal()); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); + if(Restriction != null) dest.Restriction = (Hl7.Fhir.Model.Transport.RestrictionComponent)Restriction.DeepCopyInternal(); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Output.Any()) dest.Output = new List(Output.DeepCopyInternal()); + if(RequestedLocation != null) dest.RequestedLocation = (Hl7.Fhir.Model.ResourceReference)RequestedLocation.DeepCopyInternal(); + if(CurrentLocation != null) dest.CurrentLocation = (Hl7.Fhir.Model.ResourceReference)CurrentLocation.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableReference)Reason.DeepCopyInternal(); + if(History != null) dest.History = (Hl7.Fhir.Model.ResourceReference)History.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Transport()); + var instance = new Transport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/TriggerDefinition.cs b/src/Hl7.Fhir.R5/Model/Generated/TriggerDefinition.cs index 1a9aca34d1..66fe96c902 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/TriggerDefinition.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/TriggerDefinition.cs @@ -270,7 +270,7 @@ public Hl7.Fhir.Model.Expression Condition private Hl7.Fhir.Model.Expression _Condition; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TriggerDefinition; @@ -279,20 +279,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(SubscriptionTopicElement != null) dest.SubscriptionTopicElement = (Hl7.Fhir.Model.Canonical)SubscriptionTopicElement.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Data.Any()) dest.Data = new List(Data.DeepCopy()); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.Expression)Condition.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(SubscriptionTopicElement != null) dest.SubscriptionTopicElement = (Hl7.Fhir.Model.Canonical)SubscriptionTopicElement.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Data.Any()) dest.Data = new List(Data.DeepCopyInternal()); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.Expression)Condition.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TriggerDefinition()); + var instance = new TriggerDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/VerificationResult.cs b/src/Hl7.Fhir.R5/Model/Generated/VerificationResult.cs index 3addb5f469..1b6fb680db 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/VerificationResult.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/VerificationResult.cs @@ -240,7 +240,7 @@ public List PushTypeAvailable private List _PushTypeAvailable; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PrimarySourceComponent; @@ -249,20 +249,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(CommunicationMethod.Any()) dest.CommunicationMethod = new List(CommunicationMethod.DeepCopy()); - if(ValidationStatus != null) dest.ValidationStatus = (Hl7.Fhir.Model.CodeableConcept)ValidationStatus.DeepCopy(); - if(ValidationDateElement != null) dest.ValidationDateElement = (Hl7.Fhir.Model.FhirDateTime)ValidationDateElement.DeepCopy(); - if(CanPushUpdates != null) dest.CanPushUpdates = (Hl7.Fhir.Model.CodeableConcept)CanPushUpdates.DeepCopy(); - if(PushTypeAvailable.Any()) dest.PushTypeAvailable = new List(PushTypeAvailable.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(CommunicationMethod.Any()) dest.CommunicationMethod = new List(CommunicationMethod.DeepCopyInternal()); + if(ValidationStatus != null) dest.ValidationStatus = (Hl7.Fhir.Model.CodeableConcept)ValidationStatus.DeepCopyInternal(); + if(ValidationDateElement != null) dest.ValidationDateElement = (Hl7.Fhir.Model.FhirDateTime)ValidationDateElement.DeepCopyInternal(); + if(CanPushUpdates != null) dest.CanPushUpdates = (Hl7.Fhir.Model.CodeableConcept)CanPushUpdates.DeepCopyInternal(); + if(PushTypeAvailable.Any()) dest.PushTypeAvailable = new List(PushTypeAvailable.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PrimarySourceComponent()); + var instance = new PrimarySourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -534,7 +535,7 @@ public Hl7.Fhir.Model.Signature SourceSignature private Hl7.Fhir.Model.Signature _SourceSignature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AttestationComponent; @@ -543,21 +544,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - if(CommunicationMethod != null) dest.CommunicationMethod = (Hl7.Fhir.Model.CodeableConcept)CommunicationMethod.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(SourceIdentityCertificateElement != null) dest.SourceIdentityCertificateElement = (Hl7.Fhir.Model.FhirString)SourceIdentityCertificateElement.DeepCopy(); - if(ProxyIdentityCertificateElement != null) dest.ProxyIdentityCertificateElement = (Hl7.Fhir.Model.FhirString)ProxyIdentityCertificateElement.DeepCopy(); - if(ProxySignature != null) dest.ProxySignature = (Hl7.Fhir.Model.Signature)ProxySignature.DeepCopy(); - if(SourceSignature != null) dest.SourceSignature = (Hl7.Fhir.Model.Signature)SourceSignature.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Who != null) dest.Who = (Hl7.Fhir.Model.ResourceReference)Who.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); + if(CommunicationMethod != null) dest.CommunicationMethod = (Hl7.Fhir.Model.CodeableConcept)CommunicationMethod.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(SourceIdentityCertificateElement != null) dest.SourceIdentityCertificateElement = (Hl7.Fhir.Model.FhirString)SourceIdentityCertificateElement.DeepCopyInternal(); + if(ProxyIdentityCertificateElement != null) dest.ProxyIdentityCertificateElement = (Hl7.Fhir.Model.FhirString)ProxyIdentityCertificateElement.DeepCopyInternal(); + if(ProxySignature != null) dest.ProxySignature = (Hl7.Fhir.Model.Signature)ProxySignature.DeepCopyInternal(); + if(SourceSignature != null) dest.SourceSignature = (Hl7.Fhir.Model.Signature)SourceSignature.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AttestationComponent()); + var instance = new AttestationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -734,7 +736,7 @@ public Hl7.Fhir.Model.Signature AttestationSignature private Hl7.Fhir.Model.Signature _AttestationSignature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ValidatorComponent; @@ -743,16 +745,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(IdentityCertificateElement != null) dest.IdentityCertificateElement = (Hl7.Fhir.Model.FhirString)IdentityCertificateElement.DeepCopy(); - if(AttestationSignature != null) dest.AttestationSignature = (Hl7.Fhir.Model.Signature)AttestationSignature.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(IdentityCertificateElement != null) dest.IdentityCertificateElement = (Hl7.Fhir.Model.FhirString)IdentityCertificateElement.DeepCopyInternal(); + if(AttestationSignature != null) dest.AttestationSignature = (Hl7.Fhir.Model.Signature)AttestationSignature.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ValidatorComponent()); + var instance = new ValidatorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1102,7 +1105,7 @@ public List Validator private List _Validator; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VerificationResult; @@ -1111,27 +1114,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(TargetLocationElement.Any()) dest.TargetLocationElement = new List(TargetLocationElement.DeepCopy()); - if(Need != null) dest.Need = (Hl7.Fhir.Model.CodeableConcept)Need.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopy(); - if(ValidationType != null) dest.ValidationType = (Hl7.Fhir.Model.CodeableConcept)ValidationType.DeepCopy(); - if(ValidationProcess.Any()) dest.ValidationProcess = new List(ValidationProcess.DeepCopy()); - if(Frequency != null) dest.Frequency = (Hl7.Fhir.Model.Timing)Frequency.DeepCopy(); - if(LastPerformedElement != null) dest.LastPerformedElement = (Hl7.Fhir.Model.FhirDateTime)LastPerformedElement.DeepCopy(); - if(NextScheduledElement != null) dest.NextScheduledElement = (Hl7.Fhir.Model.Date)NextScheduledElement.DeepCopy(); - if(FailureAction != null) dest.FailureAction = (Hl7.Fhir.Model.CodeableConcept)FailureAction.DeepCopy(); - if(PrimarySource.Any()) dest.PrimarySource = new List(PrimarySource.DeepCopy()); - if(Attestation != null) dest.Attestation = (Hl7.Fhir.Model.VerificationResult.AttestationComponent)Attestation.DeepCopy(); - if(Validator.Any()) dest.Validator = new List(Validator.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(TargetLocationElement.Any()) dest.TargetLocationElement = new List(TargetLocationElement.DeepCopyInternal()); + if(Need != null) dest.Need = (Hl7.Fhir.Model.CodeableConcept)Need.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.FhirDateTime)StatusDateElement.DeepCopyInternal(); + if(ValidationType != null) dest.ValidationType = (Hl7.Fhir.Model.CodeableConcept)ValidationType.DeepCopyInternal(); + if(ValidationProcess.Any()) dest.ValidationProcess = new List(ValidationProcess.DeepCopyInternal()); + if(Frequency != null) dest.Frequency = (Hl7.Fhir.Model.Timing)Frequency.DeepCopyInternal(); + if(LastPerformedElement != null) dest.LastPerformedElement = (Hl7.Fhir.Model.FhirDateTime)LastPerformedElement.DeepCopyInternal(); + if(NextScheduledElement != null) dest.NextScheduledElement = (Hl7.Fhir.Model.Date)NextScheduledElement.DeepCopyInternal(); + if(FailureAction != null) dest.FailureAction = (Hl7.Fhir.Model.CodeableConcept)FailureAction.DeepCopyInternal(); + if(PrimarySource.Any()) dest.PrimarySource = new List(PrimarySource.DeepCopyInternal()); + if(Attestation != null) dest.Attestation = (Hl7.Fhir.Model.VerificationResult.AttestationComponent)Attestation.DeepCopyInternal(); + if(Validator.Any()) dest.Validator = new List(Validator.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VerificationResult()); + var instance = new VerificationResult(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/VirtualServiceDetail.cs b/src/Hl7.Fhir.R5/Model/Generated/VirtualServiceDetail.cs index 7891f21b15..23bd84eeee 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/VirtualServiceDetail.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/VirtualServiceDetail.cs @@ -179,7 +179,7 @@ public string SessionKey } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VirtualServiceDetail; @@ -188,18 +188,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ChannelType != null) dest.ChannelType = (Hl7.Fhir.Model.Coding)ChannelType.DeepCopy(); - if(Address != null) dest.Address = (Hl7.Fhir.Model.DataType)Address.DeepCopy(); - if(AdditionalInfoElement.Any()) dest.AdditionalInfoElement = new List(AdditionalInfoElement.DeepCopy()); - if(MaxParticipantsElement != null) dest.MaxParticipantsElement = (Hl7.Fhir.Model.PositiveInt)MaxParticipantsElement.DeepCopy(); - if(SessionKeyElement != null) dest.SessionKeyElement = (Hl7.Fhir.Model.FhirString)SessionKeyElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ChannelType != null) dest.ChannelType = (Hl7.Fhir.Model.Coding)ChannelType.DeepCopyInternal(); + if(Address != null) dest.Address = (Hl7.Fhir.Model.DataType)Address.DeepCopyInternal(); + if(AdditionalInfoElement.Any()) dest.AdditionalInfoElement = new List(AdditionalInfoElement.DeepCopyInternal()); + if(MaxParticipantsElement != null) dest.MaxParticipantsElement = (Hl7.Fhir.Model.PositiveInt)MaxParticipantsElement.DeepCopyInternal(); + if(SessionKeyElement != null) dest.SessionKeyElement = (Hl7.Fhir.Model.FhirString)SessionKeyElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VirtualServiceDetail()); + var instance = new VirtualServiceDetail(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.R5/Model/Generated/VisionPrescription.cs b/src/Hl7.Fhir.R5/Model/Generated/VisionPrescription.cs index 2fc99a9e9a..fd90a3ceef 100644 --- a/src/Hl7.Fhir.R5/Model/Generated/VisionPrescription.cs +++ b/src/Hl7.Fhir.R5/Model/Generated/VisionPrescription.cs @@ -500,7 +500,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LensSpecificationComponent; @@ -509,27 +509,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Product != null) dest.Product = (Hl7.Fhir.Model.CodeableConcept)Product.DeepCopy(); - if(EyeElement != null) dest.EyeElement = (Code)EyeElement.DeepCopy(); - if(SphereElement != null) dest.SphereElement = (Hl7.Fhir.Model.FhirDecimal)SphereElement.DeepCopy(); - if(CylinderElement != null) dest.CylinderElement = (Hl7.Fhir.Model.FhirDecimal)CylinderElement.DeepCopy(); - if(AxisElement != null) dest.AxisElement = (Hl7.Fhir.Model.Integer)AxisElement.DeepCopy(); - if(Prism.Any()) dest.Prism = new List(Prism.DeepCopy()); - if(AddElement != null) dest.AddElement = (Hl7.Fhir.Model.FhirDecimal)AddElement.DeepCopy(); - if(PowerElement != null) dest.PowerElement = (Hl7.Fhir.Model.FhirDecimal)PowerElement.DeepCopy(); - if(BackCurveElement != null) dest.BackCurveElement = (Hl7.Fhir.Model.FhirDecimal)BackCurveElement.DeepCopy(); - if(DiameterElement != null) dest.DiameterElement = (Hl7.Fhir.Model.FhirDecimal)DiameterElement.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Quantity)Duration.DeepCopy(); - if(ColorElement != null) dest.ColorElement = (Hl7.Fhir.Model.FhirString)ColorElement.DeepCopy(); - if(BrandElement != null) dest.BrandElement = (Hl7.Fhir.Model.FhirString)BrandElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Product != null) dest.Product = (Hl7.Fhir.Model.CodeableConcept)Product.DeepCopyInternal(); + if(EyeElement != null) dest.EyeElement = (Code)EyeElement.DeepCopyInternal(); + if(SphereElement != null) dest.SphereElement = (Hl7.Fhir.Model.FhirDecimal)SphereElement.DeepCopyInternal(); + if(CylinderElement != null) dest.CylinderElement = (Hl7.Fhir.Model.FhirDecimal)CylinderElement.DeepCopyInternal(); + if(AxisElement != null) dest.AxisElement = (Hl7.Fhir.Model.Integer)AxisElement.DeepCopyInternal(); + if(Prism.Any()) dest.Prism = new List(Prism.DeepCopyInternal()); + if(AddElement != null) dest.AddElement = (Hl7.Fhir.Model.FhirDecimal)AddElement.DeepCopyInternal(); + if(PowerElement != null) dest.PowerElement = (Hl7.Fhir.Model.FhirDecimal)PowerElement.DeepCopyInternal(); + if(BackCurveElement != null) dest.BackCurveElement = (Hl7.Fhir.Model.FhirDecimal)BackCurveElement.DeepCopyInternal(); + if(DiameterElement != null) dest.DiameterElement = (Hl7.Fhir.Model.FhirDecimal)DiameterElement.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Quantity)Duration.DeepCopyInternal(); + if(ColorElement != null) dest.ColorElement = (Hl7.Fhir.Model.FhirString)ColorElement.DeepCopyInternal(); + if(BrandElement != null) dest.BrandElement = (Hl7.Fhir.Model.FhirString)BrandElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LensSpecificationComponent()); + var instance = new LensSpecificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -763,7 +764,7 @@ public Hl7.Fhir.Model.VisionPrescription.VisionBase? Base } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PrismComponent; @@ -772,15 +773,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AmountElement != null) dest.AmountElement = (Hl7.Fhir.Model.FhirDecimal)AmountElement.DeepCopy(); - if(BaseElement != null) dest.BaseElement = (Code)BaseElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AmountElement != null) dest.AmountElement = (Hl7.Fhir.Model.FhirDecimal)AmountElement.DeepCopyInternal(); + if(BaseElement != null) dest.BaseElement = (Code)BaseElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PrismComponent()); + var instance = new PrismComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1011,7 +1013,7 @@ public List LensSp List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VisionPrescription; @@ -1020,21 +1022,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateWrittenElement != null) dest.DateWrittenElement = (Hl7.Fhir.Model.FhirDateTime)DateWrittenElement.DeepCopy(); - if(Prescriber != null) dest.Prescriber = (Hl7.Fhir.Model.ResourceReference)Prescriber.DeepCopy(); - if(LensSpecification.Any()) dest.LensSpecification = new List(LensSpecification.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateWrittenElement != null) dest.DateWrittenElement = (Hl7.Fhir.Model.FhirDateTime)DateWrittenElement.DeepCopyInternal(); + if(Prescriber != null) dest.Prescriber = (Hl7.Fhir.Model.ResourceReference)Prescriber.DeepCopyInternal(); + if(LensSpecification.Any()) dest.LensSpecification = new List(LensSpecification.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VisionPrescription()); + var instance = new VisionPrescription(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3.Tests/Model/DeepCopyTest.cs b/src/Hl7.Fhir.STU3.Tests/Model/DeepCopyTest.cs index d7749025fd..1282805533 100644 --- a/src/Hl7.Fhir.STU3.Tests/Model/DeepCopyTest.cs +++ b/src/Hl7.Fhir.STU3.Tests/Model/DeepCopyTest.cs @@ -53,7 +53,7 @@ public void CollectionDeepCopySemantics() var p2 = new Patient(); var patients = new List { p1, p2 }; - var patientsCopy = patients.DeepCopy(); + var patientsCopy = patients.DeepCopyInternal(); patients.Remove(p1); Assert.AreEqual(2, patientsCopy.Count()); diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Account.cs b/src/Hl7.Fhir.STU3/Model/Generated/Account.cs index b2adb9cf9d..65e2810006 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Account.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Account.cs @@ -152,7 +152,7 @@ public int? Priority } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CoverageComponent; @@ -161,15 +161,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.PositiveInt)PriorityElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.PositiveInt)PriorityElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CoverageComponent()); + var instance = new CoverageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -301,7 +302,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GuarantorComponent; @@ -310,16 +311,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - if(OnHoldElement != null) dest.OnHoldElement = (Hl7.Fhir.Model.FhirBoolean)OnHoldElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); + if(OnHoldElement != null) dest.OnHoldElement = (Hl7.Fhir.Model.FhirBoolean)OnHoldElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GuarantorComponent()); + var instance = new GuarantorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -605,7 +607,7 @@ public List Guarantor List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Account; @@ -614,25 +616,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Active != null) dest.Active = (Hl7.Fhir.Model.Period)Active.DeepCopy(); - if(Balance != null) dest.Balance = (Hl7.Fhir.Model.Money)Balance.DeepCopy(); - if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopy()); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Guarantor.Any()) dest.Guarantor = new List(Guarantor.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Active != null) dest.Active = (Hl7.Fhir.Model.Period)Active.DeepCopyInternal(); + if(Balance != null) dest.Balance = (Hl7.Fhir.Model.Money)Balance.DeepCopyInternal(); + if(Coverage.Any()) dest.Coverage = new List(Coverage.DeepCopyInternal()); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Guarantor.Any()) dest.Guarantor = new List(Guarantor.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Account()); + var instance = new Account(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ActivityDefinition.cs b/src/Hl7.Fhir.STU3/Model/Generated/ActivityDefinition.cs index 40ab36eb3a..10dde5f33d 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ActivityDefinition.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ActivityDefinition.cs @@ -123,7 +123,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -132,15 +132,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -336,7 +337,7 @@ public string Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DynamicValueComponent; @@ -345,17 +346,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.FhirString)LanguageElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.FhirString)LanguageElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DynamicValueComponent()); + var instance = new DynamicValueComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1174,7 +1176,7 @@ public List DynamicValu List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActivityDefinition; @@ -1183,47 +1185,48 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Library.Any()) dest.Library = new List(Library.DeepCopy()); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Transform != null) dest.Transform = (Hl7.Fhir.Model.ResourceReference)Transform.DeepCopy(); - if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Library.Any()) dest.Library = new List(Library.DeepCopyInternal()); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Transform != null) dest.Transform = (Hl7.Fhir.Model.ResourceReference)Transform.DeepCopyInternal(); + if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActivityDefinition()); + var instance = new ActivityDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Address.cs b/src/Hl7.Fhir.STU3/Model/Generated/Address.cs index fc3041ff66..48a7290f04 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Address.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Address.cs @@ -419,7 +419,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Address; @@ -428,23 +428,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(LineElement.Any()) dest.LineElement = new List(LineElement.DeepCopy()); - if(CityElement != null) dest.CityElement = (Hl7.Fhir.Model.FhirString)CityElement.DeepCopy(); - if(DistrictElement != null) dest.DistrictElement = (Hl7.Fhir.Model.FhirString)DistrictElement.DeepCopy(); - if(StateElement != null) dest.StateElement = (Hl7.Fhir.Model.FhirString)StateElement.DeepCopy(); - if(PostalCodeElement != null) dest.PostalCodeElement = (Hl7.Fhir.Model.FhirString)PostalCodeElement.DeepCopy(); - if(CountryElement != null) dest.CountryElement = (Hl7.Fhir.Model.FhirString)CountryElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(LineElement.Any()) dest.LineElement = new List(LineElement.DeepCopyInternal()); + if(CityElement != null) dest.CityElement = (Hl7.Fhir.Model.FhirString)CityElement.DeepCopyInternal(); + if(DistrictElement != null) dest.DistrictElement = (Hl7.Fhir.Model.FhirString)DistrictElement.DeepCopyInternal(); + if(StateElement != null) dest.StateElement = (Hl7.Fhir.Model.FhirString)StateElement.DeepCopyInternal(); + if(PostalCodeElement != null) dest.PostalCodeElement = (Hl7.Fhir.Model.FhirString)PostalCodeElement.DeepCopyInternal(); + if(CountryElement != null) dest.CountryElement = (Hl7.Fhir.Model.FhirString)CountryElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Address()); + var instance = new Address(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/AdverseEvent.cs b/src/Hl7.Fhir.STU3/Model/Generated/AdverseEvent.cs index 29a7810d44..7109a95c4d 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/AdverseEvent.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/AdverseEvent.cs @@ -302,7 +302,7 @@ public Hl7.Fhir.Model.CodeableConcept CausalityResult private Hl7.Fhir.Model.CodeableConcept _CausalityResult; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SuspectEntityComponent; @@ -311,20 +311,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Instance != null) dest.Instance = (Hl7.Fhir.Model.ResourceReference)Instance.DeepCopy(); - if(CausalityElement != null) dest.CausalityElement = (Code)CausalityElement.DeepCopy(); - if(CausalityAssessment != null) dest.CausalityAssessment = (Hl7.Fhir.Model.CodeableConcept)CausalityAssessment.DeepCopy(); - if(CausalityProductRelatednessElement != null) dest.CausalityProductRelatednessElement = (Hl7.Fhir.Model.FhirString)CausalityProductRelatednessElement.DeepCopy(); - if(CausalityMethod != null) dest.CausalityMethod = (Hl7.Fhir.Model.CodeableConcept)CausalityMethod.DeepCopy(); - if(CausalityAuthor != null) dest.CausalityAuthor = (Hl7.Fhir.Model.ResourceReference)CausalityAuthor.DeepCopy(); - if(CausalityResult != null) dest.CausalityResult = (Hl7.Fhir.Model.CodeableConcept)CausalityResult.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Instance != null) dest.Instance = (Hl7.Fhir.Model.ResourceReference)Instance.DeepCopyInternal(); + if(CausalityElement != null) dest.CausalityElement = (Code)CausalityElement.DeepCopyInternal(); + if(CausalityAssessment != null) dest.CausalityAssessment = (Hl7.Fhir.Model.CodeableConcept)CausalityAssessment.DeepCopyInternal(); + if(CausalityProductRelatednessElement != null) dest.CausalityProductRelatednessElement = (Hl7.Fhir.Model.FhirString)CausalityProductRelatednessElement.DeepCopyInternal(); + if(CausalityMethod != null) dest.CausalityMethod = (Hl7.Fhir.Model.CodeableConcept)CausalityMethod.DeepCopyInternal(); + if(CausalityAuthor != null) dest.CausalityAuthor = (Hl7.Fhir.Model.ResourceReference)CausalityAuthor.DeepCopyInternal(); + if(CausalityResult != null) dest.CausalityResult = (Hl7.Fhir.Model.CodeableConcept)CausalityResult.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SuspectEntityComponent()); + var instance = new SuspectEntityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -712,7 +713,7 @@ public List Study Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdverseEvent; @@ -721,29 +722,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Seriousness != null) dest.Seriousness = (Hl7.Fhir.Model.CodeableConcept)Seriousness.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(EventParticipant != null) dest.EventParticipant = (Hl7.Fhir.Model.ResourceReference)EventParticipant.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(SuspectEntity.Any()) dest.SuspectEntity = new List(SuspectEntity.DeepCopy()); - if(SubjectMedicalHistory.Any()) dest.SubjectMedicalHistory = new List(SubjectMedicalHistory.DeepCopy()); - if(ReferenceDocument.Any()) dest.ReferenceDocument = new List(ReferenceDocument.DeepCopy()); - if(Study.Any()) dest.Study = new List(Study.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Seriousness != null) dest.Seriousness = (Hl7.Fhir.Model.CodeableConcept)Seriousness.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(EventParticipant != null) dest.EventParticipant = (Hl7.Fhir.Model.ResourceReference)EventParticipant.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(SuspectEntity.Any()) dest.SuspectEntity = new List(SuspectEntity.DeepCopyInternal()); + if(SubjectMedicalHistory.Any()) dest.SubjectMedicalHistory = new List(SubjectMedicalHistory.DeepCopyInternal()); + if(ReferenceDocument.Any()) dest.ReferenceDocument = new List(ReferenceDocument.DeepCopyInternal()); + if(Study.Any()) dest.Study = new List(Study.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdverseEvent()); + var instance = new AdverseEvent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Age.cs b/src/Hl7.Fhir.STU3/Model/Generated/Age.cs index 8eabde3886..13cd297c15 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Age.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Age.cs @@ -59,9 +59,11 @@ public partial class Age : Quantity /// public override string TypeName { get { return "Age"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Age()); + var instance = new Age(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.STU3/Model/Generated/AllergyIntolerance.cs b/src/Hl7.Fhir.STU3/Model/Generated/AllergyIntolerance.cs index 204d995be9..64dd1dfa45 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/AllergyIntolerance.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/AllergyIntolerance.cs @@ -402,7 +402,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReactionComponent; @@ -411,20 +411,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopy(); - if(Manifestation.Any()) dest.Manifestation = new List(Manifestation.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(OnsetElement != null) dest.OnsetElement = (Hl7.Fhir.Model.FhirDateTime)OnsetElement.DeepCopy(); - if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopy(); - if(ExposureRoute != null) dest.ExposureRoute = (Hl7.Fhir.Model.CodeableConcept)ExposureRoute.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.CodeableConcept)Substance.DeepCopyInternal(); + if(Manifestation.Any()) dest.Manifestation = new List(Manifestation.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(OnsetElement != null) dest.OnsetElement = (Hl7.Fhir.Model.FhirDateTime)OnsetElement.DeepCopyInternal(); + if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopyInternal(); + if(ExposureRoute != null) dest.ExposureRoute = (Hl7.Fhir.Model.CodeableConcept)ExposureRoute.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReactionComponent()); + var instance = new ReactionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -868,7 +869,7 @@ public List Reaction List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AllergyIntolerance; @@ -877,28 +878,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ClinicalStatusElement != null) dest.ClinicalStatusElement = (Code)ClinicalStatusElement.DeepCopy(); - if(VerificationStatusElement != null) dest.VerificationStatusElement = (Code)VerificationStatusElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(CategoryElement.Any()) dest.CategoryElement = new List>(CategoryElement.DeepCopy()); - if(CriticalityElement != null) dest.CriticalityElement = (Code)CriticalityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy(); - if(AssertedDateElement != null) dest.AssertedDateElement = (Hl7.Fhir.Model.FhirDateTime)AssertedDateElement.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy(); - if(LastOccurrenceElement != null) dest.LastOccurrenceElement = (Hl7.Fhir.Model.FhirDateTime)LastOccurrenceElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ClinicalStatusElement != null) dest.ClinicalStatusElement = (Code)ClinicalStatusElement.DeepCopyInternal(); + if(VerificationStatusElement != null) dest.VerificationStatusElement = (Code)VerificationStatusElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(CategoryElement.Any()) dest.CategoryElement = new List>(CategoryElement.DeepCopyInternal()); + if(CriticalityElement != null) dest.CriticalityElement = (Code)CriticalityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopyInternal(); + if(AssertedDateElement != null) dest.AssertedDateElement = (Hl7.Fhir.Model.FhirDateTime)AssertedDateElement.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopyInternal(); + if(LastOccurrenceElement != null) dest.LastOccurrenceElement = (Hl7.Fhir.Model.FhirDateTime)LastOccurrenceElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AllergyIntolerance()); + var instance = new AllergyIntolerance(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Annotation.cs b/src/Hl7.Fhir.STU3/Model/Generated/Annotation.cs index 88d03c1153..7015db2d0e 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Annotation.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Annotation.cs @@ -139,7 +139,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Annotation; @@ -148,16 +148,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Author != null) dest.Author = (Hl7.Fhir.Model.DataType)Author.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Author != null) dest.Author = (Hl7.Fhir.Model.DataType)Author.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Annotation()); + var instance = new Annotation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Appointment.cs b/src/Hl7.Fhir.STU3/Model/Generated/Appointment.cs index 37a47176ce..fcc15c728f 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Appointment.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Appointment.cs @@ -255,7 +255,7 @@ public Hl7.Fhir.Model.ParticipationStatus? Status } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -264,17 +264,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(RequiredElement != null) dest.RequiredElement = (Code)RequiredElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(RequiredElement != null) dest.RequiredElement = (Code)RequiredElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -778,7 +779,7 @@ public List RequestedPeriod List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Appointment; @@ -787,33 +788,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ServiceCategory != null) dest.ServiceCategory = (Hl7.Fhir.Model.CodeableConcept)ServiceCategory.DeepCopy(); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Indication.Any()) dest.Indication = new List(Indication.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.UnsignedInt)PriorityElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(MinutesDurationElement != null) dest.MinutesDurationElement = (Hl7.Fhir.Model.PositiveInt)MinutesDurationElement.DeepCopy(); - if(Slot.Any()) dest.Slot = new List(Slot.DeepCopy()); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(IncomingReferral.Any()) dest.IncomingReferral = new List(IncomingReferral.DeepCopy()); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(RequestedPeriod.Any()) dest.RequestedPeriod = new List(RequestedPeriod.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Appointment()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ServiceCategory != null) dest.ServiceCategory = (Hl7.Fhir.Model.CodeableConcept)ServiceCategory.DeepCopyInternal(); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Indication.Any()) dest.Indication = new List(Indication.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Hl7.Fhir.Model.UnsignedInt)PriorityElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(MinutesDurationElement != null) dest.MinutesDurationElement = (Hl7.Fhir.Model.PositiveInt)MinutesDurationElement.DeepCopyInternal(); + if(Slot.Any()) dest.Slot = new List(Slot.DeepCopyInternal()); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(IncomingReferral.Any()) dest.IncomingReferral = new List(IncomingReferral.DeepCopyInternal()); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(RequestedPeriod.Any()) dest.RequestedPeriod = new List(RequestedPeriod.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Appointment(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/AppointmentResponse.cs b/src/Hl7.Fhir.STU3/Model/Generated/AppointmentResponse.cs index c93d796ff8..9b2a524fd1 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/AppointmentResponse.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/AppointmentResponse.cs @@ -245,7 +245,7 @@ public string Comment List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AppointmentResponse; @@ -254,21 +254,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Appointment != null) dest.Appointment = (Hl7.Fhir.Model.ResourceReference)Appointment.DeepCopy(); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(ParticipantType.Any()) dest.ParticipantType = new List(ParticipantType.DeepCopy()); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(ParticipantStatusElement != null) dest.ParticipantStatusElement = (Code)ParticipantStatusElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Appointment != null) dest.Appointment = (Hl7.Fhir.Model.ResourceReference)Appointment.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(ParticipantType.Any()) dest.ParticipantType = new List(ParticipantType.DeepCopyInternal()); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(ParticipantStatusElement != null) dest.ParticipantStatusElement = (Code)ParticipantStatusElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AppointmentResponse()); + var instance = new AppointmentResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/AuditEvent.cs b/src/Hl7.Fhir.STU3/Model/Generated/AuditEvent.cs index 19e70a1e3f..86c0b4b6ff 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/AuditEvent.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/AuditEvent.cs @@ -418,7 +418,7 @@ public List PurposeOfUse private List _PurposeOfUse; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AgentComponent; @@ -427,24 +427,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role.Any()) dest.Role = new List(Role.DeepCopy()); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(UserId != null) dest.UserId = (Hl7.Fhir.Model.Identifier)UserId.DeepCopy(); - if(AltIdElement != null) dest.AltIdElement = (Hl7.Fhir.Model.FhirString)AltIdElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(RequestorElement != null) dest.RequestorElement = (Hl7.Fhir.Model.FhirBoolean)RequestorElement.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopy()); - if(Media != null) dest.Media = (Hl7.Fhir.Model.Coding)Media.DeepCopy(); - if(Network != null) dest.Network = (Hl7.Fhir.Model.AuditEvent.NetworkComponent)Network.DeepCopy(); - if(PurposeOfUse.Any()) dest.PurposeOfUse = new List(PurposeOfUse.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Role.Any()) dest.Role = new List(Role.DeepCopyInternal()); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(UserId != null) dest.UserId = (Hl7.Fhir.Model.Identifier)UserId.DeepCopyInternal(); + if(AltIdElement != null) dest.AltIdElement = (Hl7.Fhir.Model.FhirString)AltIdElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(RequestorElement != null) dest.RequestorElement = (Hl7.Fhir.Model.FhirBoolean)RequestorElement.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopyInternal()); + if(Media != null) dest.Media = (Hl7.Fhir.Model.Coding)Media.DeepCopyInternal(); + if(Network != null) dest.Network = (Hl7.Fhir.Model.AuditEvent.NetworkComponent)Network.DeepCopyInternal(); + if(PurposeOfUse.Any()) dest.PurposeOfUse = new List(PurposeOfUse.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AgentComponent()); + var instance = new AgentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -652,7 +653,7 @@ public Hl7.Fhir.Model.AuditEvent.AuditEventAgentNetworkType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NetworkComponent; @@ -661,15 +662,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirString)AddressElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirString)AddressElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NetworkComponent()); + var instance = new NetworkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -802,7 +804,7 @@ public List Type private List _Type; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceComponent; @@ -811,16 +813,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SiteElement != null) dest.SiteElement = (Hl7.Fhir.Model.FhirString)SiteElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SiteElement != null) dest.SiteElement = (Hl7.Fhir.Model.FhirString)SiteElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceComponent()); + var instance = new SourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1093,7 +1096,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EntityComponent; @@ -1102,23 +1105,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.Coding)Role.DeepCopy(); - if(Lifecycle != null) dest.Lifecycle = (Hl7.Fhir.Model.Coding)Lifecycle.DeepCopy(); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(QueryElement != null) dest.QueryElement = (Hl7.Fhir.Model.Base64Binary)QueryElement.DeepCopy(); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.Coding)Role.DeepCopyInternal(); + if(Lifecycle != null) dest.Lifecycle = (Hl7.Fhir.Model.Coding)Lifecycle.DeepCopyInternal(); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(QueryElement != null) dest.QueryElement = (Hl7.Fhir.Model.Base64Binary)QueryElement.DeepCopyInternal(); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EntityComponent()); + var instance = new EntityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1318,7 +1322,7 @@ public byte[] Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -1327,15 +1331,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.Base64Binary)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.Base64Binary)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1607,7 +1612,7 @@ public List Entity private List _Entity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AuditEvent; @@ -1616,23 +1621,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopy()); - if(ActionElement != null) dest.ActionElement = (Code)ActionElement.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopy(); - if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopy(); - if(OutcomeDescElement != null) dest.OutcomeDescElement = (Hl7.Fhir.Model.FhirString)OutcomeDescElement.DeepCopy(); - if(PurposeOfEvent.Any()) dest.PurposeOfEvent = new List(PurposeOfEvent.DeepCopy()); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - if(Source != null) dest.Source = (Hl7.Fhir.Model.AuditEvent.SourceComponent)Source.DeepCopy(); - if(Entity.Any()) dest.Entity = new List(Entity.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(Subtype.Any()) dest.Subtype = new List(Subtype.DeepCopyInternal()); + if(ActionElement != null) dest.ActionElement = (Code)ActionElement.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopyInternal(); + if(OutcomeElement != null) dest.OutcomeElement = (Code)OutcomeElement.DeepCopyInternal(); + if(OutcomeDescElement != null) dest.OutcomeDescElement = (Hl7.Fhir.Model.FhirString)OutcomeDescElement.DeepCopyInternal(); + if(PurposeOfEvent.Any()) dest.PurposeOfEvent = new List(PurposeOfEvent.DeepCopyInternal()); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); + if(Source != null) dest.Source = (Hl7.Fhir.Model.AuditEvent.SourceComponent)Source.DeepCopyInternal(); + if(Entity.Any()) dest.Entity = new List(Entity.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AuditEvent()); + var instance = new AuditEvent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Basic.cs b/src/Hl7.Fhir.STU3/Model/Generated/Basic.cs index ee3204a235..09ca30421a 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Basic.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Basic.cs @@ -151,7 +151,7 @@ public Hl7.Fhir.Model.ResourceReference Author List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Basic; @@ -160,18 +160,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.Date)CreatedElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.Date)CreatedElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Basic()); + var instance = new Basic(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/BodySite.cs b/src/Hl7.Fhir.STU3/Model/Generated/BodySite.cs index 8d7fdeca9c..eaea7dd450 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/BodySite.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/BodySite.cs @@ -196,7 +196,7 @@ public Hl7.Fhir.Model.ResourceReference Patient List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BodySite; @@ -205,20 +205,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Qualifier.Any()) dest.Qualifier = new List(Qualifier.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Image.Any()) dest.Image = new List(Image.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Qualifier.Any()) dest.Qualifier = new List(Qualifier.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Image.Any()) dest.Image = new List(Image.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BodySite()); + var instance = new BodySite(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/CapabilityStatement.cs b/src/Hl7.Fhir.STU3/Model/Generated/CapabilityStatement.cs index b04d39723e..a362ab4487 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/CapabilityStatement.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/CapabilityStatement.cs @@ -525,7 +525,7 @@ public string ReleaseDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SoftwareComponent; @@ -534,16 +534,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(ReleaseDateElement != null) dest.ReleaseDateElement = (Hl7.Fhir.Model.FhirDateTime)ReleaseDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(ReleaseDateElement != null) dest.ReleaseDateElement = (Hl7.Fhir.Model.FhirDateTime)ReleaseDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SoftwareComponent()); + var instance = new SoftwareComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -686,7 +687,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImplementationComponent; @@ -695,15 +696,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImplementationComponent()); + var instance = new ImplementationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -942,7 +944,7 @@ public IEnumerable Compartment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RestComponent; @@ -951,21 +953,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(Security != null) dest.Security = (Hl7.Fhir.Model.CapabilityStatement.SecurityComponent)Security.DeepCopy(); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - if(Interaction.Any()) dest.Interaction = new List(Interaction.DeepCopy()); - if(SearchParam.Any()) dest.SearchParam = new List(SearchParam.DeepCopy()); - if(Operation.Any()) dest.Operation = new List(Operation.DeepCopy()); - if(CompartmentElement.Any()) dest.CompartmentElement = new List(CompartmentElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(Security != null) dest.Security = (Hl7.Fhir.Model.CapabilityStatement.SecurityComponent)Security.DeepCopyInternal(); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); + if(Interaction.Any()) dest.Interaction = new List(Interaction.DeepCopyInternal()); + if(SearchParam.Any()) dest.SearchParam = new List(SearchParam.DeepCopyInternal()); + if(Operation.Any()) dest.Operation = new List(Operation.DeepCopyInternal()); + if(CompartmentElement.Any()) dest.CompartmentElement = new List(CompartmentElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RestComponent()); + var instance = new RestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1176,7 +1179,7 @@ public List Certificate private List _Certificate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SecurityComponent; @@ -1185,17 +1188,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CorsElement != null) dest.CorsElement = (Hl7.Fhir.Model.FhirBoolean)CorsElement.DeepCopy(); - if(Service.Any()) dest.Service = new List(Service.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Certificate.Any()) dest.Certificate = new List(Certificate.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CorsElement != null) dest.CorsElement = (Hl7.Fhir.Model.FhirBoolean)CorsElement.DeepCopyInternal(); + if(Service.Any()) dest.Service = new List(Service.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Certificate.Any()) dest.Certificate = new List(Certificate.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SecurityComponent()); + var instance = new SecurityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1343,7 +1347,7 @@ public byte[] Blob } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CertificateComponent; @@ -1352,15 +1356,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.Code)TypeElement.DeepCopy(); - if(BlobElement != null) dest.BlobElement = (Hl7.Fhir.Model.Base64Binary)BlobElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.Code)TypeElement.DeepCopyInternal(); + if(BlobElement != null) dest.BlobElement = (Hl7.Fhir.Model.Base64Binary)BlobElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CertificateComponent()); + var instance = new CertificateComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1862,7 +1867,7 @@ public List SearchParam private List _SearchParam; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceComponent; @@ -1871,28 +1876,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.ResourceReference)Profile.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopy(); - if(Interaction.Any()) dest.Interaction = new List(Interaction.DeepCopy()); - if(VersioningElement != null) dest.VersioningElement = (Code)VersioningElement.DeepCopy(); - if(ReadHistoryElement != null) dest.ReadHistoryElement = (Hl7.Fhir.Model.FhirBoolean)ReadHistoryElement.DeepCopy(); - if(UpdateCreateElement != null) dest.UpdateCreateElement = (Hl7.Fhir.Model.FhirBoolean)UpdateCreateElement.DeepCopy(); - if(ConditionalCreateElement != null) dest.ConditionalCreateElement = (Hl7.Fhir.Model.FhirBoolean)ConditionalCreateElement.DeepCopy(); - if(ConditionalReadElement != null) dest.ConditionalReadElement = (Code)ConditionalReadElement.DeepCopy(); - if(ConditionalUpdateElement != null) dest.ConditionalUpdateElement = (Hl7.Fhir.Model.FhirBoolean)ConditionalUpdateElement.DeepCopy(); - if(ConditionalDeleteElement != null) dest.ConditionalDeleteElement = (Code)ConditionalDeleteElement.DeepCopy(); - if(ReferencePolicyElement.Any()) dest.ReferencePolicyElement = new List>(ReferencePolicyElement.DeepCopy()); - if(SearchIncludeElement.Any()) dest.SearchIncludeElement = new List(SearchIncludeElement.DeepCopy()); - if(SearchRevIncludeElement.Any()) dest.SearchRevIncludeElement = new List(SearchRevIncludeElement.DeepCopy()); - if(SearchParam.Any()) dest.SearchParam = new List(SearchParam.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.ResourceReference)Profile.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.Markdown)DocumentationElement.DeepCopyInternal(); + if(Interaction.Any()) dest.Interaction = new List(Interaction.DeepCopyInternal()); + if(VersioningElement != null) dest.VersioningElement = (Code)VersioningElement.DeepCopyInternal(); + if(ReadHistoryElement != null) dest.ReadHistoryElement = (Hl7.Fhir.Model.FhirBoolean)ReadHistoryElement.DeepCopyInternal(); + if(UpdateCreateElement != null) dest.UpdateCreateElement = (Hl7.Fhir.Model.FhirBoolean)UpdateCreateElement.DeepCopyInternal(); + if(ConditionalCreateElement != null) dest.ConditionalCreateElement = (Hl7.Fhir.Model.FhirBoolean)ConditionalCreateElement.DeepCopyInternal(); + if(ConditionalReadElement != null) dest.ConditionalReadElement = (Code)ConditionalReadElement.DeepCopyInternal(); + if(ConditionalUpdateElement != null) dest.ConditionalUpdateElement = (Hl7.Fhir.Model.FhirBoolean)ConditionalUpdateElement.DeepCopyInternal(); + if(ConditionalDeleteElement != null) dest.ConditionalDeleteElement = (Code)ConditionalDeleteElement.DeepCopyInternal(); + if(ReferencePolicyElement.Any()) dest.ReferencePolicyElement = new List>(ReferencePolicyElement.DeepCopyInternal()); + if(SearchIncludeElement.Any()) dest.SearchIncludeElement = new List(SearchIncludeElement.DeepCopyInternal()); + if(SearchRevIncludeElement.Any()) dest.SearchRevIncludeElement = new List(SearchRevIncludeElement.DeepCopyInternal()); + if(SearchParam.Any()) dest.SearchParam = new List(SearchParam.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceComponent()); + var instance = new ResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2133,7 +2139,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceInteractionComponent; @@ -2142,15 +2148,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceInteractionComponent()); + var instance = new ResourceInteractionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2350,7 +2357,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SearchParamComponent; @@ -2359,17 +2366,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SearchParamComponent()); + var instance = new SearchParamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2522,7 +2530,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SystemInteractionComponent; @@ -2531,15 +2539,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SystemInteractionComponent()); + var instance = new SystemInteractionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2659,7 +2668,7 @@ public Hl7.Fhir.Model.ResourceReference Definition private Hl7.Fhir.Model.ResourceReference _Definition; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -2668,15 +2677,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationComponent()); + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2853,7 +2863,7 @@ public List Event private List _Event; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessagingComponent; @@ -2862,18 +2872,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(ReliableCacheElement != null) dest.ReliableCacheElement = (Hl7.Fhir.Model.UnsignedInt)ReliableCacheElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(SupportedMessage.Any()) dest.SupportedMessage = new List(SupportedMessage.DeepCopy()); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(ReliableCacheElement != null) dest.ReliableCacheElement = (Hl7.Fhir.Model.UnsignedInt)ReliableCacheElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(SupportedMessage.Any()) dest.SupportedMessage = new List(SupportedMessage.DeepCopyInternal()); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessagingComponent()); + var instance = new MessagingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3016,7 +3027,7 @@ public string Address } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EndpointComponent; @@ -3025,15 +3036,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Protocol != null) dest.Protocol = (Hl7.Fhir.Model.Coding)Protocol.DeepCopy(); - if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirUri)AddressElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Protocol != null) dest.Protocol = (Hl7.Fhir.Model.Coding)Protocol.DeepCopyInternal(); + if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirUri)AddressElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EndpointComponent()); + var instance = new EndpointComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3156,7 +3168,7 @@ public Hl7.Fhir.Model.ResourceReference Definition private Hl7.Fhir.Model.ResourceReference _Definition; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportedMessageComponent; @@ -3165,15 +3177,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportedMessageComponent()); + var instance = new SupportedMessageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3425,7 +3438,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventComponent; @@ -3434,20 +3447,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.Coding)Code.DeepCopy(); - if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(FocusElement != null) dest.FocusElement = (Code)FocusElement.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.Coding)Code.DeepCopyInternal(); + if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(FocusElement != null) dest.FocusElement = (Code)FocusElement.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventComponent()); + var instance = new EventComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3640,7 +3654,7 @@ public Hl7.Fhir.Model.ResourceReference Profile private Hl7.Fhir.Model.ResourceReference _Profile; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DocumentComponent; @@ -3649,16 +3663,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.ResourceReference)Profile.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.ResourceReference)Profile.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DocumentComponent()); + var instance = new DocumentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4424,7 +4439,7 @@ public List Document private List _Document; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CapabilityStatement; @@ -4433,40 +4448,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopy()); - if(Software != null) dest.Software = (Hl7.Fhir.Model.CapabilityStatement.SoftwareComponent)Software.DeepCopy(); - if(Implementation != null) dest.Implementation = (Hl7.Fhir.Model.CapabilityStatement.ImplementationComponent)Implementation.DeepCopy(); - if(FhirVersionElement != null) dest.FhirVersionElement = (Hl7.Fhir.Model.Id)FhirVersionElement.DeepCopy(); - if(AcceptUnknownElement != null) dest.AcceptUnknownElement = (Code)AcceptUnknownElement.DeepCopy(); - if(FormatElement.Any()) dest.FormatElement = new List(FormatElement.DeepCopy()); - if(PatchFormatElement.Any()) dest.PatchFormatElement = new List(PatchFormatElement.DeepCopy()); - if(ImplementationGuideElement.Any()) dest.ImplementationGuideElement = new List(ImplementationGuideElement.DeepCopy()); - if(Profile.Any()) dest.Profile = new List(Profile.DeepCopy()); - if(Rest.Any()) dest.Rest = new List(Rest.DeepCopy()); - if(Messaging.Any()) dest.Messaging = new List(Messaging.DeepCopy()); - if(Document.Any()) dest.Document = new List(Document.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(InstantiatesElement.Any()) dest.InstantiatesElement = new List(InstantiatesElement.DeepCopyInternal()); + if(Software != null) dest.Software = (Hl7.Fhir.Model.CapabilityStatement.SoftwareComponent)Software.DeepCopyInternal(); + if(Implementation != null) dest.Implementation = (Hl7.Fhir.Model.CapabilityStatement.ImplementationComponent)Implementation.DeepCopyInternal(); + if(FhirVersionElement != null) dest.FhirVersionElement = (Hl7.Fhir.Model.Id)FhirVersionElement.DeepCopyInternal(); + if(AcceptUnknownElement != null) dest.AcceptUnknownElement = (Code)AcceptUnknownElement.DeepCopyInternal(); + if(FormatElement.Any()) dest.FormatElement = new List(FormatElement.DeepCopyInternal()); + if(PatchFormatElement.Any()) dest.PatchFormatElement = new List(PatchFormatElement.DeepCopyInternal()); + if(ImplementationGuideElement.Any()) dest.ImplementationGuideElement = new List(ImplementationGuideElement.DeepCopyInternal()); + if(Profile.Any()) dest.Profile = new List(Profile.DeepCopyInternal()); + if(Rest.Any()) dest.Rest = new List(Rest.DeepCopyInternal()); + if(Messaging.Any()) dest.Messaging = new List(Messaging.DeepCopyInternal()); + if(Document.Any()) dest.Document = new List(Document.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CapabilityStatement()); + var instance = new CapabilityStatement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/CarePlan.cs b/src/Hl7.Fhir.STU3/Model/Generated/CarePlan.cs index 2042a3aa55..c3443d6e02 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/CarePlan.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/CarePlan.cs @@ -286,7 +286,7 @@ public Hl7.Fhir.Model.CarePlan.DetailComponent Detail private Hl7.Fhir.Model.CarePlan.DetailComponent _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActivityComponent; @@ -295,18 +295,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(OutcomeCodeableConcept.Any()) dest.OutcomeCodeableConcept = new List(OutcomeCodeableConcept.DeepCopy()); - if(OutcomeReference.Any()) dest.OutcomeReference = new List(OutcomeReference.DeepCopy()); - if(Progress.Any()) dest.Progress = new List(Progress.DeepCopy()); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.CarePlan.DetailComponent)Detail.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(OutcomeCodeableConcept.Any()) dest.OutcomeCodeableConcept = new List(OutcomeCodeableConcept.DeepCopyInternal()); + if(OutcomeReference.Any()) dest.OutcomeReference = new List(OutcomeReference.DeepCopyInternal()); + if(Progress.Any()) dest.Progress = new List(Progress.DeepCopyInternal()); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.CarePlan.DetailComponent)Detail.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActivityComponent()); + var instance = new ActivityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -708,7 +709,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -717,29 +718,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Goal.Any()) dest.Goal = new List(Goal.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReasonElement != null) dest.StatusReasonElement = (Hl7.Fhir.Model.FhirString)StatusReasonElement.DeepCopy(); - if(ProhibitedElement != null) dest.ProhibitedElement = (Hl7.Fhir.Model.FhirBoolean)ProhibitedElement.DeepCopy(); - if(Scheduled != null) dest.Scheduled = (Hl7.Fhir.Model.DataType)Scheduled.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopy(); - if(DailyAmount != null) dest.DailyAmount = (Hl7.Fhir.Model.Quantity)DailyAmount.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Goal.Any()) dest.Goal = new List(Goal.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReasonElement != null) dest.StatusReasonElement = (Hl7.Fhir.Model.FhirString)StatusReasonElement.DeepCopyInternal(); + if(ProhibitedElement != null) dest.ProhibitedElement = (Hl7.Fhir.Model.FhirBoolean)ProhibitedElement.DeepCopyInternal(); + if(Scheduled != null) dest.Scheduled = (Hl7.Fhir.Model.DataType)Scheduled.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Product != null) dest.Product = (Hl7.Fhir.Model.DataType)Product.DeepCopyInternal(); + if(DailyAmount != null) dest.DailyAmount = (Hl7.Fhir.Model.Quantity)DailyAmount.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1284,7 +1286,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CarePlan; @@ -1293,33 +1295,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Definition.Any()) dest.Definition = new List(Definition.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Goal.Any()) dest.Goal = new List(Goal.DeepCopy()); - if(Activity.Any()) dest.Activity = new List(Activity.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Definition.Any()) dest.Definition = new List(Definition.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Goal.Any()) dest.Goal = new List(Goal.DeepCopyInternal()); + if(Activity.Any()) dest.Activity = new List(Activity.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CarePlan()); + var instance = new CarePlan(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/CareTeam.cs b/src/Hl7.Fhir.STU3/Model/Generated/CareTeam.cs index c4f5fbc6ba..d893d3955a 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/CareTeam.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/CareTeam.cs @@ -172,7 +172,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -181,17 +181,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Member != null) dest.Member = (Hl7.Fhir.Model.ResourceReference)Member.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Member != null) dest.Member = (Hl7.Fhir.Model.ResourceReference)Member.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -476,7 +477,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CareTeam; @@ -485,25 +486,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(ManagingOrganization.Any()) dest.ManagingOrganization = new List(ManagingOrganization.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(ManagingOrganization.Any()) dest.ManagingOrganization = new List(ManagingOrganization.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CareTeam()); + var instance = new CareTeam(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ChargeItem.cs b/src/Hl7.Fhir.STU3/Model/Generated/ChargeItem.cs index b960cc5244..a0039d66ed 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ChargeItem.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ChargeItem.cs @@ -157,7 +157,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -166,15 +166,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -658,7 +659,7 @@ public List SupportingInformation Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ChargeItem; @@ -667,36 +668,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(DefinitionElement.Any()) dest.DefinitionElement = new List(DefinitionElement.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(PerformingOrganization != null) dest.PerformingOrganization = (Hl7.Fhir.Model.ResourceReference)PerformingOrganization.DeepCopy(); - if(RequestingOrganization != null) dest.RequestingOrganization = (Hl7.Fhir.Model.ResourceReference)RequestingOrganization.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Bodysite.Any()) dest.Bodysite = new List(Bodysite.DeepCopy()); - if(FactorOverrideElement != null) dest.FactorOverrideElement = (Hl7.Fhir.Model.FhirDecimal)FactorOverrideElement.DeepCopy(); - if(PriceOverride != null) dest.PriceOverride = (Hl7.Fhir.Model.Money)PriceOverride.DeepCopy(); - if(OverrideReasonElement != null) dest.OverrideReasonElement = (Hl7.Fhir.Model.FhirString)OverrideReasonElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(EnteredDateElement != null) dest.EnteredDateElement = (Hl7.Fhir.Model.FhirDateTime)EnteredDateElement.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Service.Any()) dest.Service = new List(Service.DeepCopy()); - if(Account.Any()) dest.Account = new List(Account.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ChargeItem()); + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(DefinitionElement.Any()) dest.DefinitionElement = new List(DefinitionElement.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(PerformingOrganization != null) dest.PerformingOrganization = (Hl7.Fhir.Model.ResourceReference)PerformingOrganization.DeepCopyInternal(); + if(RequestingOrganization != null) dest.RequestingOrganization = (Hl7.Fhir.Model.ResourceReference)RequestingOrganization.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Bodysite.Any()) dest.Bodysite = new List(Bodysite.DeepCopyInternal()); + if(FactorOverrideElement != null) dest.FactorOverrideElement = (Hl7.Fhir.Model.FhirDecimal)FactorOverrideElement.DeepCopyInternal(); + if(PriceOverride != null) dest.PriceOverride = (Hl7.Fhir.Model.Money)PriceOverride.DeepCopyInternal(); + if(OverrideReasonElement != null) dest.OverrideReasonElement = (Hl7.Fhir.Model.FhirString)OverrideReasonElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(EnteredDateElement != null) dest.EnteredDateElement = (Hl7.Fhir.Model.FhirDateTime)EnteredDateElement.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Service.Any()) dest.Service = new List(Service.DeepCopyInternal()); + if(Account.Any()) dest.Account = new List(Account.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ChargeItem(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Claim.cs b/src/Hl7.Fhir.STU3/Model/Generated/Claim.cs index 2d2ac44ad1..1b6fe31a67 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Claim.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Claim.cs @@ -151,7 +151,7 @@ public Hl7.Fhir.Model.Identifier Reference private Hl7.Fhir.Model.Identifier _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedClaimComponent; @@ -160,16 +160,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedClaimComponent()); + var instance = new RelatedClaimComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -293,7 +294,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayeeComponent; @@ -302,16 +303,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ResourceType != null) dest.ResourceType = (Hl7.Fhir.Model.Coding)ResourceType.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ResourceType != null) dest.ResourceType = (Hl7.Fhir.Model.Coding)ResourceType.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayeeComponent()); + var instance = new PayeeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -498,7 +500,7 @@ public Hl7.Fhir.Model.CodeableConcept Qualification private Hl7.Fhir.Model.CodeableConcept _Qualification; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CareTeamComponent; @@ -507,18 +509,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Qualification != null) dest.Qualification = (Hl7.Fhir.Model.CodeableConcept)Qualification.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Qualification != null) dest.Qualification = (Hl7.Fhir.Model.CodeableConcept)Qualification.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CareTeamComponent()); + var instance = new CareTeamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -720,7 +723,7 @@ public Hl7.Fhir.Model.CodeableConcept Reason private Hl7.Fhir.Model.CodeableConcept _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SpecialConditionComponent; @@ -729,19 +732,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SpecialConditionComponent()); + var instance = new SpecialConditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -924,7 +928,7 @@ public Hl7.Fhir.Model.CodeableConcept PackageCode private Hl7.Fhir.Model.CodeableConcept _PackageCode; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -933,17 +937,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(PackageCode != null) dest.PackageCode = (Hl7.Fhir.Model.CodeableConcept)PackageCode.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(PackageCode != null) dest.PackageCode = (Hl7.Fhir.Model.CodeableConcept)PackageCode.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1112,7 +1117,7 @@ public Hl7.Fhir.Model.DataType Procedure private Hl7.Fhir.Model.DataType _Procedure; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcedureComponent; @@ -1121,16 +1126,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcedureComponent()); + var instance = new ProcedureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1368,7 +1374,7 @@ public Hl7.Fhir.Model.ResourceReference ClaimResponse private Hl7.Fhir.Model.ResourceReference _ClaimResponse; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -1377,19 +1383,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopy(); - if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopy()); - if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopyInternal(); + if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopyInternal()); + if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1559,7 +1566,7 @@ public Hl7.Fhir.Model.DataType Location private Hl7.Fhir.Model.DataType _Location; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AccidentComponent; @@ -1568,16 +1575,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AccidentComponent()); + var instance = new AccidentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2066,7 +2074,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -2075,34 +2083,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(CareTeamLinkIdElement.Any()) dest.CareTeamLinkIdElement = new List(CareTeamLinkIdElement.DeepCopy()); - if(DiagnosisLinkIdElement.Any()) dest.DiagnosisLinkIdElement = new List(DiagnosisLinkIdElement.DeepCopy()); - if(ProcedureLinkIdElement.Any()) dest.ProcedureLinkIdElement = new List(ProcedureLinkIdElement.DeepCopy()); - if(InformationLinkIdElement.Any()) dest.InformationLinkIdElement = new List(InformationLinkIdElement.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ItemComponent()); + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(CareTeamLinkIdElement.Any()) dest.CareTeamLinkIdElement = new List(CareTeamLinkIdElement.DeepCopyInternal()); + if(DiagnosisLinkIdElement.Any()) dest.DiagnosisLinkIdElement = new List(DiagnosisLinkIdElement.DeepCopyInternal()); + if(ProcedureLinkIdElement.Any()) dest.ProcedureLinkIdElement = new List(ProcedureLinkIdElement.DeepCopyInternal()); + if(InformationLinkIdElement.Any()) dest.InformationLinkIdElement = new List(InformationLinkIdElement.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); + if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2530,7 +2539,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -2539,25 +2548,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2899,7 +2909,7 @@ public List Udi private List _Udi; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubDetailComponent; @@ -2908,24 +2918,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubDetailComponent()); + var instance = new SubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3534,7 +3545,7 @@ public Hl7.Fhir.Model.Money Total List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Claim; @@ -3543,43 +3554,44 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType.Any()) dest.SubType = new List(SubType.DeepCopy()); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopy(); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopy(); - if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.Claim.PayeeComponent)Payee.DeepCopy(); - if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopy(); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(Information.Any()) dest.Information = new List(Information.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Accident != null) dest.Accident = (Hl7.Fhir.Model.Claim.AccidentComponent)Accident.DeepCopy(); - if(EmploymentImpacted != null) dest.EmploymentImpacted = (Hl7.Fhir.Model.Period)EmploymentImpacted.DeepCopy(); - if(Hospitalization != null) dest.Hospitalization = (Hl7.Fhir.Model.Period)Hospitalization.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - if(Total != null) dest.Total = (Hl7.Fhir.Model.Money)Total.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType.Any()) dest.SubType = new List(SubType.DeepCopyInternal()); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(FundsReserve != null) dest.FundsReserve = (Hl7.Fhir.Model.CodeableConcept)FundsReserve.DeepCopyInternal(); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); + if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopyInternal(); + if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.Claim.PayeeComponent)Payee.DeepCopyInternal(); + if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopyInternal(); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(Information.Any()) dest.Information = new List(Information.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Accident != null) dest.Accident = (Hl7.Fhir.Model.Claim.AccidentComponent)Accident.DeepCopyInternal(); + if(EmploymentImpacted != null) dest.EmploymentImpacted = (Hl7.Fhir.Model.Period)EmploymentImpacted.DeepCopyInternal(); + if(Hospitalization != null) dest.Hospitalization = (Hl7.Fhir.Model.Period)Hospitalization.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + if(Total != null) dest.Total = (Hl7.Fhir.Model.Money)Total.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Claim()); + var instance = new Claim(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ClaimResponse.cs b/src/Hl7.Fhir.STU3/Model/Generated/ClaimResponse.cs index 2fba0cd408..ef07d27116 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ClaimResponse.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ClaimResponse.cs @@ -167,7 +167,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -176,17 +176,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceLinkIdElement != null) dest.SequenceLinkIdElement = (Hl7.Fhir.Model.PositiveInt)SequenceLinkIdElement.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceLinkIdElement != null) dest.SequenceLinkIdElement = (Hl7.Fhir.Model.PositiveInt)SequenceLinkIdElement.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -347,7 +348,7 @@ public decimal? Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdjudicationComponent; @@ -356,17 +357,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdjudicationComponent()); + var instance = new AdjudicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -546,7 +548,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemDetailComponent; @@ -555,17 +557,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceLinkIdElement != null) dest.SequenceLinkIdElement = (Hl7.Fhir.Model.PositiveInt)SequenceLinkIdElement.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceLinkIdElement != null) dest.SequenceLinkIdElement = (Hl7.Fhir.Model.PositiveInt)SequenceLinkIdElement.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemDetailComponent()); + var instance = new ItemDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -731,7 +734,7 @@ public List Adjudication private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubDetailComponent; @@ -740,16 +743,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceLinkIdElement != null) dest.SequenceLinkIdElement = (Hl7.Fhir.Model.PositiveInt)SequenceLinkIdElement.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceLinkIdElement != null) dest.SequenceLinkIdElement = (Hl7.Fhir.Model.PositiveInt)SequenceLinkIdElement.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubDetailComponent()); + var instance = new SubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -991,7 +995,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemComponent; @@ -1000,22 +1004,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceLinkIdElement.Any()) dest.SequenceLinkIdElement = new List(SequenceLinkIdElement.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Fee != null) dest.Fee = (Hl7.Fhir.Model.Money)Fee.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceLinkIdElement.Any()) dest.SequenceLinkIdElement = new List(SequenceLinkIdElement.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Fee != null) dest.Fee = (Hl7.Fhir.Model.Money)Fee.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemComponent()); + var instance = new AddedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1259,7 +1264,7 @@ public List Adjudication private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemsDetailComponent; @@ -1268,20 +1273,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Fee != null) dest.Fee = (Hl7.Fhir.Model.Money)Fee.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Fee != null) dest.Fee = (Hl7.Fhir.Model.Money)Fee.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemsDetailComponent()); + var instance = new AddedItemsDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1501,7 +1507,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ErrorComponent; @@ -1510,17 +1516,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceLinkIdElement != null) dest.SequenceLinkIdElement = (Hl7.Fhir.Model.PositiveInt)SequenceLinkIdElement.DeepCopy(); - if(DetailSequenceLinkIdElement != null) dest.DetailSequenceLinkIdElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceLinkIdElement.DeepCopy(); - if(SubdetailSequenceLinkIdElement != null) dest.SubdetailSequenceLinkIdElement = (Hl7.Fhir.Model.PositiveInt)SubdetailSequenceLinkIdElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceLinkIdElement != null) dest.SequenceLinkIdElement = (Hl7.Fhir.Model.PositiveInt)SequenceLinkIdElement.DeepCopyInternal(); + if(DetailSequenceLinkIdElement != null) dest.DetailSequenceLinkIdElement = (Hl7.Fhir.Model.PositiveInt)DetailSequenceLinkIdElement.DeepCopyInternal(); + if(SubdetailSequenceLinkIdElement != null) dest.SubdetailSequenceLinkIdElement = (Hl7.Fhir.Model.PositiveInt)SubdetailSequenceLinkIdElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ErrorComponent()); + var instance = new ErrorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1706,7 +1713,7 @@ public Hl7.Fhir.Model.Identifier Identifier private Hl7.Fhir.Model.Identifier _Identifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentComponent; @@ -1715,19 +1722,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopy(); - if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopyInternal(); + if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentComponent()); + var instance = new PaymentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1921,7 +1929,7 @@ public Hl7.Fhir.Model.CodeableConcept Language private Hl7.Fhir.Model.CodeableConcept _Language; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NoteComponent; @@ -1930,17 +1938,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NoteComponent()); + var instance = new NoteComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2186,7 +2195,7 @@ public Hl7.Fhir.Model.ResourceReference ClaimResponse private Hl7.Fhir.Model.ResourceReference _ClaimResponse; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -2195,19 +2204,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopy(); - if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopy()); - if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(FocalElement != null) dest.FocalElement = (Hl7.Fhir.Model.FhirBoolean)FocalElement.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopyInternal(); + if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopyInternal()); + if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2675,7 +2685,7 @@ public List Insurance List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClaimResponse; @@ -2684,36 +2694,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopy(); - if(RequestOrganization != null) dest.RequestOrganization = (Hl7.Fhir.Model.ResourceReference)RequestOrganization.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(PayeeType != null) dest.PayeeType = (Hl7.Fhir.Model.CodeableConcept)PayeeType.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopy()); - if(Error.Any()) dest.Error = new List(Error.DeepCopy()); - if(TotalCost != null) dest.TotalCost = (Hl7.Fhir.Model.Money)TotalCost.DeepCopy(); - if(UnallocDeductable != null) dest.UnallocDeductable = (Hl7.Fhir.Model.Money)UnallocDeductable.DeepCopy(); - if(TotalBenefit != null) dest.TotalBenefit = (Hl7.Fhir.Model.Money)TotalBenefit.DeepCopy(); - if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ClaimResponse.PaymentComponent)Payment.DeepCopy(); - if(Reserved != null) dest.Reserved = (Hl7.Fhir.Model.Coding)Reserved.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopy()); - if(CommunicationRequest.Any()) dest.CommunicationRequest = new List(CommunicationRequest.DeepCopy()); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopyInternal(); + if(RequestOrganization != null) dest.RequestOrganization = (Hl7.Fhir.Model.ResourceReference)RequestOrganization.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(PayeeType != null) dest.PayeeType = (Hl7.Fhir.Model.CodeableConcept)PayeeType.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopyInternal()); + if(Error.Any()) dest.Error = new List(Error.DeepCopyInternal()); + if(TotalCost != null) dest.TotalCost = (Hl7.Fhir.Model.Money)TotalCost.DeepCopyInternal(); + if(UnallocDeductable != null) dest.UnallocDeductable = (Hl7.Fhir.Model.Money)UnallocDeductable.DeepCopyInternal(); + if(TotalBenefit != null) dest.TotalBenefit = (Hl7.Fhir.Model.Money)TotalBenefit.DeepCopyInternal(); + if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ClaimResponse.PaymentComponent)Payment.DeepCopyInternal(); + if(Reserved != null) dest.Reserved = (Hl7.Fhir.Model.Coding)Reserved.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopyInternal()); + if(CommunicationRequest.Any()) dest.CommunicationRequest = new List(CommunicationRequest.DeepCopyInternal()); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClaimResponse()); + var instance = new ClaimResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ClinicalImpression.cs b/src/Hl7.Fhir.STU3/Model/Generated/ClinicalImpression.cs index 2e4cf739e9..faafdc83b6 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ClinicalImpression.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ClinicalImpression.cs @@ -134,7 +134,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InvestigationComponent; @@ -143,15 +143,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InvestigationComponent()); + var instance = new InvestigationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -272,7 +273,7 @@ public string Basis } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FindingComponent; @@ -281,15 +282,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - if(BasisElement != null) dest.BasisElement = (Hl7.Fhir.Model.FhirString)BasisElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); + if(BasisElement != null) dest.BasisElement = (Hl7.Fhir.Model.FhirString)BasisElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FindingComponent()); + var instance = new FindingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -715,7 +717,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClinicalImpression; @@ -724,32 +726,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Assessor != null) dest.Assessor = (Hl7.Fhir.Model.ResourceReference)Assessor.DeepCopy(); - if(Previous != null) dest.Previous = (Hl7.Fhir.Model.ResourceReference)Previous.DeepCopy(); - if(Problem.Any()) dest.Problem = new List(Problem.DeepCopy()); - if(Investigation.Any()) dest.Investigation = new List(Investigation.DeepCopy()); - if(ProtocolElement.Any()) dest.ProtocolElement = new List(ProtocolElement.DeepCopy()); - if(SummaryElement != null) dest.SummaryElement = (Hl7.Fhir.Model.FhirString)SummaryElement.DeepCopy(); - if(Finding.Any()) dest.Finding = new List(Finding.DeepCopy()); - if(PrognosisCodeableConcept.Any()) dest.PrognosisCodeableConcept = new List(PrognosisCodeableConcept.DeepCopy()); - if(PrognosisReference.Any()) dest.PrognosisReference = new List(PrognosisReference.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ClinicalImpression()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Assessor != null) dest.Assessor = (Hl7.Fhir.Model.ResourceReference)Assessor.DeepCopyInternal(); + if(Previous != null) dest.Previous = (Hl7.Fhir.Model.ResourceReference)Previous.DeepCopyInternal(); + if(Problem.Any()) dest.Problem = new List(Problem.DeepCopyInternal()); + if(Investigation.Any()) dest.Investigation = new List(Investigation.DeepCopyInternal()); + if(ProtocolElement.Any()) dest.ProtocolElement = new List(ProtocolElement.DeepCopyInternal()); + if(SummaryElement != null) dest.SummaryElement = (Hl7.Fhir.Model.FhirString)SummaryElement.DeepCopyInternal(); + if(Finding.Any()) dest.Finding = new List(Finding.DeepCopyInternal()); + if(PrognosisCodeableConcept.Any()) dest.PrognosisCodeableConcept = new List(PrognosisCodeableConcept.DeepCopyInternal()); + if(PrognosisReference.Any()) dest.PrognosisReference = new List(PrognosisReference.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ClinicalImpression(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/CodeSystem.cs b/src/Hl7.Fhir.STU3/Model/Generated/CodeSystem.cs index f6205b680e..6259fe27df 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/CodeSystem.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/CodeSystem.cs @@ -318,7 +318,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FilterComponent; @@ -327,17 +327,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(OperatorElement.Any()) dest.OperatorElement = new List>(OperatorElement.DeepCopy()); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(OperatorElement.Any()) dest.OperatorElement = new List>(OperatorElement.DeepCopyInternal()); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FilterComponent()); + var instance = new FilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -553,7 +554,7 @@ public Hl7.Fhir.Model.CodeSystem.PropertyType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PropertyComponent; @@ -562,17 +563,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PropertyComponent()); + var instance = new PropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -797,7 +799,7 @@ public List Concept private List _Concept; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptDefinitionComponent; @@ -806,19 +808,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirString)DefinitionElement.DeepCopy(); - if(Designation.Any()) dest.Designation = new List(Designation.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Concept.Any()) dest.Concept = new List(Concept.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirString)DefinitionElement.DeepCopyInternal(); + if(Designation.Any()) dest.Designation = new List(Designation.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Concept.Any()) dest.Concept = new List(Concept.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptDefinitionComponent()); + var instance = new ConceptDefinitionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1000,7 +1003,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DesignationComponent; @@ -1009,16 +1012,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy(); - if(Use != null) dest.Use = (Hl7.Fhir.Model.Coding)Use.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopyInternal(); + if(Use != null) dest.Use = (Hl7.Fhir.Model.Coding)Use.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DesignationComponent()); + var instance = new DesignationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1146,7 +1150,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptPropertyComponent; @@ -1155,15 +1159,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptPropertyComponent()); + var instance = new ConceptPropertyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1885,7 +1890,7 @@ public List Concept Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeSystem; @@ -1894,38 +1899,39 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(CaseSensitiveElement != null) dest.CaseSensitiveElement = (Hl7.Fhir.Model.FhirBoolean)CaseSensitiveElement.DeepCopy(); - if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.FhirUri)ValueSetElement.DeepCopy(); - if(HierarchyMeaningElement != null) dest.HierarchyMeaningElement = (Code)HierarchyMeaningElement.DeepCopy(); - if(CompositionalElement != null) dest.CompositionalElement = (Hl7.Fhir.Model.FhirBoolean)CompositionalElement.DeepCopy(); - if(VersionNeededElement != null) dest.VersionNeededElement = (Hl7.Fhir.Model.FhirBoolean)VersionNeededElement.DeepCopy(); - if(ContentElement != null) dest.ContentElement = (Code)ContentElement.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.UnsignedInt)CountElement.DeepCopy(); - if(Filter.Any()) dest.Filter = new List(Filter.DeepCopy()); - if(Property.Any()) dest.Property = new List(Property.DeepCopy()); - if(Concept.Any()) dest.Concept = new List(Concept.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(CaseSensitiveElement != null) dest.CaseSensitiveElement = (Hl7.Fhir.Model.FhirBoolean)CaseSensitiveElement.DeepCopyInternal(); + if(ValueSetElement != null) dest.ValueSetElement = (Hl7.Fhir.Model.FhirUri)ValueSetElement.DeepCopyInternal(); + if(HierarchyMeaningElement != null) dest.HierarchyMeaningElement = (Code)HierarchyMeaningElement.DeepCopyInternal(); + if(CompositionalElement != null) dest.CompositionalElement = (Hl7.Fhir.Model.FhirBoolean)CompositionalElement.DeepCopyInternal(); + if(VersionNeededElement != null) dest.VersionNeededElement = (Hl7.Fhir.Model.FhirBoolean)VersionNeededElement.DeepCopyInternal(); + if(ContentElement != null) dest.ContentElement = (Code)ContentElement.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.UnsignedInt)CountElement.DeepCopyInternal(); + if(Filter.Any()) dest.Filter = new List(Filter.DeepCopyInternal()); + if(Property.Any()) dest.Property = new List(Property.DeepCopyInternal()); + if(Concept.Any()) dest.Concept = new List(Concept.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CodeSystem()); + var instance = new CodeSystem(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Communication.cs b/src/Hl7.Fhir.STU3/Model/Generated/Communication.cs index 12ebf14364..86ec6fa79b 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Communication.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Communication.cs @@ -92,7 +92,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayloadComponent; @@ -101,14 +101,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayloadComponent()); + var instance = new PayloadComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -527,7 +528,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Communication; @@ -536,33 +537,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Definition.Any()) dest.Definition = new List(Definition.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(NotDoneElement != null) dest.NotDoneElement = (Hl7.Fhir.Model.FhirBoolean)NotDoneElement.DeepCopy(); - if(NotDoneReason != null) dest.NotDoneReason = (Hl7.Fhir.Model.CodeableConcept)NotDoneReason.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Medium.Any()) dest.Medium = new List(Medium.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(SentElement != null) dest.SentElement = (Hl7.Fhir.Model.FhirDateTime)SentElement.DeepCopy(); - if(ReceivedElement != null) dest.ReceivedElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedElement.DeepCopy(); - if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Payload.Any()) dest.Payload = new List(Payload.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Definition.Any()) dest.Definition = new List(Definition.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(NotDoneElement != null) dest.NotDoneElement = (Hl7.Fhir.Model.FhirBoolean)NotDoneElement.DeepCopyInternal(); + if(NotDoneReason != null) dest.NotDoneReason = (Hl7.Fhir.Model.CodeableConcept)NotDoneReason.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Medium.Any()) dest.Medium = new List(Medium.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(SentElement != null) dest.SentElement = (Hl7.Fhir.Model.FhirDateTime)SentElement.DeepCopyInternal(); + if(ReceivedElement != null) dest.ReceivedElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedElement.DeepCopyInternal(); + if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Payload.Any()) dest.Payload = new List(Payload.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Communication()); + var instance = new Communication(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/CommunicationRequest.cs b/src/Hl7.Fhir.STU3/Model/Generated/CommunicationRequest.cs index 37689db688..f65c319657 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/CommunicationRequest.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/CommunicationRequest.cs @@ -92,7 +92,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayloadComponent; @@ -101,14 +101,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayloadComponent()); + var instance = new PayloadComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -203,7 +204,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequesterComponent; @@ -212,15 +213,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequesterComponent()); + var instance = new RequesterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -629,7 +631,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CommunicationRequest; @@ -638,33 +640,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Medium.Any()) dest.Medium = new List(Medium.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Payload.Any()) dest.Payload = new List(Payload.DeepCopy()); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.CommunicationRequest.RequesterComponent)Requester.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Medium.Any()) dest.Medium = new List(Medium.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Payload.Any()) dest.Payload = new List(Payload.DeepCopyInternal()); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.CommunicationRequest.RequesterComponent)Requester.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CommunicationRequest()); + var instance = new CommunicationRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/CompartmentDefinition.cs b/src/Hl7.Fhir.STU3/Model/Generated/CompartmentDefinition.cs index 86f93f026b..294af0a494 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/CompartmentDefinition.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/CompartmentDefinition.cs @@ -173,7 +173,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceComponent; @@ -182,16 +182,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(ParamElement.Any()) dest.ParamElement = new List(ParamElement.DeepCopy()); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(ParamElement.Any()) dest.ParamElement = new List(ParamElement.DeepCopyInternal()); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceComponent()); + var instance = new ResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -662,7 +663,7 @@ public List Resource private List _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CompartmentDefinition; @@ -671,28 +672,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(SearchElement != null) dest.SearchElement = (Hl7.Fhir.Model.FhirBoolean)SearchElement.DeepCopy(); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new CompartmentDefinition()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(SearchElement != null) dest.SearchElement = (Hl7.Fhir.Model.FhirBoolean)SearchElement.DeepCopyInternal(); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new CompartmentDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Composition.cs b/src/Hl7.Fhir.STU3/Model/Generated/Composition.cs index b6606ae028..5a774848dc 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Composition.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Composition.cs @@ -254,7 +254,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AttesterComponent; @@ -263,16 +263,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement.Any()) dest.ModeElement = new List>(ModeElement.DeepCopy()); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ModeElement.Any()) dest.ModeElement = new List>(ModeElement.DeepCopyInternal()); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.FhirDateTime)TimeElement.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AttesterComponent()); + var instance = new AttesterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -404,7 +405,7 @@ public Hl7.Fhir.Model.DataType Target private Hl7.Fhir.Model.DataType _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatesToComponent; @@ -413,15 +414,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatesToComponent()); + var instance = new RelatesToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -538,7 +540,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EventComponent; @@ -547,16 +549,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EventComponent()); + var instance = new EventComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -785,7 +788,7 @@ public List Section private List _Section; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SectionComponent; @@ -794,21 +797,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopy(); - if(Entry.Any()) dest.Entry = new List(Entry.DeepCopy()); - if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopy(); - if(Section.Any()) dest.Section = new List(Section.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Text != null) dest.Text = (Hl7.Fhir.Model.Narrative)Text.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopyInternal(); + if(Entry.Any()) dest.Entry = new List(Entry.DeepCopyInternal()); + if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopyInternal(); + if(Section.Any()) dest.Section = new List(Section.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SectionComponent()); + var instance = new SectionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1205,7 +1209,7 @@ public List Section Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Composition; @@ -1214,28 +1218,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(ConfidentialityElement != null) dest.ConfidentialityElement = (Code)ConfidentialityElement.DeepCopy(); - if(Attester.Any()) dest.Attester = new List(Attester.DeepCopy()); - if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy(); - if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopy()); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - if(Section.Any()) dest.Section = new List(Section.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(ConfidentialityElement != null) dest.ConfidentialityElement = (Code)ConfidentialityElement.DeepCopyInternal(); + if(Attester.Any()) dest.Attester = new List(Attester.DeepCopyInternal()); + if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopyInternal(); + if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopyInternal()); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); + if(Section.Any()) dest.Section = new List(Section.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Composition()); + var instance = new Composition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ConceptMap.cs b/src/Hl7.Fhir.STU3/Model/Generated/ConceptMap.cs index d3d9bd2860..8d9dc3861d 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ConceptMap.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ConceptMap.cs @@ -324,7 +324,7 @@ public Hl7.Fhir.Model.ConceptMap.UnmappedComponent Unmapped private Hl7.Fhir.Model.ConceptMap.UnmappedComponent _Unmapped; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -333,19 +333,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopy(); - if(SourceVersionElement != null) dest.SourceVersionElement = (Hl7.Fhir.Model.FhirString)SourceVersionElement.DeepCopy(); - if(TargetElement != null) dest.TargetElement = (Hl7.Fhir.Model.FhirUri)TargetElement.DeepCopy(); - if(TargetVersionElement != null) dest.TargetVersionElement = (Hl7.Fhir.Model.FhirString)TargetVersionElement.DeepCopy(); - if(Element.Any()) dest.Element = new List(Element.DeepCopy()); - if(Unmapped != null) dest.Unmapped = (Hl7.Fhir.Model.ConceptMap.UnmappedComponent)Unmapped.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopyInternal(); + if(SourceVersionElement != null) dest.SourceVersionElement = (Hl7.Fhir.Model.FhirString)SourceVersionElement.DeepCopyInternal(); + if(TargetElement != null) dest.TargetElement = (Hl7.Fhir.Model.FhirUri)TargetElement.DeepCopyInternal(); + if(TargetVersionElement != null) dest.TargetVersionElement = (Hl7.Fhir.Model.FhirString)TargetVersionElement.DeepCopyInternal(); + if(Element.Any()) dest.Element = new List(Element.DeepCopyInternal()); + if(Unmapped != null) dest.Unmapped = (Hl7.Fhir.Model.ConceptMap.UnmappedComponent)Unmapped.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -526,7 +527,7 @@ public List Target private List _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceElementComponent; @@ -535,16 +536,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceElementComponent()); + var instance = new SourceElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -779,7 +781,7 @@ public List Product private List _Product; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetElementComponent; @@ -788,19 +790,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(EquivalenceElement != null) dest.EquivalenceElement = (Code)EquivalenceElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopy()); - if(Product.Any()) dest.Product = new List(Product.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(EquivalenceElement != null) dest.EquivalenceElement = (Code)EquivalenceElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(DependsOn.Any()) dest.DependsOn = new List(DependsOn.DeepCopyInternal()); + if(Product.Any()) dest.Product = new List(Product.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetElementComponent()); + var instance = new TargetElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1030,7 +1033,7 @@ public string Display } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OtherElementComponent; @@ -1039,17 +1042,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PropertyElement != null) dest.PropertyElement = (Hl7.Fhir.Model.FhirUri)PropertyElement.DeepCopy(); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.FhirString)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PropertyElement != null) dest.PropertyElement = (Hl7.Fhir.Model.FhirUri)PropertyElement.DeepCopyInternal(); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.FhirString)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OtherElementComponent()); + var instance = new OtherElementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1265,7 +1269,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UnmappedComponent; @@ -1274,17 +1278,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UnmappedComponent()); + var instance = new UnmappedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1804,7 +1809,7 @@ public List Group Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptMap; @@ -1813,31 +1818,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopy(); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.DataType)Target.DeepCopyInternal(); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptMap()); + var instance = new ConceptMap(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Condition.cs b/src/Hl7.Fhir.STU3/Model/Generated/Condition.cs index 95f10cea6f..0841e19d64 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Condition.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Condition.cs @@ -191,7 +191,7 @@ public List Assessment private List _Assessment; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StageComponent; @@ -200,15 +200,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Summary != null) dest.Summary = (Hl7.Fhir.Model.CodeableConcept)Summary.DeepCopy(); - if(Assessment.Any()) dest.Assessment = new List(Assessment.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Summary != null) dest.Summary = (Hl7.Fhir.Model.CodeableConcept)Summary.DeepCopyInternal(); + if(Assessment.Any()) dest.Assessment = new List(Assessment.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StageComponent()); + var instance = new StageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -312,7 +313,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EvidenceComponent; @@ -321,15 +322,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EvidenceComponent()); + var instance = new EvidenceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -673,7 +675,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Condition; @@ -682,29 +684,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ClinicalStatusElement != null) dest.ClinicalStatusElement = (Code)ClinicalStatusElement.DeepCopy(); - if(VerificationStatusElement != null) dest.VerificationStatusElement = (Code)VerificationStatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy(); - if(Abatement != null) dest.Abatement = (Hl7.Fhir.Model.DataType)Abatement.DeepCopy(); - if(AssertedDateElement != null) dest.AssertedDateElement = (Hl7.Fhir.Model.FhirDateTime)AssertedDateElement.DeepCopy(); - if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopy(); - if(Stage != null) dest.Stage = (Hl7.Fhir.Model.Condition.StageComponent)Stage.DeepCopy(); - if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ClinicalStatusElement != null) dest.ClinicalStatusElement = (Code)ClinicalStatusElement.DeepCopyInternal(); + if(VerificationStatusElement != null) dest.VerificationStatusElement = (Code)VerificationStatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Severity != null) dest.Severity = (Hl7.Fhir.Model.CodeableConcept)Severity.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopyInternal(); + if(Abatement != null) dest.Abatement = (Hl7.Fhir.Model.DataType)Abatement.DeepCopyInternal(); + if(AssertedDateElement != null) dest.AssertedDateElement = (Hl7.Fhir.Model.FhirDateTime)AssertedDateElement.DeepCopyInternal(); + if(Asserter != null) dest.Asserter = (Hl7.Fhir.Model.ResourceReference)Asserter.DeepCopyInternal(); + if(Stage != null) dest.Stage = (Hl7.Fhir.Model.Condition.StageComponent)Stage.DeepCopyInternal(); + if(Evidence.Any()) dest.Evidence = new List(Evidence.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Condition()); + var instance = new Condition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Consent.cs b/src/Hl7.Fhir.STU3/Model/Generated/Consent.cs index daf9d5ad21..32a8f1df6b 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Consent.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Consent.cs @@ -209,7 +209,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActorComponent; @@ -218,15 +218,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActorComponent()); + var instance = new ActorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -360,7 +361,7 @@ public string Uri } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PolicyComponent; @@ -369,15 +370,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AuthorityElement != null) dest.AuthorityElement = (Hl7.Fhir.Model.FhirUri)AuthorityElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AuthorityElement != null) dest.AuthorityElement = (Hl7.Fhir.Model.FhirUri)AuthorityElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PolicyComponent()); + var instance = new PolicyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -499,7 +501,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DataComponent; @@ -508,15 +510,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MeaningElement != null) dest.MeaningElement = (Code)MeaningElement.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MeaningElement != null) dest.MeaningElement = (Code)MeaningElement.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DataComponent()); + var instance = new DataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -751,7 +754,7 @@ public List Data private List _Data; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExceptComponent; @@ -760,23 +763,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Purpose.Any()) dest.Purpose = new List(Purpose.DeepCopy()); - if(Class.Any()) dest.Class = new List(Class.DeepCopy()); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(DataPeriod != null) dest.DataPeriod = (Hl7.Fhir.Model.Period)DataPeriod.DeepCopy(); - if(Data.Any()) dest.Data = new List(Data.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Purpose.Any()) dest.Purpose = new List(Purpose.DeepCopyInternal()); + if(Class.Any()) dest.Class = new List(Class.DeepCopyInternal()); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(DataPeriod != null) dest.DataPeriod = (Hl7.Fhir.Model.Period)DataPeriod.DeepCopyInternal(); + if(Data.Any()) dest.Data = new List(Data.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExceptComponent()); + var instance = new ExceptComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -943,7 +947,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExceptActorComponent; @@ -952,15 +956,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExceptActorComponent()); + var instance = new ExceptActorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1082,7 +1087,7 @@ public Hl7.Fhir.Model.ResourceReference Reference private Hl7.Fhir.Model.ResourceReference _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExceptDataComponent; @@ -1091,15 +1096,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MeaningElement != null) dest.MeaningElement = (Code)MeaningElement.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MeaningElement != null) dest.MeaningElement = (Code)MeaningElement.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.ResourceReference)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExceptDataComponent()); + var instance = new ExceptDataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1472,7 +1478,7 @@ public List Except Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Consent; @@ -1481,31 +1487,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopy(); - if(ConsentingParty.Any()) dest.ConsentingParty = new List(ConsentingParty.DeepCopy()); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - if(Organization.Any()) dest.Organization = new List(Organization.DeepCopy()); - if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopy(); - if(Policy.Any()) dest.Policy = new List(Policy.DeepCopy()); - if(PolicyRuleElement != null) dest.PolicyRuleElement = (Hl7.Fhir.Model.FhirUri)PolicyRuleElement.DeepCopy(); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Purpose.Any()) dest.Purpose = new List(Purpose.DeepCopy()); - if(DataPeriod != null) dest.DataPeriod = (Hl7.Fhir.Model.Period)DataPeriod.DeepCopy(); - if(Data.Any()) dest.Data = new List(Data.DeepCopy()); - if(Except.Any()) dest.Except = new List(Except.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopyInternal(); + if(ConsentingParty.Any()) dest.ConsentingParty = new List(ConsentingParty.DeepCopyInternal()); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + if(Organization.Any()) dest.Organization = new List(Organization.DeepCopyInternal()); + if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopyInternal(); + if(Policy.Any()) dest.Policy = new List(Policy.DeepCopyInternal()); + if(PolicyRuleElement != null) dest.PolicyRuleElement = (Hl7.Fhir.Model.FhirUri)PolicyRuleElement.DeepCopyInternal(); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Purpose.Any()) dest.Purpose = new List(Purpose.DeepCopyInternal()); + if(DataPeriod != null) dest.DataPeriod = (Hl7.Fhir.Model.Period)DataPeriod.DeepCopyInternal(); + if(Data.Any()) dest.Data = new List(Data.DeepCopyInternal()); + if(Except.Any()) dest.Except = new List(Except.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Consent()); + var instance = new Consent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Contract.cs b/src/Hl7.Fhir.STU3/Model/Generated/Contract.cs index 7054ffc54c..9dee2cb05a 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Contract.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Contract.cs @@ -208,7 +208,7 @@ public List Role private List _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AgentComponent; @@ -217,15 +217,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(Role.Any()) dest.Role = new List(Role.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(Role.Any()) dest.Role = new List(Role.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AgentComponent()); + var instance = new AgentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -344,7 +345,7 @@ public List Signature private List _Signature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SignatoryComponent; @@ -353,16 +354,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - if(Signature.Any()) dest.Signature = new List(Signature.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); + if(Signature.Any()) dest.Signature = new List(Signature.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SignatoryComponent()); + var instance = new SignatoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -600,7 +602,7 @@ public Hl7.Fhir.Model.Money Net private Hl7.Fhir.Model.Money _Net; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ValuedItemComponent; @@ -609,21 +611,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Entity != null) dest.Entity = (Hl7.Fhir.Model.DataType)Entity.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(EffectiveTimeElement != null) dest.EffectiveTimeElement = (Hl7.Fhir.Model.FhirDateTime)EffectiveTimeElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(PointsElement != null) dest.PointsElement = (Hl7.Fhir.Model.FhirDecimal)PointsElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Entity != null) dest.Entity = (Hl7.Fhir.Model.DataType)Entity.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(EffectiveTimeElement != null) dest.EffectiveTimeElement = (Hl7.Fhir.Model.FhirDateTime)EffectiveTimeElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(PointsElement != null) dest.PointsElement = (Hl7.Fhir.Model.FhirDecimal)PointsElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ValuedItemComponent()); + var instance = new ValuedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -962,7 +965,7 @@ public List Group private List _Group; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TermComponent; @@ -971,26 +974,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopy(); - if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopy(); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - if(ActionReason.Any()) dest.ActionReason = new List(ActionReason.DeepCopy()); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(ValuedItem.Any()) dest.ValuedItem = new List(ValuedItem.DeepCopy()); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopyInternal(); + if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType != null) dest.SubType = (Hl7.Fhir.Model.CodeableConcept)SubType.DeepCopyInternal(); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + if(ActionReason.Any()) dest.ActionReason = new List(ActionReason.DeepCopyInternal()); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(ValuedItem.Any()) dest.ValuedItem = new List(ValuedItem.DeepCopyInternal()); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TermComponent()); + var instance = new TermComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1183,7 +1187,7 @@ public List Role private List _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TermAgentComponent; @@ -1192,15 +1196,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(Role.Any()) dest.Role = new List(Role.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(Role.Any()) dest.Role = new List(Role.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TermAgentComponent()); + var instance = new TermAgentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1433,7 +1438,7 @@ public Hl7.Fhir.Model.Money Net private Hl7.Fhir.Model.Money _Net; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TermValuedItemComponent; @@ -1442,21 +1447,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Entity != null) dest.Entity = (Hl7.Fhir.Model.DataType)Entity.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(EffectiveTimeElement != null) dest.EffectiveTimeElement = (Hl7.Fhir.Model.FhirDateTime)EffectiveTimeElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(PointsElement != null) dest.PointsElement = (Hl7.Fhir.Model.FhirDecimal)PointsElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Entity != null) dest.Entity = (Hl7.Fhir.Model.DataType)Entity.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(EffectiveTimeElement != null) dest.EffectiveTimeElement = (Hl7.Fhir.Model.FhirDateTime)EffectiveTimeElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(PointsElement != null) dest.PointsElement = (Hl7.Fhir.Model.FhirDecimal)PointsElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TermValuedItemComponent()); + var instance = new TermValuedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1593,7 +1599,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FriendlyLanguageComponent; @@ -1602,14 +1608,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FriendlyLanguageComponent()); + var instance = new FriendlyLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1690,7 +1697,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LegalLanguageComponent; @@ -1699,14 +1706,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LegalLanguageComponent()); + var instance = new LegalLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1787,7 +1795,7 @@ public Hl7.Fhir.Model.DataType Content private Hl7.Fhir.Model.DataType _Content; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComputableLanguageComponent; @@ -1796,14 +1804,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Content != null) dest.Content = (Hl7.Fhir.Model.DataType)Content.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComputableLanguageComponent()); + var instance = new ComputableLanguageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2223,7 +2232,7 @@ public List Rule Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Contract; @@ -2232,36 +2241,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopy(); - if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopy(); - if(Subject.Any()) dest.Subject = new List(Subject.DeepCopy()); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Authority.Any()) dest.Authority = new List(Authority.DeepCopy()); - if(Domain.Any()) dest.Domain = new List(Domain.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType.Any()) dest.SubType = new List(SubType.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - if(ActionReason.Any()) dest.ActionReason = new List(ActionReason.DeepCopy()); - if(DecisionType != null) dest.DecisionType = (Hl7.Fhir.Model.CodeableConcept)DecisionType.DeepCopy(); - if(ContentDerivative != null) dest.ContentDerivative = (Hl7.Fhir.Model.CodeableConcept)ContentDerivative.DeepCopy(); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - if(Signer.Any()) dest.Signer = new List(Signer.DeepCopy()); - if(ValuedItem.Any()) dest.ValuedItem = new List(ValuedItem.DeepCopy()); - if(Term.Any()) dest.Term = new List(Term.DeepCopy()); - if(Binding != null) dest.Binding = (Hl7.Fhir.Model.DataType)Binding.DeepCopy(); - if(Friendly.Any()) dest.Friendly = new List(Friendly.DeepCopy()); - if(Legal.Any()) dest.Legal = new List(Legal.DeepCopy()); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopyInternal(); + if(Applies != null) dest.Applies = (Hl7.Fhir.Model.Period)Applies.DeepCopyInternal(); + if(Subject.Any()) dest.Subject = new List(Subject.DeepCopyInternal()); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Authority.Any()) dest.Authority = new List(Authority.DeepCopyInternal()); + if(Domain.Any()) dest.Domain = new List(Domain.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType.Any()) dest.SubType = new List(SubType.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + if(ActionReason.Any()) dest.ActionReason = new List(ActionReason.DeepCopyInternal()); + if(DecisionType != null) dest.DecisionType = (Hl7.Fhir.Model.CodeableConcept)DecisionType.DeepCopyInternal(); + if(ContentDerivative != null) dest.ContentDerivative = (Hl7.Fhir.Model.CodeableConcept)ContentDerivative.DeepCopyInternal(); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); + if(Signer.Any()) dest.Signer = new List(Signer.DeepCopyInternal()); + if(ValuedItem.Any()) dest.ValuedItem = new List(ValuedItem.DeepCopyInternal()); + if(Term.Any()) dest.Term = new List(Term.DeepCopyInternal()); + if(Binding != null) dest.Binding = (Hl7.Fhir.Model.DataType)Binding.DeepCopyInternal(); + if(Friendly.Any()) dest.Friendly = new List(Friendly.DeepCopyInternal()); + if(Legal.Any()) dest.Legal = new List(Legal.DeepCopyInternal()); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Contract()); + var instance = new Contract(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Contributor.cs b/src/Hl7.Fhir.STU3/Model/Generated/Contributor.cs index 9436f043dd..c30b4cec86 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Contributor.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Contributor.cs @@ -173,7 +173,7 @@ public List Contact private List _Contact; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Contributor; @@ -182,16 +182,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Contributor()); + var instance = new Contributor(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Count.cs b/src/Hl7.Fhir.STU3/Model/Generated/Count.cs index 4b7d7b6fbe..85704ba9a0 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Count.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Count.cs @@ -60,9 +60,11 @@ public partial class Count : Quantity /// public override string TypeName { get { return "Count"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Count()); + var instance = new Count(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Coverage.cs b/src/Hl7.Fhir.STU3/Model/Generated/Coverage.cs index 8bb94010b2..806e9673e7 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Coverage.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Coverage.cs @@ -447,7 +447,7 @@ public string SubClassDisplay } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -456,25 +456,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(GroupElement != null) dest.GroupElement = (Hl7.Fhir.Model.FhirString)GroupElement.DeepCopy(); - if(GroupDisplayElement != null) dest.GroupDisplayElement = (Hl7.Fhir.Model.FhirString)GroupDisplayElement.DeepCopy(); - if(SubGroupElement != null) dest.SubGroupElement = (Hl7.Fhir.Model.FhirString)SubGroupElement.DeepCopy(); - if(SubGroupDisplayElement != null) dest.SubGroupDisplayElement = (Hl7.Fhir.Model.FhirString)SubGroupDisplayElement.DeepCopy(); - if(PlanElement != null) dest.PlanElement = (Hl7.Fhir.Model.FhirString)PlanElement.DeepCopy(); - if(PlanDisplayElement != null) dest.PlanDisplayElement = (Hl7.Fhir.Model.FhirString)PlanDisplayElement.DeepCopy(); - if(SubPlanElement != null) dest.SubPlanElement = (Hl7.Fhir.Model.FhirString)SubPlanElement.DeepCopy(); - if(SubPlanDisplayElement != null) dest.SubPlanDisplayElement = (Hl7.Fhir.Model.FhirString)SubPlanDisplayElement.DeepCopy(); - if(ClassElement != null) dest.ClassElement = (Hl7.Fhir.Model.FhirString)ClassElement.DeepCopy(); - if(ClassDisplayElement != null) dest.ClassDisplayElement = (Hl7.Fhir.Model.FhirString)ClassDisplayElement.DeepCopy(); - if(SubClassElement != null) dest.SubClassElement = (Hl7.Fhir.Model.FhirString)SubClassElement.DeepCopy(); - if(SubClassDisplayElement != null) dest.SubClassDisplayElement = (Hl7.Fhir.Model.FhirString)SubClassDisplayElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(GroupElement != null) dest.GroupElement = (Hl7.Fhir.Model.FhirString)GroupElement.DeepCopyInternal(); + if(GroupDisplayElement != null) dest.GroupDisplayElement = (Hl7.Fhir.Model.FhirString)GroupDisplayElement.DeepCopyInternal(); + if(SubGroupElement != null) dest.SubGroupElement = (Hl7.Fhir.Model.FhirString)SubGroupElement.DeepCopyInternal(); + if(SubGroupDisplayElement != null) dest.SubGroupDisplayElement = (Hl7.Fhir.Model.FhirString)SubGroupDisplayElement.DeepCopyInternal(); + if(PlanElement != null) dest.PlanElement = (Hl7.Fhir.Model.FhirString)PlanElement.DeepCopyInternal(); + if(PlanDisplayElement != null) dest.PlanDisplayElement = (Hl7.Fhir.Model.FhirString)PlanDisplayElement.DeepCopyInternal(); + if(SubPlanElement != null) dest.SubPlanElement = (Hl7.Fhir.Model.FhirString)SubPlanElement.DeepCopyInternal(); + if(SubPlanDisplayElement != null) dest.SubPlanDisplayElement = (Hl7.Fhir.Model.FhirString)SubPlanDisplayElement.DeepCopyInternal(); + if(ClassElement != null) dest.ClassElement = (Hl7.Fhir.Model.FhirString)ClassElement.DeepCopyInternal(); + if(ClassDisplayElement != null) dest.ClassDisplayElement = (Hl7.Fhir.Model.FhirString)ClassDisplayElement.DeepCopyInternal(); + if(SubClassElement != null) dest.SubClassElement = (Hl7.Fhir.Model.FhirString)SubClassElement.DeepCopyInternal(); + if(SubClassDisplayElement != null) dest.SubClassDisplayElement = (Hl7.Fhir.Model.FhirString)SubClassDisplayElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -945,7 +946,7 @@ public List Contract List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Coverage; @@ -954,29 +955,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(PolicyHolder != null) dest.PolicyHolder = (Hl7.Fhir.Model.ResourceReference)PolicyHolder.DeepCopy(); - if(Subscriber != null) dest.Subscriber = (Hl7.Fhir.Model.ResourceReference)Subscriber.DeepCopy(); - if(SubscriberIdElement != null) dest.SubscriberIdElement = (Hl7.Fhir.Model.FhirString)SubscriberIdElement.DeepCopy(); - if(Beneficiary != null) dest.Beneficiary = (Hl7.Fhir.Model.ResourceReference)Beneficiary.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Payor.Any()) dest.Payor = new List(Payor.DeepCopy()); - if(Grouping != null) dest.Grouping = (Hl7.Fhir.Model.Coverage.GroupComponent)Grouping.DeepCopy(); - if(DependentElement != null) dest.DependentElement = (Hl7.Fhir.Model.FhirString)DependentElement.DeepCopy(); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.FhirString)SequenceElement.DeepCopy(); - if(OrderElement != null) dest.OrderElement = (Hl7.Fhir.Model.PositiveInt)OrderElement.DeepCopy(); - if(NetworkElement != null) dest.NetworkElement = (Hl7.Fhir.Model.FhirString)NetworkElement.DeepCopy(); - if(Contract.Any()) dest.Contract = new List(Contract.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(PolicyHolder != null) dest.PolicyHolder = (Hl7.Fhir.Model.ResourceReference)PolicyHolder.DeepCopyInternal(); + if(Subscriber != null) dest.Subscriber = (Hl7.Fhir.Model.ResourceReference)Subscriber.DeepCopyInternal(); + if(SubscriberIdElement != null) dest.SubscriberIdElement = (Hl7.Fhir.Model.FhirString)SubscriberIdElement.DeepCopyInternal(); + if(Beneficiary != null) dest.Beneficiary = (Hl7.Fhir.Model.ResourceReference)Beneficiary.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Payor.Any()) dest.Payor = new List(Payor.DeepCopyInternal()); + if(Grouping != null) dest.Grouping = (Hl7.Fhir.Model.Coverage.GroupComponent)Grouping.DeepCopyInternal(); + if(DependentElement != null) dest.DependentElement = (Hl7.Fhir.Model.FhirString)DependentElement.DeepCopyInternal(); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.FhirString)SequenceElement.DeepCopyInternal(); + if(OrderElement != null) dest.OrderElement = (Hl7.Fhir.Model.PositiveInt)OrderElement.DeepCopyInternal(); + if(NetworkElement != null) dest.NetworkElement = (Hl7.Fhir.Model.FhirString)NetworkElement.DeepCopyInternal(); + if(Contract.Any()) dest.Contract = new List(Contract.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Coverage()); + var instance = new Coverage(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/DataElement.cs b/src/Hl7.Fhir.STU3/Model/Generated/DataElement.cs index a2c7ae5935..d54e7c4616 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/DataElement.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/DataElement.cs @@ -247,7 +247,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MappingComponent; @@ -256,17 +256,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IdentityElement != null) dest.IdentityElement = (Hl7.Fhir.Model.Id)IdentityElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IdentityElement != null) dest.IdentityElement = (Hl7.Fhir.Model.Id)IdentityElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MappingComponent()); + var instance = new MappingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -740,7 +741,7 @@ public List Element List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DataElement; @@ -749,29 +750,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(StringencyElement != null) dest.StringencyElement = (Code)StringencyElement.DeepCopy(); - if(Mapping.Any()) dest.Mapping = new List(Mapping.DeepCopy()); - if(Element.Any()) dest.Element = new List(Element.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new DataElement()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(StringencyElement != null) dest.StringencyElement = (Code)StringencyElement.DeepCopyInternal(); + if(Mapping.Any()) dest.Mapping = new List(Mapping.DeepCopyInternal()); + if(Element.Any()) dest.Element = new List(Element.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new DataElement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/DataRequirement.cs b/src/Hl7.Fhir.STU3/Model/Generated/DataRequirement.cs index e47b088bf1..47f8c0dba0 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/DataRequirement.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/DataRequirement.cs @@ -183,7 +183,7 @@ public List ValueCodeableConcept private List _ValueCodeableConcept; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CodeFilterComponent; @@ -192,18 +192,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(ValueSet != null) dest.ValueSet = (Hl7.Fhir.Model.DataType)ValueSet.DeepCopy(); - if(ValueCodeElement.Any()) dest.ValueCodeElement = new List(ValueCodeElement.DeepCopy()); - if(ValueCoding.Any()) dest.ValueCoding = new List(ValueCoding.DeepCopy()); - if(ValueCodeableConcept.Any()) dest.ValueCodeableConcept = new List(ValueCodeableConcept.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(ValueSet != null) dest.ValueSet = (Hl7.Fhir.Model.DataType)ValueSet.DeepCopyInternal(); + if(ValueCodeElement.Any()) dest.ValueCodeElement = new List(ValueCodeElement.DeepCopyInternal()); + if(ValueCoding.Any()) dest.ValueCoding = new List(ValueCoding.DeepCopyInternal()); + if(ValueCodeableConcept.Any()) dest.ValueCodeableConcept = new List(ValueCodeableConcept.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CodeFilterComponent()); + var instance = new CodeFilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -346,7 +347,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DateFilterComponent; @@ -355,15 +356,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DateFilterComponent()); + var instance = new DateFilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -545,7 +547,7 @@ public List DateFilter private List _DateFilter; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DataRequirement; @@ -554,18 +556,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopy()); - if(MustSupportElement.Any()) dest.MustSupportElement = new List(MustSupportElement.DeepCopy()); - if(CodeFilter.Any()) dest.CodeFilter = new List(CodeFilter.DeepCopy()); - if(DateFilter.Any()) dest.DateFilter = new List(DateFilter.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ProfileElement.Any()) dest.ProfileElement = new List(ProfileElement.DeepCopyInternal()); + if(MustSupportElement.Any()) dest.MustSupportElement = new List(MustSupportElement.DeepCopyInternal()); + if(CodeFilter.Any()) dest.CodeFilter = new List(CodeFilter.DeepCopyInternal()); + if(DateFilter.Any()) dest.DateFilter = new List(DateFilter.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DataRequirement()); + var instance = new DataRequirement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/DetectedIssue.cs b/src/Hl7.Fhir.STU3/Model/Generated/DetectedIssue.cs index abdd7533ca..5e780a642e 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/DetectedIssue.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/DetectedIssue.cs @@ -164,7 +164,7 @@ public Hl7.Fhir.Model.ResourceReference Author private Hl7.Fhir.Model.ResourceReference _Author; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MitigationComponent; @@ -173,16 +173,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MitigationComponent()); + var instance = new MitigationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -495,7 +496,7 @@ public List Mitigation Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetectedIssue; @@ -504,24 +505,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Implicated.Any()) dest.Implicated = new List(Implicated.DeepCopy()); - if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopy(); - if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopy(); - if(Mitigation.Any()) dest.Mitigation = new List(Mitigation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Implicated.Any()) dest.Implicated = new List(Implicated.DeepCopyInternal()); + if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopyInternal(); + if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirUri)ReferenceElement.DeepCopyInternal(); + if(Mitigation.Any()) dest.Mitigation = new List(Mitigation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetectedIssue()); + var instance = new DetectedIssue(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Device.cs b/src/Hl7.Fhir.STU3/Model/Generated/Device.cs index 9885ea3ae4..a257abfe59 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Device.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Device.cs @@ -375,7 +375,7 @@ public Hl7.Fhir.Model.Device.UDIEntryType? EntryType } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UdiComponent; @@ -384,20 +384,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopy(); - if(CarrierHRFElement != null) dest.CarrierHRFElement = (Hl7.Fhir.Model.FhirString)CarrierHRFElement.DeepCopy(); - if(CarrierAIDCElement != null) dest.CarrierAIDCElement = (Hl7.Fhir.Model.Base64Binary)CarrierAIDCElement.DeepCopy(); - if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopy(); - if(EntryTypeElement != null) dest.EntryTypeElement = (Code)EntryTypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DeviceIdentifierElement != null) dest.DeviceIdentifierElement = (Hl7.Fhir.Model.FhirString)DeviceIdentifierElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(JurisdictionElement != null) dest.JurisdictionElement = (Hl7.Fhir.Model.FhirUri)JurisdictionElement.DeepCopyInternal(); + if(CarrierHRFElement != null) dest.CarrierHRFElement = (Hl7.Fhir.Model.FhirString)CarrierHRFElement.DeepCopyInternal(); + if(CarrierAIDCElement != null) dest.CarrierAIDCElement = (Hl7.Fhir.Model.Base64Binary)CarrierAIDCElement.DeepCopyInternal(); + if(IssuerElement != null) dest.IssuerElement = (Hl7.Fhir.Model.FhirUri)IssuerElement.DeepCopyInternal(); + if(EntryTypeElement != null) dest.EntryTypeElement = (Code)EntryTypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UdiComponent()); + var instance = new UdiComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -874,7 +875,7 @@ public List Safety List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Device; @@ -883,30 +884,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Udi != null) dest.Udi = (Hl7.Fhir.Model.Device.UdiComponent)Udi.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(ManufacturerElement != null) dest.ManufacturerElement = (Hl7.Fhir.Model.FhirString)ManufacturerElement.DeepCopy(); - if(ManufactureDateElement != null) dest.ManufactureDateElement = (Hl7.Fhir.Model.FhirDateTime)ManufactureDateElement.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopy(); - if(ModelElement != null) dest.ModelElement = (Hl7.Fhir.Model.FhirString)ModelElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Safety.Any()) dest.Safety = new List(Safety.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Udi != null) dest.Udi = (Hl7.Fhir.Model.Device.UdiComponent)Udi.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(ManufacturerElement != null) dest.ManufacturerElement = (Hl7.Fhir.Model.FhirString)ManufacturerElement.DeepCopyInternal(); + if(ManufactureDateElement != null) dest.ManufactureDateElement = (Hl7.Fhir.Model.FhirDateTime)ManufactureDateElement.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopyInternal(); + if(ModelElement != null) dest.ModelElement = (Hl7.Fhir.Model.FhirString)ModelElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Safety.Any()) dest.Safety = new List(Safety.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Device()); + var instance = new Device(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/DeviceComponent.cs b/src/Hl7.Fhir.STU3/Model/Generated/DeviceComponent.cs index 2aedc06015..8b563ee4f4 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/DeviceComponent.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/DeviceComponent.cs @@ -210,7 +210,7 @@ public string ProductionSpec } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProductionSpecificationComponent; @@ -219,16 +219,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SpecType != null) dest.SpecType = (Hl7.Fhir.Model.CodeableConcept)SpecType.DeepCopy(); - if(ComponentId != null) dest.ComponentId = (Hl7.Fhir.Model.Identifier)ComponentId.DeepCopy(); - if(ProductionSpecElement != null) dest.ProductionSpecElement = (Hl7.Fhir.Model.FhirString)ProductionSpecElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SpecType != null) dest.SpecType = (Hl7.Fhir.Model.CodeableConcept)SpecType.DeepCopyInternal(); + if(ComponentId != null) dest.ComponentId = (Hl7.Fhir.Model.Identifier)ComponentId.DeepCopyInternal(); + if(ProductionSpecElement != null) dest.ProductionSpecElement = (Hl7.Fhir.Model.FhirString)ProductionSpecElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProductionSpecificationComponent()); + var instance = new ProductionSpecificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -474,7 +475,7 @@ public Hl7.Fhir.Model.CodeableConcept LanguageCode Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceComponent; @@ -483,23 +484,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(LastSystemChangeElement != null) dest.LastSystemChangeElement = (Hl7.Fhir.Model.Instant)LastSystemChangeElement.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopy(); - if(OperationalStatus.Any()) dest.OperationalStatus = new List(OperationalStatus.DeepCopy()); - if(ParameterGroup != null) dest.ParameterGroup = (Hl7.Fhir.Model.CodeableConcept)ParameterGroup.DeepCopy(); - if(MeasurementPrincipleElement != null) dest.MeasurementPrincipleElement = (Code)MeasurementPrincipleElement.DeepCopy(); - if(ProductionSpecification.Any()) dest.ProductionSpecification = new List(ProductionSpecification.DeepCopy()); - if(LanguageCode != null) dest.LanguageCode = (Hl7.Fhir.Model.CodeableConcept)LanguageCode.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(LastSystemChangeElement != null) dest.LastSystemChangeElement = (Hl7.Fhir.Model.Instant)LastSystemChangeElement.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopyInternal(); + if(OperationalStatus.Any()) dest.OperationalStatus = new List(OperationalStatus.DeepCopyInternal()); + if(ParameterGroup != null) dest.ParameterGroup = (Hl7.Fhir.Model.CodeableConcept)ParameterGroup.DeepCopyInternal(); + if(MeasurementPrincipleElement != null) dest.MeasurementPrincipleElement = (Code)MeasurementPrincipleElement.DeepCopyInternal(); + if(ProductionSpecification.Any()) dest.ProductionSpecification = new List(ProductionSpecification.DeepCopyInternal()); + if(LanguageCode != null) dest.LanguageCode = (Hl7.Fhir.Model.CodeableConcept)LanguageCode.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceComponent()); + var instance = new DeviceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/DeviceMetric.cs b/src/Hl7.Fhir.STU3/Model/Generated/DeviceMetric.cs index 0ee6f4b00e..5c45316b36 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/DeviceMetric.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/DeviceMetric.cs @@ -364,7 +364,7 @@ public DateTimeOffset? Time } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CalibrationComponent; @@ -373,16 +373,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(StateElement != null) dest.StateElement = (Code)StateElement.DeepCopy(); - if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.Instant)TimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(StateElement != null) dest.StateElement = (Code)StateElement.DeepCopyInternal(); + if(TimeElement != null) dest.TimeElement = (Hl7.Fhir.Model.Instant)TimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CalibrationComponent()); + var instance = new CalibrationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -648,7 +649,7 @@ public List Calibration Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceMetric; @@ -657,23 +658,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopy(); - if(OperationalStatusElement != null) dest.OperationalStatusElement = (Code)OperationalStatusElement.DeepCopy(); - if(ColorElement != null) dest.ColorElement = (Code)ColorElement.DeepCopy(); - if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopy(); - if(MeasurementPeriod != null) dest.MeasurementPeriod = (Hl7.Fhir.Model.Timing)MeasurementPeriod.DeepCopy(); - if(Calibration.Any()) dest.Calibration = new List(Calibration.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopyInternal(); + if(OperationalStatusElement != null) dest.OperationalStatusElement = (Code)OperationalStatusElement.DeepCopyInternal(); + if(ColorElement != null) dest.ColorElement = (Code)ColorElement.DeepCopyInternal(); + if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopyInternal(); + if(MeasurementPeriod != null) dest.MeasurementPeriod = (Hl7.Fhir.Model.Timing)MeasurementPeriod.DeepCopyInternal(); + if(Calibration.Any()) dest.Calibration = new List(Calibration.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceMetric()); + var instance = new DeviceMetric(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/DeviceRequest.cs b/src/Hl7.Fhir.STU3/Model/Generated/DeviceRequest.cs index 04d570ed7e..b0d83c99a8 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/DeviceRequest.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/DeviceRequest.cs @@ -106,7 +106,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequesterComponent; @@ -115,15 +115,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequesterComponent()); + var instance = new RequesterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -551,7 +552,7 @@ public List RelevantHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceRequest; @@ -560,34 +561,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Definition.Any()) dest.Definition = new List(Definition.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PriorRequest.Any()) dest.PriorRequest = new List(PriorRequest.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Intent != null) dest.Intent = (Hl7.Fhir.Model.CodeableConcept)Intent.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.DataType)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.DeviceRequest.RequesterComponent)Requester.DeepCopy(); - if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Definition.Any()) dest.Definition = new List(Definition.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PriorRequest.Any()) dest.PriorRequest = new List(PriorRequest.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Intent != null) dest.Intent = (Hl7.Fhir.Model.CodeableConcept)Intent.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.DataType)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.DeviceRequest.RequesterComponent)Requester.DeepCopyInternal(); + if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceRequest()); + var instance = new DeviceRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/DeviceUseStatement.cs b/src/Hl7.Fhir.STU3/Model/Generated/DeviceUseStatement.cs index b052c8f11b..19ff1b3250 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/DeviceUseStatement.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/DeviceUseStatement.cs @@ -303,7 +303,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DeviceUseStatement; @@ -312,24 +312,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(WhenUsed != null) dest.WhenUsed = (Hl7.Fhir.Model.Period)WhenUsed.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(RecordedOnElement != null) dest.RecordedOnElement = (Hl7.Fhir.Model.FhirDateTime)RecordedOnElement.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(Indication.Any()) dest.Indication = new List(Indication.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(WhenUsed != null) dest.WhenUsed = (Hl7.Fhir.Model.Period)WhenUsed.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(RecordedOnElement != null) dest.RecordedOnElement = (Hl7.Fhir.Model.FhirDateTime)RecordedOnElement.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(Indication.Any()) dest.Indication = new List(Indication.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DeviceUseStatement()); + var instance = new DeviceUseStatement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/DiagnosticReport.cs b/src/Hl7.Fhir.STU3/Model/Generated/DiagnosticReport.cs index 85c4855925..63b04c05f3 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/DiagnosticReport.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/DiagnosticReport.cs @@ -176,7 +176,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -185,15 +185,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -312,7 +313,7 @@ public Hl7.Fhir.Model.ResourceReference Link private Hl7.Fhir.Model.ResourceReference _Link; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImageComponent; @@ -321,15 +322,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Link != null) dest.Link = (Hl7.Fhir.Model.ResourceReference)Link.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Link != null) dest.Link = (Hl7.Fhir.Model.ResourceReference)Link.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImageComponent()); + var instance = new ImageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -692,7 +694,7 @@ public List PresentedForm List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosticReport; @@ -701,30 +703,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopy()); - if(Result.Any()) dest.Result = new List(Result.DeepCopy()); - if(ImagingStudy.Any()) dest.ImagingStudy = new List(ImagingStudy.DeepCopy()); - if(Image.Any()) dest.Image = new List(Image.DeepCopy()); - if(ConclusionElement != null) dest.ConclusionElement = (Hl7.Fhir.Model.FhirString)ConclusionElement.DeepCopy(); - if(CodedDiagnosis.Any()) dest.CodedDiagnosis = new List(CodedDiagnosis.DeepCopy()); - if(PresentedForm.Any()) dest.PresentedForm = new List(PresentedForm.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopyInternal()); + if(Result.Any()) dest.Result = new List(Result.DeepCopyInternal()); + if(ImagingStudy.Any()) dest.ImagingStudy = new List(ImagingStudy.DeepCopyInternal()); + if(Image.Any()) dest.Image = new List(Image.DeepCopyInternal()); + if(ConclusionElement != null) dest.ConclusionElement = (Hl7.Fhir.Model.FhirString)ConclusionElement.DeepCopyInternal(); + if(CodedDiagnosis.Any()) dest.CodedDiagnosis = new List(CodedDiagnosis.DeepCopyInternal()); + if(PresentedForm.Any()) dest.PresentedForm = new List(PresentedForm.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosticReport()); + var instance = new DiagnosticReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Distance.cs b/src/Hl7.Fhir.STU3/Model/Generated/Distance.cs index 78764bc0bf..1023e3ad94 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Distance.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Distance.cs @@ -59,9 +59,11 @@ public partial class Distance : Quantity /// public override string TypeName { get { return "Distance"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Distance()); + var instance = new Distance(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.STU3/Model/Generated/DocumentManifest.cs b/src/Hl7.Fhir.STU3/Model/Generated/DocumentManifest.cs index ce43696d63..4cb317ee68 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/DocumentManifest.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/DocumentManifest.cs @@ -92,7 +92,7 @@ public Hl7.Fhir.Model.DataType P private Hl7.Fhir.Model.DataType _P; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContentComponent; @@ -101,14 +101,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(P != null) dest.P = (Hl7.Fhir.Model.DataType)P.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(P != null) dest.P = (Hl7.Fhir.Model.DataType)P.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContentComponent()); + var instance = new ContentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -201,7 +202,7 @@ public Hl7.Fhir.Model.ResourceReference Ref private Hl7.Fhir.Model.ResourceReference _Ref; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedComponent; @@ -210,15 +211,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Ref != null) dest.Ref = (Hl7.Fhir.Model.ResourceReference)Ref.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Ref != null) dest.Ref = (Hl7.Fhir.Model.ResourceReference)Ref.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedComponent()); + var instance = new RelatedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -519,7 +521,7 @@ public List Related List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DocumentManifest; @@ -528,25 +530,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MasterIdentifier != null) dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Content.Any()) dest.Content = new List(Content.DeepCopy()); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(MasterIdentifier != null) dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Content.Any()) dest.Content = new List(Content.DeepCopyInternal()); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DocumentManifest()); + var instance = new DocumentManifest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/DocumentReference.cs b/src/Hl7.Fhir.STU3/Model/Generated/DocumentReference.cs index aacc3e1664..1762b3e16a 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/DocumentReference.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/DocumentReference.cs @@ -126,7 +126,7 @@ public Hl7.Fhir.Model.ResourceReference Target private Hl7.Fhir.Model.ResourceReference _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatesToComponent; @@ -135,15 +135,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatesToComponent()); + var instance = new RelatesToComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -243,7 +244,7 @@ public Hl7.Fhir.Model.Coding Format private Hl7.Fhir.Model.Coding _Format; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContentComponent; @@ -252,15 +253,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopy(); - if(Format != null) dest.Format = (Hl7.Fhir.Model.Coding)Format.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Attachment != null) dest.Attachment = (Hl7.Fhir.Model.Attachment)Attachment.DeepCopyInternal(); + if(Format != null) dest.Format = (Hl7.Fhir.Model.Coding)Format.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContentComponent()); + var instance = new ContentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -433,7 +435,7 @@ public List Related private List _Related; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContextComponent; @@ -442,20 +444,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Event.Any()) dest.Event = new List(Event.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(FacilityType != null) dest.FacilityType = (Hl7.Fhir.Model.CodeableConcept)FacilityType.DeepCopy(); - if(PracticeSetting != null) dest.PracticeSetting = (Hl7.Fhir.Model.CodeableConcept)PracticeSetting.DeepCopy(); - if(SourcePatientInfo != null) dest.SourcePatientInfo = (Hl7.Fhir.Model.ResourceReference)SourcePatientInfo.DeepCopy(); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Event.Any()) dest.Event = new List(Event.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(FacilityType != null) dest.FacilityType = (Hl7.Fhir.Model.CodeableConcept)FacilityType.DeepCopyInternal(); + if(PracticeSetting != null) dest.PracticeSetting = (Hl7.Fhir.Model.CodeableConcept)PracticeSetting.DeepCopyInternal(); + if(SourcePatientInfo != null) dest.SourcePatientInfo = (Hl7.Fhir.Model.ResourceReference)SourcePatientInfo.DeepCopyInternal(); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContextComponent()); + var instance = new ContextComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -596,7 +599,7 @@ public Hl7.Fhir.Model.ResourceReference Ref private Hl7.Fhir.Model.ResourceReference _Ref; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedComponent; @@ -605,15 +608,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Ref != null) dest.Ref = (Hl7.Fhir.Model.ResourceReference)Ref.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Ref != null) dest.Ref = (Hl7.Fhir.Model.ResourceReference)Ref.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedComponent()); + var instance = new RelatedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1005,7 +1009,7 @@ public Hl7.Fhir.Model.DocumentReference.ContextComponent Context List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DocumentReference; @@ -1014,30 +1018,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(MasterIdentifier != null) dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(DocStatusElement != null) dest.DocStatusElement = (Code)DocStatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(IndexedElement != null) dest.IndexedElement = (Hl7.Fhir.Model.Instant)IndexedElement.DeepCopy(); - if(Author.Any()) dest.Author = new List(Author.DeepCopy()); - if(Authenticator != null) dest.Authenticator = (Hl7.Fhir.Model.ResourceReference)Authenticator.DeepCopy(); - if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy(); - if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopy()); - if(Content.Any()) dest.Content = new List(Content.DeepCopy()); - if(Context != null) dest.Context = (Hl7.Fhir.Model.DocumentReference.ContextComponent)Context.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(MasterIdentifier != null) dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(DocStatusElement != null) dest.DocStatusElement = (Code)DocStatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Class != null) dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(IndexedElement != null) dest.IndexedElement = (Hl7.Fhir.Model.Instant)IndexedElement.DeepCopyInternal(); + if(Author.Any()) dest.Author = new List(Author.DeepCopyInternal()); + if(Authenticator != null) dest.Authenticator = (Hl7.Fhir.Model.ResourceReference)Authenticator.DeepCopyInternal(); + if(Custodian != null) dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopyInternal(); + if(RelatesTo.Any()) dest.RelatesTo = new List(RelatesTo.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(SecurityLabel.Any()) dest.SecurityLabel = new List(SecurityLabel.DeepCopyInternal()); + if(Content.Any()) dest.Content = new List(Content.DeepCopyInternal()); + if(Context != null) dest.Context = (Hl7.Fhir.Model.DocumentReference.ContextComponent)Context.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DocumentReference()); + var instance = new DocumentReference(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Dosage.cs b/src/Hl7.Fhir.STU3/Model/Generated/Dosage.cs index 1f787e4663..b33971f3db 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Dosage.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Dosage.cs @@ -307,7 +307,7 @@ public Hl7.Fhir.Model.DataType Rate private Hl7.Fhir.Model.DataType _Rate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Dosage; @@ -316,27 +316,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.Integer)SequenceElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(AdditionalInstruction.Any()) dest.AdditionalInstruction = new List(AdditionalInstruction.DeepCopy()); - if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.Timing)Timing.DeepCopy(); - if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopy(); - if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy(); - if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Dose != null) dest.Dose = (Hl7.Fhir.Model.DataType)Dose.DeepCopy(); - if(MaxDosePerPeriod != null) dest.MaxDosePerPeriod = (Hl7.Fhir.Model.Ratio)MaxDosePerPeriod.DeepCopy(); - if(MaxDosePerAdministration != null) dest.MaxDosePerAdministration = (Hl7.Fhir.Model.Quantity)MaxDosePerAdministration.DeepCopy(); - if(MaxDosePerLifetime != null) dest.MaxDosePerLifetime = (Hl7.Fhir.Model.Quantity)MaxDosePerLifetime.DeepCopy(); - if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.Integer)SequenceElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(AdditionalInstruction.Any()) dest.AdditionalInstruction = new List(AdditionalInstruction.DeepCopyInternal()); + if(PatientInstructionElement != null) dest.PatientInstructionElement = (Hl7.Fhir.Model.FhirString)PatientInstructionElement.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.Timing)Timing.DeepCopyInternal(); + if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopyInternal(); + if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopyInternal(); + if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Dose != null) dest.Dose = (Hl7.Fhir.Model.DataType)Dose.DeepCopyInternal(); + if(MaxDosePerPeriod != null) dest.MaxDosePerPeriod = (Hl7.Fhir.Model.Ratio)MaxDosePerPeriod.DeepCopyInternal(); + if(MaxDosePerAdministration != null) dest.MaxDosePerAdministration = (Hl7.Fhir.Model.Quantity)MaxDosePerAdministration.DeepCopyInternal(); + if(MaxDosePerLifetime != null) dest.MaxDosePerLifetime = (Hl7.Fhir.Model.Quantity)MaxDosePerLifetime.DeepCopyInternal(); + if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Dosage()); + var instance = new Dosage(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Duration.cs b/src/Hl7.Fhir.STU3/Model/Generated/Duration.cs index 8eac517e6f..34316d2e6b 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Duration.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Duration.cs @@ -59,9 +59,11 @@ public partial class Duration : Quantity /// public override string TypeName { get { return "Duration"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Duration()); + var instance = new Duration(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ElementDefinition.cs b/src/Hl7.Fhir.STU3/Model/Generated/ElementDefinition.cs index 9ae275c8b4..c918775033 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ElementDefinition.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ElementDefinition.cs @@ -372,7 +372,7 @@ public Hl7.Fhir.Model.ElementDefinition.SlicingRules? Rules } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SlicingComponent; @@ -381,17 +381,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Discriminator.Any()) dest.Discriminator = new List(Discriminator.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(OrderedElement != null) dest.OrderedElement = (Hl7.Fhir.Model.FhirBoolean)OrderedElement.DeepCopy(); - if(RulesElement != null) dest.RulesElement = (Code)RulesElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Discriminator.Any()) dest.Discriminator = new List(Discriminator.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(OrderedElement != null) dest.OrderedElement = (Hl7.Fhir.Model.FhirBoolean)OrderedElement.DeepCopyInternal(); + if(RulesElement != null) dest.RulesElement = (Code)RulesElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SlicingComponent()); + var instance = new SlicingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -546,7 +547,7 @@ public string Path } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiscriminatorComponent; @@ -555,15 +556,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiscriminatorComponent()); + var instance = new DiscriminatorComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -732,7 +734,7 @@ public string Max } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BaseComponent; @@ -741,16 +743,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BaseComponent()); + var instance = new BaseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -993,7 +996,7 @@ public Hl7.Fhir.Model.ElementDefinition.ReferenceVersionRules? Versioning } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TypeRefComponent; @@ -1002,18 +1005,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.FhirUri)CodeElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.FhirUri)ProfileElement.DeepCopy(); - if(TargetProfileElement != null) dest.TargetProfileElement = (Hl7.Fhir.Model.FhirUri)TargetProfileElement.DeepCopy(); - if(AggregationElement.Any()) dest.AggregationElement = new List>(AggregationElement.DeepCopy()); - if(VersioningElement != null) dest.VersioningElement = (Code)VersioningElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.FhirUri)CodeElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.FhirUri)ProfileElement.DeepCopyInternal(); + if(TargetProfileElement != null) dest.TargetProfileElement = (Hl7.Fhir.Model.FhirUri)TargetProfileElement.DeepCopyInternal(); + if(AggregationElement.Any()) dest.AggregationElement = new List>(AggregationElement.DeepCopyInternal()); + if(VersioningElement != null) dest.VersioningElement = (Code)VersioningElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TypeRefComponent()); + var instance = new TypeRefComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1158,7 +1162,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExampleComponent; @@ -1167,15 +1171,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExampleComponent()); + var instance = new ExampleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1475,7 +1480,7 @@ public string Source } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConstraintComponent; @@ -1484,20 +1489,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KeyElement != null) dest.KeyElement = (Hl7.Fhir.Model.Id)KeyElement.DeepCopy(); - if(RequirementsElement != null) dest.RequirementsElement = (Hl7.Fhir.Model.FhirString)RequirementsElement.DeepCopy(); - if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopy(); - if(HumanElement != null) dest.HumanElement = (Hl7.Fhir.Model.FhirString)HumanElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(XpathElement != null) dest.XpathElement = (Hl7.Fhir.Model.FhirString)XpathElement.DeepCopy(); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KeyElement != null) dest.KeyElement = (Hl7.Fhir.Model.Id)KeyElement.DeepCopyInternal(); + if(RequirementsElement != null) dest.RequirementsElement = (Hl7.Fhir.Model.FhirString)RequirementsElement.DeepCopyInternal(); + if(SeverityElement != null) dest.SeverityElement = (Code)SeverityElement.DeepCopyInternal(); + if(HumanElement != null) dest.HumanElement = (Hl7.Fhir.Model.FhirString)HumanElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(XpathElement != null) dest.XpathElement = (Hl7.Fhir.Model.FhirString)XpathElement.DeepCopyInternal(); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConstraintComponent()); + var instance = new ConstraintComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1691,7 +1697,7 @@ public Hl7.Fhir.Model.DataType ValueSet private Hl7.Fhir.Model.DataType _ValueSet; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ElementDefinitionBindingComponent; @@ -1700,16 +1706,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StrengthElement != null) dest.StrengthElement = (Code)StrengthElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(ValueSet != null) dest.ValueSet = (Hl7.Fhir.Model.DataType)ValueSet.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StrengthElement != null) dest.StrengthElement = (Code)StrengthElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(ValueSet != null) dest.ValueSet = (Hl7.Fhir.Model.DataType)ValueSet.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ElementDefinitionBindingComponent()); + var instance = new ElementDefinitionBindingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1917,7 +1924,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MappingComponent; @@ -1926,17 +1933,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IdentityElement != null) dest.IdentityElement = (Hl7.Fhir.Model.Id)IdentityElement.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy(); - if(MapElement != null) dest.MapElement = (Hl7.Fhir.Model.FhirString)MapElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IdentityElement != null) dest.IdentityElement = (Hl7.Fhir.Model.Id)IdentityElement.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopyInternal(); + if(MapElement != null) dest.MapElement = (Hl7.Fhir.Model.FhirString)MapElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MappingComponent()); + var instance = new MappingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2788,7 +2796,7 @@ public List Mapping private List _Mapping; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ElementDefinition; @@ -2797,45 +2805,46 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(RepresentationElement.Any()) dest.RepresentationElement = new List>(RepresentationElement.DeepCopy()); - if(SliceNameElement != null) dest.SliceNameElement = (Hl7.Fhir.Model.FhirString)SliceNameElement.DeepCopy(); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Slicing != null) dest.Slicing = (Hl7.Fhir.Model.ElementDefinition.SlicingComponent)Slicing.DeepCopy(); - if(ShortElement != null) dest.ShortElement = (Hl7.Fhir.Model.FhirString)ShortElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Markdown)DefinitionElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopy(); - if(RequirementsElement != null) dest.RequirementsElement = (Hl7.Fhir.Model.Markdown)RequirementsElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(Base != null) dest.Base = (Hl7.Fhir.Model.ElementDefinition.BaseComponent)Base.DeepCopy(); - if(ContentReferenceElement != null) dest.ContentReferenceElement = (Hl7.Fhir.Model.FhirUri)ContentReferenceElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(DefaultValue != null) dest.DefaultValue = (Hl7.Fhir.Model.DataType)DefaultValue.DeepCopy(); - if(MeaningWhenMissingElement != null) dest.MeaningWhenMissingElement = (Hl7.Fhir.Model.Markdown)MeaningWhenMissingElement.DeepCopy(); - if(OrderMeaningElement != null) dest.OrderMeaningElement = (Hl7.Fhir.Model.FhirString)OrderMeaningElement.DeepCopy(); - if(Fixed != null) dest.Fixed = (Hl7.Fhir.Model.DataType)Fixed.DeepCopy(); - if(Pattern != null) dest.Pattern = (Hl7.Fhir.Model.DataType)Pattern.DeepCopy(); - if(Example.Any()) dest.Example = new List(Example.DeepCopy()); - if(MinValue != null) dest.MinValue = (Hl7.Fhir.Model.DataType)MinValue.DeepCopy(); - if(MaxValue != null) dest.MaxValue = (Hl7.Fhir.Model.DataType)MaxValue.DeepCopy(); - if(MaxLengthElement != null) dest.MaxLengthElement = (Hl7.Fhir.Model.Integer)MaxLengthElement.DeepCopy(); - if(ConditionElement.Any()) dest.ConditionElement = new List(ConditionElement.DeepCopy()); - if(Constraint.Any()) dest.Constraint = new List(Constraint.DeepCopy()); - if(MustSupportElement != null) dest.MustSupportElement = (Hl7.Fhir.Model.FhirBoolean)MustSupportElement.DeepCopy(); - if(IsModifierElement != null) dest.IsModifierElement = (Hl7.Fhir.Model.FhirBoolean)IsModifierElement.DeepCopy(); - if(IsSummaryElement != null) dest.IsSummaryElement = (Hl7.Fhir.Model.FhirBoolean)IsSummaryElement.DeepCopy(); - if(Binding != null) dest.Binding = (Hl7.Fhir.Model.ElementDefinition.ElementDefinitionBindingComponent)Binding.DeepCopy(); - if(Mapping.Any()) dest.Mapping = new List(Mapping.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ElementDefinition()); + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(RepresentationElement.Any()) dest.RepresentationElement = new List>(RepresentationElement.DeepCopyInternal()); + if(SliceNameElement != null) dest.SliceNameElement = (Hl7.Fhir.Model.FhirString)SliceNameElement.DeepCopyInternal(); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Slicing != null) dest.Slicing = (Hl7.Fhir.Model.ElementDefinition.SlicingComponent)Slicing.DeepCopyInternal(); + if(ShortElement != null) dest.ShortElement = (Hl7.Fhir.Model.FhirString)ShortElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.Markdown)DefinitionElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.Markdown)CommentElement.DeepCopyInternal(); + if(RequirementsElement != null) dest.RequirementsElement = (Hl7.Fhir.Model.Markdown)RequirementsElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(Base != null) dest.Base = (Hl7.Fhir.Model.ElementDefinition.BaseComponent)Base.DeepCopyInternal(); + if(ContentReferenceElement != null) dest.ContentReferenceElement = (Hl7.Fhir.Model.FhirUri)ContentReferenceElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(DefaultValue != null) dest.DefaultValue = (Hl7.Fhir.Model.DataType)DefaultValue.DeepCopyInternal(); + if(MeaningWhenMissingElement != null) dest.MeaningWhenMissingElement = (Hl7.Fhir.Model.Markdown)MeaningWhenMissingElement.DeepCopyInternal(); + if(OrderMeaningElement != null) dest.OrderMeaningElement = (Hl7.Fhir.Model.FhirString)OrderMeaningElement.DeepCopyInternal(); + if(Fixed != null) dest.Fixed = (Hl7.Fhir.Model.DataType)Fixed.DeepCopyInternal(); + if(Pattern != null) dest.Pattern = (Hl7.Fhir.Model.DataType)Pattern.DeepCopyInternal(); + if(Example.Any()) dest.Example = new List(Example.DeepCopyInternal()); + if(MinValue != null) dest.MinValue = (Hl7.Fhir.Model.DataType)MinValue.DeepCopyInternal(); + if(MaxValue != null) dest.MaxValue = (Hl7.Fhir.Model.DataType)MaxValue.DeepCopyInternal(); + if(MaxLengthElement != null) dest.MaxLengthElement = (Hl7.Fhir.Model.Integer)MaxLengthElement.DeepCopyInternal(); + if(ConditionElement.Any()) dest.ConditionElement = new List(ConditionElement.DeepCopyInternal()); + if(Constraint.Any()) dest.Constraint = new List(Constraint.DeepCopyInternal()); + if(MustSupportElement != null) dest.MustSupportElement = (Hl7.Fhir.Model.FhirBoolean)MustSupportElement.DeepCopyInternal(); + if(IsModifierElement != null) dest.IsModifierElement = (Hl7.Fhir.Model.FhirBoolean)IsModifierElement.DeepCopyInternal(); + if(IsSummaryElement != null) dest.IsSummaryElement = (Hl7.Fhir.Model.FhirBoolean)IsSummaryElement.DeepCopyInternal(); + if(Binding != null) dest.Binding = (Hl7.Fhir.Model.ElementDefinition.ElementDefinitionBindingComponent)Binding.DeepCopyInternal(); + if(Mapping.Any()) dest.Mapping = new List(Mapping.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ElementDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/EligibilityRequest.cs b/src/Hl7.Fhir.STU3/Model/Generated/EligibilityRequest.cs index e1754ce8d8..c61bf54b72 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/EligibilityRequest.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/EligibilityRequest.cs @@ -332,7 +332,7 @@ public Hl7.Fhir.Model.CodeableConcept BenefitSubCategory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EligibilityRequest; @@ -341,28 +341,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopy(); - if(BenefitCategory != null) dest.BenefitCategory = (Hl7.Fhir.Model.CodeableConcept)BenefitCategory.DeepCopy(); - if(BenefitSubCategory != null) dest.BenefitSubCategory = (Hl7.Fhir.Model.CodeableConcept)BenefitSubCategory.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(BusinessArrangementElement != null) dest.BusinessArrangementElement = (Hl7.Fhir.Model.FhirString)BusinessArrangementElement.DeepCopyInternal(); + if(BenefitCategory != null) dest.BenefitCategory = (Hl7.Fhir.Model.CodeableConcept)BenefitCategory.DeepCopyInternal(); + if(BenefitSubCategory != null) dest.BenefitSubCategory = (Hl7.Fhir.Model.CodeableConcept)BenefitSubCategory.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EligibilityRequest()); + var instance = new EligibilityRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/EligibilityResponse.cs b/src/Hl7.Fhir.STU3/Model/Generated/EligibilityResponse.cs index fe198dd924..803128bcbf 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/EligibilityResponse.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/EligibilityResponse.cs @@ -119,7 +119,7 @@ public List BenefitBalance private List _BenefitBalance; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -128,16 +128,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(Contract != null) dest.Contract = (Hl7.Fhir.Model.ResourceReference)Contract.DeepCopy(); - if(BenefitBalance.Any()) dest.BenefitBalance = new List(BenefitBalance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(Contract != null) dest.Contract = (Hl7.Fhir.Model.ResourceReference)Contract.DeepCopyInternal(); + if(BenefitBalance.Any()) dest.BenefitBalance = new List(BenefitBalance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -395,7 +396,7 @@ public List Financial private List _Financial; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BenefitsComponent; @@ -404,22 +405,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(SubCategory != null) dest.SubCategory = (Hl7.Fhir.Model.CodeableConcept)SubCategory.DeepCopy(); - if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopy(); - if(Financial.Any()) dest.Financial = new List(Financial.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(SubCategory != null) dest.SubCategory = (Hl7.Fhir.Model.CodeableConcept)SubCategory.DeepCopyInternal(); + if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopyInternal(); + if(Financial.Any()) dest.Financial = new List(Financial.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BenefitsComponent()); + var instance = new BenefitsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -592,7 +594,7 @@ public Hl7.Fhir.Model.DataType Used private Hl7.Fhir.Model.DataType _Used; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BenefitComponent; @@ -601,16 +603,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopy(); - if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopyInternal(); + if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BenefitComponent()); + var instance = new BenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -705,7 +708,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ErrorsComponent; @@ -714,14 +717,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ErrorsComponent()); + var instance = new ErrorsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1027,7 +1031,7 @@ public List Error List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EligibilityResponse; @@ -1036,26 +1040,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopy(); - if(RequestOrganization != null) dest.RequestOrganization = (Hl7.Fhir.Model.ResourceReference)RequestOrganization.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(InforceElement != null) dest.InforceElement = (Hl7.Fhir.Model.FhirBoolean)InforceElement.DeepCopy(); - if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopy()); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(Error.Any()) dest.Error = new List(Error.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopyInternal(); + if(RequestOrganization != null) dest.RequestOrganization = (Hl7.Fhir.Model.ResourceReference)RequestOrganization.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(InforceElement != null) dest.InforceElement = (Hl7.Fhir.Model.FhirBoolean)InforceElement.DeepCopyInternal(); + if(Insurance.Any()) dest.Insurance = new List(Insurance.DeepCopyInternal()); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(Error.Any()) dest.Error = new List(Error.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EligibilityResponse()); + var instance = new EligibilityResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Encounter.cs b/src/Hl7.Fhir.STU3/Model/Generated/Encounter.cs index fffe7c38c4..f4bf2ac2f9 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Encounter.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Encounter.cs @@ -224,7 +224,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StatusHistoryComponent; @@ -233,15 +233,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StatusHistoryComponent()); + var instance = new StatusHistoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -343,7 +344,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ClassHistoryComponent; @@ -352,15 +353,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Class != null) dest.Class = (Hl7.Fhir.Model.Coding)Class.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Class != null) dest.Class = (Hl7.Fhir.Model.Coding)Class.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ClassHistoryComponent()); + var instance = new ClassHistoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -475,7 +477,7 @@ public Hl7.Fhir.Model.ResourceReference Individual private Hl7.Fhir.Model.ResourceReference _Individual; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -484,16 +486,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Individual != null) dest.Individual = (Hl7.Fhir.Model.ResourceReference)Individual.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Individual != null) dest.Individual = (Hl7.Fhir.Model.ResourceReference)Individual.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -631,7 +634,7 @@ public int? Rank } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -640,16 +643,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -860,7 +864,7 @@ public Hl7.Fhir.Model.CodeableConcept DischargeDisposition private Hl7.Fhir.Model.CodeableConcept _DischargeDisposition; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HospitalizationComponent; @@ -869,22 +873,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PreAdmissionIdentifier != null) dest.PreAdmissionIdentifier = (Hl7.Fhir.Model.Identifier)PreAdmissionIdentifier.DeepCopy(); - if(Origin != null) dest.Origin = (Hl7.Fhir.Model.ResourceReference)Origin.DeepCopy(); - if(AdmitSource != null) dest.AdmitSource = (Hl7.Fhir.Model.CodeableConcept)AdmitSource.DeepCopy(); - if(ReAdmission != null) dest.ReAdmission = (Hl7.Fhir.Model.CodeableConcept)ReAdmission.DeepCopy(); - if(DietPreference.Any()) dest.DietPreference = new List(DietPreference.DeepCopy()); - if(SpecialCourtesy.Any()) dest.SpecialCourtesy = new List(SpecialCourtesy.DeepCopy()); - if(SpecialArrangement.Any()) dest.SpecialArrangement = new List(SpecialArrangement.DeepCopy()); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(DischargeDisposition != null) dest.DischargeDisposition = (Hl7.Fhir.Model.CodeableConcept)DischargeDisposition.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PreAdmissionIdentifier != null) dest.PreAdmissionIdentifier = (Hl7.Fhir.Model.Identifier)PreAdmissionIdentifier.DeepCopyInternal(); + if(Origin != null) dest.Origin = (Hl7.Fhir.Model.ResourceReference)Origin.DeepCopyInternal(); + if(AdmitSource != null) dest.AdmitSource = (Hl7.Fhir.Model.CodeableConcept)AdmitSource.DeepCopyInternal(); + if(ReAdmission != null) dest.ReAdmission = (Hl7.Fhir.Model.CodeableConcept)ReAdmission.DeepCopyInternal(); + if(DietPreference.Any()) dest.DietPreference = new List(DietPreference.DeepCopyInternal()); + if(SpecialCourtesy.Any()) dest.SpecialCourtesy = new List(SpecialCourtesy.DeepCopyInternal()); + if(SpecialArrangement.Any()) dest.SpecialArrangement = new List(SpecialArrangement.DeepCopyInternal()); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(DischargeDisposition != null) dest.DischargeDisposition = (Hl7.Fhir.Model.CodeableConcept)DischargeDisposition.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HospitalizationComponent()); + var instance = new HospitalizationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1075,7 +1080,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LocationComponent; @@ -1084,16 +1089,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LocationComponent()); + var instance = new LocationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1482,7 +1488,7 @@ public Hl7.Fhir.Model.ResourceReference PartOf List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Encounter; @@ -1491,34 +1497,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopy()); - if(Class != null) dest.Class = (Hl7.Fhir.Model.Coding)Class.DeepCopy(); - if(ClassHistory.Any()) dest.ClassHistory = new List(ClassHistory.DeepCopy()); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(EpisodeOfCare.Any()) dest.EpisodeOfCare = new List(EpisodeOfCare.DeepCopy()); - if(IncomingReferral.Any()) dest.IncomingReferral = new List(IncomingReferral.DeepCopy()); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Appointment != null) dest.Appointment = (Hl7.Fhir.Model.ResourceReference)Appointment.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Length != null) dest.Length = (Hl7.Fhir.Model.Duration)Length.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Account.Any()) dest.Account = new List(Account.DeepCopy()); - if(Hospitalization != null) dest.Hospitalization = (Hl7.Fhir.Model.Encounter.HospitalizationComponent)Hospitalization.DeepCopy(); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(ServiceProvider != null) dest.ServiceProvider = (Hl7.Fhir.Model.ResourceReference)ServiceProvider.DeepCopy(); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopyInternal()); + if(Class != null) dest.Class = (Hl7.Fhir.Model.Coding)Class.DeepCopyInternal(); + if(ClassHistory.Any()) dest.ClassHistory = new List(ClassHistory.DeepCopyInternal()); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(EpisodeOfCare.Any()) dest.EpisodeOfCare = new List(EpisodeOfCare.DeepCopyInternal()); + if(IncomingReferral.Any()) dest.IncomingReferral = new List(IncomingReferral.DeepCopyInternal()); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Appointment != null) dest.Appointment = (Hl7.Fhir.Model.ResourceReference)Appointment.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Length != null) dest.Length = (Hl7.Fhir.Model.Duration)Length.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Account.Any()) dest.Account = new List(Account.DeepCopyInternal()); + if(Hospitalization != null) dest.Hospitalization = (Hl7.Fhir.Model.Encounter.HospitalizationComponent)Hospitalization.DeepCopyInternal(); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(ServiceProvider != null) dest.ServiceProvider = (Hl7.Fhir.Model.ResourceReference)ServiceProvider.DeepCopyInternal(); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Encounter()); + var instance = new Encounter(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Endpoint.cs b/src/Hl7.Fhir.STU3/Model/Generated/Endpoint.cs index 5a4c7a7775..12f99375f3 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Endpoint.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Endpoint.cs @@ -355,7 +355,7 @@ public IEnumerable Header List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Endpoint; @@ -364,24 +364,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ConnectionType != null) dest.ConnectionType = (Hl7.Fhir.Model.Coding)ConnectionType.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(PayloadType.Any()) dest.PayloadType = new List(PayloadType.DeepCopy()); - if(PayloadMimeTypeElement.Any()) dest.PayloadMimeTypeElement = new List(PayloadMimeTypeElement.DeepCopy()); - if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirUri)AddressElement.DeepCopy(); - if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ConnectionType != null) dest.ConnectionType = (Hl7.Fhir.Model.Coding)ConnectionType.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(PayloadType.Any()) dest.PayloadType = new List(PayloadType.DeepCopyInternal()); + if(PayloadMimeTypeElement.Any()) dest.PayloadMimeTypeElement = new List(PayloadMimeTypeElement.DeepCopyInternal()); + if(AddressElement != null) dest.AddressElement = (Hl7.Fhir.Model.FhirUri)AddressElement.DeepCopyInternal(); + if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Endpoint()); + var instance = new Endpoint(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/EnrollmentRequest.cs b/src/Hl7.Fhir.STU3/Model/Generated/EnrollmentRequest.cs index ce72e4dea7..72b7046e84 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/EnrollmentRequest.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/EnrollmentRequest.cs @@ -214,7 +214,7 @@ public Hl7.Fhir.Model.ResourceReference Coverage List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnrollmentRequest; @@ -223,21 +223,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnrollmentRequest()); + var instance = new EnrollmentRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/EnrollmentResponse.cs b/src/Hl7.Fhir.STU3/Model/Generated/EnrollmentResponse.cs index 6f17a88587..cd8a64950e 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/EnrollmentResponse.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/EnrollmentResponse.cs @@ -244,7 +244,7 @@ public Hl7.Fhir.Model.ResourceReference RequestOrganization List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnrollmentResponse; @@ -253,22 +253,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopy(); - if(RequestOrganization != null) dest.RequestOrganization = (Hl7.Fhir.Model.ResourceReference)RequestOrganization.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopyInternal(); + if(RequestOrganization != null) dest.RequestOrganization = (Hl7.Fhir.Model.ResourceReference)RequestOrganization.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnrollmentResponse()); + var instance = new EnrollmentResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/EpisodeOfCare.cs b/src/Hl7.Fhir.STU3/Model/Generated/EpisodeOfCare.cs index 54dcff0332..2bcb012f73 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/EpisodeOfCare.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/EpisodeOfCare.cs @@ -175,7 +175,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StatusHistoryComponent; @@ -184,15 +184,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StatusHistoryComponent()); + var instance = new StatusHistoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -322,7 +323,7 @@ public int? Rank } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -331,16 +332,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(RankElement != null) dest.RankElement = (Hl7.Fhir.Model.PositiveInt)RankElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -604,7 +606,7 @@ public List Account List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EpisodeOfCare; @@ -613,25 +615,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopy()); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(ReferralRequest.Any()) dest.ReferralRequest = new List(ReferralRequest.DeepCopy()); - if(CareManager != null) dest.CareManager = (Hl7.Fhir.Model.ResourceReference)CareManager.DeepCopy(); - if(Team.Any()) dest.Team = new List(Team.DeepCopy()); - if(Account.Any()) dest.Account = new List(Account.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusHistory.Any()) dest.StatusHistory = new List(StatusHistory.DeepCopyInternal()); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(ReferralRequest.Any()) dest.ReferralRequest = new List(ReferralRequest.DeepCopyInternal()); + if(CareManager != null) dest.CareManager = (Hl7.Fhir.Model.ResourceReference)CareManager.DeepCopyInternal(); + if(Team.Any()) dest.Team = new List(Team.DeepCopyInternal()); + if(Account.Any()) dest.Account = new List(Account.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EpisodeOfCare()); + var instance = new EpisodeOfCare(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ExpansionProfile.cs b/src/Hl7.Fhir.STU3/Model/Generated/ExpansionProfile.cs index 9e7ac76b9f..faf76edeb5 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ExpansionProfile.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ExpansionProfile.cs @@ -201,7 +201,7 @@ public Hl7.Fhir.Model.ExpansionProfile.SystemVersionProcessingMode? Mode } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FixedVersionComponent; @@ -210,16 +210,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FixedVersionComponent()); + var instance = new FixedVersionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -363,7 +364,7 @@ public string Version } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExcludedSystemComponent; @@ -372,15 +373,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExcludedSystemComponent()); + var instance = new ExcludedSystemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -478,7 +480,7 @@ public Hl7.Fhir.Model.ExpansionProfile.DesignationExcludeComponent Exclude private Hl7.Fhir.Model.ExpansionProfile.DesignationExcludeComponent _Exclude; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DesignationComponent; @@ -487,15 +489,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Include != null) dest.Include = (Hl7.Fhir.Model.ExpansionProfile.DesignationIncludeComponent)Include.DeepCopy(); - if(Exclude != null) dest.Exclude = (Hl7.Fhir.Model.ExpansionProfile.DesignationExcludeComponent)Exclude.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Include != null) dest.Include = (Hl7.Fhir.Model.ExpansionProfile.DesignationIncludeComponent)Include.DeepCopyInternal(); + if(Exclude != null) dest.Exclude = (Hl7.Fhir.Model.ExpansionProfile.DesignationExcludeComponent)Exclude.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DesignationComponent()); + var instance = new DesignationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -578,7 +581,7 @@ public List _Designation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DesignationIncludeComponent; @@ -587,14 +590,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Designation.Any()) dest.Designation = new List(Designation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Designation.Any()) dest.Designation = new List(Designation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DesignationIncludeComponent()); + var instance = new DesignationIncludeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -705,7 +709,7 @@ public Hl7.Fhir.Model.Coding Use private Hl7.Fhir.Model.Coding _Use; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DesignationIncludeDesignationComponent; @@ -714,15 +718,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy(); - if(Use != null) dest.Use = (Hl7.Fhir.Model.Coding)Use.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopyInternal(); + if(Use != null) dest.Use = (Hl7.Fhir.Model.Coding)Use.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DesignationIncludeDesignationComponent()); + var instance = new DesignationIncludeDesignationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -805,7 +810,7 @@ public List _Designation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DesignationExcludeComponent; @@ -814,14 +819,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Designation.Any()) dest.Designation = new List(Designation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Designation.Any()) dest.Designation = new List(Designation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DesignationExcludeComponent()); + var instance = new DesignationExcludeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -932,7 +938,7 @@ public Hl7.Fhir.Model.Coding Use private Hl7.Fhir.Model.Coding _Use; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DesignationExcludeDesignationComponent; @@ -941,15 +947,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy(); - if(Use != null) dest.Use = (Hl7.Fhir.Model.Coding)Use.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopyInternal(); + if(Use != null) dest.Use = (Hl7.Fhir.Model.Coding)Use.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DesignationExcludeDesignationComponent()); + var instance = new DesignationExcludeDesignationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1603,7 +1610,7 @@ public bool? LimitedExpansion Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExpansionProfile; @@ -1612,36 +1619,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(FixedVersion.Any()) dest.FixedVersion = new List(FixedVersion.DeepCopy()); - if(ExcludedSystem != null) dest.ExcludedSystem = (Hl7.Fhir.Model.ExpansionProfile.ExcludedSystemComponent)ExcludedSystem.DeepCopy(); - if(IncludeDesignationsElement != null) dest.IncludeDesignationsElement = (Hl7.Fhir.Model.FhirBoolean)IncludeDesignationsElement.DeepCopy(); - if(Designation != null) dest.Designation = (Hl7.Fhir.Model.ExpansionProfile.DesignationComponent)Designation.DeepCopy(); - if(IncludeDefinitionElement != null) dest.IncludeDefinitionElement = (Hl7.Fhir.Model.FhirBoolean)IncludeDefinitionElement.DeepCopy(); - if(ActiveOnlyElement != null) dest.ActiveOnlyElement = (Hl7.Fhir.Model.FhirBoolean)ActiveOnlyElement.DeepCopy(); - if(ExcludeNestedElement != null) dest.ExcludeNestedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeNestedElement.DeepCopy(); - if(ExcludeNotForUIElement != null) dest.ExcludeNotForUIElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeNotForUIElement.DeepCopy(); - if(ExcludePostCoordinatedElement != null) dest.ExcludePostCoordinatedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludePostCoordinatedElement.DeepCopy(); - if(DisplayLanguageElement != null) dest.DisplayLanguageElement = (Hl7.Fhir.Model.Code)DisplayLanguageElement.DeepCopy(); - if(LimitedExpansionElement != null) dest.LimitedExpansionElement = (Hl7.Fhir.Model.FhirBoolean)LimitedExpansionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(FixedVersion.Any()) dest.FixedVersion = new List(FixedVersion.DeepCopyInternal()); + if(ExcludedSystem != null) dest.ExcludedSystem = (Hl7.Fhir.Model.ExpansionProfile.ExcludedSystemComponent)ExcludedSystem.DeepCopyInternal(); + if(IncludeDesignationsElement != null) dest.IncludeDesignationsElement = (Hl7.Fhir.Model.FhirBoolean)IncludeDesignationsElement.DeepCopyInternal(); + if(Designation != null) dest.Designation = (Hl7.Fhir.Model.ExpansionProfile.DesignationComponent)Designation.DeepCopyInternal(); + if(IncludeDefinitionElement != null) dest.IncludeDefinitionElement = (Hl7.Fhir.Model.FhirBoolean)IncludeDefinitionElement.DeepCopyInternal(); + if(ActiveOnlyElement != null) dest.ActiveOnlyElement = (Hl7.Fhir.Model.FhirBoolean)ActiveOnlyElement.DeepCopyInternal(); + if(ExcludeNestedElement != null) dest.ExcludeNestedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeNestedElement.DeepCopyInternal(); + if(ExcludeNotForUIElement != null) dest.ExcludeNotForUIElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeNotForUIElement.DeepCopyInternal(); + if(ExcludePostCoordinatedElement != null) dest.ExcludePostCoordinatedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludePostCoordinatedElement.DeepCopyInternal(); + if(DisplayLanguageElement != null) dest.DisplayLanguageElement = (Hl7.Fhir.Model.Code)DisplayLanguageElement.DeepCopyInternal(); + if(LimitedExpansionElement != null) dest.LimitedExpansionElement = (Hl7.Fhir.Model.FhirBoolean)LimitedExpansionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExpansionProfile()); + var instance = new ExpansionProfile(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ExplanationOfBenefit.cs b/src/Hl7.Fhir.STU3/Model/Generated/ExplanationOfBenefit.cs index a28cc11728..cb62266c83 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ExplanationOfBenefit.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ExplanationOfBenefit.cs @@ -308,7 +308,7 @@ public Hl7.Fhir.Model.Identifier Reference private Hl7.Fhir.Model.Identifier _Reference; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedClaimComponent; @@ -317,16 +317,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Reference != null) dest.Reference = (Hl7.Fhir.Model.Identifier)Reference.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedClaimComponent()); + var instance = new RelatedClaimComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -449,7 +450,7 @@ public Hl7.Fhir.Model.ResourceReference Party private Hl7.Fhir.Model.ResourceReference _Party; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PayeeComponent; @@ -458,16 +459,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ResourceType != null) dest.ResourceType = (Hl7.Fhir.Model.CodeableConcept)ResourceType.DeepCopy(); - if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ResourceType != null) dest.ResourceType = (Hl7.Fhir.Model.CodeableConcept)ResourceType.DeepCopyInternal(); + if(Party != null) dest.Party = (Hl7.Fhir.Model.ResourceReference)Party.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PayeeComponent()); + var instance = new PayeeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -653,7 +655,7 @@ public Hl7.Fhir.Model.Coding Reason private Hl7.Fhir.Model.Coding _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupportingInformationComponent; @@ -662,19 +664,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.Coding)Reason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.Coding)Reason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupportingInformationComponent()); + var instance = new SupportingInformationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -885,7 +888,7 @@ public Hl7.Fhir.Model.CodeableConcept Qualification private Hl7.Fhir.Model.CodeableConcept _Qualification; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CareTeamComponent; @@ -894,18 +897,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Qualification != null) dest.Qualification = (Hl7.Fhir.Model.CodeableConcept)Qualification.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirBoolean)ResponsibleElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Qualification != null) dest.Qualification = (Hl7.Fhir.Model.CodeableConcept)Qualification.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CareTeamComponent()); + var instance = new CareTeamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1080,7 +1084,7 @@ public Hl7.Fhir.Model.CodeableConcept PackageCode private Hl7.Fhir.Model.CodeableConcept _PackageCode; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DiagnosisComponent; @@ -1089,17 +1093,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(PackageCode != null) dest.PackageCode = (Hl7.Fhir.Model.CodeableConcept)PackageCode.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Diagnosis != null) dest.Diagnosis = (Hl7.Fhir.Model.DataType)Diagnosis.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(PackageCode != null) dest.PackageCode = (Hl7.Fhir.Model.CodeableConcept)PackageCode.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DiagnosisComponent()); + var instance = new DiagnosisComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1268,7 +1273,7 @@ public Hl7.Fhir.Model.DataType Procedure private Hl7.Fhir.Model.DataType _Procedure; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcedureComponent; @@ -1277,16 +1282,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.DataType)Procedure.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcedureComponent()); + var instance = new ProcedureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1413,7 +1419,7 @@ public IEnumerable PreAuthRef } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InsuranceComponent; @@ -1422,15 +1428,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopy(); - if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Coverage != null) dest.Coverage = (Hl7.Fhir.Model.ResourceReference)Coverage.DeepCopyInternal(); + if(PreAuthRefElement.Any()) dest.PreAuthRefElement = new List(PreAuthRefElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InsuranceComponent()); + var instance = new InsuranceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1563,7 +1570,7 @@ public Hl7.Fhir.Model.DataType Location private Hl7.Fhir.Model.DataType _Location; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AccidentComponent; @@ -1572,16 +1579,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AccidentComponent()); + var instance = new AccidentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2116,7 +2124,7 @@ public List Detail private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -2125,36 +2133,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(CareTeamLinkIdElement.Any()) dest.CareTeamLinkIdElement = new List(CareTeamLinkIdElement.DeepCopy()); - if(DiagnosisLinkIdElement.Any()) dest.DiagnosisLinkIdElement = new List(DiagnosisLinkIdElement.DeepCopy()); - if(ProcedureLinkIdElement.Any()) dest.ProcedureLinkIdElement = new List(ProcedureLinkIdElement.DeepCopy()); - if(InformationLinkIdElement.Any()) dest.InformationLinkIdElement = new List(InformationLinkIdElement.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopy()); - if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ItemComponent()); + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(CareTeamLinkIdElement.Any()) dest.CareTeamLinkIdElement = new List(CareTeamLinkIdElement.DeepCopyInternal()); + if(DiagnosisLinkIdElement.Any()) dest.DiagnosisLinkIdElement = new List(DiagnosisLinkIdElement.DeepCopyInternal()); + if(ProcedureLinkIdElement.Any()) dest.ProcedureLinkIdElement = new List(ProcedureLinkIdElement.DeepCopyInternal()); + if(InformationLinkIdElement.Any()) dest.InformationLinkIdElement = new List(InformationLinkIdElement.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Serviced != null) dest.Serviced = (Hl7.Fhir.Model.DataType)Serviced.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.DataType)Location.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(SubSite.Any()) dest.SubSite = new List(SubSite.DeepCopyInternal()); + if(Encounter.Any()) dest.Encounter = new List(Encounter.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2467,7 +2476,7 @@ public decimal? Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdjudicationComponent; @@ -2476,17 +2485,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdjudicationComponent()); + var instance = new AdjudicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2839,7 +2849,7 @@ public List SubDetail private List _SubDetail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailComponent; @@ -2848,28 +2858,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(SubDetail.Any()) dest.SubDetail = new List(SubDetail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailComponent()); + var instance = new DetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3296,7 +3307,7 @@ public List Adjudicat private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubDetailComponent; @@ -3305,27 +3316,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopy(); - if(Udi.Any()) dest.Udi = new List(Udi.DeepCopy()); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceElement != null) dest.SequenceElement = (Hl7.Fhir.Model.PositiveInt)SequenceElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(ProgramCode.Any()) dest.ProgramCode = new List(ProgramCode.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(UnitPrice != null) dest.UnitPrice = (Hl7.Fhir.Model.Money)UnitPrice.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(Net != null) dest.Net = (Hl7.Fhir.Model.Money)Net.DeepCopyInternal(); + if(Udi.Any()) dest.Udi = new List(Udi.DeepCopyInternal()); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubDetailComponent()); + var instance = new SubDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3655,7 +3667,7 @@ public List Detai private List _Detail; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemComponent; @@ -3664,22 +3676,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceLinkIdElement.Any()) dest.SequenceLinkIdElement = new List(SequenceLinkIdElement.DeepCopy()); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Fee != null) dest.Fee = (Hl7.Fhir.Model.Money)Fee.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SequenceLinkIdElement.Any()) dest.SequenceLinkIdElement = new List(SequenceLinkIdElement.DeepCopyInternal()); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Fee != null) dest.Fee = (Hl7.Fhir.Model.Money)Fee.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemComponent()); + var instance = new AddedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3923,7 +3936,7 @@ public List Adjudicat private List _Adjudication; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AddedItemsDetailComponent; @@ -3932,20 +3945,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopy(); - if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopy()); - if(Fee != null) dest.Fee = (Hl7.Fhir.Model.Money)Fee.DeepCopy(); - if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopy()); - if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Revenue != null) dest.Revenue = (Hl7.Fhir.Model.CodeableConcept)Revenue.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Service != null) dest.Service = (Hl7.Fhir.Model.CodeableConcept)Service.DeepCopyInternal(); + if(Modifier.Any()) dest.Modifier = new List(Modifier.DeepCopyInternal()); + if(Fee != null) dest.Fee = (Hl7.Fhir.Model.Money)Fee.DeepCopyInternal(); + if(NoteNumberElement.Any()) dest.NoteNumberElement = new List(NoteNumberElement.DeepCopyInternal()); + if(Adjudication.Any()) dest.Adjudication = new List(Adjudication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AddedItemsDetailComponent()); + var instance = new AddedItemsDetailComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4155,7 +4169,7 @@ public Hl7.Fhir.Model.Identifier Identifier private Hl7.Fhir.Model.Identifier _Identifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentComponent; @@ -4164,19 +4178,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopy(); - if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Adjustment != null) dest.Adjustment = (Hl7.Fhir.Model.Money)Adjustment.DeepCopyInternal(); + if(AdjustmentReason != null) dest.AdjustmentReason = (Hl7.Fhir.Model.CodeableConcept)AdjustmentReason.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentComponent()); + var instance = new PaymentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4370,7 +4385,7 @@ public Hl7.Fhir.Model.CodeableConcept Language private Hl7.Fhir.Model.CodeableConcept _Language; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NoteComponent; @@ -4379,17 +4394,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.PositiveInt)NumberElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NoteComponent()); + var instance = new NoteComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4652,7 +4668,7 @@ public List Financial private List _Financial; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BenefitBalanceComponent; @@ -4661,22 +4677,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(SubCategory != null) dest.SubCategory = (Hl7.Fhir.Model.CodeableConcept)SubCategory.DeepCopy(); - if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopy(); - if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopy(); - if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopy(); - if(Financial.Any()) dest.Financial = new List(Financial.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(SubCategory != null) dest.SubCategory = (Hl7.Fhir.Model.CodeableConcept)SubCategory.DeepCopyInternal(); + if(ExcludedElement != null) dest.ExcludedElement = (Hl7.Fhir.Model.FhirBoolean)ExcludedElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Network != null) dest.Network = (Hl7.Fhir.Model.CodeableConcept)Network.DeepCopyInternal(); + if(Unit != null) dest.Unit = (Hl7.Fhir.Model.CodeableConcept)Unit.DeepCopyInternal(); + if(Term != null) dest.Term = (Hl7.Fhir.Model.CodeableConcept)Term.DeepCopyInternal(); + if(Financial.Any()) dest.Financial = new List(Financial.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BenefitBalanceComponent()); + var instance = new BenefitBalanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4849,7 +4866,7 @@ public Hl7.Fhir.Model.DataType Used private Hl7.Fhir.Model.DataType _Used; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BenefitComponent; @@ -4858,16 +4875,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopy(); - if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Allowed != null) dest.Allowed = (Hl7.Fhir.Model.DataType)Allowed.DeepCopyInternal(); + if(Used != null) dest.Used = (Hl7.Fhir.Model.DataType)Used.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BenefitComponent()); + var instance = new BenefitComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5551,7 +5569,7 @@ public List Benefit List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExplanationOfBenefit; @@ -5560,52 +5578,53 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SubType.Any()) dest.SubType = new List(SubType.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopy(); - if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopy(); - if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopy(); - if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopy(); - if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ExplanationOfBenefit.PayeeComponent)Payee.DeepCopy(); - if(Information.Any()) dest.Information = new List(Information.DeepCopy()); - if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopy()); - if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopy()); - if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopy()); - if(PrecedenceElement != null) dest.PrecedenceElement = (Hl7.Fhir.Model.PositiveInt)PrecedenceElement.DeepCopy(); - if(Insurance != null) dest.Insurance = (Hl7.Fhir.Model.ExplanationOfBenefit.InsuranceComponent)Insurance.DeepCopy(); - if(Accident != null) dest.Accident = (Hl7.Fhir.Model.ExplanationOfBenefit.AccidentComponent)Accident.DeepCopy(); - if(EmploymentImpacted != null) dest.EmploymentImpacted = (Hl7.Fhir.Model.Period)EmploymentImpacted.DeepCopy(); - if(Hospitalization != null) dest.Hospitalization = (Hl7.Fhir.Model.Period)Hospitalization.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopy()); - if(TotalCost != null) dest.TotalCost = (Hl7.Fhir.Model.Money)TotalCost.DeepCopy(); - if(UnallocDeductable != null) dest.UnallocDeductable = (Hl7.Fhir.Model.Money)UnallocDeductable.DeepCopy(); - if(TotalBenefit != null) dest.TotalBenefit = (Hl7.Fhir.Model.Money)TotalBenefit.DeepCopy(); - if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ExplanationOfBenefit.PaymentComponent)Payment.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopy()); - if(BenefitBalance.Any()) dest.BenefitBalance = new List(BenefitBalance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SubType.Any()) dest.SubType = new List(SubType.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(BillablePeriod != null) dest.BillablePeriod = (Hl7.Fhir.Model.Period)BillablePeriod.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Insurer != null) dest.Insurer = (Hl7.Fhir.Model.ResourceReference)Insurer.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Referral != null) dest.Referral = (Hl7.Fhir.Model.ResourceReference)Referral.DeepCopyInternal(); + if(Facility != null) dest.Facility = (Hl7.Fhir.Model.ResourceReference)Facility.DeepCopyInternal(); + if(Claim != null) dest.Claim = (Hl7.Fhir.Model.ResourceReference)Claim.DeepCopyInternal(); + if(ClaimResponse != null) dest.ClaimResponse = (Hl7.Fhir.Model.ResourceReference)ClaimResponse.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); + if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopyInternal(); + if(OriginalPrescription != null) dest.OriginalPrescription = (Hl7.Fhir.Model.ResourceReference)OriginalPrescription.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ExplanationOfBenefit.PayeeComponent)Payee.DeepCopyInternal(); + if(Information.Any()) dest.Information = new List(Information.DeepCopyInternal()); + if(CareTeam.Any()) dest.CareTeam = new List(CareTeam.DeepCopyInternal()); + if(Diagnosis.Any()) dest.Diagnosis = new List(Diagnosis.DeepCopyInternal()); + if(Procedure.Any()) dest.Procedure = new List(Procedure.DeepCopyInternal()); + if(PrecedenceElement != null) dest.PrecedenceElement = (Hl7.Fhir.Model.PositiveInt)PrecedenceElement.DeepCopyInternal(); + if(Insurance != null) dest.Insurance = (Hl7.Fhir.Model.ExplanationOfBenefit.InsuranceComponent)Insurance.DeepCopyInternal(); + if(Accident != null) dest.Accident = (Hl7.Fhir.Model.ExplanationOfBenefit.AccidentComponent)Accident.DeepCopyInternal(); + if(EmploymentImpacted != null) dest.EmploymentImpacted = (Hl7.Fhir.Model.Period)EmploymentImpacted.DeepCopyInternal(); + if(Hospitalization != null) dest.Hospitalization = (Hl7.Fhir.Model.Period)Hospitalization.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + if(AddItem.Any()) dest.AddItem = new List(AddItem.DeepCopyInternal()); + if(TotalCost != null) dest.TotalCost = (Hl7.Fhir.Model.Money)TotalCost.DeepCopyInternal(); + if(UnallocDeductable != null) dest.UnallocDeductable = (Hl7.Fhir.Model.Money)UnallocDeductable.DeepCopyInternal(); + if(TotalBenefit != null) dest.TotalBenefit = (Hl7.Fhir.Model.Money)TotalBenefit.DeepCopyInternal(); + if(Payment != null) dest.Payment = (Hl7.Fhir.Model.ExplanationOfBenefit.PaymentComponent)Payment.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopyInternal()); + if(BenefitBalance.Any()) dest.BenefitBalance = new List(BenefitBalance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExplanationOfBenefit()); + var instance = new ExplanationOfBenefit(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/FamilyMemberHistory.cs b/src/Hl7.Fhir.STU3/Model/Generated/FamilyMemberHistory.cs index a1e30b6190..053bf6ee8f 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/FamilyMemberHistory.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/FamilyMemberHistory.cs @@ -168,7 +168,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConditionComponent; @@ -177,17 +177,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(Onset != null) dest.Onset = (Hl7.Fhir.Model.DataType)Onset.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConditionComponent()); + var instance = new ConditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -631,7 +632,7 @@ public List Condition List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FamilyMemberHistory; @@ -640,31 +641,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Definition.Any()) dest.Definition = new List(Definition.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(NotDoneElement != null) dest.NotDoneElement = (Hl7.Fhir.Model.FhirBoolean)NotDoneElement.DeepCopy(); - if(NotDoneReason != null) dest.NotDoneReason = (Hl7.Fhir.Model.CodeableConcept)NotDoneReason.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(Born != null) dest.Born = (Hl7.Fhir.Model.DataType)Born.DeepCopy(); - if(Age != null) dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopy(); - if(EstimatedAgeElement != null) dest.EstimatedAgeElement = (Hl7.Fhir.Model.FhirBoolean)EstimatedAgeElement.DeepCopy(); - if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new FamilyMemberHistory()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Definition.Any()) dest.Definition = new List(Definition.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(NotDoneElement != null) dest.NotDoneElement = (Hl7.Fhir.Model.FhirBoolean)NotDoneElement.DeepCopyInternal(); + if(NotDoneReason != null) dest.NotDoneReason = (Hl7.Fhir.Model.CodeableConcept)NotDoneReason.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(Born != null) dest.Born = (Hl7.Fhir.Model.DataType)Born.DeepCopyInternal(); + if(Age != null) dest.Age = (Hl7.Fhir.Model.DataType)Age.DeepCopyInternal(); + if(EstimatedAgeElement != null) dest.EstimatedAgeElement = (Hl7.Fhir.Model.FhirBoolean)EstimatedAgeElement.DeepCopyInternal(); + if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new FamilyMemberHistory(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Flag.cs b/src/Hl7.Fhir.STU3/Model/Generated/Flag.cs index 9a7534eb55..1bf0b6b5c4 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Flag.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Flag.cs @@ -225,7 +225,7 @@ public Hl7.Fhir.Model.ResourceReference Author List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Flag; @@ -234,21 +234,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Flag()); + var instance = new Flag(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Goal.cs b/src/Hl7.Fhir.STU3/Model/Generated/Goal.cs index bbe7583c5b..102631e4b7 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Goal.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Goal.cs @@ -209,7 +209,7 @@ public Hl7.Fhir.Model.DataType Due private Hl7.Fhir.Model.DataType _Due; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -218,16 +218,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopy(); - if(Due != null) dest.Due = (Hl7.Fhir.Model.DataType)Due.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopyInternal(); + if(Due != null) dest.Due = (Hl7.Fhir.Model.DataType)Due.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -567,7 +568,7 @@ public List OutcomeReference List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Goal; @@ -576,28 +577,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Start != null) dest.Start = (Hl7.Fhir.Model.DataType)Start.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.Goal.TargetComponent)Target.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.Date)StatusDateElement.DeepCopy(); - if(StatusReasonElement != null) dest.StatusReasonElement = (Hl7.Fhir.Model.FhirString)StatusReasonElement.DeepCopy(); - if(ExpressedBy != null) dest.ExpressedBy = (Hl7.Fhir.Model.ResourceReference)ExpressedBy.DeepCopy(); - if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(OutcomeCode.Any()) dest.OutcomeCode = new List(OutcomeCode.DeepCopy()); - if(OutcomeReference.Any()) dest.OutcomeReference = new List(OutcomeReference.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Start != null) dest.Start = (Hl7.Fhir.Model.DataType)Start.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.Goal.TargetComponent)Target.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.Date)StatusDateElement.DeepCopyInternal(); + if(StatusReasonElement != null) dest.StatusReasonElement = (Hl7.Fhir.Model.FhirString)StatusReasonElement.DeepCopyInternal(); + if(ExpressedBy != null) dest.ExpressedBy = (Hl7.Fhir.Model.ResourceReference)ExpressedBy.DeepCopyInternal(); + if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(OutcomeCode.Any()) dest.OutcomeCode = new List(OutcomeCode.DeepCopyInternal()); + if(OutcomeReference.Any()) dest.OutcomeReference = new List(OutcomeReference.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Goal()); + var instance = new Goal(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/GraphDefinition.cs b/src/Hl7.Fhir.STU3/Model/Generated/GraphDefinition.cs index fd1e3c1501..1c99fc645a 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/GraphDefinition.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/GraphDefinition.cs @@ -276,7 +276,7 @@ public List Target private List _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -285,19 +285,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SliceNameElement != null) dest.SliceNameElement = (Hl7.Fhir.Model.FhirString)SliceNameElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SliceNameElement != null) dest.SliceNameElement = (Hl7.Fhir.Model.FhirString)SliceNameElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -491,7 +492,7 @@ public List Link private List _Link; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -500,17 +501,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.FhirUri)ProfileElement.DeepCopy(); - if(Compartment.Any()) dest.Compartment = new List(Compartment.DeepCopy()); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.FhirUri)ProfileElement.DeepCopyInternal(); + if(Compartment.Any()) dest.Compartment = new List(Compartment.DeepCopyInternal()); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -725,7 +727,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CompartmentComponent; @@ -734,17 +736,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(RuleElement != null) dest.RuleElement = (Code)RuleElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(RuleElement != null) dest.RuleElement = (Code)RuleElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CompartmentComponent()); + var instance = new CompartmentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1221,7 +1224,7 @@ public List Link private List _Link; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GraphDefinition; @@ -1230,28 +1233,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(StartElement != null) dest.StartElement = (Code)StartElement.DeepCopy(); - if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.FhirUri)ProfileElement.DeepCopy(); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Code)StartElement.DeepCopyInternal(); + if(ProfileElement != null) dest.ProfileElement = (Hl7.Fhir.Model.FhirUri)ProfileElement.DeepCopyInternal(); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GraphDefinition()); + var instance = new GraphDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Group.cs b/src/Hl7.Fhir.STU3/Model/Generated/Group.cs index b306a4d671..3270b20e21 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Group.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Group.cs @@ -199,7 +199,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CharacteristicComponent; @@ -208,17 +208,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(ExcludeElement != null) dest.ExcludeElement = (Hl7.Fhir.Model.FhirBoolean)ExcludeElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CharacteristicComponent()); + var instance = new CharacteristicComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -366,7 +367,7 @@ public bool? Inactive } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MemberComponent; @@ -375,16 +376,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Entity != null) dest.Entity = (Hl7.Fhir.Model.ResourceReference)Entity.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Entity != null) dest.Entity = (Hl7.Fhir.Model.ResourceReference)Entity.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MemberComponent()); + var instance = new MemberComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -665,7 +667,7 @@ public List Member List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Group; @@ -674,22 +676,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.UnsignedInt)QuantityElement.DeepCopy(); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(Member.Any()) dest.Member = new List(Member.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ActualElement != null) dest.ActualElement = (Hl7.Fhir.Model.FhirBoolean)ActualElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(QuantityElement != null) dest.QuantityElement = (Hl7.Fhir.Model.UnsignedInt)QuantityElement.DeepCopyInternal(); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(Member.Any()) dest.Member = new List(Member.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Group()); + var instance = new Group(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/GuidanceResponse.cs b/src/Hl7.Fhir.STU3/Model/Generated/GuidanceResponse.cs index 22bf11c6bd..71f7b0aa4d 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/GuidanceResponse.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/GuidanceResponse.cs @@ -367,7 +367,7 @@ public List DataRequirement Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GuidanceResponse; @@ -376,27 +376,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RequestIdElement != null) dest.RequestIdElement = (Hl7.Fhir.Model.Id)RequestIdElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Module != null) dest.Module = (Hl7.Fhir.Model.ResourceReference)Module.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(OccurrenceDateTimeElement != null) dest.OccurrenceDateTimeElement = (Hl7.Fhir.Model.FhirDateTime)OccurrenceDateTimeElement.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.DataType)Reason.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(EvaluationMessage.Any()) dest.EvaluationMessage = new List(EvaluationMessage.DeepCopy()); - if(OutputParameters != null) dest.OutputParameters = (Hl7.Fhir.Model.ResourceReference)OutputParameters.DeepCopy(); - if(Result != null) dest.Result = (Hl7.Fhir.Model.ResourceReference)Result.DeepCopy(); - if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RequestIdElement != null) dest.RequestIdElement = (Hl7.Fhir.Model.Id)RequestIdElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Module != null) dest.Module = (Hl7.Fhir.Model.ResourceReference)Module.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(OccurrenceDateTimeElement != null) dest.OccurrenceDateTimeElement = (Hl7.Fhir.Model.FhirDateTime)OccurrenceDateTimeElement.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.DataType)Reason.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(EvaluationMessage.Any()) dest.EvaluationMessage = new List(EvaluationMessage.DeepCopyInternal()); + if(OutputParameters != null) dest.OutputParameters = (Hl7.Fhir.Model.ResourceReference)OutputParameters.DeepCopyInternal(); + if(Result != null) dest.Result = (Hl7.Fhir.Model.ResourceReference)Result.DeepCopyInternal(); + if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GuidanceResponse()); + var instance = new GuidanceResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/HealthcareService.cs b/src/Hl7.Fhir.STU3/Model/Generated/HealthcareService.cs index 3ddbf48737..70e9b95268 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/HealthcareService.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/HealthcareService.cs @@ -200,7 +200,7 @@ public string AvailableEndTime } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AvailableTimeComponent; @@ -209,17 +209,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopy()); - if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopy(); - if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopy(); - if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopyInternal()); + if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopyInternal(); + if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopyInternal(); + if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AvailableTimeComponent()); + var instance = new AvailableTimeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -352,7 +353,7 @@ public Hl7.Fhir.Model.Period During private Hl7.Fhir.Model.Period _During; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotAvailableComponent; @@ -361,15 +362,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotAvailableComponent()); + var instance = new NotAvailableComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -911,7 +913,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HealthcareService; @@ -920,37 +922,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(ProvidedBy != null) dest.ProvidedBy = (Hl7.Fhir.Model.ResourceReference)ProvidedBy.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(ExtraDetailsElement != null) dest.ExtraDetailsElement = (Hl7.Fhir.Model.FhirString)ExtraDetailsElement.DeepCopy(); - if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopy()); - if(ServiceProvisionCode.Any()) dest.ServiceProvisionCode = new List(ServiceProvisionCode.DeepCopy()); - if(Eligibility != null) dest.Eligibility = (Hl7.Fhir.Model.CodeableConcept)Eligibility.DeepCopy(); - if(EligibilityNoteElement != null) dest.EligibilityNoteElement = (Hl7.Fhir.Model.FhirString)EligibilityNoteElement.DeepCopy(); - if(ProgramNameElement.Any()) dest.ProgramNameElement = new List(ProgramNameElement.DeepCopy()); - if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopy()); - if(ReferralMethod.Any()) dest.ReferralMethod = new List(ReferralMethod.DeepCopy()); - if(AppointmentRequiredElement != null) dest.AppointmentRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AppointmentRequiredElement.DeepCopy(); - if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopy()); - if(NotAvailable.Any()) dest.NotAvailable = new List(NotAvailable.DeepCopy()); - if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(ProvidedBy != null) dest.ProvidedBy = (Hl7.Fhir.Model.ResourceReference)ProvidedBy.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(ExtraDetailsElement != null) dest.ExtraDetailsElement = (Hl7.Fhir.Model.FhirString)ExtraDetailsElement.DeepCopyInternal(); + if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(CoverageArea.Any()) dest.CoverageArea = new List(CoverageArea.DeepCopyInternal()); + if(ServiceProvisionCode.Any()) dest.ServiceProvisionCode = new List(ServiceProvisionCode.DeepCopyInternal()); + if(Eligibility != null) dest.Eligibility = (Hl7.Fhir.Model.CodeableConcept)Eligibility.DeepCopyInternal(); + if(EligibilityNoteElement != null) dest.EligibilityNoteElement = (Hl7.Fhir.Model.FhirString)EligibilityNoteElement.DeepCopyInternal(); + if(ProgramNameElement.Any()) dest.ProgramNameElement = new List(ProgramNameElement.DeepCopyInternal()); + if(Characteristic.Any()) dest.Characteristic = new List(Characteristic.DeepCopyInternal()); + if(ReferralMethod.Any()) dest.ReferralMethod = new List(ReferralMethod.DeepCopyInternal()); + if(AppointmentRequiredElement != null) dest.AppointmentRequiredElement = (Hl7.Fhir.Model.FhirBoolean)AppointmentRequiredElement.DeepCopyInternal(); + if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopyInternal()); + if(NotAvailable.Any()) dest.NotAvailable = new List(NotAvailable.DeepCopyInternal()); + if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HealthcareService()); + var instance = new HealthcareService(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/HumanName.cs b/src/Hl7.Fhir.STU3/Model/Generated/HumanName.cs index 4a8872be2c..e5886f1d1c 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/HumanName.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/HumanName.cs @@ -316,7 +316,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as HumanName; @@ -325,20 +325,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(FamilyElement != null) dest.FamilyElement = (Hl7.Fhir.Model.FhirString)FamilyElement.DeepCopy(); - if(GivenElement.Any()) dest.GivenElement = new List(GivenElement.DeepCopy()); - if(PrefixElement.Any()) dest.PrefixElement = new List(PrefixElement.DeepCopy()); - if(SuffixElement.Any()) dest.SuffixElement = new List(SuffixElement.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(FamilyElement != null) dest.FamilyElement = (Hl7.Fhir.Model.FhirString)FamilyElement.DeepCopyInternal(); + if(GivenElement.Any()) dest.GivenElement = new List(GivenElement.DeepCopyInternal()); + if(PrefixElement.Any()) dest.PrefixElement = new List(PrefixElement.DeepCopyInternal()); + if(SuffixElement.Any()) dest.SuffixElement = new List(SuffixElement.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new HumanName()); + var instance = new HumanName(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ImagingManifest.cs b/src/Hl7.Fhir.STU3/Model/Generated/ImagingManifest.cs index 390ed8bb42..850a7c2504 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ImagingManifest.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ImagingManifest.cs @@ -153,7 +153,7 @@ public List Series private List _Series; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StudyComponent; @@ -162,17 +162,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Oid)UidElement.DeepCopy(); - if(ImagingStudy != null) dest.ImagingStudy = (Hl7.Fhir.Model.ResourceReference)ImagingStudy.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(Series.Any()) dest.Series = new List(Series.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Oid)UidElement.DeepCopyInternal(); + if(ImagingStudy != null) dest.ImagingStudy = (Hl7.Fhir.Model.ResourceReference)ImagingStudy.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(Series.Any()) dest.Series = new List(Series.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StudyComponent()); + var instance = new StudyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -323,7 +324,7 @@ public List Instance private List _Instance; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SeriesComponent; @@ -332,16 +333,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Oid)UidElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Oid)UidElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SeriesComponent()); + var instance = new SeriesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -486,7 +488,7 @@ public string Uid } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -495,15 +497,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SopClassElement != null) dest.SopClassElement = (Hl7.Fhir.Model.Oid)SopClassElement.DeepCopy(); - if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Oid)UidElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SopClassElement != null) dest.SopClassElement = (Hl7.Fhir.Model.Oid)SopClassElement.DeepCopyInternal(); + if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Oid)UidElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -681,7 +684,7 @@ public List Study Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImagingManifest; @@ -690,19 +693,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(AuthoringTimeElement != null) dest.AuthoringTimeElement = (Hl7.Fhir.Model.FhirDateTime)AuthoringTimeElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Study.Any()) dest.Study = new List(Study.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(AuthoringTimeElement != null) dest.AuthoringTimeElement = (Hl7.Fhir.Model.FhirDateTime)AuthoringTimeElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Study.Any()) dest.Study = new List(Study.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImagingManifest()); + var instance = new ImagingManifest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ImagingStudy.cs b/src/Hl7.Fhir.STU3/Model/Generated/ImagingStudy.cs index 2a88d2e14b..83f4a5eeeb 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ImagingStudy.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ImagingStudy.cs @@ -387,7 +387,7 @@ public List Instance private List _Instance; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SeriesComponent; @@ -396,25 +396,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Oid)UidElement.DeepCopy(); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopy(); - if(Modality != null) dest.Modality = (Hl7.Fhir.Model.Coding)Modality.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopy(); - if(AvailabilityElement != null) dest.AvailabilityElement = (Code)AvailabilityElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.Coding)BodySite.DeepCopy(); - if(Laterality != null) dest.Laterality = (Hl7.Fhir.Model.Coding)Laterality.DeepCopy(); - if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Oid)UidElement.DeepCopyInternal(); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopyInternal(); + if(Modality != null) dest.Modality = (Hl7.Fhir.Model.Coding)Modality.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopyInternal(); + if(AvailabilityElement != null) dest.AvailabilityElement = (Code)AvailabilityElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.Coding)BodySite.DeepCopyInternal(); + if(Laterality != null) dest.Laterality = (Hl7.Fhir.Model.Coding)Laterality.DeepCopyInternal(); + if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SeriesComponent()); + var instance = new SeriesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -692,7 +693,7 @@ public string Title } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -701,17 +702,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Oid)UidElement.DeepCopy(); - if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopy(); - if(SopClassElement != null) dest.SopClassElement = (Hl7.Fhir.Model.Oid)SopClassElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Oid)UidElement.DeepCopyInternal(); + if(NumberElement != null) dest.NumberElement = (Hl7.Fhir.Model.UnsignedInt)NumberElement.DeepCopyInternal(); + if(SopClassElement != null) dest.SopClassElement = (Hl7.Fhir.Model.Oid)SopClassElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1169,7 +1171,7 @@ public List Series List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImagingStudy; @@ -1178,32 +1180,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Oid)UidElement.DeepCopy(); - if(Accession != null) dest.Accession = (Hl7.Fhir.Model.Identifier)Accession.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(AvailabilityElement != null) dest.AvailabilityElement = (Code)AvailabilityElement.DeepCopy(); - if(ModalityList.Any()) dest.ModalityList = new List(ModalityList.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Referrer != null) dest.Referrer = (Hl7.Fhir.Model.ResourceReference)Referrer.DeepCopy(); - if(Interpreter.Any()) dest.Interpreter = new List(Interpreter.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - if(NumberOfSeriesElement != null) dest.NumberOfSeriesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfSeriesElement.DeepCopy(); - if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopy(); - if(ProcedureReference.Any()) dest.ProcedureReference = new List(ProcedureReference.DeepCopy()); - if(ProcedureCode.Any()) dest.ProcedureCode = new List(ProcedureCode.DeepCopy()); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Series.Any()) dest.Series = new List(Series.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UidElement != null) dest.UidElement = (Hl7.Fhir.Model.Oid)UidElement.DeepCopyInternal(); + if(Accession != null) dest.Accession = (Hl7.Fhir.Model.Identifier)Accession.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(AvailabilityElement != null) dest.AvailabilityElement = (Code)AvailabilityElement.DeepCopyInternal(); + if(ModalityList.Any()) dest.ModalityList = new List(ModalityList.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(StartedElement != null) dest.StartedElement = (Hl7.Fhir.Model.FhirDateTime)StartedElement.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Referrer != null) dest.Referrer = (Hl7.Fhir.Model.ResourceReference)Referrer.DeepCopyInternal(); + if(Interpreter.Any()) dest.Interpreter = new List(Interpreter.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); + if(NumberOfSeriesElement != null) dest.NumberOfSeriesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfSeriesElement.DeepCopyInternal(); + if(NumberOfInstancesElement != null) dest.NumberOfInstancesElement = (Hl7.Fhir.Model.UnsignedInt)NumberOfInstancesElement.DeepCopyInternal(); + if(ProcedureReference.Any()) dest.ProcedureReference = new List(ProcedureReference.DeepCopyInternal()); + if(ProcedureCode.Any()) dest.ProcedureCode = new List(ProcedureCode.DeepCopyInternal()); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Series.Any()) dest.Series = new List(Series.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImagingStudy()); + var instance = new ImagingStudy(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Immunization.cs b/src/Hl7.Fhir.STU3/Model/Generated/Immunization.cs index ae9ede3261..e2561680d6 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Immunization.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Immunization.cs @@ -127,7 +127,7 @@ public Hl7.Fhir.Model.ResourceReference Actor private Hl7.Fhir.Model.ResourceReference _Actor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PractitionerComponent; @@ -136,15 +136,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PractitionerComponent()); + var instance = new PractitionerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -246,7 +247,7 @@ public List ReasonNotGiven private List _ReasonNotGiven; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExplanationComponent; @@ -255,15 +256,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(ReasonNotGiven.Any()) dest.ReasonNotGiven = new List(ReasonNotGiven.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(ReasonNotGiven.Any()) dest.ReasonNotGiven = new List(ReasonNotGiven.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExplanationComponent()); + var instance = new ExplanationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -413,7 +415,7 @@ public bool? Reported } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReactionComponent; @@ -422,16 +424,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.ResourceReference)Detail.DeepCopy(); - if(ReportedElement != null) dest.ReportedElement = (Hl7.Fhir.Model.FhirBoolean)ReportedElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.ResourceReference)Detail.DeepCopyInternal(); + if(ReportedElement != null) dest.ReportedElement = (Hl7.Fhir.Model.FhirBoolean)ReportedElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReactionComponent()); + var instance = new ReactionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -694,7 +697,7 @@ public Hl7.Fhir.Model.CodeableConcept DoseStatusReason private Hl7.Fhir.Model.CodeableConcept _DoseStatusReason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VaccinationProtocolComponent; @@ -703,21 +706,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - 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.Any()) dest.TargetDisease = new List(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; + base.CopyToInternal(dest); + if(DoseSequenceElement != null) dest.DoseSequenceElement = (Hl7.Fhir.Model.PositiveInt)DoseSequenceElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopyInternal(); + if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopyInternal(); + if(SeriesDosesElement != null) dest.SeriesDosesElement = (Hl7.Fhir.Model.PositiveInt)SeriesDosesElement.DeepCopyInternal(); + if(TargetDisease.Any()) dest.TargetDisease = new List(TargetDisease.DeepCopyInternal()); + if(DoseStatus != null) dest.DoseStatus = (Hl7.Fhir.Model.CodeableConcept)DoseStatus.DeepCopyInternal(); + if(DoseStatusReason != null) dest.DoseStatusReason = (Hl7.Fhir.Model.CodeableConcept)DoseStatusReason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VaccinationProtocolComponent()); + var instance = new VaccinationProtocolComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1228,7 +1232,7 @@ public List Vaccinatio List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Immunization; @@ -1237,34 +1241,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(NotGivenElement != null) dest.NotGivenElement = (Hl7.Fhir.Model.FhirBoolean)NotGivenElement.DeepCopy(); - if(VaccineCode != null) dest.VaccineCode = (Hl7.Fhir.Model.CodeableConcept)VaccineCode.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PrimarySourceElement != null) dest.PrimarySourceElement = (Hl7.Fhir.Model.FhirBoolean)PrimarySourceElement.DeepCopy(); - if(ReportOrigin != null) dest.ReportOrigin = (Hl7.Fhir.Model.CodeableConcept)ReportOrigin.DeepCopy(); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy(); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.Date)ExpirationDateElement.DeepCopy(); - if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy(); - if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy(); - if(DoseQuantity != null) dest.DoseQuantity = (Hl7.Fhir.Model.Quantity)DoseQuantity.DeepCopy(); - if(Practitioner.Any()) dest.Practitioner = new List(Practitioner.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Explanation != null) dest.Explanation = (Hl7.Fhir.Model.Immunization.ExplanationComponent)Explanation.DeepCopy(); - if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopy()); - if(VaccinationProtocol.Any()) dest.VaccinationProtocol = new List(VaccinationProtocol.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(NotGivenElement != null) dest.NotGivenElement = (Hl7.Fhir.Model.FhirBoolean)NotGivenElement.DeepCopyInternal(); + if(VaccineCode != null) dest.VaccineCode = (Hl7.Fhir.Model.CodeableConcept)VaccineCode.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PrimarySourceElement != null) dest.PrimarySourceElement = (Hl7.Fhir.Model.FhirBoolean)PrimarySourceElement.DeepCopyInternal(); + if(ReportOrigin != null) dest.ReportOrigin = (Hl7.Fhir.Model.CodeableConcept)ReportOrigin.DeepCopyInternal(); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopyInternal(); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.Date)ExpirationDateElement.DeepCopyInternal(); + if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopyInternal(); + if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopyInternal(); + if(DoseQuantity != null) dest.DoseQuantity = (Hl7.Fhir.Model.Quantity)DoseQuantity.DeepCopyInternal(); + if(Practitioner.Any()) dest.Practitioner = new List(Practitioner.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Explanation != null) dest.Explanation = (Hl7.Fhir.Model.Immunization.ExplanationComponent)Explanation.DeepCopyInternal(); + if(Reaction.Any()) dest.Reaction = new List(Reaction.DeepCopyInternal()); + if(VaccinationProtocol.Any()) dest.VaccinationProtocol = new List(VaccinationProtocol.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Immunization()); + var instance = new Immunization(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ImmunizationRecommendation.cs b/src/Hl7.Fhir.STU3/Model/Generated/ImmunizationRecommendation.cs index c14d0f866c..1fef5ef394 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ImmunizationRecommendation.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ImmunizationRecommendation.cs @@ -237,7 +237,7 @@ public List SupportingPatientInformation private List _SupportingPatientInformation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RecommendationComponent; @@ -246,22 +246,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(VaccineCode != null) dest.VaccineCode = (Hl7.Fhir.Model.CodeableConcept)VaccineCode.DeepCopy(); - if(TargetDisease != null) dest.TargetDisease = (Hl7.Fhir.Model.CodeableConcept)TargetDisease.DeepCopy(); - if(DoseNumberElement != null) dest.DoseNumberElement = (Hl7.Fhir.Model.PositiveInt)DoseNumberElement.DeepCopy(); - if(ForecastStatus != null) dest.ForecastStatus = (Hl7.Fhir.Model.CodeableConcept)ForecastStatus.DeepCopy(); - if(DateCriterion.Any()) dest.DateCriterion = new List(DateCriterion.DeepCopy()); - if(Protocol != null) dest.Protocol = (Hl7.Fhir.Model.ImmunizationRecommendation.ProtocolComponent)Protocol.DeepCopy(); - if(SupportingImmunization.Any()) dest.SupportingImmunization = new List(SupportingImmunization.DeepCopy()); - if(SupportingPatientInformation.Any()) dest.SupportingPatientInformation = new List(SupportingPatientInformation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(VaccineCode != null) dest.VaccineCode = (Hl7.Fhir.Model.CodeableConcept)VaccineCode.DeepCopyInternal(); + if(TargetDisease != null) dest.TargetDisease = (Hl7.Fhir.Model.CodeableConcept)TargetDisease.DeepCopyInternal(); + if(DoseNumberElement != null) dest.DoseNumberElement = (Hl7.Fhir.Model.PositiveInt)DoseNumberElement.DeepCopyInternal(); + if(ForecastStatus != null) dest.ForecastStatus = (Hl7.Fhir.Model.CodeableConcept)ForecastStatus.DeepCopyInternal(); + if(DateCriterion.Any()) dest.DateCriterion = new List(DateCriterion.DeepCopyInternal()); + if(Protocol != null) dest.Protocol = (Hl7.Fhir.Model.ImmunizationRecommendation.ProtocolComponent)Protocol.DeepCopyInternal(); + if(SupportingImmunization.Any()) dest.SupportingImmunization = new List(SupportingImmunization.DeepCopyInternal()); + if(SupportingPatientInformation.Any()) dest.SupportingPatientInformation = new List(SupportingPatientInformation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RecommendationComponent()); + var instance = new RecommendationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -436,7 +437,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DateCriterionComponent; @@ -445,15 +446,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDateTime)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirDateTime)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DateCriterionComponent()); + var instance = new DateCriterionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -633,7 +635,7 @@ public string Series } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProtocolComponent; @@ -642,17 +644,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - 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(); - return dest; + base.CopyToInternal(dest); + if(DoseSequenceElement != null) dest.DoseSequenceElement = (Hl7.Fhir.Model.PositiveInt)DoseSequenceElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Authority != null) dest.Authority = (Hl7.Fhir.Model.ResourceReference)Authority.DeepCopyInternal(); + if(SeriesElement != null) dest.SeriesElement = (Hl7.Fhir.Model.FhirString)SeriesElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProtocolComponent()); + var instance = new ProtocolComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -770,7 +773,7 @@ public List R List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImmunizationRecommendation; @@ -779,16 +782,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Recommendation.Any()) dest.Recommendation = new List(Recommendation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Recommendation.Any()) dest.Recommendation = new List(Recommendation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImmunizationRecommendation()); + var instance = new ImmunizationRecommendation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ImplementationGuide.cs b/src/Hl7.Fhir.STU3/Model/Generated/ImplementationGuide.cs index 0abf991131..fb44c3939c 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ImplementationGuide.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ImplementationGuide.cs @@ -221,7 +221,7 @@ public string Uri } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DependencyComponent; @@ -230,15 +230,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DependencyComponent()); + var instance = new DependencyComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -387,7 +388,7 @@ public List Resource private List _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PackageComponent; @@ -396,16 +397,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Resource.Any()) dest.Resource = new List(Resource.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Resource.Any()) dest.Resource = new List(Resource.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PackageComponent()); + var instance = new PackageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -642,7 +644,7 @@ public Hl7.Fhir.Model.ResourceReference ExampleFor private Hl7.Fhir.Model.ResourceReference _ExampleFor; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResourceComponent; @@ -651,19 +653,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ExampleElement != null) dest.ExampleElement = (Hl7.Fhir.Model.FhirBoolean)ExampleElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(AcronymElement != null) dest.AcronymElement = (Hl7.Fhir.Model.FhirString)AcronymElement.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopy(); - if(ExampleFor != null) dest.ExampleFor = (Hl7.Fhir.Model.ResourceReference)ExampleFor.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ExampleElement != null) dest.ExampleElement = (Hl7.Fhir.Model.FhirBoolean)ExampleElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(AcronymElement != null) dest.AcronymElement = (Hl7.Fhir.Model.FhirString)AcronymElement.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.DataType)Source.DeepCopyInternal(); + if(ExampleFor != null) dest.ExampleFor = (Hl7.Fhir.Model.ResourceReference)ExampleFor.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResourceComponent()); + var instance = new ResourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -818,7 +821,7 @@ public Hl7.Fhir.Model.ResourceReference Profile private Hl7.Fhir.Model.ResourceReference _Profile; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GlobalComponent; @@ -827,15 +830,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.ResourceReference)Profile.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.ResourceReference)Profile.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GlobalComponent()); + var instance = new GlobalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1118,7 +1122,7 @@ public List Page private List _Page; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PageComponent; @@ -1127,20 +1131,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(TypeElement.Any()) dest.TypeElement = new List>(TypeElement.DeepCopy()); - if(PackageElement.Any()) dest.PackageElement = new List(PackageElement.DeepCopy()); - if(FormatElement != null) dest.FormatElement = (Hl7.Fhir.Model.Code)FormatElement.DeepCopy(); - if(Page.Any()) dest.Page = new List(Page.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SourceElement != null) dest.SourceElement = (Hl7.Fhir.Model.FhirUri)SourceElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(TypeElement.Any()) dest.TypeElement = new List>(TypeElement.DeepCopyInternal()); + if(PackageElement.Any()) dest.PackageElement = new List(PackageElement.DeepCopyInternal()); + if(FormatElement != null) dest.FormatElement = (Hl7.Fhir.Model.Code)FormatElement.DeepCopyInternal(); + if(Page.Any()) dest.Page = new List(Page.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PageComponent()); + var instance = new PageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1681,7 +1686,7 @@ public Hl7.Fhir.Model.ImplementationGuide.PageComponent Page private Hl7.Fhir.Model.ImplementationGuide.PageComponent _Page; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ImplementationGuide; @@ -1690,31 +1695,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(FhirVersionElement != null) dest.FhirVersionElement = (Hl7.Fhir.Model.Id)FhirVersionElement.DeepCopy(); - if(Dependency.Any()) dest.Dependency = new List(Dependency.DeepCopy()); - if(Package.Any()) dest.Package = new List(Package.DeepCopy()); - if(Global.Any()) dest.Global = new List(Global.DeepCopy()); - if(BinaryElement.Any()) dest.BinaryElement = new List(BinaryElement.DeepCopy()); - if(Page != null) dest.Page = (Hl7.Fhir.Model.ImplementationGuide.PageComponent)Page.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(FhirVersionElement != null) dest.FhirVersionElement = (Hl7.Fhir.Model.Id)FhirVersionElement.DeepCopyInternal(); + if(Dependency.Any()) dest.Dependency = new List(Dependency.DeepCopyInternal()); + if(Package.Any()) dest.Package = new List(Package.DeepCopyInternal()); + if(Global.Any()) dest.Global = new List(Global.DeepCopyInternal()); + if(BinaryElement.Any()) dest.BinaryElement = new List(BinaryElement.DeepCopyInternal()); + if(Page != null) dest.Page = (Hl7.Fhir.Model.ImplementationGuide.PageComponent)Page.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ImplementationGuide()); + var instance = new ImplementationGuide(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Library.cs b/src/Hl7.Fhir.STU3/Model/Generated/Library.cs index 78c81fdff3..a7e950faf7 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Library.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Library.cs @@ -668,7 +668,7 @@ public List Content List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Library; @@ -677,39 +677,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopy()); - if(Content.Any()) dest.Content = new List(Content.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Library()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopyInternal()); + if(Content.Any()) dest.Content = new List(Content.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Library(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Linkage.cs b/src/Hl7.Fhir.STU3/Model/Generated/Linkage.cs index c51fc8276a..af53e1babf 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Linkage.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Linkage.cs @@ -151,7 +151,7 @@ public Hl7.Fhir.Model.ResourceReference Resource private Hl7.Fhir.Model.ResourceReference _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -160,15 +160,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -284,7 +285,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Linkage; @@ -293,16 +294,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Linkage()); + var instance = new Linkage(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/List.cs b/src/Hl7.Fhir.STU3/Model/Generated/List.cs index 7703c24668..db3c67a648 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/List.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/List.cs @@ -196,7 +196,7 @@ public Hl7.Fhir.Model.ResourceReference Item private Hl7.Fhir.Model.ResourceReference _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EntryComponent; @@ -205,17 +205,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Flag != null) dest.Flag = (Hl7.Fhir.Model.CodeableConcept)Flag.DeepCopy(); - if(DeletedElement != null) dest.DeletedElement = (Hl7.Fhir.Model.FhirBoolean)DeletedElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.ResourceReference)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Flag != null) dest.Flag = (Hl7.Fhir.Model.CodeableConcept)Flag.DeepCopyInternal(); + if(DeletedElement != null) dest.DeletedElement = (Hl7.Fhir.Model.FhirBoolean)DeletedElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.ResourceReference)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EntryComponent()); + var instance = new EntryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -548,7 +549,7 @@ public Hl7.Fhir.Model.CodeableConcept EmptyReason List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as List; @@ -557,26 +558,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Entry.Any()) dest.Entry = new List(Entry.DeepCopy()); - if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(OrderedBy != null) dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Entry.Any()) dest.Entry = new List(Entry.DeepCopyInternal()); + if(EmptyReason != null) dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new List()); + var instance = new List(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Location.cs b/src/Hl7.Fhir.STU3/Model/Generated/Location.cs index 7a77c6920e..4436792344 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Location.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Location.cs @@ -220,7 +220,7 @@ public decimal? Altitude } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PositionComponent; @@ -229,16 +229,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LongitudeElement != null) dest.LongitudeElement = (Hl7.Fhir.Model.FhirDecimal)LongitudeElement.DeepCopy(); - if(LatitudeElement != null) dest.LatitudeElement = (Hl7.Fhir.Model.FhirDecimal)LatitudeElement.DeepCopy(); - if(AltitudeElement != null) dest.AltitudeElement = (Hl7.Fhir.Model.FhirDecimal)AltitudeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LongitudeElement != null) dest.LongitudeElement = (Hl7.Fhir.Model.FhirDecimal)LongitudeElement.DeepCopyInternal(); + if(LatitudeElement != null) dest.LatitudeElement = (Hl7.Fhir.Model.FhirDecimal)LatitudeElement.DeepCopyInternal(); + if(AltitudeElement != null) dest.AltitudeElement = (Hl7.Fhir.Model.FhirDecimal)AltitudeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PositionComponent()); + var instance = new PositionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -606,7 +607,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Location; @@ -615,28 +616,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(OperationalStatus != null) dest.OperationalStatus = (Hl7.Fhir.Model.Coding)OperationalStatus.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - if(PhysicalType != null) dest.PhysicalType = (Hl7.Fhir.Model.CodeableConcept)PhysicalType.DeepCopy(); - if(Position != null) dest.Position = (Hl7.Fhir.Model.Location.PositionComponent)Position.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(OperationalStatus != null) dest.OperationalStatus = (Hl7.Fhir.Model.Coding)OperationalStatus.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); + if(PhysicalType != null) dest.PhysicalType = (Hl7.Fhir.Model.CodeableConcept)PhysicalType.DeepCopyInternal(); + if(Position != null) dest.Position = (Hl7.Fhir.Model.Location.PositionComponent)Position.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Location()); + var instance = new Location(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Measure.cs b/src/Hl7.Fhir.STU3/Model/Generated/Measure.cs index 6032162354..bfc30a1ee5 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Measure.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Measure.cs @@ -179,7 +179,7 @@ public List Stratifier private List _Stratifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -188,18 +188,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -416,7 +417,7 @@ public string Criteria } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PopulationComponent; @@ -425,18 +426,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(CriteriaElement != null) dest.CriteriaElement = (Hl7.Fhir.Model.FhirString)CriteriaElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(CriteriaElement != null) dest.CriteriaElement = (Hl7.Fhir.Model.FhirString)CriteriaElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PopulationComponent()); + var instance = new PopulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -607,7 +609,7 @@ public string Path } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierComponent; @@ -616,16 +618,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(CriteriaElement != null) dest.CriteriaElement = (Hl7.Fhir.Model.FhirString)CriteriaElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(CriteriaElement != null) dest.CriteriaElement = (Hl7.Fhir.Model.FhirString)CriteriaElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierComponent()); + var instance = new StratifierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -796,7 +799,7 @@ public string Path } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplementalDataComponent; @@ -805,17 +808,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Usage.Any()) dest.Usage = new List(Usage.DeepCopy()); - if(CriteriaElement != null) dest.CriteriaElement = (Hl7.Fhir.Model.FhirString)CriteriaElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Usage.Any()) dest.Usage = new List(Usage.DeepCopyInternal()); + if(CriteriaElement != null) dest.CriteriaElement = (Hl7.Fhir.Model.FhirString)CriteriaElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplementalDataComponent()); + var instance = new SupplementalDataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1806,7 +1810,7 @@ public List SupplementalData List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Measure; @@ -1815,50 +1819,51 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Library.Any()) dest.Library = new List(Library.DeepCopy()); - if(DisclaimerElement != null) dest.DisclaimerElement = (Hl7.Fhir.Model.Markdown)DisclaimerElement.DeepCopy(); - if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopy(); - if(CompositeScoring != null) dest.CompositeScoring = (Hl7.Fhir.Model.CodeableConcept)CompositeScoring.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(RiskAdjustmentElement != null) dest.RiskAdjustmentElement = (Hl7.Fhir.Model.FhirString)RiskAdjustmentElement.DeepCopy(); - if(RateAggregationElement != null) dest.RateAggregationElement = (Hl7.Fhir.Model.FhirString)RateAggregationElement.DeepCopy(); - if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.Markdown)RationaleElement.DeepCopy(); - if(ClinicalRecommendationStatementElement != null) dest.ClinicalRecommendationStatementElement = (Hl7.Fhir.Model.Markdown)ClinicalRecommendationStatementElement.DeepCopy(); - if(ImprovementNotationElement != null) dest.ImprovementNotationElement = (Hl7.Fhir.Model.FhirString)ImprovementNotationElement.DeepCopy(); - if(DefinitionElement.Any()) dest.DefinitionElement = new List(DefinitionElement.DeepCopy()); - if(GuidanceElement != null) dest.GuidanceElement = (Hl7.Fhir.Model.Markdown)GuidanceElement.DeepCopy(); - if(SetElement != null) dest.SetElement = (Hl7.Fhir.Model.FhirString)SetElement.DeepCopy(); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - if(SupplementalData.Any()) dest.SupplementalData = new List(SupplementalData.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new Measure()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Library.Any()) dest.Library = new List(Library.DeepCopyInternal()); + if(DisclaimerElement != null) dest.DisclaimerElement = (Hl7.Fhir.Model.Markdown)DisclaimerElement.DeepCopyInternal(); + if(Scoring != null) dest.Scoring = (Hl7.Fhir.Model.CodeableConcept)Scoring.DeepCopyInternal(); + if(CompositeScoring != null) dest.CompositeScoring = (Hl7.Fhir.Model.CodeableConcept)CompositeScoring.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(RiskAdjustmentElement != null) dest.RiskAdjustmentElement = (Hl7.Fhir.Model.FhirString)RiskAdjustmentElement.DeepCopyInternal(); + if(RateAggregationElement != null) dest.RateAggregationElement = (Hl7.Fhir.Model.FhirString)RateAggregationElement.DeepCopyInternal(); + if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.Markdown)RationaleElement.DeepCopyInternal(); + if(ClinicalRecommendationStatementElement != null) dest.ClinicalRecommendationStatementElement = (Hl7.Fhir.Model.Markdown)ClinicalRecommendationStatementElement.DeepCopyInternal(); + if(ImprovementNotationElement != null) dest.ImprovementNotationElement = (Hl7.Fhir.Model.FhirString)ImprovementNotationElement.DeepCopyInternal(); + if(DefinitionElement.Any()) dest.DefinitionElement = new List(DefinitionElement.DeepCopyInternal()); + if(GuidanceElement != null) dest.GuidanceElement = (Hl7.Fhir.Model.Markdown)GuidanceElement.DeepCopyInternal(); + if(SetElement != null) dest.SetElement = (Hl7.Fhir.Model.FhirString)SetElement.DeepCopyInternal(); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); + if(SupplementalData.Any()) dest.SupplementalData = new List(SupplementalData.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new Measure(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/MeasureReport.cs b/src/Hl7.Fhir.STU3/Model/Generated/MeasureReport.cs index 2a92cfff15..1dad18e5c9 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/MeasureReport.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/MeasureReport.cs @@ -204,7 +204,7 @@ public List Stratifier private List _Stratifier; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -213,17 +213,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(MeasureScoreElement != null) dest.MeasureScoreElement = (Hl7.Fhir.Model.FhirDecimal)MeasureScoreElement.DeepCopy(); - if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(MeasureScoreElement != null) dest.MeasureScoreElement = (Hl7.Fhir.Model.FhirDecimal)MeasureScoreElement.DeepCopyInternal(); + if(Stratifier.Any()) dest.Stratifier = new List(Stratifier.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -384,7 +385,7 @@ public Hl7.Fhir.Model.ResourceReference Patients private Hl7.Fhir.Model.ResourceReference _Patients; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PopulationComponent; @@ -393,17 +394,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy(); - if(Patients != null) dest.Patients = (Hl7.Fhir.Model.ResourceReference)Patients.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopyInternal(); + if(Patients != null) dest.Patients = (Hl7.Fhir.Model.ResourceReference)Patients.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PopulationComponent()); + var instance = new PopulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -518,7 +520,7 @@ public List Stratum private List _Stratum; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierComponent; @@ -527,15 +529,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Stratum.Any()) dest.Stratum = new List(Stratum.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Stratum.Any()) dest.Stratum = new List(Stratum.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierComponent()); + var instance = new StratifierComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -684,7 +687,7 @@ public decimal? MeasureScore } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierGroupComponent; @@ -693,16 +696,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(Population.Any()) dest.Population = new List(Population.DeepCopy()); - if(MeasureScoreElement != null) dest.MeasureScoreElement = (Hl7.Fhir.Model.FhirDecimal)MeasureScoreElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(Population.Any()) dest.Population = new List(Population.DeepCopyInternal()); + if(MeasureScoreElement != null) dest.MeasureScoreElement = (Hl7.Fhir.Model.FhirDecimal)MeasureScoreElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierGroupComponent()); + var instance = new StratifierGroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -855,7 +859,7 @@ public Hl7.Fhir.Model.ResourceReference Patients private Hl7.Fhir.Model.ResourceReference _Patients; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StratifierGroupPopulationComponent; @@ -864,17 +868,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy(); - if(Patients != null) dest.Patients = (Hl7.Fhir.Model.ResourceReference)Patients.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopyInternal(); + if(Patients != null) dest.Patients = (Hl7.Fhir.Model.ResourceReference)Patients.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StratifierGroupPopulationComponent()); + var instance = new StratifierGroupPopulationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1149,7 +1154,7 @@ public Hl7.Fhir.Model.ResourceReference EvaluatedResources Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MeasureReport; @@ -1158,23 +1163,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Measure != null) dest.Measure = (Hl7.Fhir.Model.ResourceReference)Measure.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(ReportingOrganization != null) dest.ReportingOrganization = (Hl7.Fhir.Model.ResourceReference)ReportingOrganization.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - if(EvaluatedResources != null) dest.EvaluatedResources = (Hl7.Fhir.Model.ResourceReference)EvaluatedResources.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Measure != null) dest.Measure = (Hl7.Fhir.Model.ResourceReference)Measure.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(ReportingOrganization != null) dest.ReportingOrganization = (Hl7.Fhir.Model.ResourceReference)ReportingOrganization.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); + if(EvaluatedResources != null) dest.EvaluatedResources = (Hl7.Fhir.Model.ResourceReference)EvaluatedResources.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MeasureReport()); + var instance = new MeasureReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Media.cs b/src/Hl7.Fhir.STU3/Model/Generated/Media.cs index 9a271bf730..4e93f50208 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Media.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Media.cs @@ -434,7 +434,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Media; @@ -443,31 +443,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Subtype != null) dest.Subtype = (Hl7.Fhir.Model.CodeableConcept)Subtype.DeepCopy(); - if(View != null) dest.View = (Hl7.Fhir.Model.CodeableConcept)View.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Operator != null) dest.Operator = (Hl7.Fhir.Model.ResourceReference)Operator.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(HeightElement != null) dest.HeightElement = (Hl7.Fhir.Model.PositiveInt)HeightElement.DeepCopy(); - if(WidthElement != null) dest.WidthElement = (Hl7.Fhir.Model.PositiveInt)WidthElement.DeepCopy(); - if(FramesElement != null) dest.FramesElement = (Hl7.Fhir.Model.PositiveInt)FramesElement.DeepCopy(); - if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.UnsignedInt)DurationElement.DeepCopy(); - if(Content != null) dest.Content = (Hl7.Fhir.Model.Attachment)Content.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Subtype != null) dest.Subtype = (Hl7.Fhir.Model.CodeableConcept)Subtype.DeepCopyInternal(); + if(View != null) dest.View = (Hl7.Fhir.Model.CodeableConcept)View.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Operator != null) dest.Operator = (Hl7.Fhir.Model.ResourceReference)Operator.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(HeightElement != null) dest.HeightElement = (Hl7.Fhir.Model.PositiveInt)HeightElement.DeepCopyInternal(); + if(WidthElement != null) dest.WidthElement = (Hl7.Fhir.Model.PositiveInt)WidthElement.DeepCopyInternal(); + if(FramesElement != null) dest.FramesElement = (Hl7.Fhir.Model.PositiveInt)FramesElement.DeepCopyInternal(); + if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.UnsignedInt)DurationElement.DeepCopyInternal(); + if(Content != null) dest.Content = (Hl7.Fhir.Model.Attachment)Content.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Media()); + var instance = new Media(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Medication.cs b/src/Hl7.Fhir.STU3/Model/Generated/Medication.cs index 54cf7ca2a0..d70ebc80a0 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Medication.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Medication.cs @@ -165,7 +165,7 @@ public Hl7.Fhir.Model.Ratio Amount private Hl7.Fhir.Model.Ratio _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientComponent; @@ -174,16 +174,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - if(IsActiveElement != null) dest.IsActiveElement = (Hl7.Fhir.Model.FhirBoolean)IsActiveElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Ratio)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); + if(IsActiveElement != null) dest.IsActiveElement = (Hl7.Fhir.Model.FhirBoolean)IsActiveElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Ratio)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientComponent()); + var instance = new IngredientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -305,7 +306,7 @@ public List Batch private List _Batch; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PackageComponent; @@ -314,16 +315,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Container != null) dest.Container = (Hl7.Fhir.Model.CodeableConcept)Container.DeepCopy(); - if(Content.Any()) dest.Content = new List(Content.DeepCopy()); - if(Batch.Any()) dest.Batch = new List(Batch.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Container != null) dest.Container = (Hl7.Fhir.Model.CodeableConcept)Container.DeepCopyInternal(); + if(Content.Any()) dest.Content = new List(Content.DeepCopyInternal()); + if(Batch.Any()) dest.Batch = new List(Batch.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PackageComponent()); + var instance = new PackageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -433,7 +435,7 @@ public Hl7.Fhir.Model.Quantity Amount private Hl7.Fhir.Model.Quantity _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContentComponent; @@ -442,15 +444,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContentComponent()); + var instance = new ContentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -584,7 +587,7 @@ public string ExpirationDate } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BatchComponent; @@ -593,15 +596,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopy(); - if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LotNumberElement != null) dest.LotNumberElement = (Hl7.Fhir.Model.FhirString)LotNumberElement.DeepCopyInternal(); + if(ExpirationDateElement != null) dest.ExpirationDateElement = (Hl7.Fhir.Model.FhirDateTime)ExpirationDateElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BatchComponent()); + var instance = new BatchComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -836,7 +840,7 @@ public List Image private List _Image; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Medication; @@ -845,22 +849,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IsBrandElement != null) dest.IsBrandElement = (Hl7.Fhir.Model.FhirBoolean)IsBrandElement.DeepCopy(); - if(IsOverTheCounterElement != null) dest.IsOverTheCounterElement = (Hl7.Fhir.Model.FhirBoolean)IsOverTheCounterElement.DeepCopy(); - if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - if(Package != null) dest.Package = (Hl7.Fhir.Model.Medication.PackageComponent)Package.DeepCopy(); - if(Image.Any()) dest.Image = new List(Image.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IsBrandElement != null) dest.IsBrandElement = (Hl7.Fhir.Model.FhirBoolean)IsBrandElement.DeepCopyInternal(); + if(IsOverTheCounterElement != null) dest.IsOverTheCounterElement = (Hl7.Fhir.Model.FhirBoolean)IsOverTheCounterElement.DeepCopyInternal(); + if(Manufacturer != null) dest.Manufacturer = (Hl7.Fhir.Model.ResourceReference)Manufacturer.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); + if(Package != null) dest.Package = (Hl7.Fhir.Model.Medication.PackageComponent)Package.DeepCopyInternal(); + if(Image.Any()) dest.Image = new List(Image.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Medication()); + var instance = new Medication(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/MedicationAdministration.cs b/src/Hl7.Fhir.STU3/Model/Generated/MedicationAdministration.cs index ceb39ca3c4..f8de41e153 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/MedicationAdministration.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/MedicationAdministration.cs @@ -153,7 +153,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -162,15 +162,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -343,7 +344,7 @@ public Hl7.Fhir.Model.DataType Rate private Hl7.Fhir.Model.DataType _Rate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DosageComponent; @@ -352,19 +353,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopy(); - if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Dose != null) dest.Dose = (Hl7.Fhir.Model.Quantity)Dose.DeepCopy(); - if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Site != null) dest.Site = (Hl7.Fhir.Model.CodeableConcept)Site.DeepCopyInternal(); + if(Route != null) dest.Route = (Hl7.Fhir.Model.CodeableConcept)Route.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Dose != null) dest.Dose = (Hl7.Fhir.Model.Quantity)Dose.DeepCopyInternal(); + if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DosageComponent()); + var instance = new DosageComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -794,7 +796,7 @@ public List EventHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationAdministration; @@ -803,33 +805,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Definition.Any()) dest.Definition = new List(Definition.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)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(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(NotGivenElement != null) dest.NotGivenElement = (Hl7.Fhir.Model.FhirBoolean)NotGivenElement.DeepCopy(); - if(ReasonNotGiven.Any()) dest.ReasonNotGiven = new List(ReasonNotGiven.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopy(); - if(Device.Any()) dest.Device = new List(Device.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Dosage != null) dest.Dosage = (Hl7.Fhir.Model.MedicationAdministration.DosageComponent)Dosage.DeepCopy(); - if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Definition.Any()) dest.Definition = new List(Definition.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(NotGivenElement != null) dest.NotGivenElement = (Hl7.Fhir.Model.FhirBoolean)NotGivenElement.DeepCopyInternal(); + if(ReasonNotGiven.Any()) dest.ReasonNotGiven = new List(ReasonNotGiven.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Prescription != null) dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopyInternal(); + if(Device.Any()) dest.Device = new List(Device.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Dosage != null) dest.Dosage = (Hl7.Fhir.Model.MedicationAdministration.DosageComponent)Dosage.DeepCopyInternal(); + if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationAdministration()); + var instance = new MedicationAdministration(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/MedicationDispense.cs b/src/Hl7.Fhir.STU3/Model/Generated/MedicationDispense.cs index b48f41aaba..201c7c536c 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/MedicationDispense.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/MedicationDispense.cs @@ -154,7 +154,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -163,15 +163,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -320,7 +321,7 @@ public List ResponsibleParty private List _ResponsibleParty; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstitutionComponent; @@ -329,17 +330,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(WasSubstitutedElement != null) dest.WasSubstitutedElement = (Hl7.Fhir.Model.FhirBoolean)WasSubstitutedElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(ResponsibleParty.Any()) dest.ResponsibleParty = new List(ResponsibleParty.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(WasSubstitutedElement != null) dest.WasSubstitutedElement = (Hl7.Fhir.Model.FhirBoolean)WasSubstitutedElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(ResponsibleParty.Any()) dest.ResponsibleParty = new List(ResponsibleParty.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstitutionComponent()); + var instance = new SubstitutionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -837,7 +839,7 @@ public List EventHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationDispense; @@ -846,37 +848,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)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(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(AuthorizingPrescription.Any()) dest.AuthorizingPrescription = new List(AuthorizingPrescription.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(DaysSupply != null) dest.DaysSupply = (Hl7.Fhir.Model.Quantity)DaysSupply.DeepCopy(); - if(WhenPreparedElement != null) dest.WhenPreparedElement = (Hl7.Fhir.Model.FhirDateTime)WhenPreparedElement.DeepCopy(); - if(WhenHandedOverElement != null) dest.WhenHandedOverElement = (Hl7.Fhir.Model.FhirDateTime)WhenHandedOverElement.DeepCopy(); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopy()); - if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationDispense.SubstitutionComponent)Substitution.DeepCopy(); - if(DetectedIssue.Any()) dest.DetectedIssue = new List(DetectedIssue.DeepCopy()); - if(NotDoneElement != null) dest.NotDoneElement = (Hl7.Fhir.Model.FhirBoolean)NotDoneElement.DeepCopy(); - if(NotDoneReason != null) dest.NotDoneReason = (Hl7.Fhir.Model.DataType)NotDoneReason.DeepCopy(); - if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(AuthorizingPrescription.Any()) dest.AuthorizingPrescription = new List(AuthorizingPrescription.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(DaysSupply != null) dest.DaysSupply = (Hl7.Fhir.Model.Quantity)DaysSupply.DeepCopyInternal(); + if(WhenPreparedElement != null) dest.WhenPreparedElement = (Hl7.Fhir.Model.FhirDateTime)WhenPreparedElement.DeepCopyInternal(); + if(WhenHandedOverElement != null) dest.WhenHandedOverElement = (Hl7.Fhir.Model.FhirDateTime)WhenHandedOverElement.DeepCopyInternal(); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopyInternal()); + if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationDispense.SubstitutionComponent)Substitution.DeepCopyInternal(); + if(DetectedIssue.Any()) dest.DetectedIssue = new List(DetectedIssue.DeepCopyInternal()); + if(NotDoneElement != null) dest.NotDoneElement = (Hl7.Fhir.Model.FhirBoolean)NotDoneElement.DeepCopyInternal(); + if(NotDoneReason != null) dest.NotDoneReason = (Hl7.Fhir.Model.DataType)NotDoneReason.DeepCopyInternal(); + if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationDispense()); + var instance = new MedicationDispense(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/MedicationRequest.cs b/src/Hl7.Fhir.STU3/Model/Generated/MedicationRequest.cs index 96c564a907..a23d298d73 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/MedicationRequest.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/MedicationRequest.cs @@ -232,7 +232,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequesterComponent; @@ -241,15 +241,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequesterComponent()); + var instance = new RequesterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -406,7 +407,7 @@ public Hl7.Fhir.Model.ResourceReference Performer private Hl7.Fhir.Model.ResourceReference _Performer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DispenseRequestComponent; @@ -415,18 +416,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopy(); - if(NumberOfRepeatsAllowedElement != null) dest.NumberOfRepeatsAllowedElement = (Hl7.Fhir.Model.PositiveInt)NumberOfRepeatsAllowedElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(ExpectedSupplyDuration != null) dest.ExpectedSupplyDuration = (Hl7.Fhir.Model.Duration)ExpectedSupplyDuration.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ValidityPeriod != null) dest.ValidityPeriod = (Hl7.Fhir.Model.Period)ValidityPeriod.DeepCopyInternal(); + if(NumberOfRepeatsAllowedElement != null) dest.NumberOfRepeatsAllowedElement = (Hl7.Fhir.Model.PositiveInt)NumberOfRepeatsAllowedElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(ExpectedSupplyDuration != null) dest.ExpectedSupplyDuration = (Hl7.Fhir.Model.Duration)ExpectedSupplyDuration.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DispenseRequestComponent()); + var instance = new DispenseRequestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -568,7 +570,7 @@ public Hl7.Fhir.Model.CodeableConcept Reason private Hl7.Fhir.Model.CodeableConcept _Reason; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SubstitutionComponent; @@ -577,15 +579,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AllowedElement != null) dest.AllowedElement = (Hl7.Fhir.Model.FhirBoolean)AllowedElement.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AllowedElement != null) dest.AllowedElement = (Hl7.Fhir.Model.FhirBoolean)AllowedElement.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SubstitutionComponent()); + var instance = new SubstitutionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1072,7 +1075,7 @@ public List EventHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationRequest; @@ -1081,37 +1084,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Definition.Any()) dest.Definition = new List(Definition.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopy()); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.MedicationRequest.RequesterComponent)Requester.DeepCopy(); - if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopy()); - if(DispenseRequest != null) dest.DispenseRequest = (Hl7.Fhir.Model.MedicationRequest.DispenseRequestComponent)DispenseRequest.DeepCopy(); - if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationRequest.SubstitutionComponent)Substitution.DeepCopy(); - if(PriorPrescription != null) dest.PriorPrescription = (Hl7.Fhir.Model.ResourceReference)PriorPrescription.DeepCopy(); - if(DetectedIssue.Any()) dest.DetectedIssue = new List(DetectedIssue.DeepCopy()); - if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Definition.Any()) dest.Definition = new List(Definition.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(SupportingInformation.Any()) dest.SupportingInformation = new List(SupportingInformation.DeepCopyInternal()); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.MedicationRequest.RequesterComponent)Requester.DeepCopyInternal(); + if(Recorder != null) dest.Recorder = (Hl7.Fhir.Model.ResourceReference)Recorder.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(DosageInstruction.Any()) dest.DosageInstruction = new List(DosageInstruction.DeepCopyInternal()); + if(DispenseRequest != null) dest.DispenseRequest = (Hl7.Fhir.Model.MedicationRequest.DispenseRequestComponent)DispenseRequest.DeepCopyInternal(); + if(Substitution != null) dest.Substitution = (Hl7.Fhir.Model.MedicationRequest.SubstitutionComponent)Substitution.DeepCopyInternal(); + if(PriorPrescription != null) dest.PriorPrescription = (Hl7.Fhir.Model.ResourceReference)PriorPrescription.DeepCopyInternal(); + if(DetectedIssue.Any()) dest.DetectedIssue = new List(DetectedIssue.DeepCopyInternal()); + if(EventHistory.Any()) dest.EventHistory = new List(EventHistory.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationRequest()); + var instance = new MedicationRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/MedicationStatement.cs b/src/Hl7.Fhir.STU3/Model/Generated/MedicationStatement.cs index 76f04e1985..83289cd779 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/MedicationStatement.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/MedicationStatement.cs @@ -480,7 +480,7 @@ public List Dosage List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MedicationStatement; @@ -489,31 +489,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)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.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopy()); - if(TakenElement != null) dest.TakenElement = (Code)TakenElement.DeepCopy(); - if(ReasonNotTaken.Any()) dest.ReasonNotTaken = new List(ReasonNotTaken.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Medication != null) dest.Medication = (Hl7.Fhir.Model.DataType)Medication.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(DateAssertedElement != null) dest.DateAssertedElement = (Hl7.Fhir.Model.FhirDateTime)DateAssertedElement.DeepCopyInternal(); + if(InformationSource != null) dest.InformationSource = (Hl7.Fhir.Model.ResourceReference)InformationSource.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(DerivedFrom.Any()) dest.DerivedFrom = new List(DerivedFrom.DeepCopyInternal()); + if(TakenElement != null) dest.TakenElement = (Code)TakenElement.DeepCopyInternal(); + if(ReasonNotTaken.Any()) dest.ReasonNotTaken = new List(ReasonNotTaken.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Dosage.Any()) dest.Dosage = new List(Dosage.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MedicationStatement()); + var instance = new MedicationStatement(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/MessageDefinition.cs b/src/Hl7.Fhir.STU3/Model/Generated/MessageDefinition.cs index c2f944a0bd..8350b930e6 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/MessageDefinition.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/MessageDefinition.cs @@ -187,7 +187,7 @@ public string Max } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FocusComponent; @@ -196,17 +196,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.ResourceReference)Profile.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.ResourceReference)Profile.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.UnsignedInt)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FocusComponent()); + var instance = new FocusComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -342,7 +343,7 @@ public string Situation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AllowedResponseComponent; @@ -351,15 +352,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Message != null) dest.Message = (Hl7.Fhir.Model.ResourceReference)Message.DeepCopy(); - if(SituationElement != null) dest.SituationElement = (Hl7.Fhir.Model.Markdown)SituationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Message != null) dest.Message = (Hl7.Fhir.Model.ResourceReference)Message.DeepCopyInternal(); + if(SituationElement != null) dest.SituationElement = (Hl7.Fhir.Model.Markdown)SituationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AllowedResponseComponent()); + var instance = new AllowedResponseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -972,7 +974,7 @@ public List AllowedRe Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageDefinition; @@ -981,36 +983,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(Base != null) dest.Base = (Hl7.Fhir.Model.ResourceReference)Base.DeepCopy(); - if(Parent.Any()) dest.Parent = new List(Parent.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(Event != null) dest.Event = (Hl7.Fhir.Model.Coding)Event.DeepCopy(); - if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(ResponseRequiredElement != null) dest.ResponseRequiredElement = (Hl7.Fhir.Model.FhirBoolean)ResponseRequiredElement.DeepCopy(); - if(AllowedResponse.Any()) dest.AllowedResponse = new List(AllowedResponse.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(Base != null) dest.Base = (Hl7.Fhir.Model.ResourceReference)Base.DeepCopyInternal(); + if(Parent.Any()) dest.Parent = new List(Parent.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(Event != null) dest.Event = (Hl7.Fhir.Model.Coding)Event.DeepCopyInternal(); + if(CategoryElement != null) dest.CategoryElement = (Code)CategoryElement.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(ResponseRequiredElement != null) dest.ResponseRequiredElement = (Hl7.Fhir.Model.FhirBoolean)ResponseRequiredElement.DeepCopyInternal(); + if(AllowedResponse.Any()) dest.AllowedResponse = new List(AllowedResponse.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageDefinition()); + var instance = new MessageDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/MessageHeader.cs b/src/Hl7.Fhir.STU3/Model/Generated/MessageHeader.cs index 83d0f35431..d1b4e22856 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/MessageHeader.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/MessageHeader.cs @@ -182,7 +182,7 @@ public string Endpoint } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageDestinationComponent; @@ -191,16 +191,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUri)EndpointElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); + if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUri)EndpointElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageDestinationComponent()); + var instance = new MessageDestinationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -418,7 +419,7 @@ public string Endpoint } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageSourceComponent; @@ -427,18 +428,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(SoftwareElement != null) dest.SoftwareElement = (Hl7.Fhir.Model.FhirString)SoftwareElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(Contact != null) dest.Contact = (Hl7.Fhir.Model.ContactPoint)Contact.DeepCopy(); - if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUri)EndpointElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(SoftwareElement != null) dest.SoftwareElement = (Hl7.Fhir.Model.FhirString)SoftwareElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(Contact != null) dest.Contact = (Hl7.Fhir.Model.ContactPoint)Contact.DeepCopyInternal(); + if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUri)EndpointElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageSourceComponent()); + var instance = new MessageSourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -615,7 +617,7 @@ public Hl7.Fhir.Model.ResourceReference Details private Hl7.Fhir.Model.ResourceReference _Details; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResponseComponent; @@ -624,16 +626,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IdentifierElement != null) dest.IdentifierElement = (Hl7.Fhir.Model.Id)IdentifierElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopy(); - if(Details != null) dest.Details = (Hl7.Fhir.Model.ResourceReference)Details.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IdentifierElement != null) dest.IdentifierElement = (Hl7.Fhir.Model.Id)IdentifierElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Code)CodeElement.DeepCopyInternal(); + if(Details != null) dest.Details = (Hl7.Fhir.Model.ResourceReference)Details.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResponseComponent()); + var instance = new ResponseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -890,7 +893,7 @@ public List Focus private List _Focus; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MessageHeader; @@ -899,25 +902,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Event != null) dest.Event = (Hl7.Fhir.Model.Coding)Event.DeepCopy(); - if(Destination.Any()) dest.Destination = new List(Destination.DeepCopy()); - if(Receiver != null) dest.Receiver = (Hl7.Fhir.Model.ResourceReference)Receiver.DeepCopy(); - if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopy(); - if(TimestampElement != null) dest.TimestampElement = (Hl7.Fhir.Model.Instant)TimestampElement.DeepCopy(); - if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.MessageHeader.MessageSourceComponent)Source.DeepCopy(); - if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.MessageHeader.ResponseComponent)Response.DeepCopy(); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Event != null) dest.Event = (Hl7.Fhir.Model.Coding)Event.DeepCopyInternal(); + if(Destination.Any()) dest.Destination = new List(Destination.DeepCopyInternal()); + if(Receiver != null) dest.Receiver = (Hl7.Fhir.Model.ResourceReference)Receiver.DeepCopyInternal(); + if(Sender != null) dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopyInternal(); + if(TimestampElement != null) dest.TimestampElement = (Hl7.Fhir.Model.Instant)TimestampElement.DeepCopyInternal(); + if(Enterer != null) dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.MessageHeader.MessageSourceComponent)Source.DeepCopyInternal(); + if(Responsible != null) dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.MessageHeader.ResponseComponent)Response.DeepCopyInternal(); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MessageHeader()); + var instance = new MessageHeader(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Money.cs b/src/Hl7.Fhir.STU3/Model/Generated/Money.cs index e2ec09db37..f82116ab43 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Money.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Money.cs @@ -59,9 +59,11 @@ public partial class Money : Quantity /// public override string TypeName { get { return "Money"; } } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Money()); + var instance = new Money(); + CopyToInternal(instance); + return instance; } } diff --git a/src/Hl7.Fhir.STU3/Model/Generated/NamingSystem.cs b/src/Hl7.Fhir.STU3/Model/Generated/NamingSystem.cs index 37d687c7f4..76da9c039b 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/NamingSystem.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/NamingSystem.cs @@ -279,7 +279,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as UniqueIdComponent; @@ -288,18 +288,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new UniqueIdComponent()); + var instance = new UniqueIdComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -721,7 +722,7 @@ public Hl7.Fhir.Model.ResourceReference ReplacedBy private Hl7.Fhir.Model.ResourceReference _ReplacedBy; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NamingSystem; @@ -730,27 +731,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirString)ResponsibleElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(UniqueId.Any()) dest.UniqueId = new List(UniqueId.DeepCopy()); - if(ReplacedBy != null) dest.ReplacedBy = (Hl7.Fhir.Model.ResourceReference)ReplacedBy.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(ResponsibleElement != null) dest.ResponsibleElement = (Hl7.Fhir.Model.FhirString)ResponsibleElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(UniqueId.Any()) dest.UniqueId = new List(UniqueId.DeepCopyInternal()); + if(ReplacedBy != null) dest.ReplacedBy = (Hl7.Fhir.Model.ResourceReference)ReplacedBy.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NamingSystem()); + var instance = new NamingSystem(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/NutritionOrder.cs b/src/Hl7.Fhir.STU3/Model/Generated/NutritionOrder.cs index 614443d5da..469b0965ab 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/NutritionOrder.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/NutritionOrder.cs @@ -243,7 +243,7 @@ public string Instruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OralDietComponent; @@ -252,19 +252,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopy()); - if(Nutrient.Any()) dest.Nutrient = new List(Nutrient.DeepCopy()); - if(Texture.Any()) dest.Texture = new List(Texture.DeepCopy()); - if(FluidConsistencyType.Any()) dest.FluidConsistencyType = new List(FluidConsistencyType.DeepCopy()); - if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopyInternal()); + if(Nutrient.Any()) dest.Nutrient = new List(Nutrient.DeepCopyInternal()); + if(Texture.Any()) dest.Texture = new List(Texture.DeepCopyInternal()); + if(FluidConsistencyType.Any()) dest.FluidConsistencyType = new List(FluidConsistencyType.DeepCopyInternal()); + if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OralDietComponent()); + var instance = new OralDietComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -395,7 +396,7 @@ public Hl7.Fhir.Model.Quantity Amount private Hl7.Fhir.Model.Quantity _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NutrientComponent; @@ -404,15 +405,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Quantity)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NutrientComponent()); + var instance = new NutrientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -512,7 +514,7 @@ public Hl7.Fhir.Model.CodeableConcept FoodType private Hl7.Fhir.Model.CodeableConcept _FoodType; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TextureComponent; @@ -521,15 +523,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopy(); - if(FoodType != null) dest.FoodType = (Hl7.Fhir.Model.CodeableConcept)FoodType.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Modifier != null) dest.Modifier = (Hl7.Fhir.Model.CodeableConcept)Modifier.DeepCopyInternal(); + if(FoodType != null) dest.FoodType = (Hl7.Fhir.Model.CodeableConcept)FoodType.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TextureComponent()); + var instance = new TextureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -704,7 +707,7 @@ public string Instruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplementComponent; @@ -713,18 +716,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopy(); - if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopy()); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(ProductNameElement != null) dest.ProductNameElement = (Hl7.Fhir.Model.FhirString)ProductNameElement.DeepCopyInternal(); + if(Schedule.Any()) dest.Schedule = new List(Schedule.DeepCopyInternal()); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(InstructionElement != null) dest.InstructionElement = (Hl7.Fhir.Model.FhirString)InstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplementComponent()); + var instance = new SupplementComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -995,7 +999,7 @@ public string AdministrationInstruction } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnteralFormulaComponent; @@ -1004,22 +1008,23 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(BaseFormulaType != null) dest.BaseFormulaType = (Hl7.Fhir.Model.CodeableConcept)BaseFormulaType.DeepCopy(); - if(BaseFormulaProductNameElement != null) dest.BaseFormulaProductNameElement = (Hl7.Fhir.Model.FhirString)BaseFormulaProductNameElement.DeepCopy(); - if(AdditiveType != null) dest.AdditiveType = (Hl7.Fhir.Model.CodeableConcept)AdditiveType.DeepCopy(); - if(AdditiveProductNameElement != null) dest.AdditiveProductNameElement = (Hl7.Fhir.Model.FhirString)AdditiveProductNameElement.DeepCopy(); - if(CaloricDensity != null) dest.CaloricDensity = (Hl7.Fhir.Model.Quantity)CaloricDensity.DeepCopy(); - if(RouteofAdministration != null) dest.RouteofAdministration = (Hl7.Fhir.Model.CodeableConcept)RouteofAdministration.DeepCopy(); - if(Administration.Any()) dest.Administration = new List(Administration.DeepCopy()); - if(MaxVolumeToDeliver != null) dest.MaxVolumeToDeliver = (Hl7.Fhir.Model.Quantity)MaxVolumeToDeliver.DeepCopy(); - if(AdministrationInstructionElement != null) dest.AdministrationInstructionElement = (Hl7.Fhir.Model.FhirString)AdministrationInstructionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(BaseFormulaType != null) dest.BaseFormulaType = (Hl7.Fhir.Model.CodeableConcept)BaseFormulaType.DeepCopyInternal(); + if(BaseFormulaProductNameElement != null) dest.BaseFormulaProductNameElement = (Hl7.Fhir.Model.FhirString)BaseFormulaProductNameElement.DeepCopyInternal(); + if(AdditiveType != null) dest.AdditiveType = (Hl7.Fhir.Model.CodeableConcept)AdditiveType.DeepCopyInternal(); + if(AdditiveProductNameElement != null) dest.AdditiveProductNameElement = (Hl7.Fhir.Model.FhirString)AdditiveProductNameElement.DeepCopyInternal(); + if(CaloricDensity != null) dest.CaloricDensity = (Hl7.Fhir.Model.Quantity)CaloricDensity.DeepCopyInternal(); + if(RouteofAdministration != null) dest.RouteofAdministration = (Hl7.Fhir.Model.CodeableConcept)RouteofAdministration.DeepCopyInternal(); + if(Administration.Any()) dest.Administration = new List(Administration.DeepCopyInternal()); + if(MaxVolumeToDeliver != null) dest.MaxVolumeToDeliver = (Hl7.Fhir.Model.Quantity)MaxVolumeToDeliver.DeepCopyInternal(); + if(AdministrationInstructionElement != null) dest.AdministrationInstructionElement = (Hl7.Fhir.Model.FhirString)AdministrationInstructionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnteralFormulaComponent()); + var instance = new EnteralFormulaComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1189,7 +1194,7 @@ public Hl7.Fhir.Model.DataType Rate private Hl7.Fhir.Model.DataType _Rate; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AdministrationComponent; @@ -1198,16 +1203,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.Timing)Schedule.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.Timing)Schedule.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Rate != null) dest.Rate = (Hl7.Fhir.Model.DataType)Rate.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AdministrationComponent()); + var instance = new AdministrationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1484,7 +1490,7 @@ public Hl7.Fhir.Model.NutritionOrder.EnteralFormulaComponent EnteralFormula List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NutritionOrder; @@ -1493,25 +1499,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopy(); - if(Orderer != null) dest.Orderer = (Hl7.Fhir.Model.ResourceReference)Orderer.DeepCopy(); - if(AllergyIntolerance.Any()) dest.AllergyIntolerance = new List(AllergyIntolerance.DeepCopy()); - if(FoodPreferenceModifier.Any()) dest.FoodPreferenceModifier = new List(FoodPreferenceModifier.DeepCopy()); - if(ExcludeFoodModifier.Any()) dest.ExcludeFoodModifier = new List(ExcludeFoodModifier.DeepCopy()); - if(OralDiet != null) dest.OralDiet = (Hl7.Fhir.Model.NutritionOrder.OralDietComponent)OralDiet.DeepCopy(); - if(Supplement.Any()) dest.Supplement = new List(Supplement.DeepCopy()); - if(EnteralFormula != null) dest.EnteralFormula = (Hl7.Fhir.Model.NutritionOrder.EnteralFormulaComponent)EnteralFormula.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateTimeElement != null) dest.DateTimeElement = (Hl7.Fhir.Model.FhirDateTime)DateTimeElement.DeepCopyInternal(); + if(Orderer != null) dest.Orderer = (Hl7.Fhir.Model.ResourceReference)Orderer.DeepCopyInternal(); + if(AllergyIntolerance.Any()) dest.AllergyIntolerance = new List(AllergyIntolerance.DeepCopyInternal()); + if(FoodPreferenceModifier.Any()) dest.FoodPreferenceModifier = new List(FoodPreferenceModifier.DeepCopyInternal()); + if(ExcludeFoodModifier.Any()) dest.ExcludeFoodModifier = new List(ExcludeFoodModifier.DeepCopyInternal()); + if(OralDiet != null) dest.OralDiet = (Hl7.Fhir.Model.NutritionOrder.OralDietComponent)OralDiet.DeepCopyInternal(); + if(Supplement.Any()) dest.Supplement = new List(Supplement.DeepCopyInternal()); + if(EnteralFormula != null) dest.EnteralFormula = (Hl7.Fhir.Model.NutritionOrder.EnteralFormulaComponent)EnteralFormula.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NutritionOrder()); + var instance = new NutritionOrder(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Observation.cs b/src/Hl7.Fhir.STU3/Model/Generated/Observation.cs index 3d1a215065..8710f88671 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Observation.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Observation.cs @@ -222,7 +222,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferenceRangeComponent; @@ -231,19 +231,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Low != null) dest.Low = (Hl7.Fhir.Model.Quantity)Low.DeepCopy(); - if(High != null) dest.High = (Hl7.Fhir.Model.Quantity)High.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopy()); - if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Low != null) dest.Low = (Hl7.Fhir.Model.Quantity)Low.DeepCopyInternal(); + if(High != null) dest.High = (Hl7.Fhir.Model.Quantity)High.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(AppliesTo.Any()) dest.AppliesTo = new List(AppliesTo.DeepCopyInternal()); + if(Age != null) dest.Age = (Hl7.Fhir.Model.Range)Age.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferenceRangeComponent()); + var instance = new ReferenceRangeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -397,7 +398,7 @@ public Hl7.Fhir.Model.ResourceReference Target private Hl7.Fhir.Model.ResourceReference _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedComponent; @@ -406,15 +407,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedComponent()); + var instance = new RelatedComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -559,7 +561,7 @@ public List ReferenceRange private List _ReferenceRange; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -568,18 +570,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)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(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopyInternal(); + if(Interpretation != null) dest.Interpretation = (Hl7.Fhir.Model.CodeableConcept)Interpretation.DeepCopyInternal(); + if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1021,7 +1024,7 @@ public List Component List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Observation; @@ -1030,34 +1033,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)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(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopy()); - if(Related.Any()) dest.Related = new List(Related.DeepCopy()); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Effective != null) dest.Effective = (Hl7.Fhir.Model.DataType)Effective.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.Instant)IssuedElement.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(DataAbsentReason != null) dest.DataAbsentReason = (Hl7.Fhir.Model.CodeableConcept)DataAbsentReason.DeepCopyInternal(); + if(Interpretation != null) dest.Interpretation = (Hl7.Fhir.Model.CodeableConcept)Interpretation.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(ReferenceRange.Any()) dest.ReferenceRange = new List(ReferenceRange.DeepCopyInternal()); + if(Related.Any()) dest.Related = new List(Related.DeepCopyInternal()); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Observation()); + var instance = new Observation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/OperationDefinition.cs b/src/Hl7.Fhir.STU3/Model/Generated/OperationDefinition.cs index b6ff4a52e2..ebeb19584a 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/OperationDefinition.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/OperationDefinition.cs @@ -367,7 +367,7 @@ public List Part private List _Part; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -376,23 +376,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(SearchTypeElement != null) dest.SearchTypeElement = (Code)SearchTypeElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.ResourceReference)Profile.DeepCopy(); - if(Binding != null) dest.Binding = (Hl7.Fhir.Model.OperationDefinition.BindingComponent)Binding.DeepCopy(); - if(Part.Any()) dest.Part = new List(Part.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(SearchTypeElement != null) dest.SearchTypeElement = (Code)SearchTypeElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.ResourceReference)Profile.DeepCopyInternal(); + if(Binding != null) dest.Binding = (Hl7.Fhir.Model.OperationDefinition.BindingComponent)Binding.DeepCopyInternal(); + if(Part.Any()) dest.Part = new List(Part.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -579,7 +580,7 @@ public Hl7.Fhir.Model.DataType ValueSet private Hl7.Fhir.Model.DataType _ValueSet; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as BindingComponent; @@ -588,15 +589,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StrengthElement != null) dest.StrengthElement = (Code)StrengthElement.DeepCopy(); - if(ValueSet != null) dest.ValueSet = (Hl7.Fhir.Model.DataType)ValueSet.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StrengthElement != null) dest.StrengthElement = (Code)StrengthElement.DeepCopyInternal(); + if(ValueSet != null) dest.ValueSet = (Hl7.Fhir.Model.DataType)ValueSet.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new BindingComponent()); + var instance = new BindingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -732,7 +734,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OverloadComponent; @@ -741,15 +743,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ParameterNameElement.Any()) dest.ParameterNameElement = new List(ParameterNameElement.DeepCopy()); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ParameterNameElement.Any()) dest.ParameterNameElement = new List(ParameterNameElement.DeepCopyInternal()); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OverloadComponent()); + var instance = new OverloadComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1432,7 +1435,7 @@ public List Overload private List _Overload; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationDefinition; @@ -1441,36 +1444,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(IdempotentElement != null) dest.IdempotentElement = (Hl7.Fhir.Model.FhirBoolean)IdempotentElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - if(Base != null) dest.Base = (Hl7.Fhir.Model.ResourceReference)Base.DeepCopy(); - if(ResourceElement.Any()) dest.ResourceElement = new List>(ResourceElement.DeepCopy()); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirBoolean)SystemElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirBoolean)TypeElement.DeepCopy(); - if(InstanceElement != null) dest.InstanceElement = (Hl7.Fhir.Model.FhirBoolean)InstanceElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Overload.Any()) dest.Overload = new List(Overload.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(IdempotentElement != null) dest.IdempotentElement = (Hl7.Fhir.Model.FhirBoolean)IdempotentElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); + if(Base != null) dest.Base = (Hl7.Fhir.Model.ResourceReference)Base.DeepCopyInternal(); + if(ResourceElement.Any()) dest.ResourceElement = new List>(ResourceElement.DeepCopyInternal()); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirBoolean)SystemElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirBoolean)TypeElement.DeepCopyInternal(); + if(InstanceElement != null) dest.InstanceElement = (Hl7.Fhir.Model.FhirBoolean)InstanceElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Overload.Any()) dest.Overload = new List(Overload.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationDefinition()); + var instance = new OperationDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Organization.cs b/src/Hl7.Fhir.STU3/Model/Generated/Organization.cs index ba13a54f67..cddea91b88 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Organization.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Organization.cs @@ -129,7 +129,7 @@ public Hl7.Fhir.Model.Address Address private Hl7.Fhir.Model.Address _Address; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContactComponent; @@ -138,17 +138,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Purpose != null) dest.Purpose = (Hl7.Fhir.Model.CodeableConcept)Purpose.DeepCopy(); - if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Purpose != null) dest.Purpose = (Hl7.Fhir.Model.CodeableConcept)Purpose.DeepCopyInternal(); + if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContactComponent()); + var instance = new ContactComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -418,7 +419,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Organization; @@ -427,23 +428,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Type.Any()) dest.Type = new List(Type.DeepCopy()); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Type.Any()) dest.Type = new List(Type.DeepCopyInternal()); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(AliasElement.Any()) dest.AliasElement = new List(AliasElement.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(PartOf != null) dest.PartOf = (Hl7.Fhir.Model.ResourceReference)PartOf.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Organization()); + var instance = new Organization(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ParameterDefinition.cs b/src/Hl7.Fhir.STU3/Model/Generated/ParameterDefinition.cs index 0c75601d11..cdf39eb510 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ParameterDefinition.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ParameterDefinition.cs @@ -266,7 +266,7 @@ public Hl7.Fhir.Model.ResourceReference Profile private Hl7.Fhir.Model.ResourceReference _Profile; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterDefinition; @@ -275,20 +275,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopy(); - if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.ResourceReference)Profile.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Code)NameElement.DeepCopyInternal(); + if(UseElement != null) dest.UseElement = (Code)UseElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.ResourceReference)Profile.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterDefinition()); + var instance = new ParameterDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Patient.cs b/src/Hl7.Fhir.STU3/Model/Generated/Patient.cs index b38374fe1d..4e9c1dcacd 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Patient.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Patient.cs @@ -225,7 +225,7 @@ public Hl7.Fhir.Model.Period Period private Hl7.Fhir.Model.Period _Period; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContactComponent; @@ -234,20 +234,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopy()); - if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy(); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Relationship.Any()) dest.Relationship = new List(Relationship.DeepCopyInternal()); + if(Name != null) dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopyInternal(); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address != null) dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopyInternal(); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContactComponent()); + var instance = new ContactComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -403,7 +404,7 @@ public Hl7.Fhir.Model.CodeableConcept GenderStatus private Hl7.Fhir.Model.CodeableConcept _GenderStatus; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AnimalComponent; @@ -412,16 +413,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Species != null) dest.Species = (Hl7.Fhir.Model.CodeableConcept)Species.DeepCopy(); - if(Breed != null) dest.Breed = (Hl7.Fhir.Model.CodeableConcept)Breed.DeepCopy(); - if(GenderStatus != null) dest.GenderStatus = (Hl7.Fhir.Model.CodeableConcept)GenderStatus.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Species != null) dest.Species = (Hl7.Fhir.Model.CodeableConcept)Species.DeepCopyInternal(); + if(Breed != null) dest.Breed = (Hl7.Fhir.Model.CodeableConcept)Breed.DeepCopyInternal(); + if(GenderStatus != null) dest.GenderStatus = (Hl7.Fhir.Model.CodeableConcept)GenderStatus.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AnimalComponent()); + var instance = new AnimalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -548,7 +550,7 @@ public bool? Preferred } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CommunicationComponent; @@ -557,15 +559,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopy(); - if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Language != null) dest.Language = (Hl7.Fhir.Model.CodeableConcept)Language.DeepCopyInternal(); + if(PreferredElement != null) dest.PreferredElement = (Hl7.Fhir.Model.FhirBoolean)PreferredElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CommunicationComponent()); + var instance = new CommunicationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -689,7 +692,7 @@ public Hl7.Fhir.Model.Patient.LinkType? Type } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -698,15 +701,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Other != null) dest.Other = (Hl7.Fhir.Model.ResourceReference)Other.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Other != null) dest.Other = (Hl7.Fhir.Model.ResourceReference)Other.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1059,7 +1063,7 @@ public List Link List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Patient; @@ -1068,30 +1072,31 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopy(); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(MaritalStatus != null) dest.MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)MaritalStatus.DeepCopy(); - if(MultipleBirth != null) dest.MultipleBirth = (Hl7.Fhir.Model.DataType)MultipleBirth.DeepCopy(); - if(Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(Animal != null) dest.Animal = (Hl7.Fhir.Model.Patient.AnimalComponent)Animal.DeepCopy(); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - if(GeneralPractitioner.Any()) dest.GeneralPractitioner = new List(GeneralPractitioner.DeepCopy()); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Deceased != null) dest.Deceased = (Hl7.Fhir.Model.DataType)Deceased.DeepCopyInternal(); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(MaritalStatus != null) dest.MaritalStatus = (Hl7.Fhir.Model.CodeableConcept)MaritalStatus.DeepCopyInternal(); + if(MultipleBirth != null) dest.MultipleBirth = (Hl7.Fhir.Model.DataType)MultipleBirth.DeepCopyInternal(); + if(Photo.Any()) dest.Photo = new List(Photo.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(Animal != null) dest.Animal = (Hl7.Fhir.Model.Patient.AnimalComponent)Animal.DeepCopyInternal(); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); + if(GeneralPractitioner.Any()) dest.GeneralPractitioner = new List(GeneralPractitioner.DeepCopyInternal()); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Patient()); + var instance = new Patient(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/PaymentNotice.cs b/src/Hl7.Fhir.STU3/Model/Generated/PaymentNotice.cs index 90e2805c93..e85adcfdc2 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/PaymentNotice.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/PaymentNotice.cs @@ -259,7 +259,7 @@ public Hl7.Fhir.Model.CodeableConcept PaymentStatus List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentNotice; @@ -268,23 +268,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopy(); - if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.Date)StatusDateElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(PaymentStatus != null) dest.PaymentStatus = (Hl7.Fhir.Model.CodeableConcept)PaymentStatus.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopyInternal(); + if(StatusDateElement != null) dest.StatusDateElement = (Hl7.Fhir.Model.Date)StatusDateElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(PaymentStatus != null) dest.PaymentStatus = (Hl7.Fhir.Model.CodeableConcept)PaymentStatus.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentNotice()); + var instance = new PaymentNotice(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/PaymentReconciliation.cs b/src/Hl7.Fhir.STU3/Model/Generated/PaymentReconciliation.cs index ad46ffeb3f..d9cc11946e 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/PaymentReconciliation.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/PaymentReconciliation.cs @@ -194,7 +194,7 @@ public Hl7.Fhir.Model.Money Amount private Hl7.Fhir.Model.Money _Amount; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DetailsComponent; @@ -203,20 +203,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopy(); - if(Submitter != null) dest.Submitter = (Hl7.Fhir.Model.ResourceReference)Submitter.DeepCopy(); - if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy(); - if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopyInternal(); + if(Submitter != null) dest.Submitter = (Hl7.Fhir.Model.ResourceReference)Submitter.DeepCopyInternal(); + if(Payee != null) dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopyInternal(); + if(Amount != null) dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DetailsComponent()); + var instance = new DetailsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -373,7 +374,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotesComponent; @@ -382,15 +383,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotesComponent()); + var instance = new NotesComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -699,7 +701,7 @@ public List ProcessNote List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PaymentReconciliation; @@ -708,27 +710,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopy(); - if(RequestOrganization != null) dest.RequestOrganization = (Hl7.Fhir.Model.ResourceReference)RequestOrganization.DeepCopy(); - if(Detail.Any()) dest.Detail = new List(Detail.DeepCopy()); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(Total != null) dest.Total = (Hl7.Fhir.Model.Money)Total.DeepCopy(); - if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopyInternal(); + if(RequestOrganization != null) dest.RequestOrganization = (Hl7.Fhir.Model.ResourceReference)RequestOrganization.DeepCopyInternal(); + if(Detail.Any()) dest.Detail = new List(Detail.DeepCopyInternal()); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(Total != null) dest.Total = (Hl7.Fhir.Model.Money)Total.DeepCopyInternal(); + if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PaymentReconciliation()); + var instance = new PaymentReconciliation(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Person.cs b/src/Hl7.Fhir.STU3/Model/Generated/Person.cs index 8d359c9bb8..1f9f71da88 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Person.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Person.cs @@ -156,7 +156,7 @@ public Hl7.Fhir.Model.Person.IdentityAssuranceLevel? Assurance } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -165,15 +165,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - if(AssuranceElement != null) dest.AssuranceElement = (Code)AssuranceElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); + if(AssuranceElement != null) dest.AssuranceElement = (Code)AssuranceElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -424,7 +425,7 @@ public List Link List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Person; @@ -433,23 +434,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopy(); - if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopy(); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(Photo != null) dest.Photo = (Hl7.Fhir.Model.Attachment)Photo.DeepCopyInternal(); + if(ManagingOrganization != null) dest.ManagingOrganization = (Hl7.Fhir.Model.ResourceReference)ManagingOrganization.DeepCopyInternal(); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Person()); + var instance = new Person(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/PlanDefinition.cs b/src/Hl7.Fhir.STU3/Model/Generated/PlanDefinition.cs index d85ada381f..9bd526a718 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/PlanDefinition.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/PlanDefinition.cs @@ -175,7 +175,7 @@ public List Target private List _Target; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GoalComponent; @@ -184,20 +184,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopy(); - if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopy(); - if(Start != null) dest.Start = (Hl7.Fhir.Model.CodeableConcept)Start.DeepCopy(); - if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopy()); - if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopy()); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Description != null) dest.Description = (Hl7.Fhir.Model.CodeableConcept)Description.DeepCopyInternal(); + if(Priority != null) dest.Priority = (Hl7.Fhir.Model.CodeableConcept)Priority.DeepCopyInternal(); + if(Start != null) dest.Start = (Hl7.Fhir.Model.CodeableConcept)Start.DeepCopyInternal(); + if(Addresses.Any()) dest.Addresses = new List(Addresses.DeepCopyInternal()); + if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopyInternal()); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GoalComponent()); + var instance = new GoalComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -351,7 +352,7 @@ public Hl7.Fhir.Model.Duration Due private Hl7.Fhir.Model.Duration _Due; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -360,16 +361,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopy(); - if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopy(); - if(Due != null) dest.Due = (Hl7.Fhir.Model.Duration)Due.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Measure != null) dest.Measure = (Hl7.Fhir.Model.CodeableConcept)Measure.DeepCopyInternal(); + if(Detail != null) dest.Detail = (Hl7.Fhir.Model.DataType)Detail.DeepCopyInternal(); + if(Due != null) dest.Due = (Hl7.Fhir.Model.Duration)Due.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -983,7 +985,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionComponent; @@ -992,38 +994,39 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.FhirString)TextEquivalentElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopy()); - if(GoalIdElement.Any()) dest.GoalIdElement = new List(GoalIdElement.DeepCopy()); - if(TriggerDefinition.Any()) dest.TriggerDefinition = new List(TriggerDefinition.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Output.Any()) dest.Output = new List(Output.DeepCopy()); - if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopy()); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopy(); - if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopy(); - if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopy(); - if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopy(); - if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopy(); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopy(); - if(Transform != null) dest.Transform = (Hl7.Fhir.Model.ResourceReference)Transform.DeepCopy(); - if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActionComponent()); + base.CopyToInternal(dest); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.FhirString)TextEquivalentElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopyInternal()); + if(GoalIdElement.Any()) dest.GoalIdElement = new List(GoalIdElement.DeepCopyInternal()); + if(TriggerDefinition.Any()) dest.TriggerDefinition = new List(TriggerDefinition.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Output.Any()) dest.Output = new List(Output.DeepCopyInternal()); + if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopyInternal()); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopyInternal(); + if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopyInternal(); + if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopyInternal(); + if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopyInternal(); + if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopyInternal(); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopyInternal(); + if(Transform != null) dest.Transform = (Hl7.Fhir.Model.ResourceReference)Transform.DeepCopyInternal(); + if(DynamicValue.Any()) dest.DynamicValue = new List(DynamicValue.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1406,7 +1409,7 @@ public string Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConditionComponent; @@ -1415,17 +1418,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.FhirString)LanguageElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.FhirString)LanguageElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConditionComponent()); + var instance = new ConditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1595,7 +1599,7 @@ public Hl7.Fhir.Model.DataType Offset private Hl7.Fhir.Model.DataType _Offset; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedActionComponent; @@ -1604,16 +1608,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ActionIdElement != null) dest.ActionIdElement = (Hl7.Fhir.Model.Id)ActionIdElement.DeepCopy(); - if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopy(); - if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ActionIdElement != null) dest.ActionIdElement = (Hl7.Fhir.Model.Id)ActionIdElement.DeepCopyInternal(); + if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopyInternal(); + if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedActionComponent()); + var instance = new RelatedActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1741,7 +1746,7 @@ public Hl7.Fhir.Model.CodeableConcept Role private Hl7.Fhir.Model.CodeableConcept _Role; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -1750,15 +1755,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1954,7 +1960,7 @@ public string Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DynamicValueComponent; @@ -1963,17 +1969,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.FhirString)LanguageElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.FhirString)LanguageElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DynamicValueComponent()); + var instance = new DynamicValueComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2655,7 +2662,7 @@ public List Action List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PlanDefinition; @@ -2664,39 +2671,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Library.Any()) dest.Library = new List(Library.DeepCopy()); - if(Goal.Any()) dest.Goal = new List(Goal.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Library.Any()) dest.Library = new List(Library.DeepCopyInternal()); + if(Goal.Any()) dest.Goal = new List(Goal.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PlanDefinition()); + var instance = new PlanDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Practitioner.cs b/src/Hl7.Fhir.STU3/Model/Generated/Practitioner.cs index b5e81b89f1..781bc108db 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Practitioner.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Practitioner.cs @@ -130,7 +130,7 @@ public Hl7.Fhir.Model.ResourceReference Issuer private Hl7.Fhir.Model.ResourceReference _Issuer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QualificationComponent; @@ -139,17 +139,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Issuer != null) dest.Issuer = (Hl7.Fhir.Model.ResourceReference)Issuer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QualificationComponent()); + var instance = new QualificationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -417,7 +418,7 @@ public List Communication List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Practitioner; @@ -426,23 +427,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if(Qualification.Any()) dest.Qualification = new List(Qualification.DeepCopy()); - if(Communication.Any()) dest.Communication = new List(Communication.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Photo.Any()) dest.Photo = new List(Photo.DeepCopyInternal()); + if(Qualification.Any()) dest.Qualification = new List(Qualification.DeepCopyInternal()); + if(Communication.Any()) dest.Communication = new List(Communication.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Practitioner()); + var instance = new Practitioner(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/PractitionerRole.cs b/src/Hl7.Fhir.STU3/Model/Generated/PractitionerRole.cs index 2bb22a8149..8f323868e7 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/PractitionerRole.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/PractitionerRole.cs @@ -203,7 +203,7 @@ public string AvailableEndTime } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AvailableTimeComponent; @@ -212,17 +212,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopy()); - if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopy(); - if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopy(); - if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DaysOfWeekElement.Any()) dest.DaysOfWeekElement = new List>(DaysOfWeekElement.DeepCopyInternal()); + if(AllDayElement != null) dest.AllDayElement = (Hl7.Fhir.Model.FhirBoolean)AllDayElement.DeepCopyInternal(); + if(AvailableStartTimeElement != null) dest.AvailableStartTimeElement = (Hl7.Fhir.Model.Time)AvailableStartTimeElement.DeepCopyInternal(); + if(AvailableEndTimeElement != null) dest.AvailableEndTimeElement = (Hl7.Fhir.Model.Time)AvailableEndTimeElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AvailableTimeComponent()); + var instance = new AvailableTimeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -355,7 +356,7 @@ public Hl7.Fhir.Model.Period During private Hl7.Fhir.Model.Period _During; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as NotAvailableComponent; @@ -364,15 +365,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(During != null) dest.During = (Hl7.Fhir.Model.Period)During.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new NotAvailableComponent()); + var instance = new NotAvailableComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -669,7 +671,7 @@ public List Endpoint List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PractitionerRole; @@ -678,27 +680,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Practitioner != null) dest.Practitioner = (Hl7.Fhir.Model.ResourceReference)Practitioner.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Location.Any()) dest.Location = new List(Location.DeepCopy()); - if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopy()); - if(NotAvailable.Any()) dest.NotAvailable = new List(NotAvailable.DeepCopy()); - if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopy(); - if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Practitioner != null) dest.Practitioner = (Hl7.Fhir.Model.ResourceReference)Practitioner.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Location.Any()) dest.Location = new List(Location.DeepCopyInternal()); + if(HealthcareService.Any()) dest.HealthcareService = new List(HealthcareService.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(AvailableTime.Any()) dest.AvailableTime = new List(AvailableTime.DeepCopyInternal()); + if(NotAvailable.Any()) dest.NotAvailable = new List(NotAvailable.DeepCopyInternal()); + if(AvailabilityExceptionsElement != null) dest.AvailabilityExceptionsElement = (Hl7.Fhir.Model.FhirString)AvailabilityExceptionsElement.DeepCopyInternal(); + if(Endpoint.Any()) dest.Endpoint = new List(Endpoint.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PractitionerRole()); + var instance = new PractitionerRole(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Procedure.cs b/src/Hl7.Fhir.STU3/Model/Generated/Procedure.cs index 637fc35195..13cee663ae 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Procedure.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Procedure.cs @@ -120,7 +120,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PerformerComponent; @@ -129,16 +129,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopy(); - if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role != null) dest.Role = (Hl7.Fhir.Model.CodeableConcept)Role.DeepCopyInternal(); + if(Actor != null) dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PerformerComponent()); + var instance = new PerformerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -248,7 +249,7 @@ public Hl7.Fhir.Model.ResourceReference Manipulated private Hl7.Fhir.Model.ResourceReference _Manipulated; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FocalDeviceComponent; @@ -257,15 +258,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopy(); - if(Manipulated != null) dest.Manipulated = (Hl7.Fhir.Model.ResourceReference)Manipulated.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Action != null) dest.Action = (Hl7.Fhir.Model.CodeableConcept)Action.DeepCopyInternal(); + if(Manipulated != null) dest.Manipulated = (Hl7.Fhir.Model.ResourceReference)Manipulated.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FocalDeviceComponent()); + var instance = new FocalDeviceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -748,7 +750,7 @@ public List UsedCode List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Procedure; @@ -757,39 +759,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Definition.Any()) dest.Definition = new List(Definition.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(NotDoneElement != null) dest.NotDoneElement = (Hl7.Fhir.Model.FhirBoolean)NotDoneElement.DeepCopy(); - if(NotDoneReason != null) dest.NotDoneReason = (Hl7.Fhir.Model.CodeableConcept)NotDoneReason.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Performed != null) dest.Performed = (Hl7.Fhir.Model.DataType)Performed.DeepCopy(); - if(Performer.Any()) dest.Performer = new List(Performer.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(Report.Any()) dest.Report = new List(Report.DeepCopy()); - if(Complication.Any()) dest.Complication = new List(Complication.DeepCopy()); - if(ComplicationDetail.Any()) dest.ComplicationDetail = new List(ComplicationDetail.DeepCopy()); - if(FollowUp.Any()) dest.FollowUp = new List(FollowUp.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(FocalDevice.Any()) dest.FocalDevice = new List(FocalDevice.DeepCopy()); - if(UsedReference.Any()) dest.UsedReference = new List(UsedReference.DeepCopy()); - if(UsedCode.Any()) dest.UsedCode = new List(UsedCode.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Definition.Any()) dest.Definition = new List(Definition.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(NotDoneElement != null) dest.NotDoneElement = (Hl7.Fhir.Model.FhirBoolean)NotDoneElement.DeepCopyInternal(); + if(NotDoneReason != null) dest.NotDoneReason = (Hl7.Fhir.Model.CodeableConcept)NotDoneReason.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Performed != null) dest.Performed = (Hl7.Fhir.Model.DataType)Performed.DeepCopyInternal(); + if(Performer.Any()) dest.Performer = new List(Performer.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(Report.Any()) dest.Report = new List(Report.DeepCopyInternal()); + if(Complication.Any()) dest.Complication = new List(Complication.DeepCopyInternal()); + if(ComplicationDetail.Any()) dest.ComplicationDetail = new List(ComplicationDetail.DeepCopyInternal()); + if(FollowUp.Any()) dest.FollowUp = new List(FollowUp.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(FocalDevice.Any()) dest.FocalDevice = new List(FocalDevice.DeepCopyInternal()); + if(UsedReference.Any()) dest.UsedReference = new List(UsedReference.DeepCopyInternal()); + if(UsedCode.Any()) dest.UsedCode = new List(UsedCode.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Procedure()); + var instance = new Procedure(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ProcedureRequest.cs b/src/Hl7.Fhir.STU3/Model/Generated/ProcedureRequest.cs index 0be750377e..68e01a8213 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ProcedureRequest.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ProcedureRequest.cs @@ -107,7 +107,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequesterComponent; @@ -116,15 +116,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequesterComponent()); + var instance = new RequesterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -662,7 +663,7 @@ public List RelevantHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcedureRequest; @@ -671,39 +672,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Definition.Any()) dest.Definition = new List(Definition.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(Requisition != null) dest.Requisition = (Hl7.Fhir.Model.Identifier)Requisition.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ProcedureRequest.RequesterComponent)Requester.DeepCopy(); - if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopy()); - if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ProcedureRequest()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Definition.Any()) dest.Definition = new List(Definition.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(Requisition != null) dest.Requisition = (Hl7.Fhir.Model.Identifier)Requisition.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(DoNotPerformElement != null) dest.DoNotPerformElement = (Hl7.Fhir.Model.FhirBoolean)DoNotPerformElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AsNeeded != null) dest.AsNeeded = (Hl7.Fhir.Model.DataType)AsNeeded.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ProcedureRequest.RequesterComponent)Requester.DeepCopyInternal(); + if(PerformerType != null) dest.PerformerType = (Hl7.Fhir.Model.CodeableConcept)PerformerType.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Specimen.Any()) dest.Specimen = new List(Specimen.DeepCopyInternal()); + if(BodySite.Any()) dest.BodySite = new List(BodySite.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ProcedureRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ProcessRequest.cs b/src/Hl7.Fhir.STU3/Model/Generated/ProcessRequest.cs index b9d11bb708..0e776313f0 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ProcessRequest.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ProcessRequest.cs @@ -141,7 +141,7 @@ public int? SequenceLinkId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemsComponent; @@ -150,14 +150,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SequenceLinkIdElement != null) dest.SequenceLinkIdElement = (Hl7.Fhir.Model.Integer)SequenceLinkIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(SequenceLinkIdElement != null) dest.SequenceLinkIdElement = (Hl7.Fhir.Model.Integer)SequenceLinkIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemsComponent()); + var instance = new ItemsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -546,7 +547,7 @@ public Hl7.Fhir.Model.Period Period List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcessRequest; @@ -555,28 +556,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ActionElement != null) dest.ActionElement = (Code)ActionElement.DeepCopy(); - if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopy(); - if(NullifyElement != null) dest.NullifyElement = (Hl7.Fhir.Model.FhirBoolean)NullifyElement.DeepCopy(); - if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirString)ReferenceElement.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - if(IncludeElement.Any()) dest.IncludeElement = new List(IncludeElement.DeepCopy()); - if(ExcludeElement.Any()) dest.ExcludeElement = new List(ExcludeElement.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ActionElement != null) dest.ActionElement = (Code)ActionElement.DeepCopyInternal(); + if(Target != null) dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Provider != null) dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Response != null) dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopyInternal(); + if(NullifyElement != null) dest.NullifyElement = (Hl7.Fhir.Model.FhirBoolean)NullifyElement.DeepCopyInternal(); + if(ReferenceElement != null) dest.ReferenceElement = (Hl7.Fhir.Model.FhirString)ReferenceElement.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); + if(IncludeElement.Any()) dest.IncludeElement = new List(IncludeElement.DeepCopyInternal()); + if(ExcludeElement.Any()) dest.ExcludeElement = new List(ExcludeElement.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcessRequest()); + var instance = new ProcessRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ProcessResponse.cs b/src/Hl7.Fhir.STU3/Model/Generated/ProcessResponse.cs index 75866a6ddf..1447bf538f 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ProcessResponse.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ProcessResponse.cs @@ -120,7 +120,7 @@ public string Text } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcessNoteComponent; @@ -129,15 +129,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcessNoteComponent()); + var instance = new ProcessNoteComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -437,7 +438,7 @@ public List CommunicationRequest List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcessResponse; @@ -446,26 +447,27 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); - if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy(); - if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy(); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy(); - if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopy(); - if(RequestOrganization != null) dest.RequestOrganization = (Hl7.Fhir.Model.ResourceReference)RequestOrganization.DeepCopy(); - if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy(); - if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopy()); - if(Error.Any()) dest.Error = new List(Error.DeepCopy()); - if(CommunicationRequest.Any()) dest.CommunicationRequest = new List(CommunicationRequest.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(CreatedElement != null) dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopyInternal(); + if(Organization != null) dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopyInternal(); + if(Request != null) dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopyInternal(); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(DispositionElement != null) dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopyInternal(); + if(RequestProvider != null) dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopyInternal(); + if(RequestOrganization != null) dest.RequestOrganization = (Hl7.Fhir.Model.ResourceReference)RequestOrganization.DeepCopyInternal(); + if(Form != null) dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopyInternal(); + if(ProcessNote.Any()) dest.ProcessNote = new List(ProcessNote.DeepCopyInternal()); + if(Error.Any()) dest.Error = new List(Error.DeepCopyInternal()); + if(CommunicationRequest.Any()) dest.CommunicationRequest = new List(CommunicationRequest.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcessResponse()); + var instance = new ProcessResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Provenance.cs b/src/Hl7.Fhir.STU3/Model/Generated/Provenance.cs index 289b8f15b6..d639c34546 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Provenance.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Provenance.cs @@ -179,7 +179,7 @@ public Hl7.Fhir.Model.CodeableConcept RelatedAgentType private Hl7.Fhir.Model.CodeableConcept _RelatedAgentType; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AgentComponent; @@ -188,17 +188,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Role.Any()) dest.Role = new List(Role.DeepCopy()); - if(Who != null) dest.Who = (Hl7.Fhir.Model.DataType)Who.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.DataType)OnBehalfOf.DeepCopy(); - if(RelatedAgentType != null) dest.RelatedAgentType = (Hl7.Fhir.Model.CodeableConcept)RelatedAgentType.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Role.Any()) dest.Role = new List(Role.DeepCopyInternal()); + if(Who != null) dest.Who = (Hl7.Fhir.Model.DataType)Who.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.DataType)OnBehalfOf.DeepCopyInternal(); + if(RelatedAgentType != null) dest.RelatedAgentType = (Hl7.Fhir.Model.CodeableConcept)RelatedAgentType.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AgentComponent()); + var instance = new AgentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -351,7 +352,7 @@ public List Agent private List _Agent; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EntityComponent; @@ -360,16 +361,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RoleElement != null) dest.RoleElement = (Code)RoleElement.DeepCopy(); - if(What != null) dest.What = (Hl7.Fhir.Model.DataType)What.DeepCopy(); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RoleElement != null) dest.RoleElement = (Code)RoleElement.DeepCopyInternal(); + if(What != null) dest.What = (Hl7.Fhir.Model.DataType)What.DeepCopyInternal(); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EntityComponent()); + var instance = new EntityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -612,7 +614,7 @@ public List Signature private List _Signature; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Provenance; @@ -621,23 +623,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopy(); - if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopy()); - if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopy(); - if(Reason.Any()) dest.Reason = new List(Reason.DeepCopy()); - if(Activity != null) dest.Activity = (Hl7.Fhir.Model.Coding)Activity.DeepCopy(); - if(Agent.Any()) dest.Agent = new List(Agent.DeepCopy()); - if(Entity.Any()) dest.Entity = new List(Entity.DeepCopy()); - if(Signature.Any()) dest.Signature = new List(Signature.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(RecordedElement != null) dest.RecordedElement = (Hl7.Fhir.Model.Instant)RecordedElement.DeepCopyInternal(); + if(PolicyElement.Any()) dest.PolicyElement = new List(PolicyElement.DeepCopyInternal()); + if(Location != null) dest.Location = (Hl7.Fhir.Model.ResourceReference)Location.DeepCopyInternal(); + if(Reason.Any()) dest.Reason = new List(Reason.DeepCopyInternal()); + if(Activity != null) dest.Activity = (Hl7.Fhir.Model.Coding)Activity.DeepCopyInternal(); + if(Agent.Any()) dest.Agent = new List(Agent.DeepCopyInternal()); + if(Entity.Any()) dest.Entity = new List(Entity.DeepCopyInternal()); + if(Signature.Any()) dest.Signature = new List(Signature.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Provenance()); + var instance = new Provenance(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Questionnaire.cs b/src/Hl7.Fhir.STU3/Model/Generated/Questionnaire.cs index f78de60128..a85c721848 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Questionnaire.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Questionnaire.cs @@ -554,7 +554,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -563,28 +563,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(EnableWhen.Any()) dest.EnableWhen = new List(EnableWhen.DeepCopy()); - if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopy(); - if(RepeatsElement != null) dest.RepeatsElement = (Hl7.Fhir.Model.FhirBoolean)RepeatsElement.DeepCopy(); - if(ReadOnlyElement != null) dest.ReadOnlyElement = (Hl7.Fhir.Model.FhirBoolean)ReadOnlyElement.DeepCopy(); - if(MaxLengthElement != null) dest.MaxLengthElement = (Hl7.Fhir.Model.Integer)MaxLengthElement.DeepCopy(); - if(Options != null) dest.Options = (Hl7.Fhir.Model.ResourceReference)Options.DeepCopy(); - if(Option.Any()) dest.Option = new List(Option.DeepCopy()); - if(Initial != null) dest.Initial = (Hl7.Fhir.Model.DataType)Initial.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(PrefixElement != null) dest.PrefixElement = (Hl7.Fhir.Model.FhirString)PrefixElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(EnableWhen.Any()) dest.EnableWhen = new List(EnableWhen.DeepCopyInternal()); + if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopyInternal(); + if(RepeatsElement != null) dest.RepeatsElement = (Hl7.Fhir.Model.FhirBoolean)RepeatsElement.DeepCopyInternal(); + if(ReadOnlyElement != null) dest.ReadOnlyElement = (Hl7.Fhir.Model.FhirBoolean)ReadOnlyElement.DeepCopyInternal(); + if(MaxLengthElement != null) dest.MaxLengthElement = (Hl7.Fhir.Model.Integer)MaxLengthElement.DeepCopyInternal(); + if(Options != null) dest.Options = (Hl7.Fhir.Model.ResourceReference)Options.DeepCopyInternal(); + if(Option.Any()) dest.Option = new List(Option.DeepCopyInternal()); + if(Initial != null) dest.Initial = (Hl7.Fhir.Model.DataType)Initial.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -842,7 +843,7 @@ public Hl7.Fhir.Model.DataType Answer private Hl7.Fhir.Model.DataType _Answer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as EnableWhenComponent; @@ -851,16 +852,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(QuestionElement != null) dest.QuestionElement = (Hl7.Fhir.Model.FhirString)QuestionElement.DeepCopy(); - if(HasAnswerElement != null) dest.HasAnswerElement = (Hl7.Fhir.Model.FhirBoolean)HasAnswerElement.DeepCopy(); - if(Answer != null) dest.Answer = (Hl7.Fhir.Model.DataType)Answer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(QuestionElement != null) dest.QuestionElement = (Hl7.Fhir.Model.FhirString)QuestionElement.DeepCopyInternal(); + if(HasAnswerElement != null) dest.HasAnswerElement = (Hl7.Fhir.Model.FhirBoolean)HasAnswerElement.DeepCopyInternal(); + if(Answer != null) dest.Answer = (Hl7.Fhir.Model.DataType)Answer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new EnableWhenComponent()); + var instance = new EnableWhenComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -958,7 +960,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OptionComponent; @@ -967,14 +969,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OptionComponent()); + var instance = new OptionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1563,7 +1566,7 @@ public List Item List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Questionnaire; @@ -1572,34 +1575,35 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(SubjectTypeElement.Any()) dest.SubjectTypeElement = new List>(SubjectTypeElement.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(SubjectTypeElement.Any()) dest.SubjectTypeElement = new List>(SubjectTypeElement.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Questionnaire()); + var instance = new Questionnaire(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/QuestionnaireResponse.cs b/src/Hl7.Fhir.STU3/Model/Generated/QuestionnaireResponse.cs index 6dba93f944..9dec186b4b 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/QuestionnaireResponse.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/QuestionnaireResponse.cs @@ -254,7 +254,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ItemComponent; @@ -263,19 +263,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopy(); - if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopy(); - if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Answer.Any()) dest.Answer = new List(Answer.DeepCopy()); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LinkIdElement != null) dest.LinkIdElement = (Hl7.Fhir.Model.FhirString)LinkIdElement.DeepCopyInternal(); + if(DefinitionElement != null) dest.DefinitionElement = (Hl7.Fhir.Model.FhirUri)DefinitionElement.DeepCopyInternal(); + if(TextElement != null) dest.TextElement = (Hl7.Fhir.Model.FhirString)TextElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Answer.Any()) dest.Answer = new List(Answer.DeepCopyInternal()); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ItemComponent()); + var instance = new ItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -411,7 +412,7 @@ public List Item private List _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AnswerComponent; @@ -420,15 +421,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AnswerComponent()); + var instance = new AnswerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -685,7 +687,7 @@ public List Item Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QuestionnaireResponse; @@ -694,24 +696,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Parent.Any()) dest.Parent = new List(Parent.DeepCopy()); - if(Questionnaire != null) dest.Questionnaire = (Hl7.Fhir.Model.ResourceReference)Questionnaire.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(AuthoredElement != null) dest.AuthoredElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); - if(Item.Any()) dest.Item = new List(Item.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Parent.Any()) dest.Parent = new List(Parent.DeepCopyInternal()); + if(Questionnaire != null) dest.Questionnaire = (Hl7.Fhir.Model.ResourceReference)Questionnaire.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(AuthoredElement != null) dest.AuthoredElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Source != null) dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopyInternal(); + if(Item.Any()) dest.Item = new List(Item.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QuestionnaireResponse()); + var instance = new QuestionnaireResponse(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Ratio.cs b/src/Hl7.Fhir.STU3/Model/Generated/Ratio.cs index 405fedea0f..9ceee425a6 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Ratio.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Ratio.cs @@ -85,7 +85,7 @@ public Hl7.Fhir.Model.Quantity Denominator private Hl7.Fhir.Model.Quantity _Denominator; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Ratio; @@ -94,15 +94,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Numerator != null) dest.Numerator = (Hl7.Fhir.Model.Quantity)Numerator.DeepCopy(); - if(Denominator != null) dest.Denominator = (Hl7.Fhir.Model.Quantity)Denominator.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Numerator != null) dest.Numerator = (Hl7.Fhir.Model.Quantity)Numerator.DeepCopyInternal(); + if(Denominator != null) dest.Denominator = (Hl7.Fhir.Model.Quantity)Denominator.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Ratio()); + var instance = new Ratio(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ReferralRequest.cs b/src/Hl7.Fhir.STU3/Model/Generated/ReferralRequest.cs index 2371e31fe9..7cb7b7313a 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ReferralRequest.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ReferralRequest.cs @@ -106,7 +106,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequesterComponent; @@ -115,15 +115,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequesterComponent()); + var instance = new RequesterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -614,7 +615,7 @@ public List RelevantHistory List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferralRequest; @@ -623,36 +624,37 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Definition.Any()) dest.Definition = new List(Definition.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(ServiceRequested.Any()) dest.ServiceRequested = new List(ServiceRequested.DeepCopy()); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ReferralRequest.RequesterComponent)Requester.DeepCopy(); - if(Specialty != null) dest.Specialty = (Hl7.Fhir.Model.CodeableConcept)Specialty.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopy()); - if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ReferralRequest()); + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Definition.Any()) dest.Definition = new List(Definition.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(ServiceRequested.Any()) dest.ServiceRequested = new List(ServiceRequested.DeepCopyInternal()); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.ReferralRequest.RequesterComponent)Requester.DeepCopyInternal(); + if(Specialty != null) dest.Specialty = (Hl7.Fhir.Model.CodeableConcept)Specialty.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); + if(ReasonCode.Any()) dest.ReasonCode = new List(ReasonCode.DeepCopyInternal()); + if(ReasonReference.Any()) dest.ReasonReference = new List(ReasonReference.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(SupportingInfo.Any()) dest.SupportingInfo = new List(SupportingInfo.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ReferralRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/RelatedArtifact.cs b/src/Hl7.Fhir.STU3/Model/Generated/RelatedArtifact.cs index 03643f43b0..8010d672e0 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/RelatedArtifact.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/RelatedArtifact.cs @@ -277,7 +277,7 @@ public Hl7.Fhir.Model.ResourceReference Resource private Hl7.Fhir.Model.ResourceReference _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedArtifact; @@ -286,19 +286,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(CitationElement != null) dest.CitationElement = (Hl7.Fhir.Model.FhirString)CitationElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Document != null) dest.Document = (Hl7.Fhir.Model.Attachment)Document.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(CitationElement != null) dest.CitationElement = (Hl7.Fhir.Model.FhirString)CitationElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Document != null) dest.Document = (Hl7.Fhir.Model.Attachment)Document.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedArtifact()); + var instance = new RelatedArtifact(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/RelatedPerson.cs b/src/Hl7.Fhir.STU3/Model/Generated/RelatedPerson.cs index c36fc094d5..ab5e1a6192 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/RelatedPerson.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/RelatedPerson.cs @@ -269,7 +269,7 @@ public Hl7.Fhir.Model.Period Period List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedPerson; @@ -278,24 +278,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); - if(Name.Any()) dest.Name = new List(Name.DeepCopy()); - if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopy()); - if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopy(); - if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopy(); - if(Address.Any()) dest.Address = new List(Address.DeepCopy()); - if(Photo.Any()) dest.Photo = new List(Photo.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Relationship != null) dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopyInternal(); + if(Name.Any()) dest.Name = new List(Name.DeepCopyInternal()); + if(Telecom.Any()) dest.Telecom = new List(Telecom.DeepCopyInternal()); + if(GenderElement != null) dest.GenderElement = (Code)GenderElement.DeepCopyInternal(); + if(BirthDateElement != null) dest.BirthDateElement = (Hl7.Fhir.Model.Date)BirthDateElement.DeepCopyInternal(); + if(Address.Any()) dest.Address = new List(Address.DeepCopyInternal()); + if(Photo.Any()) dest.Photo = new List(Photo.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedPerson()); + var instance = new RelatedPerson(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/RequestGroup.cs b/src/Hl7.Fhir.STU3/Model/Generated/RequestGroup.cs index af0a52227e..ca0ef87f8f 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/RequestGroup.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/RequestGroup.cs @@ -494,7 +494,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionComponent; @@ -503,31 +503,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.FhirString)TextEquivalentElement.DeepCopy(); - if(Code.Any()) dest.Code = new List(Code.DeepCopy()); - if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopy()); - if(Condition.Any()) dest.Condition = new List(Condition.DeepCopy()); - if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopy()); - if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopy(); - if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopy(); - if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopy(); - if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopy(); - if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ActionComponent()); + base.CopyToInternal(dest); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(TextEquivalentElement != null) dest.TextEquivalentElement = (Hl7.Fhir.Model.FhirString)TextEquivalentElement.DeepCopyInternal(); + if(Code.Any()) dest.Code = new List(Code.DeepCopyInternal()); + if(Documentation.Any()) dest.Documentation = new List(Documentation.DeepCopyInternal()); + if(Condition.Any()) dest.Condition = new List(Condition.DeepCopyInternal()); + if(RelatedAction.Any()) dest.RelatedAction = new List(RelatedAction.DeepCopyInternal()); + if(Timing != null) dest.Timing = (Hl7.Fhir.Model.DataType)Timing.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(GroupingBehaviorElement != null) dest.GroupingBehaviorElement = (Code)GroupingBehaviorElement.DeepCopyInternal(); + if(SelectionBehaviorElement != null) dest.SelectionBehaviorElement = (Code)SelectionBehaviorElement.DeepCopyInternal(); + if(RequiredBehaviorElement != null) dest.RequiredBehaviorElement = (Code)RequiredBehaviorElement.DeepCopyInternal(); + if(PrecheckBehaviorElement != null) dest.PrecheckBehaviorElement = (Code)PrecheckBehaviorElement.DeepCopyInternal(); + if(CardinalityBehaviorElement != null) dest.CardinalityBehaviorElement = (Code)CardinalityBehaviorElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -854,7 +855,7 @@ public string Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConditionComponent; @@ -863,17 +864,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.FhirString)LanguageElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.FhirString)LanguageElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConditionComponent()); + var instance = new ConditionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1042,7 +1044,7 @@ public Hl7.Fhir.Model.DataType Offset private Hl7.Fhir.Model.DataType _Offset; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RelatedActionComponent; @@ -1051,16 +1053,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ActionIdElement != null) dest.ActionIdElement = (Hl7.Fhir.Model.Id)ActionIdElement.DeepCopy(); - if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopy(); - if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ActionIdElement != null) dest.ActionIdElement = (Hl7.Fhir.Model.Id)ActionIdElement.DeepCopyInternal(); + if(RelationshipElement != null) dest.RelationshipElement = (Code)RelationshipElement.DeepCopyInternal(); + if(Offset != null) dest.Offset = (Hl7.Fhir.Model.DataType)Offset.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RelatedActionComponent()); + var instance = new RelatedActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1422,7 +1425,7 @@ public List Action List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequestGroup; @@ -1431,28 +1434,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Definition.Any()) dest.Definition = new List(Definition.DeepCopy()); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.DataType)Reason.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Definition.Any()) dest.Definition = new List(Definition.DeepCopyInternal()); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(Replaces.Any()) dest.Replaces = new List(Replaces.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Author != null) dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.DataType)Reason.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequestGroup()); + var instance = new RequestGroup(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ResearchStudy.cs b/src/Hl7.Fhir.STU3/Model/Generated/ResearchStudy.cs index 5908366a48..fb171127bc 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ResearchStudy.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ResearchStudy.cs @@ -198,7 +198,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ArmComponent; @@ -207,16 +207,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ArmComponent()); + var instance = new ArmComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -628,7 +629,7 @@ public List Arm List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResearchStudy; @@ -637,33 +638,34 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(Protocol.Any()) dest.Protocol = new List(Protocol.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Focus.Any()) dest.Focus = new List(Focus.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Keyword.Any()) dest.Keyword = new List(Keyword.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(Enrollment.Any()) dest.Enrollment = new List(Enrollment.DeepCopy()); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Sponsor != null) dest.Sponsor = (Hl7.Fhir.Model.ResourceReference)Sponsor.DeepCopy(); - if(PrincipalInvestigator != null) dest.PrincipalInvestigator = (Hl7.Fhir.Model.ResourceReference)PrincipalInvestigator.DeepCopy(); - if(Site.Any()) dest.Site = new List(Site.DeepCopy()); - if(ReasonStopped != null) dest.ReasonStopped = (Hl7.Fhir.Model.CodeableConcept)ReasonStopped.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(Arm.Any()) dest.Arm = new List(Arm.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(Protocol.Any()) dest.Protocol = new List(Protocol.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Focus.Any()) dest.Focus = new List(Focus.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Keyword.Any()) dest.Keyword = new List(Keyword.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(Enrollment.Any()) dest.Enrollment = new List(Enrollment.DeepCopyInternal()); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Sponsor != null) dest.Sponsor = (Hl7.Fhir.Model.ResourceReference)Sponsor.DeepCopyInternal(); + if(PrincipalInvestigator != null) dest.PrincipalInvestigator = (Hl7.Fhir.Model.ResourceReference)PrincipalInvestigator.DeepCopyInternal(); + if(Site.Any()) dest.Site = new List(Site.DeepCopyInternal()); + if(ReasonStopped != null) dest.ReasonStopped = (Hl7.Fhir.Model.CodeableConcept)ReasonStopped.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(Arm.Any()) dest.Arm = new List(Arm.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResearchStudy()); + var instance = new ResearchStudy(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ResearchSubject.cs b/src/Hl7.Fhir.STU3/Model/Generated/ResearchSubject.cs index 818c21643f..20a46ce66a 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ResearchSubject.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ResearchSubject.cs @@ -277,7 +277,7 @@ public Hl7.Fhir.Model.ResourceReference Consent Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ResearchSubject; @@ -286,21 +286,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Study != null) dest.Study = (Hl7.Fhir.Model.ResourceReference)Study.DeepCopy(); - if(Individual != null) dest.Individual = (Hl7.Fhir.Model.ResourceReference)Individual.DeepCopy(); - if(AssignedArmElement != null) dest.AssignedArmElement = (Hl7.Fhir.Model.FhirString)AssignedArmElement.DeepCopy(); - if(ActualArmElement != null) dest.ActualArmElement = (Hl7.Fhir.Model.FhirString)ActualArmElement.DeepCopy(); - if(Consent != null) dest.Consent = (Hl7.Fhir.Model.ResourceReference)Consent.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Study != null) dest.Study = (Hl7.Fhir.Model.ResourceReference)Study.DeepCopyInternal(); + if(Individual != null) dest.Individual = (Hl7.Fhir.Model.ResourceReference)Individual.DeepCopyInternal(); + if(AssignedArmElement != null) dest.AssignedArmElement = (Hl7.Fhir.Model.FhirString)AssignedArmElement.DeepCopyInternal(); + if(ActualArmElement != null) dest.ActualArmElement = (Hl7.Fhir.Model.FhirString)ActualArmElement.DeepCopyInternal(); + if(Consent != null) dest.Consent = (Hl7.Fhir.Model.ResourceReference)Consent.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ResearchSubject()); + var instance = new ResearchSubject(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/RiskAssessment.cs b/src/Hl7.Fhir.STU3/Model/Generated/RiskAssessment.cs index 52bd2cdd48..4992e7565c 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/RiskAssessment.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/RiskAssessment.cs @@ -197,7 +197,7 @@ public string Rationale } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as PredictionComponent; @@ -206,19 +206,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); - if(Probability != null) dest.Probability = (Hl7.Fhir.Model.DataType)Probability.DeepCopy(); - if(QualitativeRisk != null) dest.QualitativeRisk = (Hl7.Fhir.Model.CodeableConcept)QualitativeRisk.DeepCopy(); - if(RelativeRiskElement != null) dest.RelativeRiskElement = (Hl7.Fhir.Model.FhirDecimal)RelativeRiskElement.DeepCopy(); - if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopy(); - if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.FhirString)RationaleElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Outcome != null) dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopyInternal(); + if(Probability != null) dest.Probability = (Hl7.Fhir.Model.DataType)Probability.DeepCopyInternal(); + if(QualitativeRisk != null) dest.QualitativeRisk = (Hl7.Fhir.Model.CodeableConcept)QualitativeRisk.DeepCopyInternal(); + if(RelativeRiskElement != null) dest.RelativeRiskElement = (Hl7.Fhir.Model.FhirDecimal)RelativeRiskElement.DeepCopyInternal(); + if(When != null) dest.When = (Hl7.Fhir.Model.DataType)When.DeepCopyInternal(); + if(RationaleElement != null) dest.RationaleElement = (Hl7.Fhir.Model.FhirString)RationaleElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new PredictionComponent()); + var instance = new PredictionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -595,7 +596,7 @@ public string Comment Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RiskAssessment; @@ -604,29 +605,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(BasedOn != null) dest.BasedOn = (Hl7.Fhir.Model.ResourceReference)BasedOn.DeepCopy(); - if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.DataType)Reason.DeepCopy(); - if(Basis.Any()) dest.Basis = new List(Basis.DeepCopy()); - if(Prediction.Any()) dest.Prediction = new List(Prediction.DeepCopy()); - if(MitigationElement != null) dest.MitigationElement = (Hl7.Fhir.Model.FhirString)MitigationElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(BasedOn != null) dest.BasedOn = (Hl7.Fhir.Model.ResourceReference)BasedOn.DeepCopyInternal(); + if(Parent != null) dest.Parent = (Hl7.Fhir.Model.ResourceReference)Parent.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Condition != null) dest.Condition = (Hl7.Fhir.Model.ResourceReference)Condition.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.DataType)Reason.DeepCopyInternal(); + if(Basis.Any()) dest.Basis = new List(Basis.DeepCopyInternal()); + if(Prediction.Any()) dest.Prediction = new List(Prediction.DeepCopyInternal()); + if(MitigationElement != null) dest.MitigationElement = (Hl7.Fhir.Model.FhirString)MitigationElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RiskAssessment()); + var instance = new RiskAssessment(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/SampledData.cs b/src/Hl7.Fhir.STU3/Model/Generated/SampledData.cs index 5b2a1b1c21..1c544992c6 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/SampledData.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/SampledData.cs @@ -263,7 +263,7 @@ public string Data } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SampledData; @@ -272,20 +272,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Origin != null) dest.Origin = (Hl7.Fhir.Model.Quantity)Origin.DeepCopy(); - if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopy(); - if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopy(); - if(LowerLimitElement != null) dest.LowerLimitElement = (Hl7.Fhir.Model.FhirDecimal)LowerLimitElement.DeepCopy(); - if(UpperLimitElement != null) dest.UpperLimitElement = (Hl7.Fhir.Model.FhirDecimal)UpperLimitElement.DeepCopy(); - if(DimensionsElement != null) dest.DimensionsElement = (Hl7.Fhir.Model.PositiveInt)DimensionsElement.DeepCopy(); - if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.FhirString)DataElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Origin != null) dest.Origin = (Hl7.Fhir.Model.Quantity)Origin.DeepCopyInternal(); + if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopyInternal(); + if(FactorElement != null) dest.FactorElement = (Hl7.Fhir.Model.FhirDecimal)FactorElement.DeepCopyInternal(); + if(LowerLimitElement != null) dest.LowerLimitElement = (Hl7.Fhir.Model.FhirDecimal)LowerLimitElement.DeepCopyInternal(); + if(UpperLimitElement != null) dest.UpperLimitElement = (Hl7.Fhir.Model.FhirDecimal)UpperLimitElement.DeepCopyInternal(); + if(DimensionsElement != null) dest.DimensionsElement = (Hl7.Fhir.Model.PositiveInt)DimensionsElement.DeepCopyInternal(); + if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.FhirString)DataElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SampledData()); + var instance = new SampledData(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Schedule.cs b/src/Hl7.Fhir.STU3/Model/Generated/Schedule.cs index 743a4664e8..1595460491 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Schedule.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Schedule.cs @@ -207,7 +207,7 @@ public string Comment List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Schedule; @@ -216,21 +216,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); - if(ServiceCategory != null) dest.ServiceCategory = (Hl7.Fhir.Model.CodeableConcept)ServiceCategory.DeepCopy(); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(Actor.Any()) dest.Actor = new List(Actor.DeepCopy()); - if(PlanningHorizon != null) dest.PlanningHorizon = (Hl7.Fhir.Model.Period)PlanningHorizon.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ActiveElement != null) dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopyInternal(); + if(ServiceCategory != null) dest.ServiceCategory = (Hl7.Fhir.Model.CodeableConcept)ServiceCategory.DeepCopyInternal(); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(Actor.Any()) dest.Actor = new List(Actor.DeepCopyInternal()); + if(PlanningHorizon != null) dest.PlanningHorizon = (Hl7.Fhir.Model.Period)PlanningHorizon.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Schedule()); + var instance = new Schedule(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/SearchParameter.cs b/src/Hl7.Fhir.STU3/Model/Generated/SearchParameter.cs index 93cc6f436e..da1c621a0b 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/SearchParameter.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/SearchParameter.cs @@ -298,7 +298,7 @@ public string Expression } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComponentComponent; @@ -307,15 +307,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.ResourceReference)Definition.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComponentComponent()); + var instance = new ComponentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1073,7 +1074,7 @@ public List Component private List _Component; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SearchParameter; @@ -1082,37 +1083,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(BaseElement.Any()) dest.BaseElement = new List>(BaseElement.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(DerivedFromElement != null) dest.DerivedFromElement = (Hl7.Fhir.Model.FhirUri)DerivedFromElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(XpathElement != null) dest.XpathElement = (Hl7.Fhir.Model.FhirString)XpathElement.DeepCopy(); - if(XpathUsageElement != null) dest.XpathUsageElement = (Code)XpathUsageElement.DeepCopy(); - if(TargetElement.Any()) dest.TargetElement = new List>(TargetElement.DeepCopy()); - if(ComparatorElement.Any()) dest.ComparatorElement = new List>(ComparatorElement.DeepCopy()); - if(ModifierElement.Any()) dest.ModifierElement = new List>(ModifierElement.DeepCopy()); - if(ChainElement.Any()) dest.ChainElement = new List(ChainElement.DeepCopy()); - if(Component.Any()) dest.Component = new List(Component.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(BaseElement.Any()) dest.BaseElement = new List>(BaseElement.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(DerivedFromElement != null) dest.DerivedFromElement = (Hl7.Fhir.Model.FhirUri)DerivedFromElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(XpathElement != null) dest.XpathElement = (Hl7.Fhir.Model.FhirString)XpathElement.DeepCopyInternal(); + if(XpathUsageElement != null) dest.XpathUsageElement = (Code)XpathUsageElement.DeepCopyInternal(); + if(TargetElement.Any()) dest.TargetElement = new List>(TargetElement.DeepCopyInternal()); + if(ComparatorElement.Any()) dest.ComparatorElement = new List>(ComparatorElement.DeepCopyInternal()); + if(ModifierElement.Any()) dest.ModifierElement = new List>(ModifierElement.DeepCopyInternal()); + if(ChainElement.Any()) dest.ChainElement = new List(ChainElement.DeepCopyInternal()); + if(Component.Any()) dest.Component = new List(Component.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SearchParameter()); + var instance = new SearchParameter(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Sequence.cs b/src/Hl7.Fhir.STU3/Model/Generated/Sequence.cs index 3d1683ca54..8805fde0a2 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Sequence.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Sequence.cs @@ -343,7 +343,7 @@ public int? WindowEnd } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ReferenceSeqComponent; @@ -352,21 +352,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Chromosome != null) dest.Chromosome = (Hl7.Fhir.Model.CodeableConcept)Chromosome.DeepCopy(); - if(GenomeBuildElement != null) dest.GenomeBuildElement = (Hl7.Fhir.Model.FhirString)GenomeBuildElement.DeepCopy(); - if(ReferenceSeqId != null) dest.ReferenceSeqId = (Hl7.Fhir.Model.CodeableConcept)ReferenceSeqId.DeepCopy(); - if(ReferenceSeqPointer != null) dest.ReferenceSeqPointer = (Hl7.Fhir.Model.ResourceReference)ReferenceSeqPointer.DeepCopy(); - if(ReferenceSeqStringElement != null) dest.ReferenceSeqStringElement = (Hl7.Fhir.Model.FhirString)ReferenceSeqStringElement.DeepCopy(); - if(StrandElement != null) dest.StrandElement = (Hl7.Fhir.Model.Integer)StrandElement.DeepCopy(); - if(WindowStartElement != null) dest.WindowStartElement = (Hl7.Fhir.Model.Integer)WindowStartElement.DeepCopy(); - if(WindowEndElement != null) dest.WindowEndElement = (Hl7.Fhir.Model.Integer)WindowEndElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Chromosome != null) dest.Chromosome = (Hl7.Fhir.Model.CodeableConcept)Chromosome.DeepCopyInternal(); + if(GenomeBuildElement != null) dest.GenomeBuildElement = (Hl7.Fhir.Model.FhirString)GenomeBuildElement.DeepCopyInternal(); + if(ReferenceSeqId != null) dest.ReferenceSeqId = (Hl7.Fhir.Model.CodeableConcept)ReferenceSeqId.DeepCopyInternal(); + if(ReferenceSeqPointer != null) dest.ReferenceSeqPointer = (Hl7.Fhir.Model.ResourceReference)ReferenceSeqPointer.DeepCopyInternal(); + if(ReferenceSeqStringElement != null) dest.ReferenceSeqStringElement = (Hl7.Fhir.Model.FhirString)ReferenceSeqStringElement.DeepCopyInternal(); + if(StrandElement != null) dest.StrandElement = (Hl7.Fhir.Model.Integer)StrandElement.DeepCopyInternal(); + if(WindowStartElement != null) dest.WindowStartElement = (Hl7.Fhir.Model.Integer)WindowStartElement.DeepCopyInternal(); + if(WindowEndElement != null) dest.WindowEndElement = (Hl7.Fhir.Model.Integer)WindowEndElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ReferenceSeqComponent()); + var instance = new ReferenceSeqComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -656,7 +657,7 @@ public Hl7.Fhir.Model.ResourceReference VariantPointer private Hl7.Fhir.Model.ResourceReference _VariantPointer; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VariantComponent; @@ -665,19 +666,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopy(); - if(ObservedAlleleElement != null) dest.ObservedAlleleElement = (Hl7.Fhir.Model.FhirString)ObservedAlleleElement.DeepCopy(); - if(ReferenceAlleleElement != null) dest.ReferenceAlleleElement = (Hl7.Fhir.Model.FhirString)ReferenceAlleleElement.DeepCopy(); - if(CigarElement != null) dest.CigarElement = (Hl7.Fhir.Model.FhirString)CigarElement.DeepCopy(); - if(VariantPointer != null) dest.VariantPointer = (Hl7.Fhir.Model.ResourceReference)VariantPointer.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopyInternal(); + if(ObservedAlleleElement != null) dest.ObservedAlleleElement = (Hl7.Fhir.Model.FhirString)ObservedAlleleElement.DeepCopyInternal(); + if(ReferenceAlleleElement != null) dest.ReferenceAlleleElement = (Hl7.Fhir.Model.FhirString)ReferenceAlleleElement.DeepCopyInternal(); + if(CigarElement != null) dest.CigarElement = (Hl7.Fhir.Model.FhirString)CigarElement.DeepCopyInternal(); + if(VariantPointer != null) dest.VariantPointer = (Hl7.Fhir.Model.ResourceReference)VariantPointer.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VariantComponent()); + var instance = new VariantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1166,7 +1168,7 @@ public decimal? FScore } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as QualityComponent; @@ -1175,27 +1177,28 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(StandardSequence != null) dest.StandardSequence = (Hl7.Fhir.Model.CodeableConcept)StandardSequence.DeepCopy(); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopy(); - if(Score != null) dest.Score = (Hl7.Fhir.Model.Quantity)Score.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(TruthTPElement != null) dest.TruthTPElement = (Hl7.Fhir.Model.FhirDecimal)TruthTPElement.DeepCopy(); - if(QueryTPElement != null) dest.QueryTPElement = (Hl7.Fhir.Model.FhirDecimal)QueryTPElement.DeepCopy(); - if(TruthFNElement != null) dest.TruthFNElement = (Hl7.Fhir.Model.FhirDecimal)TruthFNElement.DeepCopy(); - if(QueryFPElement != null) dest.QueryFPElement = (Hl7.Fhir.Model.FhirDecimal)QueryFPElement.DeepCopy(); - if(GtFPElement != null) dest.GtFPElement = (Hl7.Fhir.Model.FhirDecimal)GtFPElement.DeepCopy(); - if(PrecisionElement != null) dest.PrecisionElement = (Hl7.Fhir.Model.FhirDecimal)PrecisionElement.DeepCopy(); - if(RecallElement != null) dest.RecallElement = (Hl7.Fhir.Model.FhirDecimal)RecallElement.DeepCopy(); - if(FScoreElement != null) dest.FScoreElement = (Hl7.Fhir.Model.FhirDecimal)FScoreElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(StandardSequence != null) dest.StandardSequence = (Hl7.Fhir.Model.CodeableConcept)StandardSequence.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Integer)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Integer)EndElement.DeepCopyInternal(); + if(Score != null) dest.Score = (Hl7.Fhir.Model.Quantity)Score.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(TruthTPElement != null) dest.TruthTPElement = (Hl7.Fhir.Model.FhirDecimal)TruthTPElement.DeepCopyInternal(); + if(QueryTPElement != null) dest.QueryTPElement = (Hl7.Fhir.Model.FhirDecimal)QueryTPElement.DeepCopyInternal(); + if(TruthFNElement != null) dest.TruthFNElement = (Hl7.Fhir.Model.FhirDecimal)TruthFNElement.DeepCopyInternal(); + if(QueryFPElement != null) dest.QueryFPElement = (Hl7.Fhir.Model.FhirDecimal)QueryFPElement.DeepCopyInternal(); + if(GtFPElement != null) dest.GtFPElement = (Hl7.Fhir.Model.FhirDecimal)GtFPElement.DeepCopyInternal(); + if(PrecisionElement != null) dest.PrecisionElement = (Hl7.Fhir.Model.FhirDecimal)PrecisionElement.DeepCopyInternal(); + if(RecallElement != null) dest.RecallElement = (Hl7.Fhir.Model.FhirDecimal)RecallElement.DeepCopyInternal(); + if(FScoreElement != null) dest.FScoreElement = (Hl7.Fhir.Model.FhirDecimal)FScoreElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new QualityComponent()); + var instance = new QualityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1552,7 +1555,7 @@ public string ReadsetId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepositoryComponent; @@ -1561,19 +1564,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DatasetIdElement != null) dest.DatasetIdElement = (Hl7.Fhir.Model.FhirString)DatasetIdElement.DeepCopy(); - if(VariantsetIdElement != null) dest.VariantsetIdElement = (Hl7.Fhir.Model.FhirString)VariantsetIdElement.DeepCopy(); - if(ReadsetIdElement != null) dest.ReadsetIdElement = (Hl7.Fhir.Model.FhirString)ReadsetIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DatasetIdElement != null) dest.DatasetIdElement = (Hl7.Fhir.Model.FhirString)DatasetIdElement.DeepCopyInternal(); + if(VariantsetIdElement != null) dest.VariantsetIdElement = (Hl7.Fhir.Model.FhirString)VariantsetIdElement.DeepCopyInternal(); + if(ReadsetIdElement != null) dest.ReadsetIdElement = (Hl7.Fhir.Model.FhirString)ReadsetIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepositoryComponent()); + var instance = new RepositoryComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1947,7 +1951,7 @@ public List Pointer List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Sequence; @@ -1956,28 +1960,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.Code)TypeElement.DeepCopy(); - if(CoordinateSystemElement != null) dest.CoordinateSystemElement = (Hl7.Fhir.Model.Integer)CoordinateSystemElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopy(); - if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); - if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(ReferenceSeq != null) dest.ReferenceSeq = (Hl7.Fhir.Model.Sequence.ReferenceSeqComponent)ReferenceSeq.DeepCopy(); - if(Variant.Any()) dest.Variant = new List(Variant.DeepCopy()); - if(ObservedSeqElement != null) dest.ObservedSeqElement = (Hl7.Fhir.Model.FhirString)ObservedSeqElement.DeepCopy(); - if(Quality.Any()) dest.Quality = new List(Quality.DeepCopy()); - if(ReadCoverageElement != null) dest.ReadCoverageElement = (Hl7.Fhir.Model.Integer)ReadCoverageElement.DeepCopy(); - if(Repository.Any()) dest.Repository = new List(Repository.DeepCopy()); - if(Pointer.Any()) dest.Pointer = new List(Pointer.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.Code)TypeElement.DeepCopyInternal(); + if(CoordinateSystemElement != null) dest.CoordinateSystemElement = (Hl7.Fhir.Model.Integer)CoordinateSystemElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Specimen != null) dest.Specimen = (Hl7.Fhir.Model.ResourceReference)Specimen.DeepCopyInternal(); + if(Device != null) dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopyInternal(); + if(Performer != null) dest.Performer = (Hl7.Fhir.Model.ResourceReference)Performer.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(ReferenceSeq != null) dest.ReferenceSeq = (Hl7.Fhir.Model.Sequence.ReferenceSeqComponent)ReferenceSeq.DeepCopyInternal(); + if(Variant.Any()) dest.Variant = new List(Variant.DeepCopyInternal()); + if(ObservedSeqElement != null) dest.ObservedSeqElement = (Hl7.Fhir.Model.FhirString)ObservedSeqElement.DeepCopyInternal(); + if(Quality.Any()) dest.Quality = new List(Quality.DeepCopyInternal()); + if(ReadCoverageElement != null) dest.ReadCoverageElement = (Hl7.Fhir.Model.Integer)ReadCoverageElement.DeepCopyInternal(); + if(Repository.Any()) dest.Repository = new List(Repository.DeepCopyInternal()); + if(Pointer.Any()) dest.Pointer = new List(Pointer.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Sequence()); + var instance = new Sequence(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ServiceDefinition.cs b/src/Hl7.Fhir.STU3/Model/Generated/ServiceDefinition.cs index 5fc77b7172..078a96b2ae 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ServiceDefinition.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ServiceDefinition.cs @@ -654,7 +654,7 @@ public Hl7.Fhir.Model.ResourceReference OperationDefinition List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ServiceDefinition; @@ -663,38 +663,39 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy(); - if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy(); - if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy(); - if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(Topic.Any()) dest.Topic = new List(Topic.DeepCopy()); - if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopy()); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopy()); - if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopy()); - if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopy()); - if(OperationDefinition != null) dest.OperationDefinition = (Hl7.Fhir.Model.ResourceReference)OperationDefinition.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new ServiceDefinition()); + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(UsageElement != null) dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopyInternal(); + if(ApprovalDateElement != null) dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopyInternal(); + if(LastReviewDateElement != null) dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopyInternal(); + if(EffectivePeriod != null) dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(Topic.Any()) dest.Topic = new List(Topic.DeepCopyInternal()); + if(Contributor.Any()) dest.Contributor = new List(Contributor.DeepCopyInternal()); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(RelatedArtifact.Any()) dest.RelatedArtifact = new List(RelatedArtifact.DeepCopyInternal()); + if(Trigger.Any()) dest.Trigger = new List(Trigger.DeepCopyInternal()); + if(DataRequirement.Any()) dest.DataRequirement = new List(DataRequirement.DeepCopyInternal()); + if(OperationDefinition != null) dest.OperationDefinition = (Hl7.Fhir.Model.ResourceReference)OperationDefinition.DeepCopyInternal(); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new ServiceDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Slot.cs b/src/Hl7.Fhir.STU3/Model/Generated/Slot.cs index aeb488dbe0..9d5858425b 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Slot.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Slot.cs @@ -346,7 +346,7 @@ public string Comment List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Slot; @@ -355,24 +355,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(ServiceCategory != null) dest.ServiceCategory = (Hl7.Fhir.Model.CodeableConcept)ServiceCategory.DeepCopy(); - if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopy()); - if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopy()); - if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopy(); - if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.ResourceReference)Schedule.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy(); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(OverbookedElement != null) dest.OverbookedElement = (Hl7.Fhir.Model.FhirBoolean)OverbookedElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(ServiceCategory != null) dest.ServiceCategory = (Hl7.Fhir.Model.CodeableConcept)ServiceCategory.DeepCopyInternal(); + if(ServiceType.Any()) dest.ServiceType = new List(ServiceType.DeepCopyInternal()); + if(Specialty.Any()) dest.Specialty = new List(Specialty.DeepCopyInternal()); + if(AppointmentType != null) dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopyInternal(); + if(Schedule != null) dest.Schedule = (Hl7.Fhir.Model.ResourceReference)Schedule.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StartElement != null) dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopyInternal(); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(OverbookedElement != null) dest.OverbookedElement = (Hl7.Fhir.Model.FhirBoolean)OverbookedElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Slot()); + var instance = new Slot(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Specimen.cs b/src/Hl7.Fhir.STU3/Model/Generated/Specimen.cs index d261cf8435..4a891c30ed 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Specimen.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Specimen.cs @@ -180,7 +180,7 @@ public Hl7.Fhir.Model.CodeableConcept BodySite private Hl7.Fhir.Model.CodeableConcept _BodySite; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CollectionComponent; @@ -189,18 +189,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopy(); - if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopy(); - if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Collector != null) dest.Collector = (Hl7.Fhir.Model.ResourceReference)Collector.DeepCopyInternal(); + if(Collected != null) dest.Collected = (Hl7.Fhir.Model.DataType)Collected.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Method != null) dest.Method = (Hl7.Fhir.Model.CodeableConcept)Method.DeepCopyInternal(); + if(BodySite != null) dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CollectionComponent()); + var instance = new CollectionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -372,7 +373,7 @@ public Hl7.Fhir.Model.DataType Time private Hl7.Fhir.Model.DataType _Time; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ProcessingComponent; @@ -381,17 +382,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.CodeableConcept)Procedure.DeepCopy(); - if(Additive.Any()) dest.Additive = new List(Additive.DeepCopy()); - if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Procedure != null) dest.Procedure = (Hl7.Fhir.Model.CodeableConcept)Procedure.DeepCopyInternal(); + if(Additive.Any()) dest.Additive = new List(Additive.DeepCopyInternal()); + if(Time != null) dest.Time = (Hl7.Fhir.Model.DataType)Time.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ProcessingComponent()); + var instance = new ProcessingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -581,7 +583,7 @@ public Hl7.Fhir.Model.DataType Additive private Hl7.Fhir.Model.DataType _Additive; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainerComponent; @@ -590,19 +592,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Capacity != null) dest.Capacity = (Hl7.Fhir.Model.Quantity)Capacity.DeepCopy(); - if(SpecimenQuantity != null) dest.SpecimenQuantity = (Hl7.Fhir.Model.Quantity)SpecimenQuantity.DeepCopy(); - if(Additive != null) dest.Additive = (Hl7.Fhir.Model.DataType)Additive.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Capacity != null) dest.Capacity = (Hl7.Fhir.Model.Quantity)Capacity.DeepCopyInternal(); + if(SpecimenQuantity != null) dest.SpecimenQuantity = (Hl7.Fhir.Model.Quantity)SpecimenQuantity.DeepCopyInternal(); + if(Additive != null) dest.Additive = (Hl7.Fhir.Model.DataType)Additive.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainerComponent()); + var instance = new ContainerComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -900,7 +903,7 @@ public List Note List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Specimen; @@ -909,25 +912,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(AccessionIdentifier != null) dest.AccessionIdentifier = (Hl7.Fhir.Model.Identifier)AccessionIdentifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); - if(ReceivedTimeElement != null) dest.ReceivedTimeElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedTimeElement.DeepCopy(); - if(Parent.Any()) dest.Parent = new List(Parent.DeepCopy()); - if(Request.Any()) dest.Request = new List(Request.DeepCopy()); - if(Collection != null) dest.Collection = (Hl7.Fhir.Model.Specimen.CollectionComponent)Collection.DeepCopy(); - if(Processing.Any()) dest.Processing = new List(Processing.DeepCopy()); - if(Container.Any()) dest.Container = new List(Container.DeepCopy()); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(AccessionIdentifier != null) dest.AccessionIdentifier = (Hl7.Fhir.Model.Identifier)AccessionIdentifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Subject != null) dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopyInternal(); + if(ReceivedTimeElement != null) dest.ReceivedTimeElement = (Hl7.Fhir.Model.FhirDateTime)ReceivedTimeElement.DeepCopyInternal(); + if(Parent.Any()) dest.Parent = new List(Parent.DeepCopyInternal()); + if(Request.Any()) dest.Request = new List(Request.DeepCopyInternal()); + if(Collection != null) dest.Collection = (Hl7.Fhir.Model.Specimen.CollectionComponent)Collection.DeepCopyInternal(); + if(Processing.Any()) dest.Processing = new List(Processing.DeepCopyInternal()); + if(Container.Any()) dest.Container = new List(Container.DeepCopyInternal()); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Specimen()); + var instance = new Specimen(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/StructureDefinition.cs b/src/Hl7.Fhir.STU3/Model/Generated/StructureDefinition.cs index 5fb0af0042..660462b5ad 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/StructureDefinition.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/StructureDefinition.cs @@ -284,7 +284,7 @@ public string Comment } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MappingComponent; @@ -293,17 +293,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IdentityElement != null) dest.IdentityElement = (Hl7.Fhir.Model.Id)IdentityElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IdentityElement != null) dest.IdentityElement = (Hl7.Fhir.Model.Id)IdentityElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(CommentElement != null) dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MappingComponent()); + var instance = new MappingComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -405,7 +406,7 @@ public List Element private List _Element; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SnapshotComponent; @@ -414,14 +415,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Element.Any()) dest.Element = new List(Element.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Element.Any()) dest.Element = new List(Element.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SnapshotComponent()); + var instance = new SnapshotComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -499,7 +501,7 @@ public List Element private List _Element; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DifferentialComponent; @@ -508,14 +510,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Element.Any()) dest.Element = new List(Element.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Element.Any()) dest.Element = new List(Element.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DifferentialComponent()); + var instance = new DifferentialComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1314,7 +1317,7 @@ public Hl7.Fhir.Model.StructureDefinition.DifferentialComponent Differential List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureDefinition; @@ -1323,41 +1326,42 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(Keyword.Any()) dest.Keyword = new List(Keyword.DeepCopy()); - if(FhirVersionElement != null) dest.FhirVersionElement = (Hl7.Fhir.Model.Id)FhirVersionElement.DeepCopy(); - if(Mapping.Any()) dest.Mapping = new List(Mapping.DeepCopy()); - if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopy(); - if(AbstractElement != null) dest.AbstractElement = (Hl7.Fhir.Model.FhirBoolean)AbstractElement.DeepCopy(); - if(ContextTypeElement != null) dest.ContextTypeElement = (Code)ContextTypeElement.DeepCopy(); - if(ContextElement.Any()) dest.ContextElement = new List(ContextElement.DeepCopy()); - if(ContextInvariantElement.Any()) dest.ContextInvariantElement = new List(ContextInvariantElement.DeepCopy()); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.Code)TypeElement.DeepCopy(); - if(BaseDefinitionElement != null) dest.BaseDefinitionElement = (Hl7.Fhir.Model.FhirUri)BaseDefinitionElement.DeepCopy(); - if(DerivationElement != null) dest.DerivationElement = (Code)DerivationElement.DeepCopy(); - if(Snapshot != null) dest.Snapshot = (Hl7.Fhir.Model.StructureDefinition.SnapshotComponent)Snapshot.DeepCopy(); - if(Differential != null) dest.Differential = (Hl7.Fhir.Model.StructureDefinition.DifferentialComponent)Differential.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(Keyword.Any()) dest.Keyword = new List(Keyword.DeepCopyInternal()); + if(FhirVersionElement != null) dest.FhirVersionElement = (Hl7.Fhir.Model.Id)FhirVersionElement.DeepCopyInternal(); + if(Mapping.Any()) dest.Mapping = new List(Mapping.DeepCopyInternal()); + if(KindElement != null) dest.KindElement = (Code)KindElement.DeepCopyInternal(); + if(AbstractElement != null) dest.AbstractElement = (Hl7.Fhir.Model.FhirBoolean)AbstractElement.DeepCopyInternal(); + if(ContextTypeElement != null) dest.ContextTypeElement = (Code)ContextTypeElement.DeepCopyInternal(); + if(ContextElement.Any()) dest.ContextElement = new List(ContextElement.DeepCopyInternal()); + if(ContextInvariantElement.Any()) dest.ContextInvariantElement = new List(ContextInvariantElement.DeepCopyInternal()); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.Code)TypeElement.DeepCopyInternal(); + if(BaseDefinitionElement != null) dest.BaseDefinitionElement = (Hl7.Fhir.Model.FhirUri)BaseDefinitionElement.DeepCopyInternal(); + if(DerivationElement != null) dest.DerivationElement = (Code)DerivationElement.DeepCopyInternal(); + if(Snapshot != null) dest.Snapshot = (Hl7.Fhir.Model.StructureDefinition.SnapshotComponent)Snapshot.DeepCopyInternal(); + if(Differential != null) dest.Differential = (Hl7.Fhir.Model.StructureDefinition.DifferentialComponent)Differential.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureDefinition()); + var instance = new StructureDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/StructureMap.cs b/src/Hl7.Fhir.STU3/Model/Generated/StructureMap.cs index 77e4937bcb..659949ec98 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/StructureMap.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/StructureMap.cs @@ -493,7 +493,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureComponent; @@ -502,17 +502,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(AliasElement != null) dest.AliasElement = (Hl7.Fhir.Model.FhirString)AliasElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(AliasElement != null) dest.AliasElement = (Hl7.Fhir.Model.FhirString)AliasElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureComponent()); + var instance = new StructureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -756,7 +757,7 @@ public List Rule private List _Rule; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as GroupComponent; @@ -765,19 +766,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(ExtendsElement != null) dest.ExtendsElement = (Hl7.Fhir.Model.Id)ExtendsElement.DeepCopy(); - if(TypeModeElement != null) dest.TypeModeElement = (Code)TypeModeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(ExtendsElement != null) dest.ExtendsElement = (Hl7.Fhir.Model.Id)ExtendsElement.DeepCopyInternal(); + if(TypeModeElement != null) dest.TypeModeElement = (Code)TypeModeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new GroupComponent()); + var instance = new GroupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1010,7 +1012,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InputComponent; @@ -1019,17 +1021,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopy(); - if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopy(); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopyInternal(); + if(ModeElement != null) dest.ModeElement = (Code)ModeElement.DeepCopyInternal(); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InputComponent()); + var instance = new InputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1233,7 +1236,7 @@ public string Documentation } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RuleComponent; @@ -1242,19 +1245,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(Source.Any()) dest.Source = new List(Source.DeepCopy()); - if(Target.Any()) dest.Target = new List(Target.DeepCopy()); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - if(Dependent.Any()) dest.Dependent = new List(Dependent.DeepCopy()); - if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(Source.Any()) dest.Source = new List(Source.DeepCopyInternal()); + if(Target.Any()) dest.Target = new List(Target.DeepCopyInternal()); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); + if(Dependent.Any()) dest.Dependent = new List(Dependent.DeepCopyInternal()); + if(DocumentationElement != null) dest.DocumentationElement = (Hl7.Fhir.Model.FhirString)DocumentationElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RuleComponent()); + var instance = new RuleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1652,7 +1656,7 @@ public string Check } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SourceComponent; @@ -1661,23 +1665,24 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopy(); - if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopy(); - if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopy(); - if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopy(); - if(DefaultValue != null) dest.DefaultValue = (Hl7.Fhir.Model.DataType)DefaultValue.DeepCopy(); - if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopy(); - if(ListModeElement != null) dest.ListModeElement = (Code)ListModeElement.DeepCopy(); - if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopy(); - if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopy(); - if(CheckElement != null) dest.CheckElement = (Hl7.Fhir.Model.FhirString)CheckElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopyInternal(); + if(MinElement != null) dest.MinElement = (Hl7.Fhir.Model.Integer)MinElement.DeepCopyInternal(); + if(MaxElement != null) dest.MaxElement = (Hl7.Fhir.Model.FhirString)MaxElement.DeepCopyInternal(); + if(TypeElement != null) dest.TypeElement = (Hl7.Fhir.Model.FhirString)TypeElement.DeepCopyInternal(); + if(DefaultValue != null) dest.DefaultValue = (Hl7.Fhir.Model.DataType)DefaultValue.DeepCopyInternal(); + if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopyInternal(); + if(ListModeElement != null) dest.ListModeElement = (Code)ListModeElement.DeepCopyInternal(); + if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopyInternal(); + if(ConditionElement != null) dest.ConditionElement = (Hl7.Fhir.Model.FhirString)ConditionElement.DeepCopyInternal(); + if(CheckElement != null) dest.CheckElement = (Hl7.Fhir.Model.FhirString)CheckElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SourceComponent()); + var instance = new SourceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2048,7 +2053,7 @@ public List Parameter private List _Parameter; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TargetComponent; @@ -2057,21 +2062,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopy(); - if(ContextTypeElement != null) dest.ContextTypeElement = (Code)ContextTypeElement.DeepCopy(); - if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopy(); - if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopy(); - if(ListModeElement.Any()) dest.ListModeElement = new List>(ListModeElement.DeepCopy()); - if(ListRuleIdElement != null) dest.ListRuleIdElement = (Hl7.Fhir.Model.Id)ListRuleIdElement.DeepCopy(); - if(TransformElement != null) dest.TransformElement = (Code)TransformElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(ContextElement != null) dest.ContextElement = (Hl7.Fhir.Model.Id)ContextElement.DeepCopyInternal(); + if(ContextTypeElement != null) dest.ContextTypeElement = (Code)ContextTypeElement.DeepCopyInternal(); + if(ElementElement != null) dest.ElementElement = (Hl7.Fhir.Model.FhirString)ElementElement.DeepCopyInternal(); + if(VariableElement != null) dest.VariableElement = (Hl7.Fhir.Model.Id)VariableElement.DeepCopyInternal(); + if(ListModeElement.Any()) dest.ListModeElement = new List>(ListModeElement.DeepCopyInternal()); + if(ListRuleIdElement != null) dest.ListRuleIdElement = (Hl7.Fhir.Model.Id)ListRuleIdElement.DeepCopyInternal(); + if(TransformElement != null) dest.TransformElement = (Code)TransformElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TargetComponent()); + var instance = new TargetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2204,7 +2210,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -2213,14 +2219,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2345,7 +2352,7 @@ public IEnumerable Variable } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DependentComponent; @@ -2354,15 +2361,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopy(); - if(VariableElement.Any()) dest.VariableElement = new List(VariableElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.Id)NameElement.DeepCopyInternal(); + if(VariableElement.Any()) dest.VariableElement = new List(VariableElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DependentComponent()); + var instance = new DependentComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2883,7 +2891,7 @@ public List Group List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as StructureMap; @@ -2892,31 +2900,32 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(Structure.Any()) dest.Structure = new List(Structure.DeepCopy()); - if(ImportElement.Any()) dest.ImportElement = new List(ImportElement.DeepCopy()); - if(Group.Any()) dest.Group = new List(Group.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(Structure.Any()) dest.Structure = new List(Structure.DeepCopyInternal()); + if(ImportElement.Any()) dest.ImportElement = new List(ImportElement.DeepCopyInternal()); + if(Group.Any()) dest.Group = new List(Group.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new StructureMap()); + var instance = new StructureMap(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Subscription.cs b/src/Hl7.Fhir.STU3/Model/Generated/Subscription.cs index 8552d37a82..02412bedef 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Subscription.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Subscription.cs @@ -277,7 +277,7 @@ public IEnumerable Header } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ChannelComponent; @@ -286,17 +286,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUri)EndpointElement.DeepCopy(); - if(PayloadElement != null) dest.PayloadElement = (Hl7.Fhir.Model.FhirString)PayloadElement.DeepCopy(); - if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(EndpointElement != null) dest.EndpointElement = (Hl7.Fhir.Model.FhirUri)EndpointElement.DeepCopyInternal(); + if(PayloadElement != null) dest.PayloadElement = (Hl7.Fhir.Model.FhirString)PayloadElement.DeepCopyInternal(); + if(HeaderElement.Any()) dest.HeaderElement = new List(HeaderElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ChannelComponent()); + var instance = new ChannelComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -571,7 +572,7 @@ public List Tag private List _Tag; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Subscription; @@ -580,21 +581,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy(); - if(ReasonElement != null) dest.ReasonElement = (Hl7.Fhir.Model.FhirString)ReasonElement.DeepCopy(); - if(CriteriaElement != null) dest.CriteriaElement = (Hl7.Fhir.Model.FhirString)CriteriaElement.DeepCopy(); - if(ErrorElement != null) dest.ErrorElement = (Hl7.Fhir.Model.FhirString)ErrorElement.DeepCopy(); - if(Channel != null) dest.Channel = (Hl7.Fhir.Model.Subscription.ChannelComponent)Channel.DeepCopy(); - if(Tag.Any()) dest.Tag = new List(Tag.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(EndElement != null) dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopyInternal(); + if(ReasonElement != null) dest.ReasonElement = (Hl7.Fhir.Model.FhirString)ReasonElement.DeepCopyInternal(); + if(CriteriaElement != null) dest.CriteriaElement = (Hl7.Fhir.Model.FhirString)CriteriaElement.DeepCopyInternal(); + if(ErrorElement != null) dest.ErrorElement = (Hl7.Fhir.Model.FhirString)ErrorElement.DeepCopyInternal(); + if(Channel != null) dest.Channel = (Hl7.Fhir.Model.Subscription.ChannelComponent)Channel.DeepCopyInternal(); + if(Tag.Any()) dest.Tag = new List(Tag.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Subscription()); + var instance = new Subscription(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Substance.cs b/src/Hl7.Fhir.STU3/Model/Generated/Substance.cs index b6005fd66f..10665431f4 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Substance.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Substance.cs @@ -157,7 +157,7 @@ public Hl7.Fhir.Model.Quantity Quantity private Hl7.Fhir.Model.Quantity _Quantity; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as InstanceComponent; @@ -166,16 +166,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopy(); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(ExpiryElement != null) dest.ExpiryElement = (Hl7.Fhir.Model.FhirDateTime)ExpiryElement.DeepCopyInternal(); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new InstanceComponent()); + var instance = new InstanceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -286,7 +287,7 @@ public Hl7.Fhir.Model.DataType Substance private Hl7.Fhir.Model.DataType _Substance; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as IngredientComponent; @@ -295,15 +296,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Ratio)Quantity.DeepCopy(); - if(Substance != null) dest.Substance = (Hl7.Fhir.Model.DataType)Substance.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Ratio)Quantity.DeepCopyInternal(); + if(Substance != null) dest.Substance = (Hl7.Fhir.Model.DataType)Substance.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new IngredientComponent()); + var instance = new IngredientComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -497,7 +499,7 @@ public List Ingredient List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Substance; @@ -506,20 +508,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category.Any()) dest.Category = new List(Category.DeepCopy()); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Instance.Any()) dest.Instance = new List(Instance.DeepCopy()); - if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category.Any()) dest.Category = new List(Category.DeepCopyInternal()); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Instance.Any()) dest.Instance = new List(Instance.DeepCopyInternal()); + if(Ingredient.Any()) dest.Ingredient = new List(Ingredient.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Substance()); + var instance = new Substance(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/SupplyDelivery.cs b/src/Hl7.Fhir.STU3/Model/Generated/SupplyDelivery.cs index ab6e1984d8..36ede8b9bf 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/SupplyDelivery.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/SupplyDelivery.cs @@ -161,7 +161,7 @@ public Hl7.Fhir.Model.DataType Item private Hl7.Fhir.Model.DataType _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SuppliedItemComponent; @@ -170,15 +170,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SuppliedItemComponent()); + var instance = new SuppliedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -417,7 +418,7 @@ public List Receiver Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplyDelivery; @@ -426,24 +427,25 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(SuppliedItem != null) dest.SuppliedItem = (Hl7.Fhir.Model.SupplyDelivery.SuppliedItemComponent)SuppliedItem.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(Supplier != null) dest.Supplier = (Hl7.Fhir.Model.ResourceReference)Supplier.DeepCopy(); - if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); - if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(SuppliedItem != null) dest.SuppliedItem = (Hl7.Fhir.Model.SupplyDelivery.SuppliedItemComponent)SuppliedItem.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(Supplier != null) dest.Supplier = (Hl7.Fhir.Model.ResourceReference)Supplier.DeepCopyInternal(); + if(Destination != null) dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopyInternal(); + if(Receiver.Any()) dest.Receiver = new List(Receiver.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplyDelivery()); + var instance = new SupplyDelivery(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/SupplyRequest.cs b/src/Hl7.Fhir.STU3/Model/Generated/SupplyRequest.cs index cd7180ae95..b9d32d1fbc 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/SupplyRequest.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/SupplyRequest.cs @@ -155,7 +155,7 @@ public Hl7.Fhir.Model.DataType Item private Hl7.Fhir.Model.DataType _Item; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OrderedItemComponent; @@ -164,15 +164,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); - if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Quantity != null) dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopyInternal(); + if(Item != null) dest.Item = (Hl7.Fhir.Model.DataType)Item.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OrderedItemComponent()); + var instance = new OrderedItemComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -275,7 +276,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequesterComponent; @@ -284,15 +285,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequesterComponent()); + var instance = new RequesterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -578,7 +580,7 @@ public Hl7.Fhir.Model.ResourceReference DeliverTo Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SupplyRequest; @@ -587,25 +589,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(OrderedItem != null) dest.OrderedItem = (Hl7.Fhir.Model.SupplyRequest.OrderedItemComponent)OrderedItem.DeepCopy(); - if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.SupplyRequest.RequesterComponent)Requester.DeepCopy(); - if(Supplier.Any()) dest.Supplier = new List(Supplier.DeepCopy()); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.DataType)Reason.DeepCopy(); - if(DeliverFrom != null) dest.DeliverFrom = (Hl7.Fhir.Model.ResourceReference)DeliverFrom.DeepCopy(); - if(DeliverTo != null) dest.DeliverTo = (Hl7.Fhir.Model.ResourceReference)DeliverTo.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Category != null) dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(OrderedItem != null) dest.OrderedItem = (Hl7.Fhir.Model.SupplyRequest.OrderedItemComponent)OrderedItem.DeepCopyInternal(); + if(Occurrence != null) dest.Occurrence = (Hl7.Fhir.Model.DataType)Occurrence.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.SupplyRequest.RequesterComponent)Requester.DeepCopyInternal(); + if(Supplier.Any()) dest.Supplier = new List(Supplier.DeepCopyInternal()); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.DataType)Reason.DeepCopyInternal(); + if(DeliverFrom != null) dest.DeliverFrom = (Hl7.Fhir.Model.ResourceReference)DeliverFrom.DeepCopyInternal(); + if(DeliverTo != null) dest.DeliverTo = (Hl7.Fhir.Model.ResourceReference)DeliverTo.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SupplyRequest()); + var instance = new SupplyRequest(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Task.cs b/src/Hl7.Fhir.STU3/Model/Generated/Task.cs index d337045a71..109ada6bd7 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Task.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Task.cs @@ -185,7 +185,7 @@ public Hl7.Fhir.Model.ResourceReference OnBehalfOf private Hl7.Fhir.Model.ResourceReference _OnBehalfOf; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequesterComponent; @@ -194,15 +194,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopy(); - if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Agent != null) dest.Agent = (Hl7.Fhir.Model.ResourceReference)Agent.DeepCopyInternal(); + if(OnBehalfOf != null) dest.OnBehalfOf = (Hl7.Fhir.Model.ResourceReference)OnBehalfOf.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequesterComponent()); + var instance = new RequesterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -334,7 +335,7 @@ public List Recipient private List _Recipient; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RestrictionComponent; @@ -343,16 +344,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RepetitionsElement != null) dest.RepetitionsElement = (Hl7.Fhir.Model.PositiveInt)RepetitionsElement.DeepCopy(); - if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy(); - if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RepetitionsElement != null) dest.RepetitionsElement = (Hl7.Fhir.Model.PositiveInt)RepetitionsElement.DeepCopyInternal(); + if(Period != null) dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopyInternal(); + if(Recipient.Any()) dest.Recipient = new List(Recipient.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RestrictionComponent()); + var instance = new RestrictionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -463,7 +465,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -472,15 +474,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -583,7 +586,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OutputComponent; @@ -592,15 +595,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OutputComponent()); + var instance = new OutputComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1155,7 +1159,7 @@ public List Output List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Task; @@ -1164,40 +1168,41 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopy(); - if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopy()); - if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopy(); - if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopy(); - if(BusinessStatus != null) dest.BusinessStatus = (Hl7.Fhir.Model.CodeableConcept)BusinessStatus.DeepCopy(); - if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopy(); - if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopy(); - if(For != null) dest.For = (Hl7.Fhir.Model.ResourceReference)For.DeepCopy(); - if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopy(); - if(ExecutionPeriod != null) dest.ExecutionPeriod = (Hl7.Fhir.Model.Period)ExecutionPeriod.DeepCopy(); - if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopy(); - if(LastModifiedElement != null) dest.LastModifiedElement = (Hl7.Fhir.Model.FhirDateTime)LastModifiedElement.DeepCopy(); - if(Requester != null) dest.Requester = (Hl7.Fhir.Model.Task.RequesterComponent)Requester.DeepCopy(); - if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopy()); - if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopy()); - if(Restriction != null) dest.Restriction = (Hl7.Fhir.Model.Task.RestrictionComponent)Restriction.DeepCopy(); - if(Input.Any()) dest.Input = new List(Input.DeepCopy()); - if(Output.Any()) dest.Output = new List(Output.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(Definition != null) dest.Definition = (Hl7.Fhir.Model.DataType)Definition.DeepCopyInternal(); + if(BasedOn.Any()) dest.BasedOn = new List(BasedOn.DeepCopyInternal()); + if(GroupIdentifier != null) dest.GroupIdentifier = (Hl7.Fhir.Model.Identifier)GroupIdentifier.DeepCopyInternal(); + if(PartOf.Any()) dest.PartOf = new List(PartOf.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(StatusReason != null) dest.StatusReason = (Hl7.Fhir.Model.CodeableConcept)StatusReason.DeepCopyInternal(); + if(BusinessStatus != null) dest.BusinessStatus = (Hl7.Fhir.Model.CodeableConcept)BusinessStatus.DeepCopyInternal(); + if(IntentElement != null) dest.IntentElement = (Code)IntentElement.DeepCopyInternal(); + if(PriorityElement != null) dest.PriorityElement = (Code)PriorityElement.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Focus != null) dest.Focus = (Hl7.Fhir.Model.ResourceReference)Focus.DeepCopyInternal(); + if(For != null) dest.For = (Hl7.Fhir.Model.ResourceReference)For.DeepCopyInternal(); + if(Context != null) dest.Context = (Hl7.Fhir.Model.ResourceReference)Context.DeepCopyInternal(); + if(ExecutionPeriod != null) dest.ExecutionPeriod = (Hl7.Fhir.Model.Period)ExecutionPeriod.DeepCopyInternal(); + if(AuthoredOnElement != null) dest.AuthoredOnElement = (Hl7.Fhir.Model.FhirDateTime)AuthoredOnElement.DeepCopyInternal(); + if(LastModifiedElement != null) dest.LastModifiedElement = (Hl7.Fhir.Model.FhirDateTime)LastModifiedElement.DeepCopyInternal(); + if(Requester != null) dest.Requester = (Hl7.Fhir.Model.Task.RequesterComponent)Requester.DeepCopyInternal(); + if(PerformerType.Any()) dest.PerformerType = new List(PerformerType.DeepCopyInternal()); + if(Owner != null) dest.Owner = (Hl7.Fhir.Model.ResourceReference)Owner.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); + if(RelevantHistory.Any()) dest.RelevantHistory = new List(RelevantHistory.DeepCopyInternal()); + if(Restriction != null) dest.Restriction = (Hl7.Fhir.Model.Task.RestrictionComponent)Restriction.DeepCopyInternal(); + if(Input.Any()) dest.Input = new List(Input.DeepCopyInternal()); + if(Output.Any()) dest.Output = new List(Output.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Task()); + var instance = new Task(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/TestReport.cs b/src/Hl7.Fhir.STU3/Model/Generated/TestReport.cs index 32ba81b719..8ee5a6a987 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/TestReport.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/TestReport.cs @@ -305,7 +305,7 @@ public string Display } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParticipantComponent; @@ -314,16 +314,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(UriElement != null) dest.UriElement = (Hl7.Fhir.Model.FhirUri)UriElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParticipantComponent()); + var instance = new ParticipantComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -414,7 +415,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupComponent; @@ -423,14 +424,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupComponent()); + var instance = new SetupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -521,7 +523,7 @@ public Hl7.Fhir.Model.TestReport.AssertComponent Assert private Hl7.Fhir.Model.TestReport.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupActionComponent; @@ -530,15 +532,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupActionComponent()); + var instance = new SetupActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -706,7 +709,7 @@ public string Detail } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -715,16 +718,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopy(); - if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopy(); - if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirUri)DetailElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopyInternal(); + if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopyInternal(); + if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirUri)DetailElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationComponent()); + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -900,7 +904,7 @@ public string Detail } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssertComponent; @@ -909,16 +913,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopy(); - if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopy(); - if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopyInternal(); + if(MessageElement != null) dest.MessageElement = (Hl7.Fhir.Model.Markdown)MessageElement.DeepCopyInternal(); + if(DetailElement != null) dest.DetailElement = (Hl7.Fhir.Model.FhirString)DetailElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new AssertComponent()); + var instance = new AssertComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1071,7 +1076,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestComponent; @@ -1080,16 +1085,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestComponent()); + var instance = new TestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1196,7 +1202,7 @@ public Hl7.Fhir.Model.TestReport.AssertComponent Assert private Hl7.Fhir.Model.TestReport.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestActionComponent; @@ -1205,15 +1211,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestReport.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestActionComponent()); + var instance = new TestActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1299,7 +1306,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownComponent; @@ -1308,14 +1315,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownComponent()); + var instance = new TeardownComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1394,7 +1402,7 @@ public Hl7.Fhir.Model.TestReport.OperationComponent Operation private Hl7.Fhir.Model.TestReport.OperationComponent _Operation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownActionComponent; @@ -1403,14 +1411,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestReport.OperationComponent)Operation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownActionComponent()); + var instance = new TeardownActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1735,7 +1744,7 @@ public Hl7.Fhir.Model.TestReport.TeardownComponent Teardown Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestReport; @@ -1744,25 +1753,26 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(TestScript != null) dest.TestScript = (Hl7.Fhir.Model.ResourceReference)TestScript.DeepCopy(); - if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopy(); - if(ScoreElement != null) dest.ScoreElement = (Hl7.Fhir.Model.FhirDecimal)ScoreElement.DeepCopy(); - if(TesterElement != null) dest.TesterElement = (Hl7.Fhir.Model.FhirString)TesterElement.DeepCopy(); - if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopy(); - if(Participant.Any()) dest.Participant = new List(Participant.DeepCopy()); - if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestReport.SetupComponent)Setup.DeepCopy(); - if(Test.Any()) dest.Test = new List(Test.DeepCopy()); - if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestReport.TeardownComponent)Teardown.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(TestScript != null) dest.TestScript = (Hl7.Fhir.Model.ResourceReference)TestScript.DeepCopyInternal(); + if(ResultElement != null) dest.ResultElement = (Code)ResultElement.DeepCopyInternal(); + if(ScoreElement != null) dest.ScoreElement = (Hl7.Fhir.Model.FhirDecimal)ScoreElement.DeepCopyInternal(); + if(TesterElement != null) dest.TesterElement = (Hl7.Fhir.Model.FhirString)TesterElement.DeepCopyInternal(); + if(IssuedElement != null) dest.IssuedElement = (Hl7.Fhir.Model.FhirDateTime)IssuedElement.DeepCopyInternal(); + if(Participant.Any()) dest.Participant = new List(Participant.DeepCopyInternal()); + if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestReport.SetupComponent)Setup.DeepCopyInternal(); + if(Test.Any()) dest.Test = new List(Test.DeepCopyInternal()); + if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestReport.TeardownComponent)Teardown.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestReport()); + var instance = new TestReport(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/TestScript.cs b/src/Hl7.Fhir.STU3/Model/Generated/TestScript.cs index deb9b6506a..018133fdb3 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/TestScript.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/TestScript.cs @@ -383,7 +383,7 @@ public Hl7.Fhir.Model.Coding Profile private Hl7.Fhir.Model.Coding _Profile; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OriginComponent; @@ -392,15 +392,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OriginComponent()); + var instance = new OriginComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -520,7 +521,7 @@ public Hl7.Fhir.Model.Coding Profile private Hl7.Fhir.Model.Coding _Profile; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DestinationComponent; @@ -529,15 +530,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopy(); - if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(IndexElement != null) dest.IndexElement = (Hl7.Fhir.Model.Integer)IndexElement.DeepCopyInternal(); + if(Profile != null) dest.Profile = (Hl7.Fhir.Model.Coding)Profile.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DestinationComponent()); + var instance = new DestinationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -637,7 +639,7 @@ public List Capability private List _Capability; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as MetadataComponent; @@ -646,15 +648,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Link.Any()) dest.Link = new List(Link.DeepCopy()); - if(Capability.Any()) dest.Capability = new List(Capability.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Link.Any()) dest.Link = new List(Link.DeepCopyInternal()); + if(Capability.Any()) dest.Capability = new List(Capability.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new MetadataComponent()); + var instance = new MetadataComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -789,7 +792,7 @@ public string Description } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as LinkComponent; @@ -798,15 +801,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new LinkComponent()); + var instance = new LinkComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1083,7 +1087,7 @@ public Hl7.Fhir.Model.ResourceReference Capabilities private Hl7.Fhir.Model.ResourceReference _Capabilities; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as CapabilityComponent; @@ -1092,20 +1096,21 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopy(); - if(ValidatedElement != null) dest.ValidatedElement = (Hl7.Fhir.Model.FhirBoolean)ValidatedElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(OriginElement.Any()) dest.OriginElement = new List(OriginElement.DeepCopy()); - if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopy(); - if(LinkElement.Any()) dest.LinkElement = new List(LinkElement.DeepCopy()); - if(Capabilities != null) dest.Capabilities = (Hl7.Fhir.Model.ResourceReference)Capabilities.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(RequiredElement != null) dest.RequiredElement = (Hl7.Fhir.Model.FhirBoolean)RequiredElement.DeepCopyInternal(); + if(ValidatedElement != null) dest.ValidatedElement = (Hl7.Fhir.Model.FhirBoolean)ValidatedElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(OriginElement.Any()) dest.OriginElement = new List(OriginElement.DeepCopyInternal()); + if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopyInternal(); + if(LinkElement.Any()) dest.LinkElement = new List(LinkElement.DeepCopyInternal()); + if(Capabilities != null) dest.Capabilities = (Hl7.Fhir.Model.ResourceReference)Capabilities.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new CapabilityComponent()); + var instance = new CapabilityComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1294,7 +1299,7 @@ public Hl7.Fhir.Model.ResourceReference Resource private Hl7.Fhir.Model.ResourceReference _Resource; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FixtureComponent; @@ -1303,16 +1308,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(AutocreateElement != null) dest.AutocreateElement = (Hl7.Fhir.Model.FhirBoolean)AutocreateElement.DeepCopy(); - if(AutodeleteElement != null) dest.AutodeleteElement = (Hl7.Fhir.Model.FhirBoolean)AutodeleteElement.DeepCopy(); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(AutocreateElement != null) dest.AutocreateElement = (Hl7.Fhir.Model.FhirBoolean)AutocreateElement.DeepCopyInternal(); + if(AutodeleteElement != null) dest.AutodeleteElement = (Hl7.Fhir.Model.FhirBoolean)AutodeleteElement.DeepCopyInternal(); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FixtureComponent()); + var instance = new FixtureComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1642,7 +1648,7 @@ public string SourceId } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VariableComponent; @@ -1651,21 +1657,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DefaultValueElement != null) dest.DefaultValueElement = (Hl7.Fhir.Model.FhirString)DefaultValueElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopy(); - if(HintElement != null) dest.HintElement = (Hl7.Fhir.Model.FhirString)HintElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DefaultValueElement != null) dest.DefaultValueElement = (Hl7.Fhir.Model.FhirString)DefaultValueElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopyInternal(); + if(HintElement != null) dest.HintElement = (Hl7.Fhir.Model.FhirString)HintElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VariableComponent()); + var instance = new VariableComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1816,7 +1823,7 @@ public List Param private List _Param; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RuleComponent; @@ -1825,15 +1832,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - if(Param.Any()) dest.Param = new List(Param.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); + if(Param.Any()) dest.Param = new List(Param.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RuleComponent()); + var instance = new RuleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1969,7 +1977,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RuleParamComponent; @@ -1978,15 +1986,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RuleParamComponent()); + var instance = new RuleParamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2089,7 +2098,7 @@ public List Rule private List _Rule; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RulesetComponent; @@ -2098,15 +2107,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopy(); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Resource != null) dest.Resource = (Hl7.Fhir.Model.ResourceReference)Resource.DeepCopyInternal(); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RulesetComponent()); + var instance = new RulesetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2225,7 +2235,7 @@ public List Param private List _Param; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RulesetRuleComponent; @@ -2234,15 +2244,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RuleIdElement != null) dest.RuleIdElement = (Hl7.Fhir.Model.Id)RuleIdElement.DeepCopy(); - if(Param.Any()) dest.Param = new List(Param.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RuleIdElement != null) dest.RuleIdElement = (Hl7.Fhir.Model.Id)RuleIdElement.DeepCopyInternal(); + if(Param.Any()) dest.Param = new List(Param.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RulesetRuleComponent()); + var instance = new RulesetRuleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2378,7 +2389,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RulesetRuleParamComponent; @@ -2387,15 +2398,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RulesetRuleParamComponent()); + var instance = new RulesetRuleParamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2478,7 +2490,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupComponent; @@ -2487,14 +2499,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupComponent()); + var instance = new SetupComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2585,7 +2598,7 @@ public Hl7.Fhir.Model.TestScript.AssertComponent Assert private Hl7.Fhir.Model.TestScript.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as SetupActionComponent; @@ -2594,15 +2607,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new SetupActionComponent()); + var instance = new SetupActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3142,7 +3156,7 @@ public string Url } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as OperationComponent; @@ -3151,29 +3165,30 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Code)ResourceElement.DeepCopy(); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(AcceptElement != null) dest.AcceptElement = (Code)AcceptElement.DeepCopy(); - if(ContentTypeElement != null) dest.ContentTypeElement = (Code)ContentTypeElement.DeepCopy(); - if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopy(); - if(EncodeRequestUrlElement != null) dest.EncodeRequestUrlElement = (Hl7.Fhir.Model.FhirBoolean)EncodeRequestUrlElement.DeepCopy(); - if(OriginElement != null) dest.OriginElement = (Hl7.Fhir.Model.Integer)OriginElement.DeepCopy(); - if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopy(); - if(RequestHeader.Any()) dest.RequestHeader = new List(RequestHeader.DeepCopy()); - if(RequestIdElement != null) dest.RequestIdElement = (Hl7.Fhir.Model.Id)RequestIdElement.DeepCopy(); - if(ResponseIdElement != null) dest.ResponseIdElement = (Hl7.Fhir.Model.Id)ResponseIdElement.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopy(); - if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopy(); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirString)UrlElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Type != null) dest.Type = (Hl7.Fhir.Model.Coding)Type.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Code)ResourceElement.DeepCopyInternal(); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(AcceptElement != null) dest.AcceptElement = (Code)AcceptElement.DeepCopyInternal(); + if(ContentTypeElement != null) dest.ContentTypeElement = (Code)ContentTypeElement.DeepCopyInternal(); + if(DestinationElement != null) dest.DestinationElement = (Hl7.Fhir.Model.Integer)DestinationElement.DeepCopyInternal(); + if(EncodeRequestUrlElement != null) dest.EncodeRequestUrlElement = (Hl7.Fhir.Model.FhirBoolean)EncodeRequestUrlElement.DeepCopyInternal(); + if(OriginElement != null) dest.OriginElement = (Hl7.Fhir.Model.Integer)OriginElement.DeepCopyInternal(); + if(ParamsElement != null) dest.ParamsElement = (Hl7.Fhir.Model.FhirString)ParamsElement.DeepCopyInternal(); + if(RequestHeader.Any()) dest.RequestHeader = new List(RequestHeader.DeepCopyInternal()); + if(RequestIdElement != null) dest.RequestIdElement = (Hl7.Fhir.Model.Id)RequestIdElement.DeepCopyInternal(); + if(ResponseIdElement != null) dest.ResponseIdElement = (Hl7.Fhir.Model.Id)ResponseIdElement.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopyInternal(); + if(TargetIdElement != null) dest.TargetIdElement = (Hl7.Fhir.Model.Id)TargetIdElement.DeepCopyInternal(); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirString)UrlElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new OperationComponent()); + var instance = new OperationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -3422,7 +3437,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RequestHeaderComponent; @@ -3431,15 +3446,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(FieldElement != null) dest.FieldElement = (Hl7.Fhir.Model.FhirString)FieldElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(FieldElement != null) dest.FieldElement = (Hl7.Fhir.Model.FhirString)FieldElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RequestHeaderComponent()); + var instance = new RequestHeaderComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4232,7 +4248,7 @@ public bool? WarningOnly } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as AssertComponent; @@ -4241,37 +4257,38 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopy(); - if(CompareToSourceIdElement != null) dest.CompareToSourceIdElement = (Hl7.Fhir.Model.FhirString)CompareToSourceIdElement.DeepCopy(); - if(CompareToSourceExpressionElement != null) dest.CompareToSourceExpressionElement = (Hl7.Fhir.Model.FhirString)CompareToSourceExpressionElement.DeepCopy(); - if(CompareToSourcePathElement != null) dest.CompareToSourcePathElement = (Hl7.Fhir.Model.FhirString)CompareToSourcePathElement.DeepCopy(); - if(ContentTypeElement != null) dest.ContentTypeElement = (Code)ContentTypeElement.DeepCopy(); - if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopy(); - if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopy(); - if(MinimumIdElement != null) dest.MinimumIdElement = (Hl7.Fhir.Model.FhirString)MinimumIdElement.DeepCopy(); - if(NavigationLinksElement != null) dest.NavigationLinksElement = (Hl7.Fhir.Model.FhirBoolean)NavigationLinksElement.DeepCopy(); - if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopy(); - if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopy(); - if(RequestMethodElement != null) dest.RequestMethodElement = (Code)RequestMethodElement.DeepCopy(); - if(RequestURLElement != null) dest.RequestURLElement = (Hl7.Fhir.Model.FhirString)RequestURLElement.DeepCopy(); - if(ResourceElement != null) dest.ResourceElement = (Code)ResourceElement.DeepCopy(); - if(ResponseElement != null) dest.ResponseElement = (Code)ResponseElement.DeepCopy(); - if(ResponseCodeElement != null) dest.ResponseCodeElement = (Hl7.Fhir.Model.FhirString)ResponseCodeElement.DeepCopy(); - if(Rule != null) dest.Rule = (Hl7.Fhir.Model.TestScript.ActionAssertRuleComponent)Rule.DeepCopy(); - if(Ruleset != null) dest.Ruleset = (Hl7.Fhir.Model.TestScript.ActionAssertRulesetComponent)Ruleset.DeepCopy(); - if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopy(); - if(ValidateProfileIdElement != null) dest.ValidateProfileIdElement = (Hl7.Fhir.Model.Id)ValidateProfileIdElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - if(WarningOnlyElement != null) dest.WarningOnlyElement = (Hl7.Fhir.Model.FhirBoolean)WarningOnlyElement.DeepCopy(); - return dest; - } - - public override IDeepCopyable DeepCopy() - { - return CopyTo(new AssertComponent()); + base.CopyToInternal(dest); + if(LabelElement != null) dest.LabelElement = (Hl7.Fhir.Model.FhirString)LabelElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(DirectionElement != null) dest.DirectionElement = (Code)DirectionElement.DeepCopyInternal(); + if(CompareToSourceIdElement != null) dest.CompareToSourceIdElement = (Hl7.Fhir.Model.FhirString)CompareToSourceIdElement.DeepCopyInternal(); + if(CompareToSourceExpressionElement != null) dest.CompareToSourceExpressionElement = (Hl7.Fhir.Model.FhirString)CompareToSourceExpressionElement.DeepCopyInternal(); + if(CompareToSourcePathElement != null) dest.CompareToSourcePathElement = (Hl7.Fhir.Model.FhirString)CompareToSourcePathElement.DeepCopyInternal(); + if(ContentTypeElement != null) dest.ContentTypeElement = (Code)ContentTypeElement.DeepCopyInternal(); + if(ExpressionElement != null) dest.ExpressionElement = (Hl7.Fhir.Model.FhirString)ExpressionElement.DeepCopyInternal(); + if(HeaderFieldElement != null) dest.HeaderFieldElement = (Hl7.Fhir.Model.FhirString)HeaderFieldElement.DeepCopyInternal(); + if(MinimumIdElement != null) dest.MinimumIdElement = (Hl7.Fhir.Model.FhirString)MinimumIdElement.DeepCopyInternal(); + if(NavigationLinksElement != null) dest.NavigationLinksElement = (Hl7.Fhir.Model.FhirBoolean)NavigationLinksElement.DeepCopyInternal(); + if(OperatorElement != null) dest.OperatorElement = (Code)OperatorElement.DeepCopyInternal(); + if(PathElement != null) dest.PathElement = (Hl7.Fhir.Model.FhirString)PathElement.DeepCopyInternal(); + if(RequestMethodElement != null) dest.RequestMethodElement = (Code)RequestMethodElement.DeepCopyInternal(); + if(RequestURLElement != null) dest.RequestURLElement = (Hl7.Fhir.Model.FhirString)RequestURLElement.DeepCopyInternal(); + if(ResourceElement != null) dest.ResourceElement = (Code)ResourceElement.DeepCopyInternal(); + if(ResponseElement != null) dest.ResponseElement = (Code)ResponseElement.DeepCopyInternal(); + if(ResponseCodeElement != null) dest.ResponseCodeElement = (Hl7.Fhir.Model.FhirString)ResponseCodeElement.DeepCopyInternal(); + if(Rule != null) dest.Rule = (Hl7.Fhir.Model.TestScript.ActionAssertRuleComponent)Rule.DeepCopyInternal(); + if(Ruleset != null) dest.Ruleset = (Hl7.Fhir.Model.TestScript.ActionAssertRulesetComponent)Ruleset.DeepCopyInternal(); + if(SourceIdElement != null) dest.SourceIdElement = (Hl7.Fhir.Model.Id)SourceIdElement.DeepCopyInternal(); + if(ValidateProfileIdElement != null) dest.ValidateProfileIdElement = (Hl7.Fhir.Model.Id)ValidateProfileIdElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); + if(WarningOnlyElement != null) dest.WarningOnlyElement = (Hl7.Fhir.Model.FhirBoolean)WarningOnlyElement.DeepCopyInternal(); + } + + protected internal override Base DeepCopyInternal() + { + var instance = new AssertComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4566,7 +4583,7 @@ public List Param private List _Param; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionAssertRuleComponent; @@ -4575,15 +4592,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RuleIdElement != null) dest.RuleIdElement = (Hl7.Fhir.Model.Id)RuleIdElement.DeepCopy(); - if(Param.Any()) dest.Param = new List(Param.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RuleIdElement != null) dest.RuleIdElement = (Hl7.Fhir.Model.Id)RuleIdElement.DeepCopyInternal(); + if(Param.Any()) dest.Param = new List(Param.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActionAssertRuleComponent()); + var instance = new ActionAssertRuleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4720,7 +4738,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionAssertRuleParamComponent; @@ -4729,15 +4747,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActionAssertRuleParamComponent()); + var instance = new ActionAssertRuleParamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4856,7 +4875,7 @@ public List Rule private List _Rule; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionAssertRulesetComponent; @@ -4865,15 +4884,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RulesetIdElement != null) dest.RulesetIdElement = (Hl7.Fhir.Model.Id)RulesetIdElement.DeepCopy(); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RulesetIdElement != null) dest.RulesetIdElement = (Hl7.Fhir.Model.Id)RulesetIdElement.DeepCopyInternal(); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActionAssertRulesetComponent()); + var instance = new ActionAssertRulesetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -4992,7 +5012,7 @@ public List Param private List _Param; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ActionAssertRulesetRuleComponent; @@ -5001,15 +5021,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(RuleIdElement != null) dest.RuleIdElement = (Hl7.Fhir.Model.Id)RuleIdElement.DeepCopy(); - if(Param.Any()) dest.Param = new List(Param.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(RuleIdElement != null) dest.RuleIdElement = (Hl7.Fhir.Model.Id)RuleIdElement.DeepCopyInternal(); + if(Param.Any()) dest.Param = new List(Param.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ActionAssertRulesetRuleComponent()); + var instance = new ActionAssertRulesetRuleComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5146,7 +5167,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParamComponent; @@ -5155,15 +5176,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParamComponent()); + var instance = new ParamComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5308,7 +5330,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestComponent; @@ -5317,16 +5339,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopyInternal(); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestComponent()); + var instance = new TestComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5433,7 +5456,7 @@ public Hl7.Fhir.Model.TestScript.AssertComponent Assert private Hl7.Fhir.Model.TestScript.AssertComponent _Assert; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestActionComponent; @@ -5442,15 +5465,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopy(); - if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopyInternal(); + if(Assert != null) dest.Assert = (Hl7.Fhir.Model.TestScript.AssertComponent)Assert.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestActionComponent()); + var instance = new TestActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5536,7 +5560,7 @@ public List Action private List _Action; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownComponent; @@ -5545,14 +5569,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Action.Any()) dest.Action = new List(Action.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Action.Any()) dest.Action = new List(Action.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownComponent()); + var instance = new TeardownComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -5631,7 +5656,7 @@ public Hl7.Fhir.Model.TestScript.OperationComponent Operation private Hl7.Fhir.Model.TestScript.OperationComponent _Operation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TeardownActionComponent; @@ -5640,14 +5665,15 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Operation != null) dest.Operation = (Hl7.Fhir.Model.TestScript.OperationComponent)Operation.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TeardownActionComponent()); + var instance = new TeardownActionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -6252,7 +6278,7 @@ public Hl7.Fhir.Model.TestScript.TeardownComponent Teardown Identifier IIdentifiable.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TestScript; @@ -6261,39 +6287,40 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(Origin.Any()) dest.Origin = new List(Origin.DeepCopy()); - if(Destination.Any()) dest.Destination = new List(Destination.DeepCopy()); - if(Metadata != null) dest.Metadata = (Hl7.Fhir.Model.TestScript.MetadataComponent)Metadata.DeepCopy(); - if(Fixture.Any()) dest.Fixture = new List(Fixture.DeepCopy()); - if(Profile.Any()) dest.Profile = new List(Profile.DeepCopy()); - if(Variable.Any()) dest.Variable = new List(Variable.DeepCopy()); - if(Rule.Any()) dest.Rule = new List(Rule.DeepCopy()); - if(Ruleset.Any()) dest.Ruleset = new List(Ruleset.DeepCopy()); - if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestScript.SetupComponent)Setup.DeepCopy(); - if(Test.Any()) dest.Test = new List(Test.DeepCopy()); - if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestScript.TeardownComponent)Teardown.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier != null) dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(Origin.Any()) dest.Origin = new List(Origin.DeepCopyInternal()); + if(Destination.Any()) dest.Destination = new List(Destination.DeepCopyInternal()); + if(Metadata != null) dest.Metadata = (Hl7.Fhir.Model.TestScript.MetadataComponent)Metadata.DeepCopyInternal(); + if(Fixture.Any()) dest.Fixture = new List(Fixture.DeepCopyInternal()); + if(Profile.Any()) dest.Profile = new List(Profile.DeepCopyInternal()); + if(Variable.Any()) dest.Variable = new List(Variable.DeepCopyInternal()); + if(Rule.Any()) dest.Rule = new List(Rule.DeepCopyInternal()); + if(Ruleset.Any()) dest.Ruleset = new List(Ruleset.DeepCopyInternal()); + if(Setup != null) dest.Setup = (Hl7.Fhir.Model.TestScript.SetupComponent)Setup.DeepCopyInternal(); + if(Test.Any()) dest.Test = new List(Test.DeepCopyInternal()); + if(Teardown != null) dest.Teardown = (Hl7.Fhir.Model.TestScript.TeardownComponent)Teardown.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TestScript()); + var instance = new TestScript(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/Timing.cs b/src/Hl7.Fhir.STU3/Model/Generated/Timing.cs index 808e737fe6..7990bc126d 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/Timing.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/Timing.cs @@ -716,7 +716,7 @@ public int? Offset } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as RepeatComponent; @@ -725,28 +725,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Bounds != null) dest.Bounds = (Hl7.Fhir.Model.DataType)Bounds.DeepCopy(); - if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy(); - if(CountMaxElement != null) dest.CountMaxElement = (Hl7.Fhir.Model.Integer)CountMaxElement.DeepCopy(); - if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopy(); - if(DurationMaxElement != null) dest.DurationMaxElement = (Hl7.Fhir.Model.FhirDecimal)DurationMaxElement.DeepCopy(); - if(DurationUnitElement != null) dest.DurationUnitElement = (Code)DurationUnitElement.DeepCopy(); - if(FrequencyElement != null) dest.FrequencyElement = (Hl7.Fhir.Model.Integer)FrequencyElement.DeepCopy(); - if(FrequencyMaxElement != null) dest.FrequencyMaxElement = (Hl7.Fhir.Model.Integer)FrequencyMaxElement.DeepCopy(); - if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopy(); - if(PeriodMaxElement != null) dest.PeriodMaxElement = (Hl7.Fhir.Model.FhirDecimal)PeriodMaxElement.DeepCopy(); - if(PeriodUnitElement != null) dest.PeriodUnitElement = (Code)PeriodUnitElement.DeepCopy(); - if(DayOfWeekElement.Any()) dest.DayOfWeekElement = new List>(DayOfWeekElement.DeepCopy()); - if(TimeOfDayElement.Any()) dest.TimeOfDayElement = new List(TimeOfDayElement.DeepCopy()); - if(WhenElement.Any()) dest.WhenElement = new List>(WhenElement.DeepCopy()); - if(OffsetElement != null) dest.OffsetElement = (Hl7.Fhir.Model.UnsignedInt)OffsetElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(Bounds != null) dest.Bounds = (Hl7.Fhir.Model.DataType)Bounds.DeepCopyInternal(); + if(CountElement != null) dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopyInternal(); + if(CountMaxElement != null) dest.CountMaxElement = (Hl7.Fhir.Model.Integer)CountMaxElement.DeepCopyInternal(); + if(DurationElement != null) dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopyInternal(); + if(DurationMaxElement != null) dest.DurationMaxElement = (Hl7.Fhir.Model.FhirDecimal)DurationMaxElement.DeepCopyInternal(); + if(DurationUnitElement != null) dest.DurationUnitElement = (Code)DurationUnitElement.DeepCopyInternal(); + if(FrequencyElement != null) dest.FrequencyElement = (Hl7.Fhir.Model.Integer)FrequencyElement.DeepCopyInternal(); + if(FrequencyMaxElement != null) dest.FrequencyMaxElement = (Hl7.Fhir.Model.Integer)FrequencyMaxElement.DeepCopyInternal(); + if(PeriodElement != null) dest.PeriodElement = (Hl7.Fhir.Model.FhirDecimal)PeriodElement.DeepCopyInternal(); + if(PeriodMaxElement != null) dest.PeriodMaxElement = (Hl7.Fhir.Model.FhirDecimal)PeriodMaxElement.DeepCopyInternal(); + if(PeriodUnitElement != null) dest.PeriodUnitElement = (Code)PeriodUnitElement.DeepCopyInternal(); + if(DayOfWeekElement.Any()) dest.DayOfWeekElement = new List>(DayOfWeekElement.DeepCopyInternal()); + if(TimeOfDayElement.Any()) dest.TimeOfDayElement = new List(TimeOfDayElement.DeepCopyInternal()); + if(WhenElement.Any()) dest.WhenElement = new List>(WhenElement.DeepCopyInternal()); + if(OffsetElement != null) dest.OffsetElement = (Hl7.Fhir.Model.UnsignedInt)OffsetElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new RepeatComponent()); + var instance = new RepeatComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -965,7 +966,7 @@ public Hl7.Fhir.Model.CodeableConcept Code private Hl7.Fhir.Model.CodeableConcept _Code; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as Timing; @@ -974,16 +975,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(EventElement.Any()) dest.EventElement = new List(EventElement.DeepCopy()); - if(Repeat != null) dest.Repeat = (Hl7.Fhir.Model.Timing.RepeatComponent)Repeat.DeepCopy(); - if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(EventElement.Any()) dest.EventElement = new List(EventElement.DeepCopyInternal()); + if(Repeat != null) dest.Repeat = (Hl7.Fhir.Model.Timing.RepeatComponent)Repeat.DeepCopyInternal(); + if(Code != null) dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new Timing()); + var instance = new Timing(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/TriggerDefinition.cs b/src/Hl7.Fhir.STU3/Model/Generated/TriggerDefinition.cs index d920640156..183769e62f 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/TriggerDefinition.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/TriggerDefinition.cs @@ -205,7 +205,7 @@ public Hl7.Fhir.Model.DataRequirement EventData private Hl7.Fhir.Model.DataRequirement _EventData; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as TriggerDefinition; @@ -214,17 +214,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopy(); - if(EventNameElement != null) dest.EventNameElement = (Hl7.Fhir.Model.FhirString)EventNameElement.DeepCopy(); - if(EventTiming != null) dest.EventTiming = (Hl7.Fhir.Model.DataType)EventTiming.DeepCopy(); - if(EventData != null) dest.EventData = (Hl7.Fhir.Model.DataRequirement)EventData.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(TypeElement != null) dest.TypeElement = (Code)TypeElement.DeepCopyInternal(); + if(EventNameElement != null) dest.EventNameElement = (Hl7.Fhir.Model.FhirString)EventNameElement.DeepCopyInternal(); + if(EventTiming != null) dest.EventTiming = (Hl7.Fhir.Model.DataType)EventTiming.DeepCopyInternal(); + if(EventData != null) dest.EventData = (Hl7.Fhir.Model.DataRequirement)EventData.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new TriggerDefinition()); + var instance = new TriggerDefinition(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ValueSet.cs b/src/Hl7.Fhir.STU3/Model/Generated/ValueSet.cs index 5c4b8c9db5..30e55e6de1 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/ValueSet.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/ValueSet.cs @@ -165,7 +165,7 @@ public List Exclude private List _Exclude; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ComposeComponent; @@ -174,17 +174,18 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LockedDateElement != null) dest.LockedDateElement = (Hl7.Fhir.Model.Date)LockedDateElement.DeepCopy(); - if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopy(); - if(Include.Any()) dest.Include = new List(Include.DeepCopy()); - if(Exclude.Any()) dest.Exclude = new List(Exclude.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(LockedDateElement != null) dest.LockedDateElement = (Hl7.Fhir.Model.Date)LockedDateElement.DeepCopyInternal(); + if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopyInternal(); + if(Include.Any()) dest.Include = new List(Include.DeepCopyInternal()); + if(Exclude.Any()) dest.Exclude = new List(Exclude.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ComposeComponent()); + var instance = new ComposeComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -394,7 +395,7 @@ public IEnumerable ValueSet } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptSetComponent; @@ -403,18 +404,19 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(Concept.Any()) dest.Concept = new List(Concept.DeepCopy()); - if(Filter.Any()) dest.Filter = new List(Filter.DeepCopy()); - if(ValueSetElement.Any()) dest.ValueSetElement = new List(ValueSetElement.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(Concept.Any()) dest.Concept = new List(Concept.DeepCopyInternal()); + if(Filter.Any()) dest.Filter = new List(Filter.DeepCopyInternal()); + if(ValueSetElement.Any()) dest.ValueSetElement = new List(ValueSetElement.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptSetComponent()); + var instance = new ConceptSetComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -588,7 +590,7 @@ public List Designation private List _Designation; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ConceptReferenceComponent; @@ -597,16 +599,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(Designation.Any()) dest.Designation = new List(Designation.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(Designation.Any()) dest.Designation = new List(Designation.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ConceptReferenceComponent()); + var instance = new ConceptReferenceComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -764,7 +767,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DesignationComponent; @@ -773,16 +776,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy(); - if(Use != null) dest.Use = (Hl7.Fhir.Model.Coding)Use.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopyInternal(); + if(Use != null) dest.Use = (Hl7.Fhir.Model.Coding)Use.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.FhirString)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DesignationComponent()); + var instance = new DesignationComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -961,7 +965,7 @@ public string Value } } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as FilterComponent; @@ -970,16 +974,17 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(PropertyElement != null) dest.PropertyElement = (Hl7.Fhir.Model.Code)PropertyElement.DeepCopy(); - if(OpElement != null) dest.OpElement = (Code)OpElement.DeepCopy(); - if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.Code)ValueElement.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(PropertyElement != null) dest.PropertyElement = (Hl7.Fhir.Model.Code)PropertyElement.DeepCopyInternal(); + if(OpElement != null) dest.OpElement = (Code)OpElement.DeepCopyInternal(); + if(ValueElement != null) dest.ValueElement = (Hl7.Fhir.Model.Code)ValueElement.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new FilterComponent()); + var instance = new FilterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1214,7 +1219,7 @@ public List Contains private List _Contains; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ExpansionComponent; @@ -1223,19 +1228,20 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(IdentifierElement != null) dest.IdentifierElement = (Hl7.Fhir.Model.FhirUri)IdentifierElement.DeepCopy(); - if(TimestampElement != null) dest.TimestampElement = (Hl7.Fhir.Model.FhirDateTime)TimestampElement.DeepCopy(); - if(TotalElement != null) dest.TotalElement = (Hl7.Fhir.Model.Integer)TotalElement.DeepCopy(); - if(OffsetElement != null) dest.OffsetElement = (Hl7.Fhir.Model.Integer)OffsetElement.DeepCopy(); - if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopy()); - if(Contains.Any()) dest.Contains = new List(Contains.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(IdentifierElement != null) dest.IdentifierElement = (Hl7.Fhir.Model.FhirUri)IdentifierElement.DeepCopyInternal(); + if(TimestampElement != null) dest.TimestampElement = (Hl7.Fhir.Model.FhirDateTime)TimestampElement.DeepCopyInternal(); + if(TotalElement != null) dest.TotalElement = (Hl7.Fhir.Model.Integer)TotalElement.DeepCopyInternal(); + if(OffsetElement != null) dest.OffsetElement = (Hl7.Fhir.Model.Integer)OffsetElement.DeepCopyInternal(); + if(Parameter.Any()) dest.Parameter = new List(Parameter.DeepCopyInternal()); + if(Contains.Any()) dest.Contains = new List(Contains.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ExpansionComponent()); + var instance = new ExpansionComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1387,7 +1393,7 @@ public Hl7.Fhir.Model.DataType Value private Hl7.Fhir.Model.DataType _Value; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ParameterComponent; @@ -1396,15 +1402,16 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(Value != null) dest.Value = (Hl7.Fhir.Model.DataType)Value.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ParameterComponent()); + var instance = new ParameterComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -1690,7 +1697,7 @@ public List Contains private List _Contains; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ContainsComponent; @@ -1699,21 +1706,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopy(); - if(AbstractElement != null) dest.AbstractElement = (Hl7.Fhir.Model.FhirBoolean)AbstractElement.DeepCopy(); - if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopy(); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopy(); - if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopy(); - if(Designation.Any()) dest.Designation = new List(Designation.DeepCopy()); - if(Contains.Any()) dest.Contains = new List(Contains.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(SystemElement != null) dest.SystemElement = (Hl7.Fhir.Model.FhirUri)SystemElement.DeepCopyInternal(); + if(AbstractElement != null) dest.AbstractElement = (Hl7.Fhir.Model.FhirBoolean)AbstractElement.DeepCopyInternal(); + if(InactiveElement != null) dest.InactiveElement = (Hl7.Fhir.Model.FhirBoolean)InactiveElement.DeepCopyInternal(); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(CodeElement != null) dest.CodeElement = (Hl7.Fhir.Model.Code)CodeElement.DeepCopyInternal(); + if(DisplayElement != null) dest.DisplayElement = (Hl7.Fhir.Model.FhirString)DisplayElement.DeepCopyInternal(); + if(Designation.Any()) dest.Designation = new List(Designation.DeepCopyInternal()); + if(Contains.Any()) dest.Contains = new List(Contains.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ContainsComponent()); + var instance = new ContainsComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -2308,7 +2316,7 @@ public Hl7.Fhir.Model.ValueSet.ExpansionComponent Expansion List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as ValueSet; @@ -2317,32 +2325,33 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy(); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy(); - if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); - if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy(); - if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); - if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy(); - if(Contact.Any()) dest.Contact = new List(Contact.DeepCopy()); - if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopy(); - if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopy()); - if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopy()); - if(ImmutableElement != null) dest.ImmutableElement = (Hl7.Fhir.Model.FhirBoolean)ImmutableElement.DeepCopy(); - if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopy(); - if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopy(); - if(ExtensibleElement != null) dest.ExtensibleElement = (Hl7.Fhir.Model.FhirBoolean)ExtensibleElement.DeepCopy(); - if(Compose != null) dest.Compose = (Hl7.Fhir.Model.ValueSet.ComposeComponent)Compose.DeepCopy(); - if(Expansion != null) dest.Expansion = (Hl7.Fhir.Model.ValueSet.ExpansionComponent)Expansion.DeepCopy(); - return dest; + base.CopyToInternal(dest); + if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopyInternal(); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(VersionElement != null) dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopyInternal(); + if(NameElement != null) dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopyInternal(); + if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopyInternal(); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(ExperimentalElement != null) dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopyInternal(); + if(DateElement != null) dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopyInternal(); + if(PublisherElement != null) dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopyInternal(); + if(Contact.Any()) dest.Contact = new List(Contact.DeepCopyInternal()); + if(DescriptionElement != null) dest.DescriptionElement = (Hl7.Fhir.Model.Markdown)DescriptionElement.DeepCopyInternal(); + if(UseContext.Any()) dest.UseContext = new List(UseContext.DeepCopyInternal()); + if(Jurisdiction.Any()) dest.Jurisdiction = new List(Jurisdiction.DeepCopyInternal()); + if(ImmutableElement != null) dest.ImmutableElement = (Hl7.Fhir.Model.FhirBoolean)ImmutableElement.DeepCopyInternal(); + if(PurposeElement != null) dest.PurposeElement = (Hl7.Fhir.Model.Markdown)PurposeElement.DeepCopyInternal(); + if(CopyrightElement != null) dest.CopyrightElement = (Hl7.Fhir.Model.Markdown)CopyrightElement.DeepCopyInternal(); + if(ExtensibleElement != null) dest.ExtensibleElement = (Hl7.Fhir.Model.FhirBoolean)ExtensibleElement.DeepCopyInternal(); + if(Compose != null) dest.Compose = (Hl7.Fhir.Model.ValueSet.ComposeComponent)Compose.DeepCopyInternal(); + if(Expansion != null) dest.Expansion = (Hl7.Fhir.Model.ValueSet.ExpansionComponent)Expansion.DeepCopyInternal(); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new ValueSet()); + var instance = new ValueSet(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Model/Generated/VisionPrescription.cs b/src/Hl7.Fhir.STU3/Model/Generated/VisionPrescription.cs index 5f2e52a7c8..459a5f2ea3 100644 --- a/src/Hl7.Fhir.STU3/Model/Generated/VisionPrescription.cs +++ b/src/Hl7.Fhir.STU3/Model/Generated/VisionPrescription.cs @@ -548,7 +548,7 @@ public List Note private List _Note; - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as DispenseComponent; @@ -557,28 +557,29 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Product != null) dest.Product = (Hl7.Fhir.Model.CodeableConcept)Product.DeepCopy(); - if(EyeElement != null) dest.EyeElement = (Code)EyeElement.DeepCopy(); - if(SphereElement != null) dest.SphereElement = (Hl7.Fhir.Model.FhirDecimal)SphereElement.DeepCopy(); - if(CylinderElement != null) dest.CylinderElement = (Hl7.Fhir.Model.FhirDecimal)CylinderElement.DeepCopy(); - if(AxisElement != null) dest.AxisElement = (Hl7.Fhir.Model.Integer)AxisElement.DeepCopy(); - if(PrismElement != null) dest.PrismElement = (Hl7.Fhir.Model.FhirDecimal)PrismElement.DeepCopy(); - if(BaseElement != null) dest.BaseElement = (Code)BaseElement.DeepCopy(); - if(AddElement != null) dest.AddElement = (Hl7.Fhir.Model.FhirDecimal)AddElement.DeepCopy(); - if(PowerElement != null) dest.PowerElement = (Hl7.Fhir.Model.FhirDecimal)PowerElement.DeepCopy(); - if(BackCurveElement != null) dest.BackCurveElement = (Hl7.Fhir.Model.FhirDecimal)BackCurveElement.DeepCopy(); - if(DiameterElement != null) dest.DiameterElement = (Hl7.Fhir.Model.FhirDecimal)DiameterElement.DeepCopy(); - if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Quantity)Duration.DeepCopy(); - if(ColorElement != null) dest.ColorElement = (Hl7.Fhir.Model.FhirString)ColorElement.DeepCopy(); - if(BrandElement != null) dest.BrandElement = (Hl7.Fhir.Model.FhirString)BrandElement.DeepCopy(); - if(Note.Any()) dest.Note = new List(Note.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Product != null) dest.Product = (Hl7.Fhir.Model.CodeableConcept)Product.DeepCopyInternal(); + if(EyeElement != null) dest.EyeElement = (Code)EyeElement.DeepCopyInternal(); + if(SphereElement != null) dest.SphereElement = (Hl7.Fhir.Model.FhirDecimal)SphereElement.DeepCopyInternal(); + if(CylinderElement != null) dest.CylinderElement = (Hl7.Fhir.Model.FhirDecimal)CylinderElement.DeepCopyInternal(); + if(AxisElement != null) dest.AxisElement = (Hl7.Fhir.Model.Integer)AxisElement.DeepCopyInternal(); + if(PrismElement != null) dest.PrismElement = (Hl7.Fhir.Model.FhirDecimal)PrismElement.DeepCopyInternal(); + if(BaseElement != null) dest.BaseElement = (Code)BaseElement.DeepCopyInternal(); + if(AddElement != null) dest.AddElement = (Hl7.Fhir.Model.FhirDecimal)AddElement.DeepCopyInternal(); + if(PowerElement != null) dest.PowerElement = (Hl7.Fhir.Model.FhirDecimal)PowerElement.DeepCopyInternal(); + if(BackCurveElement != null) dest.BackCurveElement = (Hl7.Fhir.Model.FhirDecimal)BackCurveElement.DeepCopyInternal(); + if(DiameterElement != null) dest.DiameterElement = (Hl7.Fhir.Model.FhirDecimal)DiameterElement.DeepCopyInternal(); + if(Duration != null) dest.Duration = (Hl7.Fhir.Model.Quantity)Duration.DeepCopyInternal(); + if(ColorElement != null) dest.ColorElement = (Hl7.Fhir.Model.FhirString)ColorElement.DeepCopyInternal(); + if(BrandElement != null) dest.BrandElement = (Hl7.Fhir.Model.FhirString)BrandElement.DeepCopyInternal(); + if(Note.Any()) dest.Note = new List(Note.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new DispenseComponent()); + var instance = new DispenseComponent(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) @@ -893,7 +894,7 @@ public List Dispense List IIdentifiable>.Identifier { get => Identifier; set => Identifier = value; } - public override IDeepCopyable CopyTo(IDeepCopyable other) + protected internal override void CopyToInternal(Base other) { var dest = other as VisionPrescription; @@ -902,21 +903,22 @@ public override IDeepCopyable CopyTo(IDeepCopyable other) throw new ArgumentException("Can only copy to an object of the same type", "other"); } - base.CopyTo(dest); - if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopy()); - if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopy(); - if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); - if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); - if(DateWrittenElement != null) dest.DateWrittenElement = (Hl7.Fhir.Model.FhirDateTime)DateWrittenElement.DeepCopy(); - if(Prescriber != null) dest.Prescriber = (Hl7.Fhir.Model.ResourceReference)Prescriber.DeepCopy(); - if(Reason != null) dest.Reason = (Hl7.Fhir.Model.DataType)Reason.DeepCopy(); - if(Dispense.Any()) dest.Dispense = new List(Dispense.DeepCopy()); - return dest; + base.CopyToInternal(dest); + if(Identifier.Any()) dest.Identifier = new List(Identifier.DeepCopyInternal()); + if(StatusElement != null) dest.StatusElement = (Code)StatusElement.DeepCopyInternal(); + if(Patient != null) dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopyInternal(); + if(Encounter != null) dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopyInternal(); + if(DateWrittenElement != null) dest.DateWrittenElement = (Hl7.Fhir.Model.FhirDateTime)DateWrittenElement.DeepCopyInternal(); + if(Prescriber != null) dest.Prescriber = (Hl7.Fhir.Model.ResourceReference)Prescriber.DeepCopyInternal(); + if(Reason != null) dest.Reason = (Hl7.Fhir.Model.DataType)Reason.DeepCopyInternal(); + if(Dispense.Any()) dest.Dispense = new List(Dispense.DeepCopyInternal()); } - public override IDeepCopyable DeepCopy() + protected internal override Base DeepCopyInternal() { - return CopyTo(new VisionPrescription()); + var instance = new VisionPrescription(); + CopyToInternal(instance); + return instance; } public override bool CompareChildren(Base other, IEqualityComparer comparer) diff --git a/src/Hl7.Fhir.STU3/Specification/Snapshot/ElementDefnMerger.cs b/src/Hl7.Fhir.STU3/Specification/Snapshot/ElementDefnMerger.cs index bcd81ac848..540d1306f7 100644 --- a/src/Hl7.Fhir.STU3/Specification/Snapshot/ElementDefnMerger.cs +++ b/src/Hl7.Fhir.STU3/Specification/Snapshot/ElementDefnMerger.cs @@ -114,7 +114,7 @@ void merge(ElementDefinition snap, ElementDefinition diff, bool mergeElementId, // i.e. derived profiles can remove inherited types if (!diff.Type.IsNullOrEmpty() && !diff.Type.IsExactly(snap.Type)) { - snap.Type = new List(diff.Type.DeepCopy()); + snap.Type = new List(diff.Type.DeepCopyInternal()); foreach (var element in snap.Type) { onConstraint(element); } } @@ -228,7 +228,7 @@ T mergePrimitiveAttribute(T snap, T diff, bool allowAppend = false) where T : // if (!diff.IsNullOrEmpty() && (snap == null || !diff.IsExactly(snap))) if (!diff.IsNullOrEmpty() && (snap.IsNullOrEmpty() || !diff.IsExactly(snap))) { - var result = (T)diff.DeepCopy(); + var result = (T)diff.DeepCopyInternal(); if (allowAppend && diff.ObjectValue is string) { @@ -352,7 +352,7 @@ internal static FhirString constrainMax(FhirString max, UnsignedInt minValue) private T deepCopyAndRaiseOnConstraint(T elt) where T : PrimitiveType { - var result = (T)elt.DeepCopy(); + var result = (T)elt.DeepCopyInternal(); onConstraint(result); return result; } @@ -364,7 +364,7 @@ T mergeComplexAttribute(T snap, T diff) where T : Element { if (snap.IsNullOrEmpty()) { - result = (T)diff.DeepCopy(); + result = (T)diff.DeepCopyInternal(); onConstraint(result); } else if (!diff.IsExactly(snap)) @@ -374,14 +374,14 @@ T mergeComplexAttribute(T snap, T diff) where T : Element // [WMR 20170227] Diff type is equal to or derived from snap type // Clone base and recursively copy all non-null diff props over base props // So effectively the result inherits all missing properties from base - result = (T)snap.DeepCopy(); + result = (T)snap.DeepCopyInternal(); diff.CopyTo(result); } else { // [WMR 20170227] Diff type is incompatible with snap type (?) // diff fully replaces snap - result = (T)diff.DeepCopy(); + result = (T)diff.DeepCopyInternal(); } onConstraint(result); } @@ -400,12 +400,12 @@ T mergeComplexAttribute(T snap, T diff) where T : Element { if (snap.IsNullOrEmpty()) { - result = (List)diff.DeepCopy(); + result = (List)diff.DeepCopyInternal(); onConstraint(result); } else if (!diff.IsExactly(snap)) { - result = new List(snap.DeepCopy()); + result = new List(snap.DeepCopyInternal()); // Properly merge matching collection items foreach (var diffItem in diff) { @@ -418,7 +418,7 @@ T mergeComplexAttribute(T snap, T diff) where T : Element if (idx < 0) { // No match; add diff item - mergedItem = (ElementDefinition.ConstraintComponent)diffItem.DeepCopy(); + mergedItem = (ElementDefinition.ConstraintComponent)diffItem.DeepCopyInternal(); result.Add(mergedItem); } else @@ -461,12 +461,12 @@ List mergeCollection(List snap, List diff, Func matchIte { if (snap.IsNullOrEmpty()) { - result = (List)diff.DeepCopy(); + result = (List)diff.DeepCopyInternal(); onConstraint(result); } else if (!diff.IsExactly(snap)) { - result = new List(snap.DeepCopy()); + result = new List(snap.DeepCopyInternal()); // Properly merge matching collection items foreach (var diffItem in diff) { @@ -475,7 +475,7 @@ List mergeCollection(List snap, List diff, Func matchIte if (idx < 0) { // No match; add diff item - mergedItem = (T)diffItem.DeepCopy(); + mergedItem = (T)diffItem.DeepCopyInternal(); result.Add(mergedItem); } else @@ -502,7 +502,7 @@ private ElementDefinition.ElementDefinitionBindingComponent mergeBinding(Element { if (snap.IsNullOrEmpty()) { - result = (ElementDefinition.ElementDefinitionBindingComponent)diff.DeepCopy(); + result = (ElementDefinition.ElementDefinitionBindingComponent)diff.DeepCopyInternal(); onConstraint(result); } else if (!diff.IsExactly(snap)) diff --git a/src/Hl7.Fhir.Shared.Tests/Model/DeepCopyTest.cs b/src/Hl7.Fhir.Shared.Tests/Model/DeepCopyTest.cs index 649f1ee220..6d80afbaf0 100644 --- a/src/Hl7.Fhir.Shared.Tests/Model/DeepCopyTest.cs +++ b/src/Hl7.Fhir.Shared.Tests/Model/DeepCopyTest.cs @@ -39,7 +39,7 @@ public void CollectionDeepCopySemantics() var p2 = new Patient(); var patients = new List { p1, p2 }; - var patientsCopy = patients.DeepCopy(); + var patientsCopy = patients.DeepCopyInternal(); patients.Remove(p1); Assert.AreEqual(2, patientsCopy.Count()); diff --git a/src/Hl7.Fhir.Shims.Base/Model/StructureDefinition.cs b/src/Hl7.Fhir.Shims.Base/Model/StructureDefinition.cs index abf4296773..dac50d1bfb 100644 --- a/src/Hl7.Fhir.Shims.Base/Model/StructureDefinition.cs +++ b/src/Hl7.Fhir.Shims.Base/Model/StructureDefinition.cs @@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace Hl7.Fhir.Model; // [WMR 20160803] Add common base interfaces -public interface IElementList : IModifierExtendable, INotifyPropertyChanged, IDeepCopyable +public interface IElementList : IModifierExtendable, INotifyPropertyChanged { List Element { get; set; } } diff --git a/src/Hl7.Fhir.Support.Poco.Tests/Model/ModelTests.cs b/src/Hl7.Fhir.Support.Poco.Tests/Model/ModelTests.cs index d161ca30bd..8970fba3c7 100644 --- a/src/Hl7.Fhir.Support.Poco.Tests/Model/ModelTests.cs +++ b/src/Hl7.Fhir.Support.Poco.Tests/Model/ModelTests.cs @@ -216,7 +216,7 @@ public void TestListDeepCopy() { var x = new List { new(), new() }; - var y = new List(x.DeepCopy()); + var y = new List(x.DeepCopyInternal()); Assert.IsTrue(x[0] != null); Assert.AreNotEqual(x[0], y[0]); Assert.AreNotEqual(x[1], y[1]); diff --git a/src/Hl7.Fhir.Support.Tests/Introspection/ClassMappingTest.cs b/src/Hl7.Fhir.Support.Tests/Introspection/ClassMappingTest.cs index ea1ef5334e..3819233b01 100644 --- a/src/Hl7.Fhir.Support.Tests/Introspection/ClassMappingTest.cs +++ b/src/Hl7.Fhir.Support.Tests/Introspection/ClassMappingTest.cs @@ -166,15 +166,15 @@ public class Way : Resource, IPatient, ICoded public string Code { get; set; } public Date BirthDate => new(1972, 11, 30); - - public override IDeepCopyable DeepCopy() => throw new NotImplementedException(); + public IEnumerable ToCodings() => [new(null, Code)]; + protected internal override Base DeepCopyInternal() => throw new NotImplementedException(); } [FhirType("Way2", Since = Specification.FhirRelease.DSTU2)] public class Way2 : Resource { - public override IDeepCopyable DeepCopy() { throw new NotImplementedException(); } + protected internal override Base DeepCopyInternal() => throw new NotImplementedException(); } /* diff --git a/src/Hl7.Fhir.Support.Tests/Specification/AsyncSources.cs b/src/Hl7.Fhir.Support.Tests/Specification/AsyncSources.cs index 8ff13f8110..2105653449 100644 --- a/src/Hl7.Fhir.Support.Tests/Specification/AsyncSources.cs +++ b/src/Hl7.Fhir.Support.Tests/Specification/AsyncSources.cs @@ -190,7 +190,7 @@ public Task ResolveByUriAsync(string uri) internal class AResource : Resource { public int Data; - - public override IDeepCopyable DeepCopy() => throw new NotImplementedException(); + + protected internal override Base DeepCopyInternal() => throw new NotImplementedException(); } } \ No newline at end of file From 1fd58cd6187b673abddf307440b43d0e8eeb9730 Mon Sep 17 00:00:00 2001 From: Kasdejong Date: Tue, 17 Dec 2024 16:02:06 +0100 Subject: [PATCH 6/8] removed unsafe block ideas --- src/Hl7.Fhir.R4.Tests/Hl7.Fhir.R4.Tests.csproj | 1 - src/Hl7.Fhir.R4/Hl7.Fhir.R4.csproj | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Hl7.Fhir.R4.Tests/Hl7.Fhir.R4.Tests.csproj b/src/Hl7.Fhir.R4.Tests/Hl7.Fhir.R4.Tests.csproj index 0a58d76b0c..67680013c8 100644 --- a/src/Hl7.Fhir.R4.Tests/Hl7.Fhir.R4.Tests.csproj +++ b/src/Hl7.Fhir.R4.Tests/Hl7.Fhir.R4.Tests.csproj @@ -6,7 +6,6 @@ Hl7.Fhir.R4.Tests - true diff --git a/src/Hl7.Fhir.R4/Hl7.Fhir.R4.csproj b/src/Hl7.Fhir.R4/Hl7.Fhir.R4.csproj index 2a4c479b0d..75f2de645c 100644 --- a/src/Hl7.Fhir.R4/Hl7.Fhir.R4.csproj +++ b/src/Hl7.Fhir.R4/Hl7.Fhir.R4.csproj @@ -11,7 +11,6 @@ Firely's SDK for working with HL7 FHIR R4 (4.0.1) Firely's SDK for working with HL7 FHIR R4. This is the root package for the SDK includes core functionality to working with RESTful FHIR servers, POCO classes for FHIR, parsing/serialization of FHIR data and working with conformance data and terminologies. HL7;FHIR;Firely;SDK;POCO;Fhir client;Terminology;StructureDefinition;parsing;serialization;FHIR server - true From e30a2046df23eb0d7eae571f1a2ac36f1d47964d Mon Sep 17 00:00:00 2001 From: Kasdejong Date: Tue, 17 Dec 2024 16:12:20 +0100 Subject: [PATCH 7/8] Compatibility suppressions --- .../CompatibilitySuppressions.xml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/Hl7.Fhir.Base/CompatibilitySuppressions.xml b/src/Hl7.Fhir.Base/CompatibilitySuppressions.xml index 48190dcf42..768184637f 100644 --- a/src/Hl7.Fhir.Base/CompatibilitySuppressions.xml +++ b/src/Hl7.Fhir.Base/CompatibilitySuppressions.xml @@ -43,6 +43,20 @@ lib/net8.0/Hl7.Fhir.Base.dll true + + CP0001 + T:Hl7.Fhir.Model.IDeepCopyable + lib/net8.0/Hl7.Fhir.Base.dll + lib/net8.0/Hl7.Fhir.Base.dll + true + + + CP0001 + T:Hl7.Fhir.Model.ListCopyExtensions + lib/net8.0/Hl7.Fhir.Base.dll + lib/net8.0/Hl7.Fhir.Base.dll + true + CP0001 T:Hl7.Fhir.Serialization.DefaultModelFactory @@ -295,6 +309,20 @@ lib/net8.0/Hl7.Fhir.Base.dll true + + CP0002 + M:Hl7.Fhir.Model.Base.CopyTo(Hl7.Fhir.Model.IDeepCopyable) + lib/net8.0/Hl7.Fhir.Base.dll + lib/net8.0/Hl7.Fhir.Base.dll + true + + + CP0002 + M:Hl7.Fhir.Model.Base.DeepCopy + lib/net8.0/Hl7.Fhir.Base.dll + lib/net8.0/Hl7.Fhir.Base.dll + true + CP0002 M:Hl7.Fhir.Model.Base.get_Children @@ -631,6 +659,13 @@ lib/net8.0/Hl7.Fhir.Base.dll true + + CP0005 + M:Hl7.Fhir.Model.Base.DeepCopyInternal + lib/net8.0/Hl7.Fhir.Base.dll + lib/net8.0/Hl7.Fhir.Base.dll + true + CP0006 M:Hl7.Fhir.ElementModel.ITypedElement.Children(System.String) From b636011781f74136064ef41172c605893c4c90ac Mon Sep 17 00:00:00 2001 From: Kasdejong Date: Tue, 17 Dec 2024 16:49:30 +0100 Subject: [PATCH 8/8] hopefully fixed unit tests --- src/Hl7.Fhir.Base/Model/Base.Extensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hl7.Fhir.Base/Model/Base.Extensions.cs b/src/Hl7.Fhir.Base/Model/Base.Extensions.cs index 2fd62f9abc..a882d38161 100644 --- a/src/Hl7.Fhir.Base/Model/Base.Extensions.cs +++ b/src/Hl7.Fhir.Base/Model/Base.Extensions.cs @@ -41,7 +41,7 @@ public static IEnumerable Children(this Base instance) internal static IEnumerable DeepCopyInternal(this IEnumerable source) where T : Base { - return source.Select(item => item.DeepCopy()); + return source.Select(item => item.DeepCopy()).ToList(); } internal static void CopyToInternal(this Dictionary source, Dictionary target)