protected virtual void PrepareTreatmentRecordModel(TreatmentRecordListModel model) { //Daignosis Dropdown model.AvailableDaignosis.Add(new SelectListItem { Text = "Select Daignosis", Value = "0" }); foreach (var c in _treatmentServices.GetAllDiagnosis().Where(a => a.Deleted != true)) { model.AvailableDaignosis.Add(new SelectListItem { Text = c.DiagnosisName, Value = c.Id.ToString() }); } //Patient Dropdown model.AvailablePatient.Add(new SelectListItem { Text = "Select Patient", Value = "0" }); foreach (var c in _treatmentRecordServices.GetAllPatientMaster().Where(a => a.Deleted != true)) { model.AvailablePatient.Add(new SelectListItem { Text = _encryptionService.DecryptText(c.PatientName), Value = c.Id.ToString() }); } //Hospital Dropdown model.AvailableHospital.Add(new SelectListItem { Text = "Select Hospital", Value = "0" }); foreach (var c in _hospitalServices.GetAllHospital().Where(a => a.Deleted != true)) { model.AvailableHospital.Add(new SelectListItem { Text = _encryptionService.DecryptText(c.HospitalName), Value = c.Id.ToString() }); } //Nurse Dropdown model.AvailableNurse.Add(new SelectListItem { Text = "Select Nurse", Value = "0" }); foreach (var c in _nurseServices.GetAllNurse().Where(a => a.Deleted != true)) { model.AvailableNurse.Add(new SelectListItem { Text = _encryptionService.DecryptText(c.FirstName) + " " + _encryptionService.DecryptText(c.LastName), Value = c.Id.ToString() }); } }
// GET: Treatment public IActionResult DaignosisIndex() { if (!(bool)SharedData.isDiagnosisMenuAccessible) { return(AccessDeniedView()); } //10/10/2019 aakansha ViewBag.FormName = "Diagnosis"; var data = _treatmentServices.GetAllDiagnosis(); var daignosisData = data.Select(a => new DiagnosisModel { IsActive = a.IsActive, CreatedOn = a.CreatedOn, Deleted = a.Deleted, Description = a.Description, DiagnosisName = a.DiagnosisName, Id = a.Id, LastUpdated = a.LastUpdated }); var DiagnosisList = new DiagnosisListModel(); DiagnosisList.diagnosisList = daignosisData.ToList(); return(View(DiagnosisList)); }
private IList <SelectListItem> PrepareDiagnosisDropdown(string SelectedText = "Select Diagnosis", int Id = 0) { var PatientList = _treatmentServices.GetAllDiagnosis().Where(a => a.Deleted != true); List <SelectListItem> items = new List <SelectListItem>(); foreach (var Diagnosisdata in PatientList) { items.Add(new SelectListItem { Text = Diagnosisdata.DiagnosisName, Value = Diagnosisdata.Id.ToString() }); } return(items); }
//[Route("GetMaster")] public ActionResult GetMaster() { ResultModel resultModel = new ResultModel(); try { var model = new PatientInfoDropDownMasterModel(); var NurseData = _nurseServices.GetAllNurse(); var HospitalData = _hospitalServices.GetAllHospital(); var ProcedureData = _companyProfileService.GetAllPolicyAndProcedure().Where(a => a.IsPolicy == false); var DiagnosisData = _treatmentServices.GetAllDiagnosis(); var PateintData = _treatmentRecordsServices.GetAllPatientMaster(); var patientList = PateintData.Select(a => new PatientModel { PatientMasterId = a.Id, CreatedOn = a.CreatedOn, Deleted = a.Deleted, LastUpdated = a.LastUpdated, PatientName = _encryptionService.DecryptText(a.PatientName), //MR = a.MR, PatientInfoList = PateintInfoData(a.Id) }); var nurseData = NurseData.Select(a => new NurseModel { CreatedOn = a.CreatedOn, Deleted = a.Deleted, Email = _encryptionService.DecryptText(a.Email), FullName = _encryptionService.DecryptText(a.FirstName) + "" + _encryptionService.DecryptText(a.LastName), Id = a.Id, LastUpdated = a.LastUpdated }); var hospitalData = HospitalData.Select(a => new HospitalModel { CreatedOn = a.CreatedOn, Deleted = a.Deleted, ContactPerson = a.ContactPerson, HospitalName = _encryptionService.DecryptText(a.HospitalName), Id = a.Id, LastUpdated = a.LastUpdated }); var procedureData = ProcedureData.Select(a => new PoliciesAndProceduresModel { CompanyProfileId = a.CompanyProfileId, IsPolicy = a.IsPolicy, Text = a.Text, Id = a.Id }); var diagnosisData = DiagnosisData.Select(a => new DiagnosisModel { CreatedOn = a.CreatedOn, Deleted = a.Deleted, Description = a.Description, DiagnosisName = a.DiagnosisName, IsActive = a.IsActive, Id = a.Id, LastUpdated = a.LastUpdated }); model.NurseList = nurseData.ToList(); model.hospitalList = hospitalData.ToList(); model.ProceduresList = procedureData.ToList(); model.DiagnosisList = diagnosisData.ToList(); model.PatientList = patientList.ToList(); if (model != null) { resultModel.Message = ValidationMessages.Success; resultModel.Status = 1; resultModel.Response = model; return(Ok(resultModel)); } else { resultModel.Message = ValidationMessages.Failure; resultModel.Status = 0; resultModel.Response = null; return(Ok(resultModel)); } } catch (Exception e) { resultModel.Message = ValidationMessages.Failure; resultModel.Status = 0; resultModel.Response = null; return(Ok(e)); } }