public IActionResult VisitDetails(int id, bool exportCharts, bool otherVisits, string sgrqChart) { var patientVisitManager = new PatientVisitManager(_context, ViewBag); var patientVisit = patientVisitManager.GetPatientVisitById(id); var patientDetailsVM = PatientVisitDetailsViewModel.BuildPatientVisitDetailsVM(patientVisitManager, patientVisit); ViewBag.ShowButtons = false; patientDetailsVM.ShowOtherVisits = otherVisits; var pdfBytes = _pdfConverter.GenerateVisitDetailsPdf(patientDetailsVM); return(GetFileContentResult(pdfBytes.Result, ".pdf", "application/pdf")); }
public IActionResult Details(int id) { _patientVisitManager = new PatientVisitManager(_context, ViewBag); var patientVisit = _patientVisitManager.GetPatientVisitById(id); if (patientVisit == null) { return(NotFound()); } var patientDetailsVM = PatientVisitDetailsViewModel. BuildPatientVisitDetailsVM(_patientVisitManager, patientVisit); ViewBag.ShowButtons = true; return(PartialView(patientDetailsVM)); }