Exemple #1
0
 private static void AddEventTypeItem(XIMMessage message)
 {
     if (message is XIMInboundMessage)
     {
         if (message == null)
         {
             return;
         }
         XIMMappingItem item = new XIMMappingItem();
         item.GWDataDBField          = GWDataDBField.i_EventType.Clone();
         item.Translating.ConstValue = message.GWEventType.Code;
         item.Translating.Type       = TranslatingType.FixValue;
         GenerateSourceFieldName(item);
         message.MappingList.Add(item);
     }
     else if (message is XIMOutboundMessage)
     {
         if (message == null)
         {
             return;
         }
         QueryCriteriaItem item = new QueryCriteriaItem();
         item.GWDataDBField          = GWDataDBField.i_EventType.Clone();
         item.Translating.ConstValue = message.GWEventType.Code;
         item.Translating.Type       = TranslatingType.FixValue;
         item.Type = QueryCriteriaType.And;
         GenerateTargetFieldName(item);
         ((XIMOutboundMessage)message).Rule.QueryCriteria.MappingList.Add(item);
     }
 }
Exemple #2
0
 public static void RefreshXSLFileName(XIMMessage message)
 {
     if (message is XIMInboundMessage)
     {
         message.XSLFileName = message.HL7EventType.GetKey() + "_to_" + message.GWEventType.Code + ".xsl";
     }
     else if (message is XIMOutboundMessage)
     {
         message.XSLFileName = message.GWEventType.Code + "_to_" + message.HL7EventType.GetKey() + ".xsl";
     }
 }
Exemple #3
0
        public static XMLTransformer CreateFromMessage(XIMMessage message)
        {
            if (message == null)
            {
                return(null);
            }
            XMLTransformer t = _transformerList[message] as XMLTransformer;

            if (t == null)
            {
                string path = Application.StartupPath + "\\" + XIMTransformHelper.XSLFolder + "\\" + message.XSLFileName;
                t = CreateFromFile(path);
                if (t == null)
                {
                    return(null);
                }
                _transformerList.Add(message, t);
            }
            return(t);
        }
Exemple #4
0
        private static void ClearMapping(XIMMessage message)
        {
            if (message == null)
            {
                return;
            }

            List <XIMMappingItem> deletelist = new List <XIMMappingItem>();

            foreach (XIMMappingItem item in message.MappingList)
            {
                if (item.Enable && !XIMHelper.IsComplex(item.Element.Type))
                {
                    continue;
                }
                deletelist.Add(item);
            }

            foreach (XIMMappingItem item in deletelist)
            {
                message.MappingList.Remove(item);
            }
        }