Esempio n. 1
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Quantity;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (ValueElement != null)
                {
                    dest.ValueElement = (Hl7.Fhir.Model.FhirDecimal)ValueElement.DeepCopy();
                }
                if (ComparatorElement != null)
                {
                    dest.ComparatorElement = (Code <Hl7.Fhir.Model.Quantity.QuantityCompararator>)ComparatorElement.DeepCopy();
                }
                if (UnitsElement != null)
                {
                    dest.UnitsElement = (Hl7.Fhir.Model.FhirString)UnitsElement.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);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
Esempio n. 2
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as ScheduleRepeatComponent;

                if (dest != null)
                {
                    base.CopyTo(dest);
                    if (FrequencyElement != null)
                    {
                        dest.FrequencyElement = (Hl7.Fhir.Model.Integer)FrequencyElement.DeepCopy();
                    }
                    if (WhenElement != null)
                    {
                        dest.WhenElement = (Code <Hl7.Fhir.Model.Schedule.EventTiming>)WhenElement.DeepCopy();
                    }
                    if (DurationElement != null)
                    {
                        dest.DurationElement = (Hl7.Fhir.Model.FhirDecimal)DurationElement.DeepCopy();
                    }
                    if (UnitsElement != null)
                    {
                        dest.UnitsElement = (Code <Hl7.Fhir.Model.Schedule.UnitsOfTime>)UnitsElement.DeepCopy();
                    }
                    if (CountElement != null)
                    {
                        dest.CountElement = (Hl7.Fhir.Model.Integer)CountElement.DeepCopy();
                    }
                    if (EndElement != null)
                    {
                        dest.EndElement = (Hl7.Fhir.Model.FhirDateTime)EndElement.DeepCopy();
                    }
                    return(dest);
                }
                else
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }
            }