Ejemplo n.º 1
0
            public override ErrorList Validate()
            {
                var result = new ErrorList();

                result.AddRange(base.Validate());

                if (FrequencyElement != null)
                {
                    result.AddRange(FrequencyElement.Validate());
                }
                if (WhenElement != null)
                {
                    result.AddRange(WhenElement.Validate());
                }
                if (DurationElement != null)
                {
                    result.AddRange(DurationElement.Validate());
                }
                if (UnitsElement != null)
                {
                    result.AddRange(UnitsElement.Validate());
                }
                if (CountElement != null)
                {
                    result.AddRange(CountElement.Validate());
                }
                if (EndElement != null)
                {
                    result.AddRange(EndElement.Validate());
                }

                return(result);
            }
Ejemplo n.º 2
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Appointment;

            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 (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.Appointment.AppointmentStatus>)StatusElement.DeepCopy();
            }
            if (Type != null)
            {
                dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
            }
            if (Reason != null)
            {
                dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy();
            }
            if (PriorityElement != null)
            {
                dest.PriorityElement = (Hl7.Fhir.Model.UnsignedInt)PriorityElement.DeepCopy();
            }
            if (DescriptionElement != null)
            {
                dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy();
            }
            if (StartElement != null)
            {
                dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy();
            }
            if (EndElement != null)
            {
                dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy();
            }
            if (MinutesDurationElement != null)
            {
                dest.MinutesDurationElement = (Hl7.Fhir.Model.PositiveInt)MinutesDurationElement.DeepCopy();
            }
            if (Slot != null)
            {
                dest.Slot = new List <Hl7.Fhir.Model.ResourceReference>(Slot.DeepCopy());
            }
            if (CommentElement != null)
            {
                dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy();
            }
            if (Participant != null)
            {
                dest.Participant = new List <Hl7.Fhir.Model.Appointment.ParticipantComponent>(Participant.DeepCopy());
            }
            return(dest);
        }
Ejemplo n.º 3
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Slot;

            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 (ServiceCategory != null)
            {
                dest.ServiceCategory = (Hl7.Fhir.Model.CodeableConcept)ServiceCategory.DeepCopy();
            }
            if (ServiceType != null)
            {
                dest.ServiceType = new List <Hl7.Fhir.Model.CodeableConcept>(ServiceType.DeepCopy());
            }
            if (Specialty != null)
            {
                dest.Specialty = new List <Hl7.Fhir.Model.CodeableConcept>(Specialty.DeepCopy());
            }
            if (AppointmentType != null)
            {
                dest.AppointmentType = (Hl7.Fhir.Model.CodeableConcept)AppointmentType.DeepCopy();
            }
            if (Schedule != null)
            {
                dest.Schedule = (Hl7.Fhir.Model.ResourceReference)Schedule.DeepCopy();
            }
            if (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.Slot.SlotStatus>)StatusElement.DeepCopy();
            }
            if (StartElement != null)
            {
                dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy();
            }
            if (EndElement != null)
            {
                dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy();
            }
            if (OverbookedElement != null)
            {
                dest.OverbookedElement = (Hl7.Fhir.Model.FhirBoolean)OverbookedElement.DeepCopy();
            }
            if (CommentElement != null)
            {
                dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy();
            }
            return(dest);
        }
