Exemple #1
0
 /// <exception cref="Ca.Infoway.Messagebuilder.Marshalling.HL7.XmlToModelTransformationException"></exception>
 private void HandlePersonName(XmlToModelResult xmlToModelResult, PersonName result, XmlNodeList childNodes)
 {
     foreach (XmlNode childNode in new XmlNodeListIterable(childNodes))
     {
         if (childNode is XmlElement)
         {
             XmlElement element                = (XmlElement)childNode;
             string     name                   = NodeUtil.GetLocalOrTagName(element);
             string     value                  = GetTextValue(element, xmlToModelResult);
             string     qualifierString        = GetAttributeValue(element, NAME_PART_TYPE_QUALIFIER);
             EntityNamePartQualifier qualifier = CodeResolverRegistry.Lookup <EntityNamePartQualifier>(qualifierString);
             if (StringUtils.IsNotBlank(value))
             {
                 result.AddNamePart(new EntityNamePart(value, GetPersonalNamePartType(name), qualifier));
             }
         }
         else
         {
             //GN: Added in fix similar to what was done for AD.BASIC.  Issue with XML containing mixture of elements and untyped text nodes.
             if (IsNonBlankTextNode(childNode))
             {
                 // validation will catch if this type does not allow for a free-form name
                 result.AddNamePart(new EntityNamePart(childNode.Value.Trim(), null));
             }
         }
     }
 }
Exemple #2
0
        private Hl7Error CreateInvalidCodeError(XmlNode node, Type type, string code)
        {
            string message = "The code, \"" + code + "\", in element <" + NodeUtil.GetLocalOrTagName(node) + "> is not a valid value for domain type \""
                             + ClassUtils.GetShortClassName(type) + "\"";

            return(new Hl7Error(Hl7ErrorCode.VALUE_NOT_IN_CODE_SYSTEM, message, (XmlElement)node));
        }
Exemple #3
0
        private PostalAddress ParseAddressPartTypes(XmlNode node, XmlToModelResult xmlToModelResult)
        {
            PostalAddress result     = new PostalAddress();
            XmlNodeList   childNodes = node.ChildNodes;

            foreach (XmlNode childNode in new XmlNodeListIterable(childNodes))
            {
                if (IsNonBlankTextNode(childNode))
                {
                    string value = childNode.Value;
                    result.AddPostalAddressPart(new PostalAddressPart(value));
                }
                else
                {
                    if (childNode is XmlElement)
                    {
                        XmlElement element = (XmlElement)childNode;
                        string     name    = NodeUtil.GetLocalOrTagName(element);
                        if (!"useablePeriod".Equals(name))
                        {
                            PostalAddressPartType postalAddressPartType = GetPostalAddressPartType(name, element, xmlToModelResult);
                            string value = GetTextValue(name, element, xmlToModelResult);
                            if (postalAddressPartType != null)
                            {
                                result.AddPostalAddressPart(new PostalAddressPart(postalAddressPartType, value));
                            }
                        }
                    }
                }
            }
            return(result);
        }
Exemple #4
0
        private void ParseUseablePeriods(XmlNode node, XmlToModelResult xmlToModelResult, TelecommunicationAddress result, ParseContext
                                         context)
        {
            XmlNodeList childNodes = node.ChildNodes;

            foreach (XmlNode childNode in new XmlNodeListIterable(childNodes))
            {
                if (childNode is XmlElement)
                {
                    XmlElement useablePeriodElement = (XmlElement)childNode;
                    string     name = NodeUtil.GetLocalOrTagName(useablePeriodElement);
                    if ("useablePeriod".Equals(name))
                    {
                        BareANY tsAny  = tsR2ElementParser.Parse(TsContext(context), useablePeriodElement, xmlToModelResult);
                        MbDate  mbDate = (MbDate)tsAny.BareValue;
                        result.AddUseablePeriod(mbDate == null ? null : mbDate.Value, ((ANYMetaData)tsAny).Operator);
                    }
                    else
                    {
                        xmlToModelResult.AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, "Unexpected TEL child element: \"" + useablePeriodElement
                                                                  .Name + "\"", useablePeriodElement));
                    }
                }
            }
        }
