Пример #1
0
        public async Task <PartialViewResult> _ApRespiratorio(int PacienteId)
        {
            var items = await _apRespService.ListApRespiratorioAsync(PacienteId);

            List <ApRespiratorioFormModel> model = new List <ApRespiratorioFormModel>();

            foreach (var item in items)
            {
                var new_item = new ApRespiratorioFormModel()
                {
                    Id = item.Id,
                    SoporteRespiratorio = item.SoporteRespiratorio,
                    Parametros          = item.Parametros,
                    ValorSoporteResp    = item.ValorSoporteResp,
                    Ventilacion         = item.Ventilacion,
                    Modalidad           = item.Modalidad,
                    Gasometria          = item.Gasometria,
                    Manejo   = item.Manejo,
                    Eventos  = item.Eventos,
                    Planes   = item.Planes,
                    UserName = item.UserAdd,
                    DateAdd  = item.DateAdd
                };

                var param_sop = await _apRespService.ListSoporteRespParametrosAsync(item.Id);

                new_item.SoporteRespiratorioParam = param_sop.Select(c => new ParametrosApRespModel()
                {
                    Id     = c.Id,
                    Nombre = c.Nombre,
                    Valor  = c.Valor
                });

                var param_gas = await _apRespService.ListGasometriaParametrosAsync(item.Id);

                new_item.GasometriaParam = param_gas.Select(c => new ParametrosApRespModel()
                {
                    Id     = c.Id,
                    Nombre = c.Nombre,
                    Valor  = c.Valor
                });

                model.Add(new_item);
            }

            ViewBag.ListSoporteRespiratorio = await SelectSoporteRespiratorioAsync();

            ViewBag.ListVentilacion = await SelectVentilacionAsync();

            ViewBag.ListModalidad = await SelectModalidadAsync();

            ViewBag.ListSopParametros = await SelectSoporteRespParametrosAsync();

            ViewBag.ListGasometria = await SelectGasometriaAsync();

            ViewBag.ListGasometriaParametros = await SelectGasometriaParametrosAsync();

            return(PartialView(model));
        }
Пример #2
0
        public async Task <JsonResult> AddApRespiratorio(ApRespiratorioFormModel model)
        {
            var item_dto = Mapper.Map <ApRespiratorioDTO>(model);

            item_dto.UserName = User.Identity.Name;

            await _apRespService.AddApRespiratorioAsync(item_dto);

            return(Json(new { Success = true }));
        }