// GET: Treatment public ActionResult AutoTextIndex() {//10/10/2019 aakansha ViewBag.FormName = "AutoText"; var data = _treatmentServices.GetAllAutoText(); var autoTextData = data.Select(a => new AutoTextModel { IsActive = a.IsActive, CreatedOn = a.CreatedOn, Deleted = a.Deleted, AutoTextName = a.AutoTextName, Comment = a.Comment, CommentTypeId = a.CommentTypeId, CommentTypeName = (a.CommentTypeId != 0)?_treatmentServices.GetCommentTypeById(a.CommentTypeId).CommentTypeName:"", Id = a.Id, LastUpdated = a.LastUpdated }); var AutoTextList = new AutoTextListModel(); AutoTextList.autoTextList = autoTextData.ToList(); return(View(AutoTextList)); }
public IActionResult GetAllAutoText() { ResultModel resultModel = new ResultModel(); var model = new PreTreatmentAssessmentMasterModel(); var WeaknessAutoTextData = _treatmentServices.GetAllAutoText().Where(a => a.CommentType.CommentTypeName == "Weakness" && a.IsActive == true && a.Deleted == false); var NumbnessAutoTextData = _treatmentServices.GetAllAutoText().Where(a => a.CommentType.CommentTypeName == "Numbness/Tingling" && a.IsActive == true && a.Deleted == false); var PainAutoTextData = _treatmentServices.GetAllAutoText().Where(a => a.CommentType.CommentTypeName == "pain Level" && a.IsActive == true && a.Deleted == false); var LocationAutoTextData = _treatmentServices.GetAllAutoText().Where(a => a.CommentType.CommentTypeName == "Location on Body" && a.IsActive == true && a.Deleted == false); var LungSoundsAutoTextData = _treatmentServices.GetAllAutoText().Where(a => a.CommentType.CommentTypeName == "Lung Sounds" && a.IsActive == true && a.Deleted == false); var RhythmAutoTextData = _treatmentServices.GetAllAutoText().Where(a => a.CommentType.CommentTypeName == "Cardiac Rhythm" && a.IsActive == true && a.Deleted == false); var EdemaAutoTextData = _treatmentServices.GetAllAutoText().Where(a => a.CommentType.CommentTypeName == "Edema" && a.IsActive == true && a.Deleted == false); var BleedingAutoTextData = _treatmentServices.GetAllAutoText().Where(a => a.CommentType.CommentTypeName == "Bleeding" && a.IsActive == true && a.Deleted == false); var SkinAutoTextData = _treatmentServices.GetAllAutoText().Where(a => a.CommentType.CommentTypeName == "Skin" && a.IsActive == true && a.Deleted == false); var weaknesstextData = WeaknessAutoTextData.Select(a => new AutoTextModel { Id = a.Id, AutoTextName = a.AutoTextName, Comment = a.Comment, CommentTypeId = a.CommentTypeId, CommentTypeName = a.CommentType.CommentTypeName, CreatedOn = a.CreatedOn, Deleted = a.Deleted, IsActive = a.IsActive, LastUpdated = a.LastUpdated }); var numbnessAutoTextData = NumbnessAutoTextData.Select(a => new AutoTextModel { Id = a.Id, AutoTextName = a.AutoTextName, Comment = a.Comment, CommentTypeId = a.CommentTypeId, CommentTypeName = a.CommentType.CommentTypeName, CreatedOn = a.CreatedOn, Deleted = a.Deleted, IsActive = a.IsActive, LastUpdated = a.LastUpdated }); var painAutoTextData = PainAutoTextData.Select(a => new AutoTextModel { Id = a.Id, AutoTextName = a.AutoTextName, Comment = a.Comment, CommentTypeId = a.CommentTypeId, CommentTypeName = a.CommentType.CommentTypeName, CreatedOn = a.CreatedOn, Deleted = a.Deleted, IsActive = a.IsActive, LastUpdated = a.LastUpdated }); var locationAutoTextData = LocationAutoTextData.Select(a => new AutoTextModel { Id = a.Id, AutoTextName = a.AutoTextName, Comment = a.Comment, CommentTypeId = a.CommentTypeId, CommentTypeName = a.CommentType.CommentTypeName, CreatedOn = a.CreatedOn, Deleted = a.Deleted, IsActive = a.IsActive, LastUpdated = a.LastUpdated }); var lungSoundsAutoTextData = LungSoundsAutoTextData.Select(a => new AutoTextModel { Id = a.Id, AutoTextName = a.AutoTextName, Comment = a.Comment, CommentTypeId = a.CommentTypeId, CommentTypeName = a.CommentType.CommentTypeName, CreatedOn = a.CreatedOn, Deleted = a.Deleted, IsActive = a.IsActive, LastUpdated = a.LastUpdated }); var rhythmAutoTextData = RhythmAutoTextData.Select(a => new AutoTextModel { Id = a.Id, AutoTextName = a.AutoTextName, Comment = a.Comment, CommentTypeId = a.CommentTypeId, CommentTypeName = a.CommentType.CommentTypeName, CreatedOn = a.CreatedOn, Deleted = a.Deleted, IsActive = a.IsActive, LastUpdated = a.LastUpdated }); var edemaAutoTextData = EdemaAutoTextData.Select(a => new AutoTextModel { Id = a.Id, AutoTextName = a.AutoTextName, Comment = a.Comment, CommentTypeId = a.CommentTypeId, CommentTypeName = a.CommentType.CommentTypeName, CreatedOn = a.CreatedOn, Deleted = a.Deleted, IsActive = a.IsActive, LastUpdated = a.LastUpdated }); var bleedingAutoTextData = BleedingAutoTextData.Select(a => new AutoTextModel { Id = a.Id, AutoTextName = a.AutoTextName, Comment = a.Comment, CommentTypeId = a.CommentTypeId, CommentTypeName = a.CommentType.CommentTypeName, CreatedOn = a.CreatedOn, Deleted = a.Deleted, IsActive = a.IsActive, LastUpdated = a.LastUpdated }); var skinAutoTextData = SkinAutoTextData.Select(a => new AutoTextModel { Id = a.Id, AutoTextName = a.AutoTextName, Comment = a.Comment, CommentTypeId = a.CommentTypeId, CommentTypeName = a.CommentType.CommentTypeName, CreatedOn = a.CreatedOn, Deleted = a.Deleted, IsActive = a.IsActive, LastUpdated = a.LastUpdated }); model.WeaknessAutoTexts = weaknesstextData.ToList(); model.NumbnessAutoTexts = numbnessAutoTextData.ToList(); model.PainAutoTexts = painAutoTextData.ToList(); model.LocationAutoTexts = locationAutoTextData.ToList(); model.LungSoundsAutoTexts = lungSoundsAutoTextData.ToList(); model.RhythmAutoTexts = rhythmAutoTextData.ToList(); model.EdemaAutoTexts = edemaAutoTextData.ToList(); model.BleedingAutoTexts = bleedingAutoTextData.ToList(); model.SkinAutoTexts = skinAutoTextData.ToList(); if (model != null) { resultModel.Message = ValidationMessages.Success; resultModel.Status = 1; resultModel.Response = model; return(Ok(resultModel)); } else { resultModel.Message = ValidationMessages.Success; resultModel.Status = 1; resultModel.Response = model; return(Ok(resultModel)); } }