Exemple #5
0
        private IList <XmlElement> FindComponents(XmlElement element, XmlToModelResult xmlToModelResult)
        {
            IList <XmlElement> result = new List <XmlElement>();
            XmlNodeList        list   = element.ChildNodes;

            if (list != null)
            {
                foreach (XmlNode node in new XmlNodeListIterable(list))
                {
                    if (node.NodeType != System.Xml.XmlNodeType.Element)
                    {
                    }
                    else
                    {
                        // skip it
                        if (StringUtils.Equals("comp", NodeUtil.GetLocalOrTagName((XmlElement)node)))
                        {
                            result.Add((XmlElement)node);
                        }
                        else
                        {
                            xmlToModelResult.AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, System.String.Format("Unexpected tag {0} in GTS.BOUNDEDPIVL"
                                                                                                                         , XmlDescriber.DescribeSingleElement((XmlElement)node)), (XmlElement)node));
                        }
                    }
                }
            }
            return(result);
        }
Exemple #6
0
        protected override EntityName ParseNode(XmlNode node, XmlToModelResult xmlToModelResult)
        {
            OrganizationName result     = new OrganizationName();
            XmlNodeList      childNodes = node.ChildNodes;

            foreach (XmlNode childNode in new XmlNodeListIterable(childNodes))
            {
                if (childNode.NodeType == System.Xml.XmlNodeType.Text)
                {
                    string value = childNode.Value;
                    result.AddNamePart(new EntityNamePart(value));
                }
                else
                {
                    if (childNode is XmlElement)
                    {
                        XmlElement element = (XmlElement)childNode;
                        string     name    = NodeUtil.GetLocalOrTagName(element);
                        string     value   = GetTextValue(element, xmlToModelResult);
                        result.AddNamePart(new EntityNamePart(value, GetOrganizationNamePartType(name)));
                    }
                }
            }
            return(result);
        }
Exemple #7
0
        private Interval <PlatformDate> ParseValidTime(XmlElement node, ParseContext context, XmlToModelResult xmlToModelResult)
        {
            Interval <PlatformDate> validTime = null;
            bool        foundValidTime        = false;
            bool        loggedValidTimeError  = false;
            XmlNodeList childNodes            = node.ChildNodes;

            foreach (XmlNode childNode in new XmlNodeListIterable(childNodes))
            {
                string childElementName = NodeUtil.GetLocalOrTagName(childNode);
                bool   isValidTime      = AbstractNameR2ElementParser <V> .VALID_TIME_ELEMENT.Equals(childElementName);

                if (!loggedValidTimeError && foundValidTime)
                {
                    loggedValidTimeError = true;
                    RecordError("Only one validTime is allowed, and it must come after all name parts", (XmlElement)node, xmlToModelResult);
                }
                if (childNode is XmlElement)
                {
                    if (isValidTime)
                    {
                        foundValidTime = true;
                        ParseContext newContext = ParseContextImpl.Create("IVL<TS>", context);
                        BareANY      ivlTsAny   = this.ivlTsParser.Parse(newContext, Arrays.AsList(childNode), xmlToModelResult);
                        if (ivlTsAny != null && ivlTsAny.BareValue != null)
                        {
                            DateInterval dateInterval = (DateInterval)ivlTsAny.BareValue;
                            validTime = dateInterval == null ? null : dateInterval.Interval;
                        }
                    }
                }
            }
            return(validTime);
        }
