Exemplo n.º 1
0
        private void buttonSearch_Click(object sender, System.EventArgs e)
        {
            ComparisonFilter messageTimeStampComparisonFilter = ComparisonFilter.None;
            DateTime messageTimeStamp = DateTime.Now;
            ComparisonFilter messageTimeStampComparisonFilter2 = ComparisonFilter.None;
            DateTime messageTimeStamp2 = DateTime.Now;
            ComparisonFilter eventTimeStampComparisonFilter = ComparisonFilter.None;
            DateTime eventTimeStamp = DateTime.Now;
            ComparisonFilter eventTimeStampComparisonFilter2 = ComparisonFilter.None;
            DateTime eventTimeStamp2 = DateTime.Now;
            string[] containingEventTypes = new string[0];
            string containingText = string.Empty;
            string[] arString = null;
            decimal[] arDecimal = null;
            IList<string> searchDals = new List<string>();

            foreach (ListViewItem item in listViewDals.CheckedItems)
                searchDals.Add(item.Text);

            if (this.checkBoxMessageTimeStamp.Checked)
            {
                messageTimeStampComparisonFilter = StringToComparisonFilter((string)this.comboBoxMessageTimeStamp.Text);
                messageTimeStamp = this.dateTimePickerMessageTimeStamp.Value;
            }
            if (this.checkBoxMessageTimeStamp2.Checked)
            {
                messageTimeStampComparisonFilter2 = StringToComparisonFilter((string)this.comboBoxMessageTimeStamp2.Text);
                messageTimeStamp2 = this.dateTimePickerMessageTimeStamp2.Value;
            }
            if (this.checkBoxEventTimeStamp.Checked)
            {
                eventTimeStampComparisonFilter = StringToComparisonFilter((string)this.comboBoxEventTimeStamp.Text);
                eventTimeStamp = this.dateTimePickerEventTimeStamp.Value;
            }
            if (this.checkBoxEventTimeStamp2.Checked)
            {
                eventTimeStampComparisonFilter2 = StringToComparisonFilter((string)this.comboBoxEventTimeStamp2.Text);
                eventTimeStamp2 = this.dateTimePickerEventTimeStamp2.Value;
            }
            if (this.checkBoxContainingEventType.Checked)
            {
                containingEventTypes = new string[this.checkedListBoxEventTypes.CheckedItems.Count];
                for (int i = 0; i < this.checkedListBoxEventTypes.CheckedItems.Count; i++)
                {
                    containingEventTypes[i] = ((string)this.checkedListBoxEventTypes.CheckedItems[i]).Substring(0, 3);
                }
            }
            if (this.checkBoxContainingText.Checked)
            {
                containingText = this.textBoxContainingText.Text;
            }
            if (this.checkBoxVisitNumbers.Checked)
            {
                arString = this.textBoxVisitNumbers.Text.Split(',');
                arDecimal = new decimal[arString.Length];
                try
                {
                    for (int i = 0; i < arString.Length; i++)
                        arDecimal[i] = Decimal.Parse(arString[i].Trim());
                }
                catch(FormatException)
                {
                    errorProvider.SetError(this.textBoxVisitNumbers, "The VisitNumber(s) must be numeric!");
                    return;
                }
            }

            //invoke event
            SearchHL7ADTEventArgs eventArgs = new SearchHL7ADTEventArgs(
                this.checkBoxFullSequence.Checked,
                messageTimeStampComparisonFilter,
                messageTimeStamp,
                messageTimeStampComparisonFilter2,
                messageTimeStamp2,
                eventTimeStampComparisonFilter,
                eventTimeStamp,
                eventTimeStampComparisonFilter2,
                eventTimeStamp2,
                containingEventTypes,
                containingText,
                arDecimal,
                searchDals,
                cboBiztalkSendPorts.SelectedItem as string,
                chkShowOnlyLastBiztalkHL7s.Checked);
            OnSearch(eventArgs);
        }
Exemplo n.º 2
0
        async void m_searchHL7ADTWindow_Search(object sender, SearchHL7ADTEventArgs e)
        {
            biztalk = e.Biztalk;
            showOnlyLast100BiztalkHL7s = e.BiztalkShowOnlyLast100HL7s;
            var tasks = new List<Task>();
            foreach (var key in e.SearchDals)
                if (!searchAdtQuery.ContainsKey(key))
                {
                    UpdateResult(key, null);
                    UpdateStatus(key, key + " not implemented");
                }
                else
                    tasks.Add(DoSearch(key, e, searchAdtQuery[key]));

            await Task.WhenAll(tasks.ToArray()).ConfigureAwait(false);
        }
Exemplo n.º 3
0
 protected virtual void OnSearch(SearchHL7ADTEventArgs e)
 {
     if (Search != null)
         Search(this, e);
 }