public List <Categoria> GetAdditionalExams(BoardExamsCustom data) { var listAllServicecomponents = new ServiceDal().GetAllComponents(data.TipoBusqueda, data.Value); var ListaFinal = new List <Categoria>(); return(listAllServicecomponents); }
public IHttpActionResult GetAdditionalExams(MultiDataModel data) { BoardExamsCustom dataBoard = JsonConvert.DeserializeObject <BoardExamsCustom>(data.String1); var result = new ConsultorioBL().GetAdditionalExams(dataBoard); return(Ok(result)); }
public IHttpActionResult EliminarExamen(MultiDataModel data) { BoardExamsCustom dataBoard = JsonConvert.DeserializeObject <BoardExamsCustom>(data.String1); var result = new ConsultorioBL().EliminarExamen(dataBoard, data.Int1); return(Ok(result)); }
public IHttpActionResult GetExamenes(MultiDataModel data) { BoardExamsCustom dataBoard = JsonConvert.DeserializeObject <BoardExamsCustom>(data.String1); var result = new ComponentBl().GetExamsForConsult(dataBoard); return(Ok(result)); }
public BoardExamsCustom GetExamsForConsult(BoardExamsCustom data) { try { var query = (from A in ctx.ServiceComponent join B in ctx.SystemParameter on new { a = A.i_ServiceComponentStatusId.Value, b = 127 } equals new { a = B.i_ParameterId, b = B.i_GroupId } join C in ctx.Component on A.v_ComponentId equals C.v_ComponentId join D in ctx.SystemParameter on new { a = A.i_QueueStatusId.Value, b = 128 } equals new { a = D.i_ParameterId, b = D.i_GroupId } join E in ctx.Service on A.v_ServiceId equals E.v_ServiceId join F in ctx.SystemParameter on new { a = C.i_CategoryId, b = 116 } equals new { a = F.i_ParameterId, b = F.i_GroupId } into F_join from F in F_join.DefaultIfEmpty() where A.v_ServiceId == data.ServiceId && A.i_IsDeleted == (int)SiNo.No && A.i_IsRequiredId == (int)SiNo.Si select new ExamsCustom { v_ComponentId = A.v_ComponentId, v_PersonId = E.v_PersonId, v_ComponentName = C.v_Name, i_ServiceComponentStatusId = A.i_ServiceComponentStatusId.Value, v_ServiceComponentStatusName = B.v_Value1, d_StartDate = A.d_StartDate.Value, d_EndDate = A.d_EndDate.Value, i_QueueStatusId = A.i_QueueStatusId.Value, v_QueueStatusName = D.v_Value1, ServiceStatusId = E.i_ServiceStatusId.Value, v_Motive = E.v_Motive, i_CategoryId = C.i_CategoryId, v_CategoryName = C.i_CategoryId == -1 ? C.v_Name : F.v_Value1, v_ServiceId = E.v_ServiceId, v_ServiceComponentId = A.v_ServiceComponentId, }); var objData = query.AsEnumerable() .Where(s => s.i_CategoryId != -1) .GroupBy(x => x.i_CategoryId) .Select(group => group.First()); List <ExamsCustom> obj = objData.ToList(); obj.AddRange(query.Where(p => p.i_CategoryId == -1)); data.List = obj; return(data); } catch (Exception ex) { return(null); } }
public ActionResult GetExamenes(BoardExamsCustom data) { Api API = new Api(); Dictionary <string, string> arg = new Dictionary <string, string>() { { "String1", JsonConvert.SerializeObject(data) }, }; ViewBag.ExamsPacient = API.Post <BoardExamsCustom>("Consultorio/GetExamenes", arg); return(PartialView("_BoardExamenPartial")); }
public JsonResult CallingPacient(BoardExamsCustom data) { Api API = new Api(); Dictionary <string, string> arg = new Dictionary <string, string>() { { "String1", JsonConvert.SerializeObject(data) }, }; var result = API.Post <BoardExamsCustom>("Consultorio/CallingPacient", arg); return(new JsonResult { Data = result, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public JsonResult GetAdditionalExams(BoardExamsCustom data) { Api API = new Api(); Dictionary <string, string> arg = new Dictionary <string, string>() { { "String1", JsonConvert.SerializeObject(data) }, }; var result = API.Post <List <Categoria> >("Consultorio/GetAdditionalExams", arg); return(new JsonResult { Data = result, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public JsonResult EliminarExamen(BoardExamsCustom data) { Api API = new Api(); Dictionary <string, string> arg = new Dictionary <string, string>() { { "String1", JsonConvert.SerializeObject(data) }, { "Int1", ViewBag.USER.SystemUserId.ToString() }, }; var result = API.Post <MessageCustom>("Consultorio/EliminarExamen", arg); return(new JsonResult { Data = result, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public MessageCustom EliminarExamen(BoardExamsCustom data, int userId) { MessageCustom _Message = new MessageCustom(); var _auxiliaryExams = new List <ServiceComponentList>(); if (data.CategoryId == -1) { ServiceComponentList auxiliaryExam = new ServiceComponentList(); auxiliaryExam.v_ServiceComponentId = data.ServicecomponentId; _auxiliaryExams.Add(auxiliaryExam); } else { var oServiceComponentList = new ServiceBl().GetServiceComponentByCategoryId(data.CategoryId, data.ServiceId); if (oServiceComponentList == null) { _Message.Error = true; _Message.Status = (int)StatusHttp.BadRequest; _Message.Message = "Sucedió un error al consultar los componentes del servicio."; return(_Message); } foreach (var scid in oServiceComponentList) { ServiceComponentList auxiliaryExam = new ServiceComponentList(); auxiliaryExam.v_ServiceComponentId = scid.v_ServiceComponentId; _auxiliaryExams.Add(auxiliaryExam); } } bool result = new ServiceBl().UpdateAdditionalExam(_auxiliaryExams, data.ServiceId, (int)SiNo.No, userId); if (!result) { _Message.Error = true; _Message.Status = (int)StatusHttp.BadRequest; _Message.Message = "Sucedió un error al actualizar los examenes, no se guardó ningun cambio."; return(_Message); } _Message.Error = false; _Message.Status = (int)StatusHttp.Ok; _Message.Message = "Los cambios se guardaron correctamente."; return(_Message); }
public BoardExamsCustom CallingPacient(BoardExamsCustom data) { MessageCustom _Message = new MessageCustom(); List <Dropdownlist> ListaCetegorias = new SystemParameterBL().GetParametroByGrupoId(116); var ListaExamenesPrevios = new SystemParameterBL().GetParametroByGrupoId(306).Find(p => p.Value2 == data.CategoryId); if (ListaExamenesPrevios != null) { var consultorioPrevio = int.Parse(ListaExamenesPrevios.Field); if (consultorioPrevio == -1) { var examenesNoCulminados = new ServiceBl().GetServiceComponentsCulminados(data.ServiceId); if (examenesNoCulminados == null) { _Message.Error = true; _Message.Status = 400; _Message.Message = "Sucedio un error generando las consultas, por favor refresque y vuelva a intentar."; data.Message = _Message; return(data); } var exam = examenesNoCulminados.FindAll(p => p.i_CategoryId != data.CategoryId); if (exam.Count != 0) { _Message.Error = true; _Message.Status = 200; _Message.Message = "Este paciente debe primero CULIMINAR TODOS los examenes anteriores."; data.Message = _Message; return(data); } } var listaExamenesProtocolo = new ServiceBl().GetServiceComponents(data.ServiceId).Find(p => p.i_CategoryId == consultorioPrevio); if (listaExamenesProtocolo == null) { _Message.Error = true; _Message.Status = 400; _Message.Message = "Sucedio un error generando las consultas, por favor refresque y vuelva a intentar."; data.Message = _Message; return(data); } if (listaExamenesProtocolo != null) { var examenesNoCulminados = new ServiceBl().GetServiceComponentsCulminados(data.ServiceId); if (examenesNoCulminados == null) { _Message.Error = true; _Message.Status = 400; _Message.Message = "Sucedio un error generando las consultas, por favor refresque y vuelva a intentar."; data.Message = _Message; return(data); } var result = examenesNoCulminados.Find(p => p.i_CategoryId == consultorioPrevio); if (result != null) { _Message.Error = true; _Message.Status = 200; int field = int.Parse(ListaExamenesPrevios.Field); _Message.Message = "Este paciente debe primero CULIMINAR el examen " + ListaCetegorias.Find(p => p.Id == field).Value; data.Message = _Message; return(data); } } } if (data.Piso != -1) { var ResultPiso = new ServiceBl().PermitirLlamar(data.ServiceId, data.Piso); if (!ResultPiso) { _Message.Error = true; _Message.Status = 200; _Message.Message = "El Paciente tiene consultorios por culminar, antes de ser llamado por este. Verifíquelo en unos minutos"; data.Message = _Message; return(data); } } if (data.ServiceStatusId == (int)ServiceStatus.EsperandoAptitud) { _Message.Error = true; _Message.Status = 200; _Message.Message = "Este paciente ya tiene el servicio en espera de Aptitud, no puede ser llamado."; data.Message = _Message; return(data); } var oServiceComponentList = new ServiceBl().GetServiceComponentByCategoryId(data.CategoryId, data.ServiceId); List <string> _ServiceComponentId = new List <string>(); foreach (var item in oServiceComponentList) { _ServiceComponentId.Add(item.v_ServiceComponentId); } bool resultOff = new ServiceDal().UpdateServiceComponentOfficeLlamando(_ServiceComponentId, data.Oficina); if (!resultOff) { _Message.Error = true; _Message.Status = 500; _Message.Message = "Sucedio un error actualizando la llamada, vuelva a intentar por favor."; data.Message = _Message; return(data); } _Message.Error = false; _Message.Status = 200; data.Message = _Message; return(data); }
public BoardExamsCustom GetExamsForConsult(BoardExamsCustom data) { return(new ComponentDal().GetExamsForConsult(data)); }