Exemple #8
0
        private void MapToTeal(Hl7Source source, BeanWrapper wrapper, Relationship relationship)
        {
            bool hasNullFlavor          = MapNodeAttributesToTeal(source, wrapper, relationship);
            IList <XmlElement> elements = NodeUtil.ToElementList(source.GetCurrentElement());

            if (hasNullFlavor && elements.IsEmpty())
            {
                // don't bother processing/validating any further
                // however, if there are elements and the association has a nullFlavor, something weird is going on so keep processing
                return;
            }
            // 1) "elements" contains the xml-order of the current part's relationships - note that this can have duplicates at this point
            // 2) "source" contains the message part being processed - this is not exposed
            // 3) "source" contains the result bean where errors can be stored - this *is* exposed
            // 4) need to watch choice/template cases (including choices with supertypes)
            // relationship.getType() is
            //		- choice type (if choice)
            //		- null (if template)
            //		- or the actual type
            // source.getMessagePartName() is
            //      - the choice option (if above was a choice)
            //      - the actual template type (if above was null)
            //      - or the actual type (which it is in all cases, really)
            IList <string>               xmlElementNamesInProvidedOrder = new List <string>();
            List <Relationship>          sortedRelationshipsMatchingUpToXmlElementNames = new List <Relationship>();
            IDictionary <string, string> resolvedRelationshipNames = new Dictionary <string, string>();
            int length = elements.Count;

            for (int j = 0; j < length; j++)
            {
                XmlElement      element  = elements[j];
                string          nodeName = NodeUtil.GetLocalOrTagName(element);
                IList <XmlNode> nodes    = new List <XmlNode>();
                nodes.Add(element);
                while (j + 1 < length && IsSameElementName(element, elements[j + 1]))
                {
                    nodes.Add(elements[++j]);
                }
                if (NamespaceUtil.IsHl7Node(element))
                {
                    Relationship xmlRelationship = source.GetRelationship(nodeName);
                    if (xmlRelationship != null)
                    {
                        ValidateNamespace(element, xmlRelationship, source);
                        // since we have a match we know that the xml name is correct; all we need the xmlRelationship for is sorting purposes
                        // however, for choice and template relationships, there will be an apparent mismatch between relationship names
                        xmlElementNamesInProvidedOrder.Add(nodeName);
                        sortedRelationshipsMatchingUpToXmlElementNames.Add(xmlRelationship);
                        resolvedRelationshipNames[GenerateRelationshipKey(xmlRelationship)] = nodeName;
                    }
                    Process(wrapper, source, nodes, nodeName);
                }
            }
            ValidateElementOrder(source, xmlElementNamesInProvidedOrder, sortedRelationshipsMatchingUpToXmlElementNames, resolvedRelationshipNames
                                 );
            // only do this if relationship not null and relationship not a null flavor???
            ValidateMissingMandatoryNonStructuralRelationships(source, resolvedRelationshipNames);
        }
Exemple #9
0
        protected virtual XmlNode GetNamedChildNode(XmlNode node, string childNodeName)
        {
            XmlNode     result     = null;
            XmlNodeList childNodes = node.ChildNodes;

            foreach (XmlNode childNode in new XmlNodeListIterable(childNodes))
            {
                if (childNodeName.Equals(NodeUtil.GetLocalOrTagName(childNode)))
                {
                    result = childNode;
                }
            }
            return(result);
        }
Exemple #10
0
        public virtual IList <XmlElement> GetElements(Relationship relationship)
        {
            IList <XmlElement>   result = new List <XmlElement>();
            ICollection <string> name   = GetElementNames(relationship);

            foreach (XmlElement element in NodeUtil.ToElementList(this.@base))
            {
                string elementName = NodeUtil.GetLocalOrTagName(element);
                if (name.Contains(elementName))
                {
                    result.Add(element);
                }
            }
            return(result);
        }
