コード例 #1
0
        public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (MasterIdentifier != null)
            {
                result.AddRange(MasterIdentifier.Validate());
            }
            if (Identifier != null)
            {
                Identifier.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (Subject != null)
            {
                result.AddRange(Subject.Validate());
            }
            if (Type != null)
            {
                result.AddRange(Type.Validate());
            }
            if (Subtype != null)
            {
                result.AddRange(Subtype.Validate());
            }
            if (Author != null)
            {
                Author.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (Custodian != null)
            {
                result.AddRange(Custodian.Validate());
            }
            if (Authenticator != null)
            {
                result.AddRange(Authenticator.Validate());
            }
            if (CreatedElement != null)
            {
                result.AddRange(CreatedElement.Validate());
            }
            if (IndexedElement != null)
            {
                result.AddRange(IndexedElement.Validate());
            }
            if (StatusElement != null)
            {
                result.AddRange(StatusElement.Validate());
            }
            if (DocStatus != null)
            {
                result.AddRange(DocStatus.Validate());
            }
            if (Supercedes != null)
            {
                result.AddRange(Supercedes.Validate());
            }
            if (DescriptionElement != null)
            {
                result.AddRange(DescriptionElement.Validate());
            }
            if (Confidentiality != null)
            {
                result.AddRange(Confidentiality.Validate());
            }
            if (PrimaryLanguageElement != null)
            {
                result.AddRange(PrimaryLanguageElement.Validate());
            }
            if (MimeTypeElement != null)
            {
                result.AddRange(MimeTypeElement.Validate());
            }
            if (Format != null)
            {
                result.AddRange(Format.Validate());
            }
            if (SizeElement != null)
            {
                result.AddRange(SizeElement.Validate());
            }
            if (HashElement != null)
            {
                result.AddRange(HashElement.Validate());
            }
            if (LocationElement != null)
            {
                result.AddRange(LocationElement.Validate());
            }
            if (Service != null)
            {
                result.AddRange(Service.Validate());
            }
            if (Context != null)
            {
                result.AddRange(Context.Validate());
            }

            return(result);
        }
コード例 #2
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as DocumentReference;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (MasterIdentifier != null)
                {
                    dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopy();
                }
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Subject != null)
                {
                    dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
                }
                if (Type != null)
                {
                    dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
                }
                if (Class != null)
                {
                    dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy();
                }
                if (Author != null)
                {
                    dest.Author = new List <Hl7.Fhir.Model.ResourceReference>(Author.DeepCopy());
                }
                if (Custodian != null)
                {
                    dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy();
                }
                if (PolicyManagerElement != null)
                {
                    dest.PolicyManagerElement = (Hl7.Fhir.Model.FhirUri)PolicyManagerElement.DeepCopy();
                }
                if (Authenticator != null)
                {
                    dest.Authenticator = (Hl7.Fhir.Model.ResourceReference)Authenticator.DeepCopy();
                }
                if (CreatedElement != null)
                {
                    dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy();
                }
                if (IndexedElement != null)
                {
                    dest.IndexedElement = (Hl7.Fhir.Model.Instant)IndexedElement.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.DocumentReference.DocumentReferenceStatus>)StatusElement.DeepCopy();
                }
                if (DocStatus != null)
                {
                    dest.DocStatus = (Hl7.Fhir.Model.CodeableConcept)DocStatus.DeepCopy();
                }
                if (RelatesTo != null)
                {
                    dest.RelatesTo = new List <Hl7.Fhir.Model.DocumentReference.DocumentReferenceRelatesToComponent>(RelatesTo.DeepCopy());
                }
                if (DescriptionElement != null)
                {
                    dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy();
                }
                if (Confidentiality != null)
                {
                    dest.Confidentiality = new List <Hl7.Fhir.Model.CodeableConcept>(Confidentiality.DeepCopy());
                }
                if (PrimaryLanguageElement != null)
                {
                    dest.PrimaryLanguageElement = (Hl7.Fhir.Model.Code)PrimaryLanguageElement.DeepCopy();
                }
                if (MimeTypeElement != null)
                {
                    dest.MimeTypeElement = (Hl7.Fhir.Model.Code)MimeTypeElement.DeepCopy();
                }
                if (FormatElement != null)
                {
                    dest.FormatElement = new List <Hl7.Fhir.Model.FhirUri>(FormatElement.DeepCopy());
                }
                if (SizeElement != null)
                {
                    dest.SizeElement = (Hl7.Fhir.Model.Integer)SizeElement.DeepCopy();
                }
                if (HashElement != null)
                {
                    dest.HashElement = (Hl7.Fhir.Model.FhirString)HashElement.DeepCopy();
                }
                if (LocationElement != null)
                {
                    dest.LocationElement = (Hl7.Fhir.Model.FhirUri)LocationElement.DeepCopy();
                }
                if (Service != null)
                {
                    dest.Service = (Hl7.Fhir.Model.DocumentReference.DocumentReferenceServiceComponent)Service.DeepCopy();
                }
                if (Context != null)
                {
                    dest.Context = (Hl7.Fhir.Model.DocumentReference.DocumentReferenceContextComponent)Context.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }