Пример #1
0
        private void BgwDBCompare_DoWork(object sender, DoWorkEventArgs e)
        {
            SegmentTableMappingList segmentTableList = new SegmentTableMappingList();

            try
            {
                segmentTableList.GetMappingFile(e.Argument.ToString());
            }
            catch (FileNotFoundException ex)
            {
                LogError(ex.Message);
            }
            catch (SerializationException ex)
            {
                LogError(ex.Message);
            }

            try
            {
                segmentTableList.GetMessagesFromDB(_hl7Message.MessageToken.MessageControlId);
                e.Result = segmentTableList;
            }
            catch (Exception ex)
            {
                LogError(string.Format("Failed to retrieve db record for message control id {0}. ERROR:{1}", _hl7Message.MessageToken.MessageControlId, ex.Message));
            }
        }
Пример #2
0
        private void BgwDBCompare_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            SegmentTableMappingList segmentTableList = e.Result as SegmentTableMappingList;

            foreach (SegmentTableMapping map in segmentTableList.SegmentMappings)
            {
                frmDatabaseView db = new frmDatabaseView(map);
                db.Show();
            }

            StopProgressBar();
        }
Пример #3
0
        private void ToolStripMenuItemNew_Click(object sender, EventArgs e)
        {
            EnableDisableControl(Enable_Disable_Control.ENABLE);

            txtMapFilePath.Clear();
            _segmentDBMappingList        = new SegmentTableMappingList();
            cmbHL7Versions.SelectedIndex = 0;
            cmbMessageType.SelectedIndex = 0;
            cmbEventType.SelectedIndex   = 0;
            btnLoadMapFile.Enabled       = false;
            tvSegmentTableMap.Nodes.Clear();
            btnMap.Enabled     = true;
            btnRemove.Enabled  = false;
            btnSaveMap.Enabled = true;
        }
Пример #4
0
        private void btnLoadMapFile_Click(object sender, EventArgs e)
        {
            // load the mapping file if it exists
            string mapFile = txtMapFilePath.Text;

            if (!string.IsNullOrEmpty(mapFile))
            {
                btnSaveMap.Enabled         = true;
                btnMap.Enabled             = true;
                btnRemove.Enabled          = true;
                this._segmentDBMappingList = File.ReadAllText(mapFile).FromXML <SegmentTableMappingList>();

                if (this._segmentDBMappingList != null)
                {
                    LoadFromSegmentDbMappingCollection();
                }
                else
                {
                    LogError(string.Format("Failed to transform file: {0}", mapFile));
                }
            }
        }