public async Task <ActionResult> AppointmentMedicalRecord(int id, int?page) { var appointment = await _appointmentservices.GetAppointment(id); int pageIndex = page ?? 1; int dataCount = 3; ViewBag.patId = appointment.Pat_Id; ViewBag.phyId = appointment.Phys_id; ViewBag.appointNo = appointment.No; var patientRecordDetails = new PatientMedicalRecordDetailsViewModel { AppointmentId = appointment.No, PatientId = appointment.Pat_Id, PhyId = appointment.Phys_id, Phy_abr = _userphysicianservices.GetUserPhysician_By_Id(appointment.Phys_id).Abr, Patient = _patientservices.GetPatientById(appointment.Pat_Id) }; var medicalRecord = _patientrecordservices.GetAllRecords(appointment.Pat_Id, appointment.Phys_id); patientRecordDetails.MedicalRecordList = medicalRecord.OrderByDescending(t => t.RecordNo).ToList() .ToPagedList(pageIndex, dataCount); if (Request.IsAjaxRequest()) { return(PartialView("_RecordListPartialView", (PagedList <MedicalRecord>)patientRecordDetails.MedicalRecordList)); } return(View("MedicalHistory", patientRecordDetails)); }
public ActionResult RemovePatientProfile(string patientId) { var success = false; var patient = _patientServices.GetPatientById(patientId); if (patient != null) { _patientServices.RemovePatient(patient); _unitofwork.Commit(); success = true; } return(Json(new { success = success }, JsonRequestBehavior.AllowGet)); }
public bool SyncPatients(List <CernerPatientViewModel> patientList) { var newPatients = patientList.Where(x => x.PatientIdToBeMapped == null).ToList(); var patientsToBeMapped = patientList.Where(x => x.PatientIdToBeMapped != null).ToList(); using (var scope = new TransactionScope()) { foreach (var item in newPatients) { CreateCernerPatientToChargeCapture(item.CernerPatientId, item.CernerLocationId); } foreach (var item in patientsToBeMapped) { var patient = _patientServices.GetPatientById((long)item.PatientIdToBeMapped); patient.ExternalKey3 = item.CernerIntegrationId; if (item.IsReordToBeUpdated) { patient.FirstName = item.FirstName; patient.LastName = item.LastName; } _uow.GetRepository <Patient>().Update(patient); _uow.SaveChanges(); CreateCernerPatientToChargeCapture(item.CernerPatientId, item.CernerLocationId); } scope.Complete(); } return(true); }
public ActionResult MedicalHistory(string id, string phyid, int?page) { int pageIndex = page ?? 1; int dataCount = 3; ViewBag.patId = id; ViewBag.phyId = phyid; var patientRecordDetails = new PatientMedicalRecordDetailsViewModel { PatientId = id, PhyId = phyid, Patient = _patientservices.GetPatientById(id) }; var medicalRecord = _patientrecordservices.GetAllRecords(id, phyid); patientRecordDetails.MedicalRecordList = medicalRecord.OrderByDescending(t => t.RecordNo).ToList() .ToPagedList(pageIndex, dataCount); if (Request.IsAjaxRequest()) { return(PartialView("_RecordListPartialView", (PagedList <MedicalRecord>)patientRecordDetails.MedicalRecordList)); } return(View(patientRecordDetails)); }