Exemple #11
0
        protected override Ratio <N, D> ParseNonNullNode(ParseContext context, XmlNode node, BareANY parseResult, Type expectedReturnType
                                                         , XmlToModelResult xmlToModelResult)
        {
            Ratio <N, D>            result     = new Ratio <N, D>();
            IList <Hl7DataTypeName> innerTypes = Hl7DataTypeName.Create(context.Type).GetInnerTypes();

            if (innerTypes.Count != 2)
            {
                // this should never happen unless a message set is incorrect; ok to abort with exception (parsing will continue after this datatype)
                throw new XmlToModelTransformationException("RTO data type must have two inner types. Type " + context.Type + " has " + innerTypes
                                                            .Count + ".");
            }
            bool        numeratorFound   = false;
            bool        denominatorFound = false;
            XmlNodeList childNodes       = node.ChildNodes;

            foreach (XmlNode childNode in new XmlNodeListIterable(childNodes))
            {
                if (childNode is XmlElement)
                {
                    XmlElement element = (XmlElement)childNode;
                    string     name    = NodeUtil.GetLocalOrTagName(element);
                    if ("numerator".Equals(name))
                    {
                        numeratorFound   = true;
                        result.Numerator = GetNumeratorValue(element, innerTypes[0].ToString(), context, xmlToModelResult);
                    }
                    else
                    {
                        if ("denominator".Equals(name))
                        {
                            denominatorFound   = true;
                            result.Denominator = GetDenominatorValue(element, innerTypes[1].ToString(), context, xmlToModelResult);
                        }
                    }
                }
            }
            if (!numeratorFound)
            {
                RecordMissingElementError("Numerator", context, node, xmlToModelResult);
            }
            if (!denominatorFound)
            {
                RecordMissingElementError("Denominator", context, node, xmlToModelResult);
            }
            return(result);
        }
Exemple #12
0
        public virtual ICollection <string> GetNames()
        {
            ICollection <string> names = new HashSet <string>();

            if (IsStructuralAttribute())
            {
                names.Add(this.relationship.Name);
            }
            else
            {
                foreach (XmlElement element in GetElements())
                {
                    names.Add(NodeUtil.GetLocalOrTagName(element));
                }
            }
            return(names);
        }
Exemple #13
0
        private IList <EntityNamePart> ParseNameParts(ParseContext context, XmlNodeList childNodes, XmlToModelResult xmlToModelResult
                                                      )
        {
            IList <EntityNamePart> parts = new List <EntityNamePart>();

            foreach (XmlNode childNode in new XmlNodeListIterable(childNodes))
            {
                if (childNode is XmlElement)
                {
                    XmlElement element = (XmlElement)childNode;
                    string     name    = NodeUtil.GetLocalOrTagName(element);
                    if (!StringUtils.Equals(AbstractNameR2ElementParser <V> .VALID_TIME_ELEMENT, name))
                    {
                        if (StringUtils.Equals("TN", context.Type))
                        {
                            RecordError("TN fields only support text and a single (optional) validTime element. Found element: " + name, element, xmlToModelResult
                                        );
                        }
                        else
                        {
                            NullFlavor nullFlavor             = GetNullFlavor(element, xmlToModelResult);
                            string     value                  = GetTextValue(element, xmlToModelResult);
                            EntityNamePartQualifier qualifier = GetQualifier(context, element, xmlToModelResult);
                            if (StringUtils.IsNotBlank(value) || nullFlavor != null)
                            {
                                NamePartType namePartType = GetNamePartType(name, context.Type, element, xmlToModelResult);
                                if (namePartType != null)
                                {
                                    parts.Add(new EntityNamePart(value, namePartType, qualifier, nullFlavor));
                                }
                            }
                        }
                    }
                }
                else
                {
                    if (IsNonBlankTextNode(childNode))
                    {
                        parts.Add(new EntityNamePart(childNode.Value.Trim(), null));
                    }
                }
            }
            return(parts);
        }
