Пример #1
0
 private static void GenerateSourceFieldName(XIMInboundMessage message)
 {
     if (message == null)
     {
         return;
     }
     foreach (XIMMappingItem item in message.MappingList)
     {
         if (item.Enable && !XIMHelper.IsComplex(item.Element.Type))
         {
             GenerateSourceFieldName(item);
         }
     }
 }
Пример #2
0
        public XIMInboundMessage Clone()
        {
            XIMInboundMessage msg = new XIMInboundMessage();

            msg.HL7EventType = HL7EventType.Clone();
            msg.GWEventType  = GWEventType.Clone();
            msg.XSLFileName  = XSLFileName;

            //msg.Rule.RuleID = Rule.RuleID;        // do not copy RuleID
            msg.Rule.RuleName              = Rule.RuleName;
            msg.Rule.CheckProcessFlag      = Rule.CheckProcessFlag;
            msg.Rule.AutoUpdateProcessFlag = Rule.AutoUpdateProcessFlag;
            foreach (XIMMappingItem item in Rule.QueryResult.MappingList)
            {
                XIMMappingItem i = item.Clone() as XIMMappingItem;
                msg.Rule.QueryResult.MappingList.Add(i);
            }

            return(msg);
        }
Пример #3
0
        public static string GenerateXSL(XIMInboundMessage message)
        {
            if (message == null)
            {
                return(null);
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
            sb.AppendLine("<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">");
            sb.AppendLine("  <xsl:include href = \"" + TemplateFileNameIn + "\"/>");
            sb.AppendLine("  <xsl:template match=\"/\">");
            sb.AppendLine("    <NewDataSet>");
            sb.AppendLine("        <Table>");

            foreach (XIMMappingItem item in message.MappingList)
            {
                string nodeName = item.SourceField;
                if (item.Translating.Type == TranslatingType.FixValue)
                {
                    sb.Append("          <" + nodeName + ">");
                    sb.Append(item.Translating.ConstValue);
                    sb.AppendLine("</" + nodeName + ">");
                }
                else
                {
                    sb.AppendLine("          <" + nodeName + ">");
                    sb.Append(GetMultiItemSelection(item.Element, item.Element.XPath, "            "));
                    sb.AppendLine("          </" + nodeName + ">");
                }
            }

            sb.AppendLine("        </Table>");
            sb.AppendLine("    </NewDataSet>");
            sb.AppendLine("  </xsl:template>");
            sb.AppendLine("</xsl:stylesheet>");

            return(sb.ToString());
        }