/// <summary> /// Loads the last two versions of the report. Use LoadCaseData to refresh UI as it loads the diagnosis for the case as well. /// </summary> private void RefreshComparison() { if (cmbCaseNumber.SelectedValue != null && cmbVersion.SelectedIndex != -1) { wbDiffText.Text = ""; string html = ""; var listCase = SqliteDataAcces.GetListCaseEntry(cmbCaseNumber.SelectedValue.ToString()); // gets the case entrys, groups them by author and then selects the last two author entries to compare. var dt = DateTime.Parse(cmbVersion.SelectedItem.ToString()); CaseEntry residentEntry = listCase.Where(x => x.DateTimeModifiedObject == dt).First(); CaseEntry attendingEntry = listCase.Last(); html += DiffToHTML(residentEntry.Interpretation, attendingEntry.Interpretation, "Interpretation"); html += DiffToHTML(residentEntry.Material, attendingEntry.Material, "Material"); html += DiffToHTML(residentEntry.History, attendingEntry.History, "History"); html += DiffToHTML(residentEntry.Gross, attendingEntry.Gross, "Gross"); html += DiffToHTML(residentEntry.Microscopic, attendingEntry.Microscopic, "Microscopic"); html += DiffToHTML(residentEntry.TumorSynoptic, attendingEntry.TumorSynoptic, "Tumor Synoptic"); html += DiffToHTML(residentEntry.Comment, attendingEntry.Comment, "Comment"); html = "<head><style>INS {background-color: powderblue;}DEL {color: #ff5151;}</style></head>" + html; wbDiffText.Text = html; } else { wbDiffText.Text = ""; } }
private void RefreshCaseEntry() { if (txtCaseNumber.Text != SqliteDataAcces.CaseNumberPrefix && txtCaseNumber.Text != "") { CaseEntry ce = SqliteDataAcces.GetCaseEntryLatestVersion(txtCaseNumber.Text); if (ce != null) { txtInterpretation.Text = ce.Interpretation; txtResultEntry.Text = ce.Result; txtComment.Text = ce.Comment; txtTumorSynoptic.Text = ce.TumorSynoptic; message.Text = $"Case entry found by: {ce.AuthorID} ({ce.DateModifiedString} {ce.TimeModifiedString})"; } hasCaseNumberChanged = false; } else { message.Text = $"No case entry found"; } }
private void btnAddCase_Click(object sender, RoutedEventArgs e) { if (txtCaseNumber.Text.Trim() == "" || txtCaseNumber.Text == SqliteDataAcces.CaseNumberPrefix) { MessageBox.Show("Please enter a case number"); } else if (cmbService.Text == "") { MessageBox.Show("Please choose a service"); } else if (cmbAuthor.Text == "") { MessageBox.Show("Please choose an author"); } else { CaselyUserData pc = new CaselyUserData(); pc.CaseNumber = txtCaseNumber.Text; pc.Service = cmbService.Text; CaseEntry ce = new CaseEntry(); DateTime currentTime = DateTime.Now; ce.AuthorID = cmbAuthor.Text; ce.CaseNumber = txtCaseNumber.Text; ce.Interpretation = txtInterpretation.Text; ce.Result = txtResultEntry.Text; ce.Comment = txtComment.Text; ce.TumorSynoptic = txtTumorSynoptic.Text; ce.DateModifiedString = dtCreated.Value.GetValueOrDefault().ToString("yyyy-MM-dd"); ce.TimeModifiedString = dtCreated.Value.GetValueOrDefault().ToString("HH:mm:ss"); SqliteDataAcces.InsertNewCaseEntry(ce, pc); txtInterpretation.Text = ""; txtComment.Text = ""; txtResultEntry.Text = ""; txtTumorSynoptic.Text = ""; txtCaseNumber.Text = SqliteDataAcces.CaseNumberPrefix; MessageBox.Show("Case Added"); dtCreated.Value = DateTime.Now; } }
private bool IsCaseEvaluated(CaseEntry CE) { var xy = listAllCaselyUserData.Where(x => x.CaseNumber == CE.CaseNumber).Where(y => y.Evaluation != null && y.Evaluation.TrimStart(' ') != ""); return(xy.Count() != 0); }