public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as Group; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (ActiveElement != null) { dest.ActiveElement = (Hl7.Fhir.Model.FhirBoolean)ActiveElement.DeepCopy(); } if (TypeElement != null) { dest.TypeElement = (Code <Hl7.Fhir.Model.Group.GroupType>)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 != null) { dest.Characteristic = new List <Hl7.Fhir.Model.Group.CharacteristicComponent>(Characteristic.DeepCopy()); } if (Member != null) { dest.Member = new List <Hl7.Fhir.Model.Group.MemberComponent>(Member.DeepCopy()); } return(dest); }
internal string GetFullPath() { var stringBuilder = new StringBuilder(); var logicalElementAttribute = ActualElement.Attributes(XName.Get(Config.AttributeToIdentifyDuplicateElements)).FirstOrDefault(); var isLeafNodeWithIdentificationAttribute = logicalElementAttribute != null && !ActualElement.HasElements; var logicalElementAttributeName = isLeafNodeWithIdentificationAttribute ? string.Format("[{0}]", logicalElementAttribute.Value) : string.Empty; stringBuilder.Append(string.Format("/{0}{1}", ActualElement.Name, logicalElementAttributeName)); stringBuilder.Insert(0, ParentElement == null ? string.Format("{0}", Config.DocumentName) : ParentElement.GetFullPath()); return(stringBuilder.ToString()); }
public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (Identifier != null) { result.AddRange(Identifier.Validate()); } if (TypeElement != null) { result.AddRange(TypeElement.Validate()); } if (ActualElement != null) { result.AddRange(ActualElement.Validate()); } if (Code != null) { result.AddRange(Code.Validate()); } if (NameElement != null) { result.AddRange(NameElement.Validate()); } if (QuantityElement != null) { result.AddRange(QuantityElement.Validate()); } if (Characteristic != null) { Characteristic.ForEach(elem => result.AddRange(elem.Validate())); } if (Member != null) { Member.ForEach(elem => result.AddRange(elem.Validate())); } return(result); }