Example #1
0
        /// <summary>
        /// Invoked when a filter is selected using the ComboBox in snapped view state.
        /// </summary>
        /// <param name="sender">The ComboBox instance.</param>
        /// <param name="e">Event data describing how the selected filter was changed.</param>
        async void Filter_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // Determine what filter was selected
            var selectedFilter = e.AddedItems.FirstOrDefault() as Filter;
            
            if (selectedFilter != null)
            {
                // Mirror the results into the corresponding Filter object to allow the
                // RadioButton representation used when not snapped to reflect the change
                selectedFilter.Active = true;

                // TODO: Respond to the change in active filter by setting this.DefaultViewModel["Results"]
                //       to a collection of items with bindable Image, Title, Subtitle, and Description properties


//You will need implement IEnumerable<Person>, that is all that WPF need to make something bindable.? (right now nly displaying description?

                 object objQueryText;
                
                string queryText = string.Empty;

                if (this.DefaultViewModel.TryGetValue("QueryText", out  objQueryText))
                {
                    
                    queryText =  objQueryText.ToString();
                    queryText = queryText.Replace("'\u201c'", String.Empty);
                   
                    Regex r = new Regex("(?:[^a-z0-9, ]|(?<=['\"])s)", RegexOptions.IgnoreCase );
                   queryText= r.Replace(queryText, String.Empty);

                }
                
                PatientObject po = new  PatientObject();
                try
                {
                    Collection<PatientItem> colPatients = await po.SearchPatients(objUnityData.UnityAppUser, queryText);
                    this.DefaultViewModel["Results"] = colPatients;

                }
                catch (Exception ex)
                {
                    ErrorHandler eh = new ErrorHandler(ex, "Patient Search");
                    eh.ShowErrorDialog();
                    return;
                }
             
                // Ensure results are found
                object results;
                ICollection resultsCollection;
                if (this.DefaultViewModel.TryGetValue("Results", out results) &&
                    (resultsCollection = results as ICollection) != null &&
                    resultsCollection.Count != 0)
                {
                    VisualStateManager.GoToState(this, "ResultsFound", true);
                    return;
                }
            }

            // Display informational text when there are no search results.
            VisualStateManager.GoToState(this, "NoResultsFound", true);
        }
Example #2
0
        private async void GetPatientData(string sPatientID, string datatype)
        {
            try
            {
                PatientObject po = new PatientObject();
                List<DocumentListItem> lstDocuments = await PatientDataService.GetDocumentList(UnityDataService.UnityAppUser, sPatientID);

                List<ChartSectionItem> lstChartSection = await PatientDataService.GetChartSections(UnityDataService.UnityAppUser, sPatientID, datatype);


                //MEDS SECTION
                ChartItemCategory listMeds = new ChartItemCategory("Medications");
                //Allergies SECTION
                ChartItemCategory listAllergy = new ChartItemCategory("Allergies");
                //PROBLEM SECTION
                ChartItemCategory listProblems = new ChartItemCategory("Problems");
                //Vitals SECTION
                ChartItemCategory listVitals = new ChartItemCategory("Vitals");
                //Immunizations SECTION
                ChartItemCategory listImmunizations = new ChartItemCategory("Immunizations");
                //History SECTION
                ChartItemCategory listHistory = new ChartItemCategory("History");


                ChartItemCategory listAll = new ChartItemCategory("Test");
                ChartItemCategory listDocuments = new ChartItemCategory("Documents");

                //Documents Section some hardcodes for demo
                if (lstDocuments.Count > 0)
                {

                    foreach (DocumentListItem doc in lstDocuments)
                    {
                        DocumentChartItem newDoc = new DocumentChartItem(doc.DocumentID, doc.DisplayName + " " + doc.SortDate, doc.AuthorName, doc.DocumentType, "Y", "0", doc.Img);
                        listDocuments.AddChartItem(newDoc);
                        listAll.AddChartItem(newDoc);

                    }
                }
                //TODO: replace this with faster LINQ query.
                foreach (ChartSectionItem csi in lstChartSection)
                {
                    ProblemItem pi = new ProblemItem(csi.transid, csi.expdescription, csi.level1);

                    DateTime vitalsDateTime = DateTime.Now;
                    if ((csi.level1.ToUpper() != "Y") && (csi.section.ToUpper() != "VITALS"))//this is skipping vitals...
                    {
                        continue;
                    }
                    switch (csi.section)
                    {
                        case "medications":
                            MedicationChartItem newMed = new MedicationChartItem(csi.transid, csi.expdescription, csi.exp2description, csi.exp2detail, csi.level1, csi.sortorder);
                            listMeds.AddChartItem(newMed);
                            listAll.AddChartItem(newMed);
                            break;
                        case "allergies":
                            AllergyChartItem newAllergy = new AllergyChartItem(csi.transid, csi.expdescription, csi.exp2description, csi.exp2detail, csi.level1, csi.sortorder);
                            listAllergy.AddChartItem(newAllergy);
                            listAll.AddChartItem(newAllergy);
                            break;
                        case "problems":
                            ProblemChartItem newProblem = new ProblemChartItem(csi.transid, csi.expdescription, csi.exp2description, csi.exp2detail, csi.level1, csi.sortorder);
                            listProblems.AddChartItem(newProblem);
                            listAll.AddChartItem(newProblem);
                            break;
                        case "immunizations":
                            ImmunizationChartItem newImmunization = new ImmunizationChartItem(csi.transid, csi.expdescription, csi.exp2description, csi.exp2detail, csi.level1, csi.sortorder);
                            listImmunizations.AddChartItem(newImmunization);
                            listAll.AddChartItem(newImmunization);
                            break;
                        case "history":
                            HistoryChartItem newHistory = new HistoryChartItem(csi.transid, csi.expdescription, csi.exp2description, csi.exp2detail, csi.level1, csi.sortorder);
                            listHistory.AddChartItem(newHistory);
                            break;
                        case "vitals":
                            if (csi.description.ToLower() != "other")
                            {
                                VitalChartItem newVitals = new VitalChartItem("0", csi.description, csi.detail, csi.expright, csi.level1, csi.sortorder);
                                listVitals.AddChartItem(newVitals);
                            }
                            break;
                        default:
                            break;
                    }

                }

                ObservableCollection<ChartItemCategory> newChart = new ObservableCollection<ChartItemCategory>();
                newChart.Add(listProblems);
                newChart.Add(listVitals);
                newChart.Add(listAllergy);
                newChart.Add(listMeds);
                newChart.Add(listDocuments);
                newChart.Add(listImmunizations);
                newChart.Add(listHistory);

                ChartItems cis = new ChartItems();
                cis.AddChartItemCategory(listProblems);
                cis.AddChartItemCategory(listVitals);
                cis.AddChartItemCategory(listAllergy);
                cis.AddChartItemCategory(listMeds);

                if (lstDocuments.Count > 0)
                    cis.AddChartItemCategory(listDocuments);

                cis.AddChartItemCategory(listImmunizations);
                cis.AddChartItemCategory(listHistory);

                ChartItemSource = new ObservableCollection<ChartItemCategory>(cis.Items);


                //This may seem redundant but it prevents the gridview from auto-selecting the first item.
                //gvChartItems.SelectionMode = ListViewSelectionMode.None;
                //gvChartItems.SelectionMode = ListViewSelectionMode.Single;
                //lvChartItems.SelectionMode = ListViewSelectionMode.None;

                //Add context for semantic zoom out.
                //var groupedChartItems = chartItemsViewSource.View.CollectionGroups;
                //var groupedChartItems = chartItemGroupViewSource.View.CollectionGroups;
                //lvChartItems.ItemsSource = cis.Items; 

            }
            catch (Exception ex)
            {
                ErrorHandler eh = new ErrorHandler(ex, "PatientOverview GetData");
                eh.ShowErrorDialog();
            }

        }