Exemple #14
0
        private bool MapNodeAttributesToTeal(Hl7Source source, BeanWrapper wrapper, Relationship relationship)
        {
            XmlElement       currentElement   = source.GetCurrentElement();
            NullFlavorHelper nullFlavorHelper = new NullFlavorHelper(relationship != null ? relationship.Conformance : Ca.Infoway.Messagebuilder.Xml.ConformanceLevel
                                                                     .OPTIONAL, currentElement, source.GetResult(), true);
            bool hasValidNullFlavorAttribute = nullFlavorHelper.HasValidNullFlavorAttribute();

            if (hasValidNullFlavorAttribute)
            {
                wrapper.WriteNullFlavor(source, relationship, nullFlavorHelper.ParseNullNode());
            }
            else
            {
                XmlAttributeCollection map = currentElement.Attributes;
                foreach (XmlNode attributeNode in new XmlNamedNodeMapIterable(map))
                {
                    Relationship attributeRelationship = source.GetRelationship(NodeUtil.GetLocalOrTagName(attributeNode));
                    if (!NamespaceUtil.IsHl7Node(attributeNode))
                    {
                    }
                    else
                    {
                        // quietly ignore it
                        if (attributeRelationship == null)
                        {
                            this.log.Info("Can't find NodeAttribute relationship named: " + attributeNode.Name);
                        }
                        else
                        {
                            ValidateNamespace(attributeNode, attributeRelationship, source);
                            if (attributeRelationship.HasFixedValue())
                            {
                                ValidateFixedValue(source, currentElement, (XmlAttribute)attributeNode, attributeRelationship);
                            }
                            wrapper.WriteNodeAttribute(attributeRelationship, attributeNode.Value, source.GetVersion(), source.IsR2());
                        }
                    }
                    ValidateMandatoryAttributesExist(source, currentElement);
                }
            }
            return(hasValidNullFlavorAttribute);
        }
Exemple #15
0
        private IList <string> CreateListOfXmlNamesInOrderProvided(XmlElement element, IList <string> properlyOrderedProvidedRelationshipNames
                                                                   )
        {
            IList <string> xmlElementNamesInOrderProvided = new List <string>();

            foreach (XmlElement currentXmlElement in NodeUtil.ToElementList(element))
            {
                string elementName = NodeUtil.GetLocalOrTagName(currentXmlElement);
                if (properlyOrderedProvidedRelationshipNames.Contains(elementName))
                {
                    // remove consecutive dups (ignore garbage/extra in between; they will be caught later)
                    if (xmlElementNamesInOrderProvided.IsEmpty() || !xmlElementNamesInOrderProvided[xmlElementNamesInOrderProvided.Count - 1]
                        .Equals(elementName))
                    {
                        xmlElementNamesInOrderProvided.Add(elementName);
                    }
                }
            }
            return(xmlElementNamesInOrderProvided);
        }
Exemple #16
0
        private void ProcessUnknownChildElements(ICollection <string> knownItems, XmlElement element, MessageVisitor visitor)
        {
            IList <XmlElement> children = NodeUtil.ToElementList(element);

            foreach (XmlElement child in children)
            {
                if (!NamespaceUtil.IsHl7Node(child))
                {
                }
                else
                {
                    // ignore it
                    string localOrTagName = NodeUtil.GetLocalOrTagName(child);
                    if (!knownItems.Contains(localOrTagName))
                    {
                        knownItems.Add(localOrTagName);
                        // this call will intentionally fail fast with an error (since relationship is null)
                        visitor.VisitNonStructuralAttribute(element, Arrays.AsList(child), null);
                    }
                }
            }
        }
Exemple #17
0
        private PostalAddress ParseNode(XmlNode node, XmlToModelResult xmlToModelResult)
        {
            PostalAddress result     = new PostalAddress();
            XmlNodeList   childNodes = node.ChildNodes;

            foreach (XmlNode childNode in new XmlNodeListIterable(childNodes))
            {
                if (IsNonBlankTextNode(childNode))
                {
                    string value = childNode.Value;
                    result.AddPostalAddressPart(new PostalAddressPart(value));
                }
                else
                {
                    if (childNode is XmlElement)
                    {
                        XmlElement            element = (XmlElement)childNode;
                        string                name    = NodeUtil.GetLocalOrTagName(element);
                        PostalAddressPartType postalAddressPartType = GetPostalAddressPartType(name);
                        string                value        = GetTextValue(name, element, xmlToModelResult);
                        string                codeAsString = GetAttributeValue(childNode, "code");
                        // only for state/country
                        string codeSystem = GetAttributeValue(childNode, "codeSystem");
                        // only for state/country
                        Code code = CodeUtil.ConvertToCode(codeAsString, codeSystem);
                        if (postalAddressPartType == null)
                        {
                            // error if part type not found
                            RecordError("Address part type not valid: " + name, element, xmlToModelResult);
                        }
                        else
                        {
                            result.AddPostalAddressPart(new PostalAddressPart(postalAddressPartType, code, value));
                        }
                    }
                }
            }
            return(result);
        }
