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); }
public void RefreshStories() { Node[] startNodesArray = nodes.Where(x => x.GetType() == typeof(StartElement)).ToArray(); StartElement[] startNodes = new StartElement[startNodesArray.Length]; for (int i = 0; i < startNodes.Length; i++) { startNodes[i] = startNodesArray[i] as StartElement; } StoryNames = startNodes.Select(x => x.StoryName).ToArray(); _shortStories = new List <StoryElement> [startNodes.Length]; for (int i = 0; i < _shortStories.Length; i++) { _shortStories[i] = new List <StoryElement>(); _shortStories[i].Add(startNodes[i]); StartElement currentStartNode = startNodes[i]; StoryElement currentNode = startNodes[i].GetOutputPort("NextNode").GetOutputValue() as StoryElement; while (currentNode != null && currentNode.GetOutputPort("NextNode").IsConnected&& currentNode.GetOutputPort("NextNode").GetOutputValue().GetType() != typeof(StartElement)) { _shortStories[i].Add(currentNode); currentNode = currentNode.GetOutputPort("NextNode").GetOutputValue() as StoryElement; } if (currentNode != null && currentNode.GetType() != typeof(StartElement)) { _shortStories[i].Add(currentNode); } } }
/// <summary> /// Add nodes for the given element and its children /// </summary> private void CreateNodes(XElement element) { // Start namespace var namespaceNodes = element.Attributes().Where(x => x.IsNamespaceDeclaration).Select(x => new StartNamespace(this, x)).ToList(); namespaceNodes.ForEach(x => nodes.Add(x)); // Start element var start = new StartElement(this, element); nodes.Add(start); // Element children foreach (var child in element.Nodes()) { var childElement = child as XElement; if (childElement != null) { CreateNodes(childElement); } var childText = child as XText; if (childText != null) { nodes.Add(new CData(this, childText)); } } // End element nodes.Add(new EndElement(this, start)); // End namespaces var endNamespaceNodes = namespaceNodes.Select(x => new EndNamespace(this, x)).Reverse().ToList(); endNamespaceNodes.ForEach(x => nodes.Add(x)); }
public WorkflowResult StartNewInstance(string workflowCode, object flowData) { var definition = _flowRepository.GetFlowDefinitionByCode(workflowCode); var context = ContextBuilder.Build(workflowCode, flowData, _sessionProvider, definition); StartElement startElement = definition .GetStartingElements() .FirstOrDefault(element => _ruleEngine.CanExecuteElement(element)); if (startElement == null) { throw new CannotStartWorkflowInstanceException("Start element not found."); } var currentElements = definition.GetElementByIds(startElement.ToElements); if (currentElements == null) { throw new ElementNotFoundException(startElement.ToElements); } context.CurrentElements = currentElements; WorkflowStatus status = _executionHelper.ExecuteElement(context); _flowRepository.SaveStatus(status); return(ResultBuilder.BuildResult(context, status)); }
/// <summary> /// Add nodes for the given element and its children /// </summary> private void CreateNodes(XElement element) { // Start namespace var namespaceNodes = element.Attributes().Where(x => x.IsNamespaceDeclaration).Select(x => new StartNamespace(this, x)).ToList(); namespaceNodes.ForEach(x => nodes.Add(x)); // Start element var start = new StartElement(this, element); nodes.Add(start); // Element children foreach (var child in element.Nodes()) { var childElement = child as XElement; if (childElement != null) CreateNodes(childElement); var childText = child as XText; if (childText != null) nodes.Add(new CData(this, childText)); } // End element nodes.Add(new EndElement(this, start)); // End namespaces var endNamespaceNodes = namespaceNodes.Select(x => new EndNamespace(this, x)).Reverse().ToList(); endNamespaceNodes.ForEach(x => nodes.Add(x)); }
internal List <StartModel> RandomStart(int Size) { StartElement.Clear(); while (1 == 1) { StartElement.Add(new StartModel() { Name = StartValue, Height = rand.Next(minSize, Size), Width = rand.Next(minSize, Size) }); var Start = StartElement[0]; if (UsedPlace.Any(item => item.Contains($"{Start.Name}{Start.Height}{Start.Width}"))) { StartElement.Clear(); } else { UsedPlace.Add($"{Start.Name}{Start.Height}{Start.Width}"); break; } } return(StartElement); }
public IPipeElement <QueuePipeContext, string, TReturn> StartWithQueueMessage <TReturn, TStepProvider>( string queueMessage) { var context = new QueuePipeContext(_serviceProvider, queueMessage); var provider = _serviceProvider.GetRequiredService <TStepProvider>(); return(StartElement <QueuePipeContext, string, TReturn> .Create(context, queueMessage, provider)); }
public IPipeElement <PipeContext, TInput, TReturn> StartWithActivity <TInput, TReturn, TStepProvider>( TInput input) { var context = new PipeContext(_serviceProvider); var provider = _serviceProvider.GetRequiredService <TStepProvider>(); return(StartElement <PipeContext, TInput, TReturn> .Create(context, input, provider)); }
public IPipeElement <TimerPipeContext, TimerInfo, TReturn> StartWithTimer <TReturn, TStepProvider>( TimerInfo timer) { var context = new TimerPipeContext(_serviceProvider, timer); var provider = _serviceProvider.GetRequiredService <TStepProvider>(); return(StartElement <TimerPipeContext, TimerInfo, TReturn> .Create(context, timer, provider)); }
public IPipeElement <HttpPipeContext, HttpRequest, TReturn> StartWithHttpRequest <TReturn, TStepProvider>( HttpRequest httpRequest) { var context = new HttpPipeContext(_serviceProvider, httpRequest); var provider = _serviceProvider.GetRequiredService <TStepProvider>(); return(StartElement <HttpPipeContext, HttpRequest, TReturn> .Create(context, httpRequest, provider)); }
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); }
public override int GetHashCode() { unchecked { int hashCode = StartElement.GetHashCode(); hashCode = (hashCode * 397) ^ EndOfInputElement.GetHashCode(); hashCode = (hashCode * 397) ^ Productions.GetHashCode(); return(hashCode); } }
public override void WriteToXml(System.Xml.XmlWriter writer) { writer.WriteStartElement("ModeElement"); writer.WriteAttributeString("visibleInPlayer", IsVisibleInPlayer ? "true" : "false"); DoWriteToXml(writer); StartElement.WriteToXml(writer); if (Trigger != null) { Trigger.WriteToXml(writer); } writer.WriteEndElement(); }
public bool Equals(ContextFreeGrammar <T> other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(StartElement.Equals(other.StartElement) && EndOfInputElement.Equals(other.EndOfInputElement) && Productions.SequenceEqual(other.Productions)); }
internal void WriteStartGroupBy(string groupFieldName, bool collapse, int?groupLimit = null) { if (this._unclosedTags > 0) { var tagsToClose = this._unclosedTags; if (this._tree[0].Name == "Query") { tagsToClose--; } else if (this._tree[0].Name == "View") { tagsToClose -= 2; } if (tagsToClose > 0) { this._tree.Add(new EndElement { Count = tagsToClose }); } this._unclosedTags -= tagsToClose; } var elem = new StartElement { Name = "GroupBy", Attributes = new List <Attribute>() }; if (collapse) { elem.Attributes.Add(new Attribute { Name = "Collapse", Value = "TRUE" }); } if (groupLimit.HasValue) { elem.Attributes.Add(new Attribute { Name = "GroupLimit", Value = "" + groupLimit.Value }); } this._tree.Add(elem); this._tree.Add(new FieldRefElement { Name = groupFieldName }); this.WriteEnd(); }
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); }
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"); } }
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"); } }
/// <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; } } }
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); }
/// <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; } }
public override void Visit(IElementVisitor visitor) { StartElement.Visit(visitor); }
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(); } }
/// <summary> /// Creation ctor /// </summary> internal EndElement(XmlTree tree, StartElement start) : base(tree, ChunkTypes.RES_XML_END_ELEMENT_TYPE) { Name = start.Name; Namespace = start.Namespace; }
public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (Identifier != null) { Identifier.ForEach(elem => result.AddRange(elem.Validate())); } if (StatusElement != null) { result.AddRange(StatusElement.Validate()); } if (ClassElement != null) { result.AddRange(ClassElement.Validate()); } if (Type != null) { Type.ForEach(elem => result.AddRange(elem.Validate())); } if (Subject != null) { result.AddRange(Subject.Validate()); } if (Participant != null) { Participant.ForEach(elem => result.AddRange(elem.Validate())); } if (Fulfills != null) { result.AddRange(Fulfills.Validate()); } if (StartElement != null) { result.AddRange(StartElement.Validate()); } if (Length != null) { result.AddRange(Length.Validate()); } if (Reason != null) { result.AddRange(Reason.Validate()); } if (Indication != null) { result.AddRange(Indication.Validate()); } if (Priority != null) { result.AddRange(Priority.Validate()); } if (Hospitalization != null) { result.AddRange(Hospitalization.Validate()); } if (Location != null) { Location.ForEach(elem => result.AddRange(elem.Validate())); } if (ServiceProvider != null) { result.AddRange(ServiceProvider.Validate()); } if (PartOf != null) { result.AddRange(PartOf.Validate()); } return(result); }