示例#1
0
        private void tbInserir_Click(object sender, System.EventArgs e)
        {
            try
            {
                var paciente = new Paciente();
                validationInsertUpdate(paciente);

                if (PacienteDao.Select(new List <Tuple <string, object, string> >()
                {
                    new Tuple <string, object, string>("CPF", paciente.CPF, "=")
                }).Count > 0)
                {
                    throw new Exception("Já existe paciente com o CPF informado");
                }

                PacienteDao.Insert(paciente);
                dgResultado.DataSource = null;
                Util.lstPacientes      = PacienteDao.Select(null);

                MessageBox.Show(this, "Paciente alterado com sucesso", "Paciente");

                dgResultado.DataSource = Util.lstPacientes;
                formOnEndTask();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public ActionResult Index()
        {
            MedicoDao           me             = new MedicoDao();
            AgendamentoDao      ag             = new AgendamentoDao();
            IList <Agendamento> lista          = ag.Select();
            PacienteDao         dao            = new PacienteDao();
            IList <Paciente>    listaPacientes = new List <Paciente>();
            IList <Paciente>    pacientes      = dao.Select();


            foreach (var agenda in lista)
            {
                int      id       = agenda.PacienteId;
                Paciente paciente = dao.BuscaPorId(id);
                listaPacientes.Add(paciente);
            }

            listaPacientes.Count();
            ViewBag.Paciente    = listaPacientes;
            ViewBag.Pacientes   = pacientes;
            ViewBag.Agendamento = lista;
            ViewBag.Medicos     = me.Select();

            return(View());
        }
        public ActionResult Cadastrar(String nomePaciente, String nomeMedico, DateTime Data, String Hora, String Observacao, String Plano)
        {
            AgendamentoDao ag  = new AgendamentoDao();
            PacienteDao    dao = new PacienteDao();
            MedicoDao      me  = new MedicoDao();


            Agendamento agendamento = new Agendamento();

            agendamento.hora       = Hora;
            agendamento.data       = Data;
            agendamento.observacao = Observacao;
            agendamento.Plano      = Plano;
            foreach (var item in dao.Select())
            {
                if (item.Nome == nomePaciente)
                {
                    agendamento.PacienteId = item.ID;
                }
            }

            foreach (var item in me.Select())
            {
                if (item.nome == nomeMedico)
                {
                    agendamento.MedicoId = item.ID;
                }
            }

            string validacao = (ag.Cadastrar(agendamento) ? "Sim" : "Não");

            return(Json(validacao));
        }
        public ActionResult Form()
        {
            PacienteDao      pa            = new PacienteDao();
            IList <Paciente> listaPaciente = pa.Select();

            ConsumindoApiDao con    = new ConsumindoApiDao();
            IList <string>   compo  = new List <string>();
            bool             valida = true;

            foreach (var item in con.Consumir())
            {
                foreach (var item2 in compo)
                {
                    if (item.PrincipioAtivo == item2)
                    {
                        valida = false;
                    }
                }
                if (valida)
                {
                    compo.Add(item.PrincipioAtivo);
                }
                valida = true;
            }


            ViewBag.Pacientes   = listaPaciente;
            ViewBag.Componentes = compo;
            return(View());
        }
示例#5
0
        public ActionResult Index()
        {
            PacienteDao      dao   = new PacienteDao();
            IList <Paciente> lista = dao.Select();

            ViewBag.Paciente = lista;
            return(View());
        }
        public ActionResult GerarRelatorio()
        {
            AtendimentosDao      at           = new AtendimentosDao();
            IList <Atendimentos> atendimentos = at.Select();

            PacienteDao    dao       = new PacienteDao();
            IList <string> pacientes = new List <string>();

            MedicoDao      me      = new MedicoDao();
            IList <string> medicos = new List <string>();

            foreach (var item in at.Select())
            {
                foreach (var medico in me.Select())
                {
                    if (item.MedicoId == medico.ID)
                    {
                        medicos.Add(medico.nome);
                    }
                }
            }

            foreach (var item in at.Select())
            {
                foreach (var paciente in dao.Select())
                {
                    if (item.PacienteId == paciente.ID)
                    {
                        pacientes.Add(paciente.Nome);
                    }
                }
            }

            ViewBag.Quantidade  = atendimentos.Count;
            ViewBag.Atendiemtos = atendimentos;
            ViewBag.Pacientes   = pacientes;
            ViewBag.Medico      = medicos;

            int paginaNumero = 1;

            var pdf = new ViewAsPdf
            {
                ViewName    = "Relatorio",
                PageSize    = Size.A4,
                IsGrayScale = true,
                Model       = atendimentos.ToPagedList(paginaNumero, atendimentos.Count)
            };

            return(pdf);
        }
        public ActionResult Atualizar(Agendamento agendamento, String nomePaciente)
        {
            AgendamentoDao dao  = new AgendamentoDao();
            PacienteDao    paci = new PacienteDao();

            foreach (var item in paci.Select())
            {
                if (item.Nome == nomePaciente)
                {
                    agendamento.PacienteId = item.ID;
                }
            }
            dao.Alterar(agendamento);
            return(RedirectToAction("Index"));
        }
        public ActionResult Cadastrar(String nomePaciente, String Hpp, String Hf,
                                      String Historia, String Obs, IList <String> lista)
        {
            Componente_PacienteDao         com = new Componente_PacienteDao();
            ProntuarioDao                  pro = new ProntuarioDao();
            PacienteDao                    dao = new PacienteDao();
            ComponenteDao                  co  = new ComponenteDao();
            HistoriaPatologicaPregressaDao his = new HistoriaPatologicaPregressaDao();
            HistoriaPatologicaPregressa    h   = new HistoriaPatologicaPregressa();

            h.HF             = Hf;
            h.HistoriaSocial = Historia;
            h.HPP            = Hpp;

            Prontuario prontuario = new Prontuario();

            prontuario.Observacoes = Obs;

            ConsumindoApiDao con = new ConsumindoApiDao();

            foreach (var item in dao.Select())
            {
                if (item.Nome == nomePaciente)
                {
                    prontuario.PacienteId = item.ID;
                }
            }

            if (lista != null)
            {
                foreach (var item in lista)
                {
                    Componente_Paciente intermedio = new Componente_Paciente();
                    intermedio.PacienteId = prontuario.PacienteId;
                    intermedio.Componente = item;
                    com.Cadastrar(intermedio);
                }
            }

            his.Cadastrar(h);
            prontuario.HistoriaPatologicaPregressaId = h.ID;
            string valida = pro.Cadastrar(prontuario) ? "Sim" : "Não";

            return(Json(valida));
        }
        public ActionResult Update(int idProntuario, String nomePaciente, String nomeComponente, String HPP,
                                   String HF, String HistoriaSocial, String observacao)
        {
            Componente_PacienteDao         com = new Componente_PacienteDao();
            ProntuarioDao                  pro = new ProntuarioDao();
            PacienteDao                    dao = new PacienteDao();
            ComponenteDao                  co  = new ComponenteDao();
            HistoriaPatologicaPregressaDao his = new HistoriaPatologicaPregressaDao();

            Prontuario prontuario = pro.BuscaPorId(idProntuario);

            prontuario.Observacoes = observacao;

            HistoriaPatologicaPregressa historia = his.BuscaPorId(prontuario.HistoriaPatologicaPregressaId);

            historia.HPP            = HPP;
            historia.HF             = HF;
            historia.HistoriaSocial = HistoriaSocial;

            if (nomeComponente != null)
            {
                Componente_Paciente intermedio = new Componente_Paciente();
                intermedio.PacienteId = prontuario.PacienteId;
                intermedio.Componente = nomeComponente;
            }


            foreach (var item in dao.Select())
            {
                if (item.Nome == nomePaciente)
                {
                    prontuario.PacienteId = item.ID;
                }
            }


            his.Alterar(historia);
            pro.Alterar(prontuario);
            string validacao = (pro.Alterar(prontuario) ? "Sim" : "Não");

            return(Json(validacao));
        }
        public ActionResult Index()
        {
            ProntuarioDao      ag             = new ProntuarioDao();
            IList <Prontuario> lista          = ag.Select();
            PacienteDao        dao            = new PacienteDao();
            IList <Paciente>   listaPacientes = new List <Paciente>();
            IList <Paciente>   pacientes      = dao.Select();


            foreach (var agenda in lista)
            {
                int?     id       = agenda.PacienteId;
                Paciente paciente = dao.BuscaPorId(id);
                listaPacientes.Add(paciente);
            }

            listaPacientes.Count();
            ViewBag.Paciente   = listaPacientes;
            ViewBag.Pacientes  = pacientes;
            ViewBag.Prontuario = lista;
            return(View());
        }
示例#11
0
        public ActionResult Index()
        {
            AtendimentosDao      at           = new AtendimentosDao();
            IList <Atendimentos> atendimentos = at.Select();

            PacienteDao    dao       = new PacienteDao();
            IList <string> pacientes = new List <string>();

            MedicoDao      me      = new MedicoDao();
            IList <string> medicos = new List <string>();

            foreach (var item in at.Select())
            {
                foreach (var medico in me.Select())
                {
                    if (item.MedicoId == medico.ID)
                    {
                        medicos.Add(medico.nome);
                    }
                }
            }

            foreach (var item in at.Select())
            {
                foreach (var paciente in dao.Select())
                {
                    if (item.PacienteId == paciente.ID)
                    {
                        pacientes.Add(paciente.Nome);
                    }
                }
            }

            ViewBag.Quantidade  = atendimentos.Count;
            ViewBag.Atendiemtos = atendimentos;
            ViewBag.Pacientes   = pacientes;
            ViewBag.Medico      = medicos;
            return(View());
        }
示例#12
0
      public ActionResult Dashbord()
      {
          AgendamentoDao      dao            = new AgendamentoDao();
          IList <Agendamento> lista          = dao.BuscarAgendamentosPorData(DateTime.Now.Date);
          PacienteDao         paDao          = new PacienteDao();
          IList <Paciente>    listaPacientes = new List <Paciente>();
          IList <Paciente>    pacientes      = paDao.Select();


          foreach (var agenda in lista)
          {
              int      id       = agenda.PacienteId;
              Paciente paciente = paDao.BuscaPorId(id);
              listaPacientes.Add(paciente);
          }

          listaPacientes.Count();
          ViewBag.Paciente    = listaPacientes;
          ViewBag.Pacientes   = pacientes;
          ViewBag.Agendamento = lista;


          return(View());
      }
      public ActionResult Index()
      {
          Medico              medico = (Medico)Session["Medico"];
          AgendamentoDao      ag     = new AgendamentoDao();
          IList <Agendamento> lista  = ag.BuscarAgendamentos(DateTime.Now.Date, medico);

          PacienteDao      dao            = new PacienteDao();
          IList <Paciente> listaPacientes = new List <Paciente>();
          IList <Paciente> pacientes      = dao.Select();


          foreach (var agenda in lista)
          {
              int      id       = agenda.PacienteId;
              Paciente paciente = dao.BuscaPorId(id);
              listaPacientes.Add(paciente);
          }

          listaPacientes.Count();
          ViewBag.Paciente    = listaPacientes;
          ViewBag.Pacientes   = pacientes;
          ViewBag.Agendamento = lista;
          return(View());
      }