Beispiel #1
0
        public FileReaderControler(IMessagePublisher publisher)
        {
            _publisher = publisher;

            _transformer   = XmlTransformerFactory.CreateTransformer(_publisher.Context.ConfigMgr.Config.HL7XMLTransformerType, _publisher.Context.Log);
            _fialedFolder  = Path.Combine(_publisher.Context.ConfigMgr.Config.FileOutboundFolder, FOLDER_FIALED_NAME);
            _successFolder = Path.Combine(_publisher.Context.ConfigMgr.Config.FileOutboundFolder, FOLDER_SUCCESS_NAME);
            _ackFodler     = Path.Combine(_publisher.Context.ConfigMgr.Config.FileOutboundFolder, FOLDER_ACK_NAME);

            _readerTimer          = new Timer(_publisher.Context.ConfigMgr.Config.TimerInterval);
            _readerTimer.Elapsed += new ElapsedEventHandler(_readerTimer_Elapsed);
        }
Beispiel #2
0
        private void buttonHL7toXML_Click(object sender, EventArgs e)
        {
            if (this.comboBoxType.SelectedItem == null)
            {
                return;
            }
            string type = this.comboBoxType.SelectedItem.ToString();

            int    times  = (int)this.numericUpDownTimes.Value;
            string hl7Msg = this.textBoxHL7Msg.Text.Trim();
            string xmlMsg = "";

            XmlTransformerBase t = XmlTransformerFactory.CreateTransformer(type, _log);

            bool            res    = false;
            List <TimeSpan> tsList = new List <TimeSpan>();

            for (int i = 0; i < times; i++)
            {
                DateTime dtBegin = DateTime.Now;
                res = t.TransformHL7v2ToXml(hl7Msg, out xmlMsg);
                DateTime dtEnd = DateTime.Now;
                if (!res)
                {
                    break;
                }
                tsList.Add(dtEnd.Subtract(dtBegin));
            }

            if (res)
            {
                double totalTime = 0;
                foreach (TimeSpan ts in tsList)
                {
                    totalTime += ts.TotalMilliseconds;
                }
                this.labelPerformHL7toXML.Text = ((double)(totalTime / (double)tsList.Count)).ToString() + "ms";
            }
            else
            {
                this.labelPerformHL7toXML.Text = "error";
            }

            this.textBoxXmlMsg.Text = xmlMsg;
        }
Beispiel #3
0
 public HL7InboundControler(EntityImpl entity)
 {
     _entity      = entity;
     _transformer = XmlTransformerFactory.CreateTransformer(_entity.Context.ConfigMgr.Config.HL7XMLTransformerType, _entity.Context.Log);
 }
Beispiel #4
0
 public FileWriterControler(ProgramContext context)
 {
     _context     = context;
     _transformer = XmlTransformerFactory.CreateTransformer(_context.ConfigMgr.Config.HL7XMLTransformerType, _context.Log);
 }
Beispiel #5
0
 public HL7OutboundControler(EntityImpl entity)
 {
     _entity      = entity;
     _client      = SocketClientFactory.Create(_entity.Context.ConfigMgr.Config.SocketConfig);
     _transformer = XmlTransformerFactory.CreateTransformer(_entity.Context.ConfigMgr.Config.HL7XMLTransformerType, _entity.Context.Log);
 }