/// <summary> /// Handles the saved event of the Single Concept matching control. /// Adds the encoded term to the encoded list box. /// </summary> /// <param name="sender">The single concept matching control.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> private void SingleConceptMatching_Saved(object sender, System.Windows.RoutedEventArgs e) { if (this.connected && this.SingleConceptMatching.InputBoxSelectedItem != null) { ObservableCollection <AdditionalTextBoxResult> additionalTextBoxResults = new ObservableCollection <AdditionalTextBoxResult>(); foreach (object o in this.SingleConceptMatching.AdditionalTextBoxSelectedTerms) { AdditionalTextBoxResult additionalTextBoxResult = o as AdditionalTextBoxResult; if (additionalTextBoxResult != null) { additionalTextBoxResults.Add(additionalTextBoxResult); } } this.ShowProgressBar(); TerminologyManager.EncodeConcept(this.SingleConceptMatching.InputBoxSelectedItem as InputFieldResult, additionalTextBoxResults); } else { this.EncodeOutput(CreateUnencodedConcept(this.SingleConceptMatching.InputBoxText)); this.SingleConceptMatching.Clear(); this.SingleConceptMatching.FocusInputBox(); } this.lastInputBoxResults = null; this.lastInputBoxSearch = string.Empty; this.lastAdditionalTextBoxSearch = string.Empty; this.lastAdditionalTextBoxResults = null; }
/// <summary> /// Handles the filter combo box selected index changed. /// </summary> /// <param name="sender">The Single Concept Matching control.</param> /// <param name="e">Selection Changed Event Args.</param> private void SingleConceptMatching_FilterSelectedIndexChanged(object sender, SelectionChangedEventArgs e) { this.lastInputBoxSearch = string.Empty; this.lastInputBoxResults = null; this.lastAdditionalTextBoxSearch = string.Empty; this.lastAdditionalTextBoxResults = null; this.SingleConceptMatching.InputBoxItemsSource = null; this.SingleConceptMatching.InputBoxSelectedItem = null; this.Search(); }
/// <summary> /// Handles the additional text box parse completed event of the Terminology Manager. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="AdditionalTextBoxParseCompletedEventArgs"/> instance containing the event data.</param> private void TerminologyManagerAdditionalTextBoxParseCompleted(object sender, AdditionalTextBoxParseCompletedEventArgs e) { this.indexerCallCount--; if (this.indexerCallCount == 0) { this.HideProgressBar(); this.StatusText.Text = string.Empty; } if (this.SingleConceptMatching.AdditionalTextBoxText != e.SearchTextOriginal || this.SingleConceptMatching.InputBoxSelectedItem == null || ((InputFieldResult)this.SingleConceptMatching.InputBoxSelectedItem).Concept.SnomedConceptId != e.MainConceptId) { return; } if (e.Successful) { if (e.AdditionalTextBoxResults.Count > 0) { ObservableCollection <AdditionalTextBoxResult> results = new ObservableCollection <AdditionalTextBoxResult>(); foreach (AdditionalTextBoxResult result in e.AdditionalTextBoxResults) { results.Add(this.GetMatchingAdditionalTextBoxResultsFromLastResults(result)); } this.lastAdditionalTextBoxResults = new AdditionalTextBoxParseCompletedEventArgs( e.SearchTextOriginal, results, e.MainConceptId); this.SingleConceptMatching.AdditionalTextBoxMatchingTermItemsSource = results; this.SingleConceptMatching.FocusAdditionalTextBox(); this.StatusText.Text = string.Empty; } else { this.StatusText.Text = SingleConceptMatchingPage.NoMatchesFoundText; } } else { this.StatusText.Text = SingleConceptMatchingPage.NoMatchesFoundDueToErrorText; } }
/// <summary> /// Handles the Reset Button click event which clears the form. /// </summary> /// <param name="sender">The reset form button.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> private void ResetFormButtonClick(object sender, System.Windows.RoutedEventArgs e) { this.SingleConceptMatching.Clear(); this.lastInputBoxResults = null; this.lastInputBoxSearch = string.Empty; this.lastAdditionalTextBoxSearch = string.Empty; this.lastAdditionalTextBoxResults = null; this.outputs.Clear(); this.SelectedOutputContentPresenter.Content = new SingleConceptMatchingOutput(); if (this.connected) { this.StatusText.Text = string.Empty; } this.ScenarioComboBox.SelectedIndex = 0; this.SearchTypeComboBox.SelectedIndex = 0; this.ScenarioComboBox.Focus(); }
/// <summary> /// Handles the selection changed event of the Scenario ComboBox control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Controls.SelectionChangedEventArgs"/> instance containing the event data.</param> private void ScenarioComboBoxSelectionChanged(object sender, SelectionChangedEventArgs e) { this.lastInputBoxResults = null; this.lastInputBoxSearch = string.Empty; this.lastAdditionalTextBoxSearch = string.Empty; this.lastAdditionalTextBoxResults = null; this.SingleConceptMatching.InputBoxSelectedItem = null; this.SingleConceptMatching.InputBoxItemsSource = null; this.SingleConceptMatching.AdditionalTextBoxMatchingTermItemsSource = null; if (e.AddedItems != null && e.AddedItems.Count > 0) { Scenario scenario; if ((scenario = (e.AddedItems[0] as Scenario)) != null) { this.SingleConceptMatching.SubsetPickerItemsSource = scenario.FilterItemCollection; this.SingleConceptMatching.InputBoxLabelText = scenario.TitleText; this.SingleConceptMatching.InputBoxWatermark = scenario.WatermarkText; this.SingleConceptMatching.SubsetPickerSelectedIndex = 0; } } }
/// <summary> /// Handles the saved event of the Single Concept matching control. /// Adds the encoded term to the encoded list box. /// </summary> /// <param name="sender">The single concept matching control.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> private void SingleConceptMatching_Saved(object sender, System.Windows.RoutedEventArgs e) { if (this.connected && this.SingleConceptMatching.InputBoxSelectedItem != null) { ObservableCollection<AdditionalTextBoxResult> additionalTextBoxResults = new ObservableCollection<AdditionalTextBoxResult>(); foreach (object o in this.SingleConceptMatching.AdditionalTextBoxSelectedTerms) { AdditionalTextBoxResult additionalTextBoxResult = o as AdditionalTextBoxResult; if (additionalTextBoxResult != null) { additionalTextBoxResults.Add(additionalTextBoxResult); } } this.ShowProgressBar(); TerminologyManager.EncodeConcept(this.SingleConceptMatching.InputBoxSelectedItem as InputFieldResult, additionalTextBoxResults); } else { this.EncodeOutput(CreateUnencodedConcept(this.SingleConceptMatching.InputBoxText)); this.SingleConceptMatching.Clear(); this.SingleConceptMatching.FocusInputBox(); } this.lastInputBoxResults = null; this.lastInputBoxSearch = string.Empty; this.lastAdditionalTextBoxSearch = string.Empty; this.lastAdditionalTextBoxResults = null; }
/// <summary> /// Handles the additional text box parse completed event of the Terminology Manager. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="AdditionalTextBoxParseCompletedEventArgs"/> instance containing the event data.</param> private void TerminologyManagerAdditionalTextBoxParseCompleted(object sender, AdditionalTextBoxParseCompletedEventArgs e) { this.indexerCallCount--; if (this.indexerCallCount == 0) { this.HideProgressBar(); this.StatusText.Text = string.Empty; } if (this.SingleConceptMatching.AdditionalTextBoxText != e.SearchTextOriginal || this.SingleConceptMatching.InputBoxSelectedItem == null || ((InputFieldResult)this.SingleConceptMatching.InputBoxSelectedItem).Concept.SnomedConceptId != e.MainConceptId) { return; } if (e.Successful) { if (e.AdditionalTextBoxResults.Count > 0) { ObservableCollection<AdditionalTextBoxResult> results = new ObservableCollection<AdditionalTextBoxResult>(); foreach (AdditionalTextBoxResult result in e.AdditionalTextBoxResults) { results.Add(this.GetMatchingAdditionalTextBoxResultsFromLastResults(result)); } this.lastAdditionalTextBoxResults = new AdditionalTextBoxParseCompletedEventArgs( e.SearchTextOriginal, results, e.MainConceptId); this.SingleConceptMatching.AdditionalTextBoxMatchingTermItemsSource = results; this.SingleConceptMatching.FocusAdditionalTextBox(); this.StatusText.Text = string.Empty; } else { this.StatusText.Text = SingleConceptMatchingPage.NoMatchesFoundText; } } else { this.StatusText.Text = SingleConceptMatchingPage.NoMatchesFoundDueToErrorText; } }