Example #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonVitalsDone_Click_1(object sender, RoutedEventArgs e)
        {
            AddVitalsRequest vitalsRequest = new AddVitalsRequest();
            vitalsRequest.BPM = Convert.ToInt32(this.textBoxBpm.Text);
            vitalsRequest.CuffLocation = this.textBoxCuffLocation.Text;
            vitalsRequest.CuffSize = this.textBoxCuffSize.Text;
            vitalsRequest.Diastolic = Convert.ToInt32(this.textBoxDiastolic.Text);
            vitalsRequest.Systolic = Convert.ToInt32(this.textBoxSystolic.Text);
            vitalsRequest.Fahrenheit = Convert.ToInt32(this.textBoxFahrenheit.Text);
            vitalsRequest.Feet = Convert.ToInt32(this.textBoxFeet.Text);
            vitalsRequest.Inches = Convert.ToInt32(this.textBoxInches.Text);
            vitalsRequest.O2Level = this.textBoxO2SatLevel.Text;
            vitalsRequest.O2Source = this.textBoxO2Source.Text;
            vitalsRequest.Ounces = Convert.ToInt32(this.textBoxOunces.Text);
            vitalsRequest.PainLevel = Convert.ToInt32(this.textBoxPainLevel.Text);
            vitalsRequest.PatientPosition = this.textBoxPatientPosition.Text;
            vitalsRequest.PM = Convert.ToInt32(this.textBoxPm.Text);
            vitalsRequest.Pounds = Convert.ToInt32(this.textBoxPounds.Text);
            vitalsRequest.SelectedPulsePattern = this.comboPulsePattern.SelectedValue as string;
            vitalsRequest.SelectedRespirationPattern = this.comboPattern.SelectedValue as string;
            vitalsRequest.SelectedTemperatureMethod = this.comboMethod.SelectedValue as string;

            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            string requestBody = vitalsRequest.ToString();
            string patientId = localSettings.Values["CurrentPatientID"] as string;


            PatientObject po = new PatientObject();
            po.AddPatientVitals(patientId, requestBody);

            //Navigate back to previous frame

        }
Example #4
0
        private async void btnUpload_Click_1(object sender, RoutedEventArgs e)
        {
            PatientObject po = new PatientObject();

            await po.UpdatePatientPhoto(UnityData.Instance.UnityAppUser, "");
        }