コード例 #1
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as DeviceObservationReport;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (InstantElement != null)
                {
                    dest.InstantElement = (Hl7.Fhir.Model.Instant)InstantElement.DeepCopy();
                }
                if (Identifier != null)
                {
                    dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy();
                }
                if (Source != null)
                {
                    dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy();
                }
                if (Subject != null)
                {
                    dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
                }
                if (VirtualDevice != null)
                {
                    dest.VirtualDevice = new List <Hl7.Fhir.Model.DeviceObservationReport.DeviceObservationReportVirtualDeviceComponent>(VirtualDevice.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 (InstantElement != null)
            {
                result.AddRange(InstantElement.Validate());
            }
            if (Capabilities != null)
            {
                result.AddRange(Capabilities.Validate());
            }
            if (Subject != null)
            {
                result.AddRange(Subject.Validate());
            }
            if (Item != null)
            {
                Item.ForEach(elem => result.AddRange(elem.Validate()));
            }

            return(result);
        }