Ejemplo n.º 4
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Slot;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Type != null)
                {
                    dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
                }
                if (Schedule != null)
                {
                    dest.Schedule = (Hl7.Fhir.Model.ResourceReference)Schedule.DeepCopy();
                }
                if (FreeBusyTypeElement != null)
                {
                    dest.FreeBusyTypeElement = (Code <Hl7.Fhir.Model.Slot.SlotStatus>)FreeBusyTypeElement.DeepCopy();
                }
                if (StartElement != null)
                {
                    dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy();
                }
                if (EndElement != null)
                {
                    dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy();
                }
                if (OverbookedElement != null)
                {
                    dest.OverbookedElement = (Hl7.Fhir.Model.FhirBoolean)OverbookedElement.DeepCopy();
                }
                if (CommentElement != null)
                {
                    dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
Ejemplo n.º 5
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as AppointmentResponse;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Appointment != null)
                {
                    dest.Appointment = (Hl7.Fhir.Model.ResourceReference)Appointment.DeepCopy();
                }
                if (StartElement != null)
                {
                    dest.StartElement = (Hl7.Fhir.Model.Instant)StartElement.DeepCopy();
                }
                if (EndElement != null)
                {
                    dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy();
                }
                if (ParticipantType != null)
                {
                    dest.ParticipantType = new List <Hl7.Fhir.Model.CodeableConcept>(ParticipantType.DeepCopy());
                }
                if (Actor != null)
                {
                    dest.Actor = (Hl7.Fhir.Model.ResourceReference)Actor.DeepCopy();
                }
                if (ParticipantStatus_Element != null)
                {
                    dest.ParticipantStatus_Element = (Code <Hl7.Fhir.Model.AppointmentResponse.ParticipantStatus>)ParticipantStatus_Element.DeepCopy();
                }
                if (CommentElement != null)
                {
                    dest.CommentElement = (Hl7.Fhir.Model.FhirString)CommentElement.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
Ejemplo n.º 6
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Subscription;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (CriteriaElement != null)
                {
                    dest.CriteriaElement = (Hl7.Fhir.Model.FhirString)CriteriaElement.DeepCopy();
                }
                if (Contact != null)
                {
                    dest.Contact = new List <Hl7.Fhir.Model.ContactPoint>(Contact.DeepCopy());
                }
                if (ReasonElement != null)
                {
                    dest.ReasonElement = (Hl7.Fhir.Model.FhirString)ReasonElement.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.Subscription.SubscriptionStatus>)StatusElement.DeepCopy();
                }
                if (ErrorElement != null)
                {
                    dest.ErrorElement = (Hl7.Fhir.Model.FhirString)ErrorElement.DeepCopy();
                }
                if (Channel != null)
                {
                    dest.Channel = (Hl7.Fhir.Model.Subscription.ChannelComponent)Channel.DeepCopy();
                }
                if (EndElement != null)
                {
                    dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy();
                }
                if (Tag != null)
                {
                    dest.Tag = new List <Hl7.Fhir.Model.Coding>(Tag.DeepCopy());
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
Ejemplo n.º 7
0
        public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (StartElement != null)
            {
                result.AddRange(StartElement.Validate());
            }
            if (EndElement != null)
            {
                result.AddRange(EndElement.Validate());
            }

            return(result);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Reading ctor
        /// </summary>
        public XmlTree(ResReader reader)
            : base(reader, ChunkTypes.RES_XML_TYPE)
        {
            strings     = new StringPool(reader);
            resourceMap = new ResourceMap(reader);

            while (true)
            {
                var  tag = reader.PeekChunkType();
                Node node;
                switch (tag)
                {
                case ChunkTypes.RES_XML_START_NAMESPACE_TYPE:
                    node = new StartNamespace(reader, this);
                    break;

                case ChunkTypes.RES_XML_START_ELEMENT_TYPE:
                    node = new StartElement(reader, this);
                    break;

                case ChunkTypes.RES_XML_CDATA_TYPE:
                    node = new CData(reader, this);
                    break;

                case ChunkTypes.RES_XML_END_ELEMENT_TYPE:
                    node = new EndElement(reader, this);
                    break;

                case ChunkTypes.RES_XML_END_NAMESPACE_TYPE:
                    node = new EndNamespace(reader, this);
                    break;

                default:
                    throw new IOException(string.Format("Unexpected tag: 0x{0:X}", (int)tag));
                }

                nodes.Add(node);
                if (tag == ChunkTypes.RES_XML_END_NAMESPACE_TYPE)
                {
                    break;
                }
            }
        }
Ejemplo n.º 9
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Period;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (StartElement != null)
            {
                dest.StartElement = (Hl7.Fhir.Model.FhirDateTime)StartElement.DeepCopy();
            }
            if (EndElement != null)
            {
                dest.EndElement = (Hl7.Fhir.Model.FhirDateTime)EndElement.DeepCopy();
            }
            return(dest);
        }
Ejemplo n.º 10
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");
                }
            }
