コード例 #1
0
        public virtual SetOperator HandleOperator(XmlElement element, ParseContext context, Hl7Errors errors, ANYMetaData wrapper
                                                  )
        {
            string      type        = context == null ? null : context.Type;
            bool        isSxcm      = (type != null && type.StartsWith("SXCM<"));
            bool        hasOperator = (element != null && element.HasAttribute("operator"));
            SetOperator result      = null;

            if (isSxcm)
            {
                result = SetOperator.INCLUDE;
                // default
                if (hasOperator)
                {
                    string operatorString = element.GetAttribute("operator");
                    result = SetOperator.FindMatchingOperator(operatorString);
                    if (result == null)
                    {
                        errors.AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, "Operator could not be determined from attribute value: '"
                                                        + operatorString + "'", element));
                    }
                }
                wrapper.Operator = result;
            }
            else
            {
                if (hasOperator)
                {
                    errors.AddHl7Error(new Hl7Error(Hl7ErrorCode.DATA_TYPE_ERROR, "Operator property not applicable for type: " + type, element
                                                    ));
                }
            }
            return(result);
        }
コード例 #2
0
        /// <exception cref="Ca.Infoway.Messagebuilder.Marshalling.HL7.XmlToModelTransformationException"></exception>
        public override BareANY Parse(ParseContext context, XmlNode node, XmlToModelResult xmlToModelResult)
        {
            BareANY parseResult = base.Parse(context, node, xmlToModelResult);

            if (context.IsCda())
            {
                string      operatorAsString = GetAttributeValue(node, "operator");
                SetOperator @operator        = SetOperator.FindMatchingOperator(operatorAsString);
                ((ANYMetaData)parseResult).Operator = @operator;
            }
            return(parseResult);
        }