private void PopulateVisitList() { listVisits.Items.Clear(); List<PatientVisit> visits = new VisitData().GetVisits(_patientid); if (visits != null) { foreach (PatientVisit s in visits) { RadListDataItem item = new RadListDataItem(); item.Value = s.VisitId; item.Text = s.CreatedOn.ToShortDateString(); listVisits.Items.Add(item); } } }
private void btnAddNewVisit_Click(object sender, EventArgs e) { int _visitid = 0; VisitData db = new VisitData(); try { PatientVisit visit = new PatientVisit() { PatientId = _patiendid, ComplaintHistory = txtComplaint.Text.Trim(), ExaminationNotes = txtExamination.Text.Trim(), Diagnosis = txtDiagnosis.Text.Trim(), OtherAdvise = txtOtherAdvise.Text.Trim(), IsFolowUpRequired = chkFollowUp.Checked, FollowUpDate = datetimeFollowUp.Value, CreatedOn = DateTime.Now, UpdatedOn = DateTime.Now }; bool result = db.AddVisit(visit, labdatalist, imagingdatalist, prescriptionlist); if (result) { RefreshVisit(); MessageBox.Show("Visit added successfully. Please print results from [Previous Visits] section"); } else { MessageBox.Show("Error adding visit : Please contact support"); return; } } catch { MessageBox.Show("Error adding visit. Please try again."); return; } }
private void LoadPrescription(int visitid) { Patient patient = new PatientData().GetPatientById(_patientid); StringBuilder content = new StringBuilder(); content.Append("<p>"); content.Append("<b>Patient Name : </b>" + patient.FirstName.ToUpper() + " " + patient.LastName.ToUpper()); content.Append("<br/>"); content.Append("<b>Patient Id : </b>" + _patientid.ToString()); content.Append("<br/>"); content.Append("<b>Age : </b>" + Utility.GetAgeFromDob(patient.DOB).ToString()); content.Append("<br/>"); content.Append("<b>Address : </b>" + patient.Address.ToUpper()); content.Append("<br/>"); content.Append("<b>Hospital : </b>"); content.Append("<br/>"); content.Append("<b>IP Number : </b>"); content.Append("<br/>"); content.Append("<b>Date : </b>"); content.Append("<br/>"); content.Append("</p>"); VisitData db = new VisitData(); PatientVisit visit = db.GetVisitById(visitid); if (visit != null) { content.Append("<p>"); content.Append("<br/>"); content.Append("<b>Presenting complaint and relevant history : </b>"); content.Append("<br/>"); content.Append(visit.ComplaintHistory); content.Append("<br/>"); content.Append("<br/>"); content.Append("<b>Clinical findings : </b>"); content.Append("<br/>"); content.Append(visit.ExaminationNotes); content.Append("<br/>"); content = AddLabData(db.GetLabData(visitid), content); AddImagingData(db.GetImagingData(visitid), content); content.Append("<br/>"); content.Append("<b>Diagnosis : </b>"); content.Append("<br/>"); content.Append(visit.Diagnosis); content.Append("<br/>"); AddPrescriptionData(db.GetPrescriptionData(visitid), content); content.Append("<br/>"); content.Append("<b>Other Advise : </b>"); content.Append("<br/>"); content.Append(visit.OtherAdvise); content.Append("<br/>"); content.Append("<br/>"); content.Append("<b>Follow Up Date : </b>"); content.Append("<br/>"); if (visit.IsFolowUpRequired) { content.Append(visit.FollowUpDate.ToShortDateString()); } content.Append("<br/>"); content.Append("</p>"); } HtmlFormatProvider provider = new HtmlFormatProvider(); Telerik.WinControls.RichTextBox.Model.RadDocument document = provider.Import(content.ToString()); this.docPrintVisit.Document = document; this.docPrintVisit.InsertImage((Bitmap)Resources.letterhead); docPrintVisit.InsertLineBreak(); docPrintVisit.InsertLineBreak(); }