/// <summary>
        /// Searches this instance.
        /// </summary>
        private void Search()
        {
            if (this.SingleConceptMatching.InputBoxText != this.lastInputBoxSearch)
            {
                this.lastInputBoxSearch = this.SingleConceptMatching.InputBoxText;

                if (this.connected)
                {
                    if (!SingleConceptMatchingPage.ValidateInputText(this.SingleConceptMatching.InputBoxText))
                    {
                        this.StatusText.Text = SingleConceptMatchingPage.InputTextValidationFailed;
                        return;
                    }

                    this.StatusText.Text = SingleConceptMatchingPage.SearchInProgressText;
                    this.ShowProgressBar();

                    this.SingleConceptMatching.InputBoxItemsSource = null;

                    FilterItem filterItem = this.SingleConceptMatching.SubsetPickerSelectedItem as FilterItem;

                    TerminologyManager.SearchInputField(SingleConceptMatchingPage.FixupInputText(this.SingleConceptMatching.InputBoxText), filterItem.SubsetCollection);
                }
            }
            else if (this.lastInputBoxResults != null && this.SingleConceptMatching.InputBoxText == this.lastInputBoxResults.SearchTextOriginal)
            {
                this.SingleConceptMatching.InputBoxItemsSource = this.lastInputBoxResults.InputFieldResults;
            }
        }
        /// <summary>
        /// Handles the InputFieldTextChanged event of the SingleConceptMatching control.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.Controls.TextChangedEventArgs"/> instance containing the event data.</param>
        private void SingleConceptMatching_InputBoxTextChanged(object sender, TextChangedEventArgs e)
        {
            this.SingleConceptMatching.InputBoxItemsSource = null;
            this.encodableInputFieldTimer.Stop();

            if (this.connected)
            {
                this.StatusText.Text = string.Empty;
            }

            this.HideProgressBar();

            if (!SingleConceptMatchingPage.ValidateInputText(this.SingleConceptMatching.InputBoxText))
            {
                return;
            }

            switch (SingleConceptMatchingPage.searchMode)
            {
            case SearchMode.Progressive:
                if (!this.encodableInputFieldTimer.IsEnabled)
                {
                    this.encodableInputFieldTimer.Start();
                }

                break;

            case SearchMode.UserInitiated:
                break;

            default:
                break;
            }
        }
 /// <summary>
 /// Handles the encode completed event of the Terminology Manager.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EncodeConceptCompletedEventArgs"/> instance containing the event data.</param>
 private void TerminologyManagerEncodeConceptCompleted(object sender, EncodeConceptCompletedEventArgs e)
 {
     if (e.Successful)
     {
         this.StatusText.Text = string.Empty;
         this.EncodeOutput(e.EncodedConcept);
     }
     else
     {
         this.StatusText.Text = NoMatchesFoundDueToErrorText;
         this.EncodeOutput(SingleConceptMatchingPage.CreateUnencodedConcept(this.SingleConceptMatching.InputBoxText));
     }
 }
        /// <summary>
        /// Handles the input box search completed event of the Terminology Manager.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="InputFieldSearchCompletedEventArgs"/> instance containing the event data.</param>
        private void TerminologyManagerInputBoxSearchCompleted(object sender, InputFieldSearchCompletedEventArgs e)
        {
            // Check search is for the latest value in the text box
            if (SingleConceptMatchingPage.FixupInputText(this.SingleConceptMatching.InputBoxText) != e.SearchTextOriginal)
            {
                return;
            }

            if (e.Successful)
            {
                if (e.InputFieldResults != null && e.InputFieldResults.Count > 0)
                {
                    this.lastInputBoxResults = e;
                    this.SingleConceptMatching.InputBoxItemsSource = e.InputFieldResults;

                    if (e.ExceedsMaxTotal)
                    {
                        this.StatusText.Text = string.Format(System.Globalization.CultureInfo.CurrentCulture, SingleConceptMatchingPage.MoreMatchesFoundText, e.InputFieldResults.Count);
                    }
                    else
                    {
                        this.StatusText.Text = string.Format(System.Globalization.CultureInfo.CurrentCulture, SingleConceptMatchingPage.MatchesFound, e.InputFieldResults.Count);
                    }
                }
                else
                {
                    this.StatusText.Text = SingleConceptMatchingPage.NoMatchesFoundText;
                }
            }
            else
            {
                this.StatusText.Text = SingleConceptMatchingPage.NoMatchesFoundDueToErrorText;
            }

            this.HideProgressBar();
        }