Exemple #18
0
        protected virtual string GetOriginalText(XmlElement element)
        {
            XmlNodeList children = element.ChildNodes;
            string      result   = null;

            if (children != null)
            {
                foreach (XmlNode node in new XmlNodeListIterable(children))
                {
                    if (node.NodeType != System.Xml.XmlNodeType.Element)
                    {
                    }
                    else
                    {
                        if ("originalText".Equals(NodeUtil.GetLocalOrTagName(node)))
                        {
                            result = NodeUtil.GetTextValue(node);
                        }
                    }
                }
            }
            return(result);
        }
Exemple #19
0
        private IDictionary <PlatformDate, SetOperator> ParseUseablePeriods(XmlElement node, ParseContext context, XmlToModelResult
                                                                            xmlToModelResult)
        {
            IDictionary <PlatformDate, SetOperator> useablePeriods = new Dictionary <PlatformDate, SetOperator>();
            XmlNodeList childNodes               = node.ChildNodes;
            bool        foundUseablePeriod       = false;
            bool        loggedUseablePeriodError = false;

            foreach (XmlNode childNode in new XmlNodeListIterable(childNodes))
            {
                string childElementName = NodeUtil.GetLocalOrTagName(childNode);
                bool   isUseablePeriod  = "useablePeriod".Equals(childElementName);
                if (foundUseablePeriod && !isUseablePeriod && !loggedUseablePeriodError)
                {
                    loggedUseablePeriodError = true;
                    RecordError("Useable periods must come after all address part types.", (XmlElement)node, xmlToModelResult);
                }
                if (childNode is XmlElement)
                {
                    XmlElement childElement = (XmlElement)childNode;
                    if (isUseablePeriod)
                    {
                        foundUseablePeriod = true;
                        ParseContext newContext = ParseContextImpl.Create("SXCM<TS>", context);
                        BareANY      tsAny      = this.tsParser.Parse(newContext, childElement, xmlToModelResult);
                        if (tsAny != null && tsAny.BareValue != null)
                        {
                            SetOperator @operator = ((ANYMetaData)tsAny).Operator;
                            MbDate      ts        = (MbDate)tsAny.BareValue;
                            useablePeriods[ts.Value] = @operator;
                        }
                    }
                }
            }
            return(useablePeriods);
        }
Exemple #20
0
 private string ResolveTopmostType(Relationship relationship, XmlElement currentElement)
 {
     return(this.hl7InteractionSource.GetConversionContext().ResolveTopmostType(relationship, NodeUtil.GetLocalOrTagName(currentElement
                                                                                                                         )));
 }
Exemple #21
0
 private string GetInteractionId(XmlDocument message)
 {
     return(NodeUtil.GetLocalOrTagName(message.DocumentElement));
 }
