예제 #1
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as QueryResponseComponent;

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (IdentifierElement != null)
                    {
                        dest.IdentifierElement = (Hl7.Fhir.Model.FhirUri)IdentifierElement.DeepCopy();
                    }
                    if (OutcomeElement != null)
                    {
                        dest.OutcomeElement = (Code <Hl7.Fhir.Model.Query.QueryOutcome>)OutcomeElement.DeepCopy();
                    }
                    if (TotalElement != null)
                    {
                        dest.TotalElement = (Hl7.Fhir.Model.Integer)TotalElement.DeepCopy();
                    }
                    if (Parameter != null)
                    {
                        dest.Parameter = new List <Hl7.Fhir.Model.Extension>(Parameter.DeepCopy());
                    }
                    if (First != null)
                    {
                        dest.First = new List <Hl7.Fhir.Model.Extension>(First.DeepCopy());
                    }
                    if (Previous != null)
                    {
                        dest.Previous = new List <Hl7.Fhir.Model.Extension>(Previous.DeepCopy());
                    }
                    if (Next != null)
                    {
                        dest.Next = new List <Hl7.Fhir.Model.Extension>(Next.DeepCopy());
                    }
                    if (Last != null)
                    {
                        dest.Last = new List <Hl7.Fhir.Model.Extension>(Last.DeepCopy());
                    }
                    if (Reference != null)
                    {
                        dest.Reference = new List <Hl7.Fhir.Model.ResourceReference>(Reference.DeepCopy());
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }
예제 #2
0
            public override ErrorList Validate()
            {
                var result = new ErrorList();

                result.AddRange(base.Validate());

                if (IdentifierElement != null)
                {
                    result.AddRange(IdentifierElement.Validate());
                }
                if (OutcomeElement != null)
                {
                    result.AddRange(OutcomeElement.Validate());
                }
                if (TotalElement != null)
                {
                    result.AddRange(TotalElement.Validate());
                }
                if (Parameter != null)
                {
                    Parameter.ForEach(elem => result.AddRange(elem.Validate()));
                }
                if (First != null)
                {
                    First.ForEach(elem => result.AddRange(elem.Validate()));
                }
                if (Previous != null)
                {
                    Previous.ForEach(elem => result.AddRange(elem.Validate()));
                }
                if (Next != null)
                {
                    Next.ForEach(elem => result.AddRange(elem.Validate()));
                }
                if (Last != null)
                {
                    Last.ForEach(elem => result.AddRange(elem.Validate()));
                }
                if (Reference != null)
                {
                    Reference.ForEach(elem => result.AddRange(elem.Validate()));
                }

                return(result);
            }