Ejemplo n.º 11
0
        /// <summary>
        /// Reading ctor
        /// </summary>
        public XmlTree(ResReader reader)
            : base(reader, ChunkTypes.RES_XML_TYPE)
        {
            strings = new StringPool(reader);
            resourceMap = new ResourceMap(reader);

            while (true)
            {
                var tag = reader.PeekChunkType();
                Node node;
                switch (tag)
                {
                    case ChunkTypes.RES_XML_START_NAMESPACE_TYPE:
                        node = new StartNamespace(reader, this);
                        break;
                    case ChunkTypes.RES_XML_START_ELEMENT_TYPE:
                        node = new StartElement(reader, this);
                        break;
                    case ChunkTypes.RES_XML_CDATA_TYPE:
                        node = new CData(reader, this);
                        break;
                    case ChunkTypes.RES_XML_END_ELEMENT_TYPE:
                        node = new EndElement(reader, this);
                        break;
                    case ChunkTypes.RES_XML_END_NAMESPACE_TYPE:
                        node = new EndNamespace(reader, this);
                        break;
                    default:
                        throw new IOException(string.Format("Unexpected tag: 0x{0:X}", (int)tag));
                }

                nodes.Add(node);
                if (tag == ChunkTypes.RES_XML_END_NAMESPACE_TYPE)
                    break;
            }
        }