Exemple #22
0
        public virtual NullFlavor ParseNullNode()
        {
            string     attributeValue = GetAttributeValue(node, NULL_FLAVOR_ATTRIBUTE_NAME);
            NullFlavor nullFlavor     = CodeResolverRegistry.Lookup <NullFlavor>(attributeValue);

            if (ConformanceLevelUtil.IsMandatory(this.conformanceLevel, null))
            {
                xmlToModelResult.AddHl7Error(Hl7Error.CreateMandatoryAttributeIsNullError(NodeUtil.GetLocalOrTagName((XmlElement)node), GetAttributeValue
                                                                                              (node, NULL_FLAVOR_ATTRIBUTE_NAME), (XmlElement)node));
            }
            else
            {
                //      RM #15431 - strictly speaking, nullFlavors are not allowed for REQUIRED fields. However, jurisdictions often ignore this restriction.
                //      FIXME:  TM (see RM18424) - once MB has error levels implemented, this can be reinstated as a warning
                //		} else if (this.conformanceLevel != null && this.conformanceLevel == ConformanceLevel.REQUIRED) {
                //			xmlToModelResult.addHl7Error(Hl7Error.createRequiredAttributeIsNullError(
                //					NodeUtil.getLocalOrTagName((Element) node),
                //					getAttributeValue(node, NULL_FLAVOR_ATTRIBUTE_NAME),
                //					(Element) node));
                if (this.isAssociation && !StringUtils.Equals(GetAttributeValue(node, NULL_FLAVOR_XSI_NIL_ATTRIBUTE_NAME), "true"))
                {
                    if (!Ca.Infoway.Messagebuilder.BooleanUtils.ValueOf(Runtime.GetProperty(Ca.Infoway.Messagebuilder.Marshalling.HL7.Parser.NullFlavorHelper
                                                                                            .MB_SUPPRESS_XSI_NIL_ON_NULLFLAVOR)))
                    {
                        xmlToModelResult.AddHl7Error(Hl7Error.CreateNullFlavorMissingXsiNilError(NodeUtil.GetLocalOrTagName((XmlElement)node), (XmlElement
                                                                                                                                                )node));
                    }
                }
            }
            return(nullFlavor);
        }
Exemple #23
0
 /// <summary>Obtains the message's interaction id.</summary>
 /// <remarks>Obtains the message's interaction id.</remarks>
 /// <returns>the message's interaction id</returns>
 /// <exception cref="TransportLayerException">if the message's interaction id could not be determined</exception>
 /// <exception cref="Ca.Infoway.Messagebuilder.Transport.TransportLayerException"></exception>
 public virtual string GetInteractionId()
 {
     return(NodeUtil.GetLocalOrTagName(this.document.DocumentElement));
 }
Exemple #24
0
        public virtual Hl7PartSource CreatePartSourceForSpecificType(Relationship relationship, XmlElement currentElement, string
                                                                     type)
        {
            string resolvedType = (type == null ? this.context.ResolveType(relationship, NodeUtil.GetLocalOrTagName(currentElement)) :
                                   type);

            return(new Hl7PartSource(this, resolvedType, currentElement, relationship.Type));
        }
Exemple #25
0
 private string GetMessageIdFromDocument()
 {
     return(NodeUtil.GetLocalOrTagName(this.document.DocumentElement));
 }
Exemple #26
0
 private bool IsSameElementName(XmlElement element, XmlElement nextElement)
 {
     return(StringUtils.Equals(element.NamespaceURI, nextElement.NamespaceURI) && StringUtils.Equals(NodeUtil.GetLocalOrTagName
                                                                                                         (element), NodeUtil.GetLocalOrTagName(nextElement)));
 }
Exemple #27
0
 private void ProcessEachRelationshipValue(Interaction interaction, RelationshipBridge relationshipBridge, MessageVisitor
                                           visitor)
 {
     foreach (XmlElement child in relationshipBridge.GetElements())
     {
         Relationship        relationship = relationshipBridge.GetRelationship();
         IList <MessagePart> messageParts = GetMessageParts(relationship, interaction, NodeUtil.GetLocalOrTagName(child));
         if (!messageParts.IsEmpty() && !IsNull(child))
         {
             ProcessAllRelationships(child, interaction, messageParts, visitor);
         }
     }
 }
Exemple #28
0
 public static Ca.Infoway.Messagebuilder.Error.Hl7Error CreateUnknownChildElementError(XmlElement element)
 {
     return(new Ca.Infoway.Messagebuilder.Error.Hl7Error(Hl7ErrorCode.SYNTAX_ERROR, System.String.Format("Unknown child element \"{0}\" will be ignored."
                                                                                                         , NodeUtil.GetLocalOrTagName(element)), element));
 }