Beispiel #5
0
        /// <summary>
        /// Control selection changed.
        /// </summary>
        /// <param name="sender">Sender of the event.</param>
        /// <param name="e">Event args for the event.</param>
        private void ControlSelectorComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.ResetAllParenting();
            this.controlSamplePanel.Visible = true;
            this.contentWebBrowser.BringToFront();
            bool allowResize = bool.Parse(ConfigurationManager.AppSettings["AllowResize"]);

            this.wpfControlsElementHost.AutoSize = false;
            this.wpfControlsElementHost.Dock     = DockStyle.None;

            switch (this.controlSelectorComboBox.SelectedIndex)
            {
            case 0:
                this.SetBaseWpfHost();
                this.controlSamplePanel.Visible = false;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/Intro.htm"));
                break;

            case 1:
                this.controlSamplePanel.Visible = false;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/WPFIntro.htm"));
                break;

            case 2:
                AddressLabelPage addressLabelPage = new AddressLabelPage();
                addressLabelPage.AllowResize       = allowResize;
                this.wpfControlsElementHost.Size   = new Size(800, 130);
                this.wpfControlsElementHost.Parent = this.wpfAddressLabelPanel;
                this.wpfControlsElementHost.Child  = addressLabelPage;
                this.wpfAddressLabelPanel.Parent   = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/AddressLabel.htm"));
                break;

            case 3:
                ContactLabelPage contactLabelPage = new ContactLabelPage();
                contactLabelPage.AllowResize       = allowResize;
                this.wpfControlsElementHost.Size   = new Size(800, 120);
                this.wpfControlsElementHost.Parent = this.wpfContactLabelPanel;
                this.wpfControlsElementHost.Child  = contactLabelPage;
                this.wpfContactLabelPanel.Parent   = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/ContactLabel.htm"));
                break;

            case 4:
                DateLabelPage dateLabelPage = new DateLabelPage();
                dateLabelPage.AllowResize          = allowResize;
                this.wpfControlsElementHost.Size   = new Size(800, 75);
                this.wpfControlsElementHost.Parent = this.wpfDateLabelPanel;
                this.wpfControlsElementHost.Child  = dateLabelPage;
                this.wpfDateLabelPanel.Parent      = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/DateLabel.htm"));
                break;

            case 5:
                GenderLabelPage genderLabelPage = new GenderLabelPage();
                genderLabelPage.AllowResize        = allowResize;
                this.wpfControlsElementHost.Size   = new Size(800, 75);
                this.wpfControlsElementHost.Parent = this.wpfGenderLabelPanel;
                this.wpfControlsElementHost.Child  = genderLabelPage;
                this.wpfGenderLabelPanel.Parent    = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/GenderLabel.htm"));
                break;

            case 6:
                GraphingSamplePage graphingSamplePage = new GraphingSamplePage();
                this.wpfControlsElementHost.AutoSize        = true;
                this.wpfControlsElementHost.Dock            = DockStyle.Fill;
                this.graphingControlPanel.Dock              = DockStyle.Fill;
                this.contentSplitContainer.SplitterDistance = 575;
                this.wpfControlsElementHost.Parent          = this.graphingControlPanel;
                this.wpfControlsElementHost.Child           = graphingSamplePage;
                this.graphingControlPanel.Parent            = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/Graphing.htm"));
                break;

            case 7:
                IdentifierLabelPage identifierLabelPage = new IdentifierLabelPage();
                identifierLabelPage.AllowResize     = allowResize;
                this.wpfControlsElementHost.Size    = new Size(800, 75);
                this.wpfControlsElementHost.Parent  = this.wpfIdentifierLabelPanel;
                this.wpfControlsElementHost.Child   = identifierLabelPage;
                this.wpfIdentifierLabelPanel.Parent = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/IdentifierLabel.htm"));
                break;

            case 8:
                this.medsListViewSamplePanel.Parent = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/MedsListView.htm"));
                this.patientListBox.DataSource = GetPatientNames();
                break;

            case 9:
                NameLabelPage nameLabelPage = new NameLabelPage();
                nameLabelPage.AllowResize          = allowResize;
                this.wpfControlsElementHost.Size   = new Size(800, 120);
                this.wpfControlsElementHost.Parent = this.wpfNameLabelPanel;
                this.wpfControlsElementHost.Child  = nameLabelPage;
                this.wpfNameLabelPanel.Parent      = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/NameLabel.htm"));
                break;

            case 10:
                PatientBannerPage patientBannerPage = new PatientBannerPage();
                patientBannerPage.AllowResize      = allowResize;
                this.wpfControlsElementHost.Size   = new Size(850, 250);
                this.wpfControlsElementHost.Parent = this.wpfPatientBannerPanel;
                this.wpfControlsElementHost.Child  = patientBannerPage;
                this.wpfPatientBannerPanel.Parent  = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/PatientBanner.htm"));
                break;

            case 11:
                SamplePages.SearchAndPrescribePage searchAndPrescribePage = new SamplePages.SearchAndPrescribePage();
                this.wpfControlsElementHost.AutoSize        = true;
                this.wpfControlsElementHost.Dock            = DockStyle.Fill;
                this.singleConceptMatchingPanel.Dock        = DockStyle.Fill;
                this.contentSplitContainer.SplitterDistance = 575;
                this.wpfControlsElementHost.Parent          = this.singleConceptMatchingPanel;
                this.wpfControlsElementHost.Child           = searchAndPrescribePage;
                this.singleConceptMatchingPanel.Parent      = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/SearchAndPrescribe.htm"));
                break;

            case 12:
                SingleConceptMatchingPage singleConceptMatchingPage = new SingleConceptMatchingPage();
                this.wpfControlsElementHost.AutoSize        = true;
                this.wpfControlsElementHost.Dock            = DockStyle.Fill;
                this.singleConceptMatchingPanel.Dock        = DockStyle.Fill;
                this.contentSplitContainer.SplitterDistance = 575;
                this.wpfControlsElementHost.Parent          = this.singleConceptMatchingPanel;
                this.wpfControlsElementHost.Child           = singleConceptMatchingPage;
                this.singleConceptMatchingPanel.Parent      = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/SingleConceptMatching.htm"));
                break;

            case 13:
                TimeLabelPage timeLabelPage = new TimeLabelPage();
                timeLabelPage.AllowResize          = allowResize;
                this.wpfControlsElementHost.Size   = new Size(800, 180);
                this.wpfControlsElementHost.Parent = this.wpfTimeLabelPanel;
                this.wpfControlsElementHost.Child  = timeLabelPage;
                this.wpfTimeLabelPanel.Parent      = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/TimeLabel.htm"));
                break;

            case 14:
                TimeActivityGraphHostPage timeActivityGraphHostPage = new TimeActivityGraphHostPage();
                this.wpfControlsElementHost.AutoSize        = true;
                this.wpfControlsElementHost.Dock            = DockStyle.Fill;
                this.timelineGraphPanel.Dock                = DockStyle.Fill;
                this.contentSplitContainer.SplitterDistance = 575;
                this.wpfControlsElementHost.Parent          = this.timelineGraphPanel;
                this.wpfControlsElementHost.Child           = timeActivityGraphHostPage;
                this.timelineGraphPanel.Parent              = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/Timeline.htm"));
                break;

            case 15:
                this.controlSamplePanel.Visible = false;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/WinFormsIntro.htm"));
                break;

            case 16:
                this.addressLabelSamplePanel.Parent = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/AddressLabel.htm"));
                break;

            case 17:
                this.contactLabelSamplePanel.Parent = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/ContactLabel.htm"));
                break;

            case 18:
                this.dateInputBoxSamplePanel.Parent = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/DateInputBox.htm"));
                break;

            case 19:
                this.dateLabelSamplePanel.Parent = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/DateLabel.htm"));
                break;

            case 20:
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/ErrorProvider.htm"));
                this.ErrorProviderSamplePanel.Parent = this.controlSamplePanel;
                break;

            case 21:
                this.genderLabelSamplePanel.Parent = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/GenderLabel.htm"));
                break;

            case 22:
                this.identifierLabelSamplePanel.Parent = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/IdentifierLabel.htm"));
                break;

            case 23:
                this.nameLabelSamplePanel.Parent = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/NameLabel.htm"));
                break;

            case 24:
                this.patientBannerSamplePanel.Parent = this.controlSamplePanel;
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/PatientBanner.htm"));
                this.patientBannerSamplePanel.BringToFront();
                break;

            case 25:
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/PatientSearchInputBox.htm"));
                this.patientSearchInputBoxSamplePanel.Parent = this.controlSamplePanel;
                break;

            case 26:
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/TimeInputBox.htm"));
                this.timeInputBoxSamplePanel.Parent = this.controlSamplePanel;
                break;

            case 27:
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/TimeLabel.htm"));
                this.timeLabelSamplePanel.Parent = this.controlSamplePanel;
                break;

            case 28:
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/TimeSpanLabel.htm"));
                this.timeSpanLabelSamplePanel.Parent = this.controlSamplePanel;
                break;

            case 29:
                this.contentWebBrowser.Navigate(new System.Uri(Application.StartupPath + "/Pages/TimeSpanInputBox.htm"));
                this.timeSpanInputBoxSamplePanel.Parent = this.controlSamplePanel;
                break;
            }

            this.AdjustControlSamplePanelHeight();
        }