Ejemplo n.º 12
0
        public void Parse(StreamReader streamReader)
        {
            ParseState state          = ParseState.Outside;
            bool       parseCancelled = false;
            int        depth          = 0;

            string buffer = streamReader.ReadToEnd();

            char[] c             = buffer.ToCharArray();
            char   attrQuoteChar = '\0';
            int    i             = -1;

            string elementName = "";
            string attrName    = "";
            Dictionary <string, string> attributes = new Dictionary <string, string>();

            bool          documentStarted = false;
            bool          tokenComplete   = false;
            StringBuilder token           = new StringBuilder();

            while (++i < c.Length && !parseCancelled)
            {
                char cc = c[i]; // current char

                switch (state)
                {
                case ParseState.Outside:
                    if (cc == '<')
                    {
                        documentStarted = true;
                        StartDocument?.Invoke();
                        state = ParseState.LessThan;
                    }
                    else
                    {
                        token.Append(cc);
                    }
                    break;

                case ParseState.LessThan:
                    if (char.IsWhiteSpace(cc))
                    {
                        // do nothing
                    }
                    else if (MayStartXmlName(cc))
                    {
                        elementName = "";
                        attributes  = new Dictionary <string, string>();
                        token       = new StringBuilder(cc.ToString());
                        state       = ParseState.NewElementName;
                    }
                    else if (cc == '/')
                    {
                        tokenComplete = false;
                        token         = new StringBuilder();
                        state         = ParseState.EndElementName;
                    }
                    else if (cc == '!')     // !DOCTYPE or !CDATA[[ or !--
                    {
                        var bang = new string(c.SubArray(i, 10));
                        if (bang.StartsWith("!DOCTYPE "))
                        {
                            i    += 8;
                            token = new StringBuilder();
                            state = ParseState.DocType;
                        }
                        else if (bang.StartsWith("!CDATA[["))
                        {
                            i    += 7;
                            token = new StringBuilder();
                            state = ParseState.CData;
                        }
                        else if (bang.StartsWith("!--"))
                        {
                            i    += 2;
                            token = new StringBuilder();
                            state = ParseState.Comment;
                        }
                        else
                        {
                            parseCancelled = RaiseError("Unexpected chars after <! : <" + c.SubArray(i, 5), i);
                        }
                    }
                    else if (cc == '?')     // ?xml declaration ?
                    {
                        if (new string(c.SubArray(i, 5)) == "?xml ")
                        {
                            i    += 4;
                            state = ParseState.XmlDeclaration;
                        }
                        else
                        {
                            state = ParseState.ProcessingInstruction;
                        }
                    }
                    else
                    {
                        parseCancelled = RaiseError("Unexpected char '" + cc.ToString() + "' after <", i);
                    }
                    break;

                case ParseState.DocType:
                case ParseState.XmlDeclaration:
                    if (cc == '>')
                    {
                        state = ParseState.Outside;
                    }
                    // Ignore anything else, until we get to '>'
                    break;

                case ParseState.NewElementName:
                    if (ValidInXmlName(cc))
                    {
                        token.Append(cc);
                    }
                    else if (cc == '>')
                    {
                        elementName = token.ToString();
                        StartElement?.Invoke(elementName, attributes);
                        depth++;
                        token = new StringBuilder();
                        state = ParseState.InsideElement;
                    }
                    else if (cc == '/')
                    {
                        elementName = token.ToString();
                        state       = ParseState.EmptyElement;
                    }
                    else if (cc == ' ')
                    {
                        elementName = token.ToString();
                        state       = ParseState.SeekingAttrName;
                        attributes  = new Dictionary <string, string>();
                    }
                    else
                    {
                        parseCancelled = RaiseError("Invalid char '" + cc.ToString() + "' in Element Name", i);
                    }
                    break;

                case ParseState.SeekingAttrName:
                    if (char.IsWhiteSpace(cc))
                    {
                        // do nothing
                    }
                    else if (MayStartXmlName(cc))
                    {
                        token = new StringBuilder(cc.ToString());
                        state = ParseState.AttrName;
                    }
                    else if (cc == '/')
                    {
                        state = ParseState.EmptyElement;
                    }
                    else if (cc == '>')
                    {
                        StartElement?.Invoke(elementName, attributes);
                        depth++;
                        token = new StringBuilder();
                        state = ParseState.InsideElement;
                    }
                    else
                    {
                        parseCancelled = RaiseError("Invalid char '" + cc.ToString() + "' at start of Attribute Name", i);
                    }
                    break;

                case ParseState.AttrName:
                    if (ValidInXmlName(cc))
                    {
                        token.Append(cc);
                    }
                    else if (cc == ' ')
                    {
                        attrName = token.ToString();
                        token    = new StringBuilder();
                        state    = ParseState.SeekingEquals;
                    }
                    else if (cc == '=')
                    {
                        attrName = token.ToString();
                        token    = new StringBuilder();
                        state    = ParseState.SeekingAttrValue;
                    }
                    else
                    {
                        parseCancelled = RaiseError("Invalid char '" + cc.ToString() + "' in Attribute Name", i);
                    }
                    break;

                case ParseState.SeekingEquals:
                    if (cc == '=')
                    {
                        state = ParseState.SeekingAttrValue;
                    }
                    else if (cc == '/')
                    {
                        attributes.Add(attrName, "");
                        state = ParseState.EmptyElement;
                    }
                    else if (cc == '>')
                    {
                        attributes.Add(attrName, "");
                        token = new StringBuilder();
                        state = ParseState.InsideElement;
                    }
                    else if (MayStartXmlName(cc))
                    {
                        // Assume empty attribute (with no value)
                        attributes.Add(attrName, "");
                        token = new StringBuilder(cc.ToString());
                        state = ParseState.AttrName;
                    }
                    else
                    {
                        parseCancelled = RaiseError("Found '" + cc.ToString() + "' when expecting '=' after Attribute Name", i);
                    }
                    break;

                case ParseState.SeekingAttrValue:
                    if (cc == '\'' || cc == '\"')
                    {
                        attrQuoteChar = cc;
                        token         = new StringBuilder();
                        state         = ParseState.AttrValue;
                    }
                    else
                    {
                        parseCancelled = RaiseError("Found '" + cc.ToString() + "' when expecting quoted Attribute Value", i);
                    }
                    break;

                case ParseState.AttrValue:
                    if (cc == attrQuoteChar)
                    {
                        attributes.Add(attrName, token.ToString());
                        token = new StringBuilder();
                        state = ParseState.SeekingAttrName;
                    }
                    else
                    {
                        token.Append(cc);
                    }
                    break;

                case ParseState.EmptyElement:
                    if (cc == '>')
                    {
                        StartElement?.Invoke(elementName, attributes);
                        // no change to depth, because...
                        EndElement?.Invoke(elementName);
                        token = new StringBuilder();
                        state = ParseState.InsideElement;
                    }
                    else if (cc == ' ')
                    {
                        // do nothing
                    }
                    else
                    {
                        parseCancelled = RaiseError("Found '" + cc.ToString() + "' after '/' in empty Element Tag", i);
                    }
                    break;

                case ParseState.InsideElement:
                    if (cc == '<')
                    {
                        string data = token.ToString();
                        if (data.Length > 0)
                        {
                            if (string.IsNullOrWhiteSpace(data))
                            {
                                IgnorableWhitespace?.Invoke(data, 0, data.Length);
                            }
                            else
                            {
                                Characters?.Invoke(data, 0, data.Length);
                            }
                        }
                        token = new StringBuilder();
                        state = ParseState.LessThan;
                    }
                    else
                    {
                        token.Append(cc);
                    }
                    break;

                case ParseState.EndElementName:
                    if (MayStartXmlName(cc) && token.Length == 0)
                    {
                        token.Append(cc);
                        tokenComplete = false;
                    }
                    else if (ValidInXmlName(cc) && !tokenComplete)
                    {
                        token.Append(cc);
                    }
                    else if (cc == '>')
                    {
                        elementName = token.ToString();
                        EndElement?.Invoke(elementName);
                        token = new StringBuilder();
                        if (--depth > 0)
                        {
                            state = ParseState.InsideElement;
                        }
                        else
                        {
                            state = ParseState.Outside;
                        }
                    }
                    else if (cc == ' ')
                    {
                        tokenComplete = true;
                    }
                    else
                    {
                        parseCancelled = RaiseError("Found '" + cc.ToString() + "' after Name in End-of-Element tag.", i);
                    }
                    break;

                case ParseState.Comment:
                    if (cc == '-' && new string(c.SubArray(i, 3)) == "-->")
                    {
                        i += 2;
                        Comment?.Invoke(token.ToString());
                        token = new StringBuilder();
                        if (depth > 0)
                        {
                            state = ParseState.InsideElement;
                        }
                        else
                        {
                            state = ParseState.Outside;
                        }
                    }
                    else
                    {
                        token.Append(cc);
                    }
                    break;

                case ParseState.ProcessingInstruction:
                    if (cc == '?' && new string(c.SubArray(i, 2)) == "?>")
                    {
                        i          += 1;
                        elementName = token.ToString();
                        ProcessingInstruction?.Invoke(elementName.Head(), elementName.Tail());
                        token = new StringBuilder();
                        if (depth > 0)
                        {
                            state = ParseState.InsideElement;
                        }
                        else
                        {
                            state = ParseState.Outside;
                        }
                    }
                    else
                    {
                        token.Append(cc);
                    }
                    break;

                default:
                    parseCancelled = RaiseError("Unhandled ParseState: " + state.ToString(), i);
                    break;
                }
            }
            if (documentStarted)
            {
                EndDocument?.Invoke();
            }
        }
