public IActionResult DoctorView(Patient patient) { patientId = patient.Id; Properties.patient = patient; var doctorSpecialization = DoctorTable.GetSpecializationById(Properties.UserId); if (patient.Name == null) { patient.Id = 100; } List <Visit> visits = VisitTable.GetDataByPatientIdAndSpecialization(patient.Id, doctorSpecialization[0].Specialization); List <Prescription> prescriptions = PrescriptionTable.GetDataByPatientId(patient.Id); List <Test> tests = TestTable.GetDataByPatientId(patient.Id); List <Documentation> docs = DocumentationTable.GetDataByPatientId(patient.Id); List <MedicalDescription> list = MedicalDescriptionTable.GetDataByPatientId(patient.Id); ViewData["data"] = patient; ViewData["docs"] = docs; ViewData["visits"] = visits; ViewData["prescript"] = prescriptions; ViewData["tests"] = tests; ViewData["medicalDescriptionData"] = list; return(View()); }
public ActionResult PatientView([FromForm] string searchString) { try { if (Regex.IsMatch(searchString, @"^[a-zA-Z]+$")) { List <Doctor> doctor = DoctorTable.GetDoctorIdBySurname(searchString); if (doctor.Count != 0) { int doctorId = doctor[0].Id; var visit = VisitTable.GetDataByDoctorId(doctorId, Properties.UserId); var prescript = PrescriptionTable.GetDataByDoctorId(doctorId, Properties.UserId); var test = TestTable.GetDataByDoctorId(doctorId, Properties.UserId); var sickleave = SickLeaveTable.GetDataByDoctorId(doctorId, Properties.UserId); var description = MedicalDescriptionTable.GetDataByDoctorId(doctorId, Properties.UserId); var doc = DocumentationTable.GetDataByDoctorId(doctorId, Properties.UserId); ViewData["PatientName"] = PatientTable.GetPatientById(Properties.UserId)[0]; ViewData["visitData"] = visit; ViewData["prescriptioneData"] = prescript; ViewData["Tests"] = test; ViewData["sickLeaveData"] = sickleave; ViewData["medicalDescription"] = description; ViewData["documentation"] = doc; return(View()); } else { ViewData["PatientName"] = PatientTable.GetPatientById(Properties.UserId)[0]; ViewData["visitData"] = new List <Visit>(); ViewData["prescriptioneData"] = new List <Prescription>(); ViewData["Tests"] = new List <Test>(); ViewData["sickLeaveData"] = new List <SickLeave>(); ViewData["medicalDescription"] = new List <MedicalDescription>(); ViewData["documentation"] = new List <Documentation>(); var prescript = PrescriptionTable.GetPrescriptByMedicine(searchString); if (prescript.Count != 0) { ViewData["prescriptioneData"] = prescript; } var des = MedicalDescriptionTable.GetData(Properties.UserId, searchString); if (des.Count != 0) { ViewData["medicalDescription"] = des; } View(); } } return(View()); } catch { return(View()); } }
public IActionResult Prescription(int id) { ViewBag.var = id; var data = PrescriptionTable.GetDataById(id); return(View(data[0])); }
public ActionResult DoctorPrescription([FromForm] Prescription presc) { var patients = PatientTable.GetPatientById(patientId); DateTime time = DateTime.Now.Date; string date = time.ToString("yyyy-MM-dd"); PrescriptionTable.InsertData(patients[0].Id, Properties.UserId, presc.Medicine, presc.Description, date, presc.Refund); return(RedirectToAction("Visit", "Doctor", new { id = Properties.VisitId })); }
public IActionResult PdfPrescription(int id) { var prescription = PrescriptionTable.GetDataById(id); var patData = PatientTable.GetPatientById(Properties.UserId); patData[0].Name = patData[0].Name + " " + patData[0].Surname; ViewBag.patient = patData; var doc = DoctorTable.GetDoctorIdByName(prescription[0].DoctorName); var docData = DoctorTable.GetSpecializationById(doc[0].Id); docData[0].Name = docData[0].Name + " " + docData[0].Surname; ViewBag.doctor = docData; return(View(prescription)); }
public int GetPrescription(MySqlCommand cmd) { Prescription p = new Prescription(); MySqlCommand query = cmd; MySqlDataReader reader = query.ExecuteReader(); while (reader.Read()) { Prescription a = new Prescription(); PrescriptionTable pt = Tables.PRESCRIPTION_TABLE; a.Id = GetInt(reader[pt.ID.Name]); p.Id = a.Id; } reader.Close(); reader.Dispose(); return(p.Id); }
public ActionResult PatientView(Patient patient) { var patients = PatientTable.GetPatientById(Properties.UserId); var description = MedicalDescriptionTable.GetDataByPatientId(Properties.UserId); var visit = VisitTable.GetDataByPatientId(Properties.UserId); var prescript = PrescriptionTable.GetData(Properties.UserId); var test = TestTable.GetData(Properties.UserId); var leavesick = SickLeaveTable.GetDataByPatientId(Properties.UserId); var doc = DocumentationTable.GetDataByPatientId(Properties.UserId); // ViewData["PatientName"] = PatientTable.GetPatientById(patient.Id); ViewData["PatientName"] = patients[0]; ViewData["visitData"] = visit; ViewData["prescriptioneData"] = prescript; ViewData["Tests"] = test; ViewData["sickLeaveData"] = leavesick; ViewData["medicalDescription"] = description; ViewData["documentation"] = doc; return(View()); }
/// <summary> /// Gets a list of Prescriptions from the database based on search critera provided by the QueryBuilder. /// </summary> /// <param name="b">QueryBuilder containing the SQL code.</param> /// <returns>A list of <see cref="Mockup2.DatabaseClasses.Prescription"/>s.</returns> public List <Prescription> GetPrescriptions(QueryBuilder b) { List <Prescription> result = new List <Prescription>(); MySqlCommand query = new MySqlCommand(b.ToString(), dbCon.GetConnection()); MySqlDataReader reader = query.ExecuteReader(); while (reader.Read()) { Prescription a = new Prescription(); PrescriptionTable pt = Tables.PRESCRIPTION_TABLE; a.Id = GetInt(reader[pt.ID.Name]); a.StaffId = GetInt(reader[pt.IssuingStaffID.Name]); a.PatientId = GetInt(reader[pt.PatientID.Name]); a.IsRepeatable = GetBool(reader[pt.IsRepeatable.Name]); a.IssueDate = GetDateTime(reader[pt.IssueDate.Name]); a.RepeatRequested = GetBool(reader[pt.RepeatRequested.Name]); result.Add(a); } reader.Close(); reader.Dispose(); return(result); }