using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;  
using MediII.Adapter.BizComponent.Base;

namespace MediII.Adapter.BizComponent.ADT
{
    public class BizComponent_ADT : BaseBizComponent, IBizComponent
    {
        public override string DoProcess(string m,string msgType,string ID)
        {
            try
            {
                //string type = msh.MessageType.TriggerEvent.Value;
                string errMsg = string.Empty;
                ADTHandler handler = ADTHandler.GetHandler(msgType);
                try
                {
                    handler.Handler(m,ID);
                    return string.Empty;
                }
                catch (Exception ex)
                {
                    if (ex.InnerException == null)
                    {
                        return ex.Message;
                    }
                    else
                    {
                        return ex.Message + " InnerException:" + ex.InnerException.Message;
                    }
                } 
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
             
        }

       
    }
}