Ejemplo n.º 13
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as Subscription;

            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 (NameElement != null)
            {
                dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy();
            }
            if (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.SubscriptionState>)StatusElement.DeepCopy();
            }
            if (Topic != null)
            {
                dest.Topic = (Hl7.Fhir.Model.ResourceReference)Topic.DeepCopy();
            }
            if (Contact != null)
            {
                dest.Contact = new List <Hl7.Fhir.Model.ContactPoint>(Contact.DeepCopy());
            }
            if (EndElement != null)
            {
                dest.EndElement = (Hl7.Fhir.Model.Instant)EndElement.DeepCopy();
            }
            if (ReasonElement != null)
            {
                dest.ReasonElement = (Hl7.Fhir.Model.FhirString)ReasonElement.DeepCopy();
            }
            if (FilterBy != null)
            {
                dest.FilterBy = new List <Hl7.Fhir.Model.Subscription.FilterByComponent>(FilterBy.DeepCopy());
            }
            if (Error != null)
            {
                dest.Error = new List <Hl7.Fhir.Model.CodeableConcept>(Error.DeepCopy());
            }
            if (ChannelType != null)
            {
                dest.ChannelType = (Hl7.Fhir.Model.Coding)ChannelType.DeepCopy();
            }
            if (EndpointElement != null)
            {
                dest.EndpointElement = (Hl7.Fhir.Model.FhirUrl)EndpointElement.DeepCopy();
            }
            if (HeaderElement != null)
            {
                dest.HeaderElement = new List <Hl7.Fhir.Model.FhirString>(HeaderElement.DeepCopy());
            }
            if (HeartbeatPeriodElement != null)
            {
                dest.HeartbeatPeriodElement = (Hl7.Fhir.Model.UnsignedInt)HeartbeatPeriodElement.DeepCopy();
            }
            if (TimeoutElement != null)
            {
                dest.TimeoutElement = (Hl7.Fhir.Model.UnsignedInt)TimeoutElement.DeepCopy();
            }
            if (ContentTypeElement != null)
            {
                dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopy();
            }
            if (ContentElement != null)
            {
                dest.ContentElement = (Code <Hl7.Fhir.Model.Subscription.SubscriptionPayloadContent>)ContentElement.DeepCopy();
            }
            return(dest);
        }
 public void Visit(EndElement end)
 {
     endEmelents++;
 }