示例#1
0
        protected async override void OnStart()
        {
            try
            {
                await AsyncHelper.Wait();

                PacienteController pacienteController = new PacienteController();

                Usuario usuario = await pacienteController.GetSession();

                if (usuario?.validadeToken > DateTime.MinValue && usuario?.validadeToken > DateTime.UtcNow)
                {
                    MainPage = new NavigationPage(new Views.Home.IndexPage());
                }
                else
                {
                    MainPage = new NavigationPage(new LoginPage());
                }
            }
            catch (Exception ex)
            {
                MainPage = new NavigationPage(new LoginPage());
                Log.Error(ex);
            }
        }
 public FRM_AgregarPaciente()
 {
     InitializeComponent();
     pacienteController = new PacienteController(this);
     cbSexo.Text        = "Seleccionar";
     alerta.CambiarImagenWarning();
 }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button button = ((Button)sender);

            if (button.Content.Equals("SALVAR"))
            {
                Paciente paciente = new Paciente()
                {
                    ID             = (Atual != null) ? Atual.ID : 0,
                    Nome           = txb_nome_paciente.Text,
                    DataNascimento = Convert.ToDateTime(dpk_data_nascimento.Text),
                    CartaoSus      = PacienteController.Formatar(txb_cartao_sus.Text),
                    Sexo           = (cbx_sexo.SelectedIndex - 1),
                    Responsavel    = txb_nome_responsavel.Text,
                    Telefone       = PacienteController.Formatar(txb_telefone_responsavel.Text),
                    Endereco       = new string[] { txb_bairro_distrito.Text, txb_rua.Text, txb_numero_casa.Text }
                };

                Hide();

                MessageBox.Show(
                    new PacienteController().Inserir(paciente), "Salvando paciente...", MessageBoxButton.OK, MessageBoxImage.Information
                    );

                Owner.Refresh(string.Empty);
            }
            else if (button.Content.Equals("CANCELAR"))
            {
                Hide();
            }
        }
示例#4
0
        private void Load_Consulta(int consultaId)
        {
            // preencher dropdown medico
            MedicoController medicoController = new MedicoController();

            cbMedico.ItemsSource = medicoController.readMedicos();

            // preencher dropdown paciente
            PacienteController pacienteController = new PacienteController();

            cbPaciente.ItemsSource = pacienteController.readPacientes();

            // preencher dropdown secretaria
            SecretariaController secretariaController = new SecretariaController();

            cbSecretaria.ItemsSource = secretariaController.readSecretaria();

            ConsultaController consultaController = new ConsultaController();
            Consulta           consulta           = consultaController.readConsulta(consultaId);

            txtId.Text = consulta.Id.ToString();

            cbMedico.SelectedValue     = consulta.Medico.MedicoId;
            cbPaciente.SelectedValue   = consulta.Paciente.PacienteId;
            cbSecretaria.SelectedValue = consulta.Secretaria.SecretariaId;

            dpConsulta.SelectedDate = consulta.Hora;
        }
        public void TestGetAll()
        {
            //Arrange

            ICollection <Paciente> listaMock = new List <Paciente>();

            listaMock.Add(new Paciente()
            {
                Id = 0, Nombre = "Prueba"
            });
            mockRepositorioPaciente.Setup(r => r.GetAll()).Returns(listaMock);
            PacienteController controller = new PacienteController(mockRepositorioPaciente.Object, mockRepositorioTratamiento.Object);

            controller.Request       = new HttpRequestMessage();
            controller.Configuration = new HttpConfiguration();

            //Act
            var response = controller.GetAll();

            //Assert
            IEnumerable <Paciente> pacientes;

            response.TryGetContentValue <IEnumerable <Paciente> >(out pacientes);
            Assert.AreEqual(1, pacientes.Count());
        }
示例#6
0
        public int PutPersona([FromBody] PacienteModel paciente)
        {
            PacienteController obj = new PacienteController();

            int res = obj.insertarPaciente(paciente);

            return(res);
        }
示例#7
0
        public PacienteModel[] GetPersona(string cadena)
        {
            PacienteModel[]    res = null;
            PacienteController obj = new PacienteController();

            res = obj.BuscarPacienteDatos(cadena);

            return(res);
        }
        private void btnCadastrar_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "" && textBox2.Text != "  /  /" && textBox3.Text != "  /  /" && comboBox1.Text != "")
            {
                try
                {
                    string             id   = dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells[0].Value.ToString();
                    string             sexo = comboBox1.Text[0].ToString();
                    PacienteController pc   = new PacienteController();
                    Model.Paciente     p    = pc.search("id", id)[0];
                    p.nome = textBox1.Text;
                    p.sexo = sexo;

                    try
                    {
                        string[] nasc           = textBox2.Text.Split('/');
                        DateTime dataNascimento = new DateTime(Convert.ToInt32(nasc[2]), Convert.ToInt32(nasc[1]), Convert.ToInt32(nasc[0]));
                        string[] entr           = textBox3.Text.Split('/');
                        DateTime dataEntrada    = new DateTime(Convert.ToInt32(entr[2]), Convert.ToInt32(entr[1]), Convert.ToInt32(entr[0]));
                        p.nascimento  = dataNascimento;
                        p.dataEntrada = dataEntrada;

                        if (Data.nascimento(dataNascimento) && pc.update(p))
                        {
                            MessageBox.Show("Paciente atualizado com sucesso!");
                            Limpar.limpar(this);
                            MySqlCommand sql = new MySqlCommand();
                            sql.CommandText = "select id as 'Id', nome as 'Nome', date_format(nascimento,'%d/%m/%Y') as 'Nascimento', sexo as 'Sexo', date_format(dataEntrada,'%d/%m/%Y') as 'Entrada' from paciente where (dataSaida is null or dataSaida = @saida) and id = @id";
                            sql.Parameters.AddWithValue("@id", p.id);
                            sql.Parameters.AddWithValue("@saida", Convert.ToDateTime(null));
                            Grid.grid(dataGridView1, sql);
                        }
                        else
                        {
                            MessageBox.Show("Paciente não pôde ser atualizado!");
                        }
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("Preencha tudo corretamente!");
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Selecione um paciente para ser atualizado!");
                }
            }
            else
            {
                MessageBox.Show("Preencha todos os campos!");
            }
        }
        public void TestGetbyIdException()
        {
            //Arrange
            mockRepositorioPaciente.Setup(r => r.GetById(It.IsAny <int>())).Throws(new System.Exception());
            PacienteController controller = new PacienteController(mockRepositorioPaciente.Object, mockRepositorioTratamiento.Object);

            controller.Request       = new HttpRequestMessage();
            controller.Configuration = new HttpConfiguration();

            //Act
            var response = controller.GetbyId(10);

            //Assert
            Assert.IsTrue(response.StatusCode == System.Net.HttpStatusCode.InternalServerError);
        }
示例#10
0
        public void CarregarPaciente(int id)
        {
            Atual = new PacienteController().Buscar(new string[] { "id" }, new string[] { id.ToString() });

            if (new InternacaoController().PacienteInternado(Atual.ID))
            {
                ctrl_ex.Visibility = Visibility.Hidden;
                ctrl_in.Visibility = Visibility.Visible;
            }
            else
            {
                ctrl_in.Visibility = Visibility.Hidden;
                ctrl_ex.Visibility = Visibility.Visible;
            }
        }
示例#11
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // preencher dropdown medico
            MedicoController medicoController = new MedicoController();

            cbMedico.ItemsSource = medicoController.readMedicos();

            // preencher dropdown paciente
            PacienteController pacienteController = new PacienteController();

            cbPaciente.ItemsSource = pacienteController.readPacientes();

            // preencher dropdown secretaria
            SecretariaController secretariaController = new SecretariaController();

            cbSecretaria.ItemsSource = secretariaController.readSecretaria();
        }
        private void btnExcluir_Click(object sender, EventArgs e)
        {
            desabilita();
            if (textBox1.Text != "" && textBox2.Text != "  /  /" && textBox3.Text != "  /  /" && comboBox1.Text != "" && textBox4.Text != "  /  /")
            {
                try
                {
                    string id = dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells[0].Value.ToString();

                    try
                    {
                        string[]           sd      = textBox4.Text.Split('/');
                        DateTime           saida   = new DateTime(Convert.ToInt32(sd[2]), Convert.ToInt32(sd[1]), Convert.ToInt32(sd[0]));
                        string[]           entr    = dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells[4].Value.ToString().Split('/');
                        DateTime           entrada = new DateTime(Convert.ToInt32(entr[2]), Convert.ToInt32(entr[1]), Convert.ToInt32(entr[0]));
                        PacienteController ec      = new PacienteController();

                        if (Data.saida(entrada, saida) && ec.delete(id, saida))
                        {
                            MessageBox.Show("Paciente excluído com sucesso!");
                            MySqlCommand sql = new MySqlCommand();
                            sql.CommandText = "select id as 'Id', nome as 'Nome', date_format(nascimento,'%d/%m/%Y') as 'Nascimento', sexo as 'Sexo', date_format(dataEntrada,'%d/%m/%Y') as 'Entrada' from paciente where (dataSaida is null or dataSaida = @saida)";
                            sql.Parameters.AddWithValue("@saida", Convert.ToDateTime(null));
                            Grid.grid(dataGridView1, sql);
                            Limpar.limpar(this);
                        }
                        else
                        {
                            MessageBox.Show("Paciente não pôde ser excluído!");
                        }
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("Selecione algum paciente para ser excluído em uma data!");
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Selecione um paciente para ser excluído em uma data!");
                }
            }
            else
            {
                MessageBox.Show("Selecione algum paciente para ser excluído em uma data!");
            }
        }
示例#13
0
        private void btnSalvar_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                // validar
                if (string.IsNullOrEmpty(txtNome.Text))
                {
                    throw new NullReferenceException("O campo nome é obrigatório.");
                }
                if (string.IsNullOrEmpty(txtCPF.Text))
                {
                    throw new NullReferenceException("O campo CPF é obrigatório.");
                }
                if (string.IsNullOrEmpty(txtTelefone.Text))
                {
                    throw new NullReferenceException("O campo Telefone é obrigatório.");
                }
                if (cbConvenio.SelectedItem == null)
                {
                    throw new NullReferenceException("O campo Convenio é obrigatório.");
                }
                if (dpDataNascimento.SelectedDate == null)
                {
                    throw new NullReferenceException("A campo Data de Nascimento é obrigatório.");
                }

                Paciente paciente = new Paciente();
                paciente.PacienteId = Convert.ToInt32(txtId.Text);
                paciente.Nome       = txtNome.Text;
                paciente.CPF        = txtCPF.Text;
                paciente.Telefone   = txtTelefone.Text;
                paciente.Nascimento = (DateTime)dpDataNascimento.SelectedDate;
                paciente.Convenio   = (Convenio)cbConvenio.SelectedItem;

                PacienteController pacienteController = new PacienteController();
                pacienteController.updatePaciente(paciente);

                MessageBox.Show("Paciente salvo com sucesso!");
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro ao salvar o Paciente (" + ex.Message + ")");
            }
        }
示例#14
0
        private void Load_Paciente(int pacienteId)
        {
            // preencher dropdown convenio
            ConvenioController convenio = new ConvenioController();

            cbConvenio.ItemsSource = convenio.readConvenios();

            PacienteController pacienteController = new PacienteController();
            Paciente           paciente           = pacienteController.readPaciente(pacienteId);

            txtId.Text       = paciente.PacienteId.ToString();
            txtNome.Text     = paciente.Nome;
            txtCPF.Text      = paciente.CPF;
            txtTelefone.Text = paciente.Telefone;
            dpDataNascimento.SelectedDate = paciente.Nascimento;

            cbConvenio.SelectedValue = paciente.Convenio.Id;
        }
示例#15
0
        private void btnCadastrar_Click(object sender, EventArgs e)
        {
            try
            {
                if (!(textBox1.Text == "" || textBox2.Text == "  /  /" || textBox3.Text == "  /  /" || comboBox1.Text == ""))
                {
                    string             nome       = textBox1.Text;
                    string             nasci      = textBox2.Text;
                    string[]           nascimento = nasci.Split('/');
                    string             sexo       = comboBox1.Text[0].ToString();
                    string             enfermeiro = Session.codigo;
                    string             entra      = textBox3.Text;
                    string[]           entrada    = entra.Split('/');
                    PacienteController pc         = new PacienteController();
                    DateTime           nasc       = new DateTime(Convert.ToInt32(nascimento[2]), Convert.ToInt32(nascimento[1]), Convert.ToInt32(nascimento[0]));
                    DateTime           entr       = new DateTime(Convert.ToInt32(entrada[2]), Convert.ToInt32(entrada[1]), Convert.ToInt32(entrada[0]));
                    string             id         = Hash.md5(nome + nascimento);
                    enfermeiro = Session.codigo;

                    Projeto.Model.Paciente p = new Projeto.Model.Paciente(id, nome, nasc, sexo, enfermeiro, entr, Convert.ToDateTime(null));
                    if (Data.nascimento(nasc) && pc.add(p))
                    {
                        MessageBox.Show("Paciente cadastrado com sucesso!");
                        Limpar.limpar(this);
                        dataGridView1.DataSource = null;
                        Grid.grid(dataGridView1, "select nome as 'Nome',  date_format(nascimento,'%d/%m/%Y') as 'Nascimento', sexo as 'Sexo', date_format(dataEntrada,'%d/%m/%Y') as 'Entrada' from paciente where id = '" + id + "'");
                    }
                    else
                    {
                        MessageBox.Show("Paciente não pôde ser cadastrado!");
                    }
                }
                else
                {
                    MessageBox.Show("Informe tudo que for necessário!");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Paciente não pôde ser cadastrado!");
            }
        }
 private void comboBox2_SelectedValueChanged(object sender, EventArgs e)
 {
     try
     {
         PacienteController pc  = new PacienteController();
         Model.Paciente     pac = pc.search("id", comboBox2.SelectedItem.ToString())[0];
         textBox9.Text       = pac.nome;
         maskedTextBox4.Text = pac.nascimento.ToString("dd/MM/yyyy");
         if (pac.sexo == "F")
         {
             comboBox1.SelectedItem = "Feminino";
         }
         else if (pac.sexo == "M")
         {
             comboBox1.SelectedItem = "Masculino";
         }
         maskedTextBox3.Text = pac.dataEntrada.ToString("dd/MM/yyyy");
     }
     catch (Exception) {}
 }
        public void TestSaveException()
        {
            //Arrange
            Paciente mockPaciente = new Paciente()
            {
                Id = 0, Nombre = "Prueba"
            };

            mockRepositorioPaciente.Setup(r => r.AddOrUpdate(It.IsAny <Paciente>())).Throws(new Exception());
            PacienteController controller = new PacienteController(mockRepositorioPaciente.Object, mockRepositorioTratamiento.Object);

            controller.Request       = new HttpRequestMessage();
            controller.Configuration = new HttpConfiguration();

            //Act
            var response = controller.Save(mockPaciente);

            //Assert
            Assert.IsTrue(response.StatusCode == System.Net.HttpStatusCode.InternalServerError);
        }
        public void TestDelete()
        {
            //Arrange
            Paciente mockPaciente = new Paciente()
            {
                Id = 0, Nombre = "Prueba"
            };

            mockRepositorioPaciente.Setup(r => r.GetById(It.IsAny <int>())).Returns(mockPaciente);
            mockRepositorioPaciente.Setup(r => r.Remove(It.IsAny <Paciente>())).Verifiable();
            PacienteController controller = new PacienteController(mockRepositorioPaciente.Object, mockRepositorioTratamiento.Object);

            controller.Request       = new HttpRequestMessage();
            controller.Configuration = new HttpConfiguration();

            //Act
            var response = controller.deletePaciente(10);

            //Assert
            Assert.IsTrue(response.StatusCode == System.Net.HttpStatusCode.OK);
        }
        public void TestUpdate()
        {
            //Arrange
            ICollection <Tratamiento> mockNuevosTratamientos = new List <Tratamiento>()
            {
                new Tratamiento()
                {
                    Id = 2, Paciente_Id = 1
                }
            };
            Paciente mockPaciente = new Paciente()
            {
                Id = 1, Nombre = "Prueba", Tratamientos = mockNuevosTratamientos
            };
            ICollection <Tratamiento> mockViejosTratamientos = new List <Tratamiento>()
            {
                new Tratamiento()
                {
                    Id = 1, Paciente_Id = 1
                }
            };

            mockRepositorioPaciente.Setup(r => r.AddOrUpdate(It.IsAny <Paciente>())).Returns(mockPaciente);

            mockRepositorioTratamiento.Setup(t => t.AddOrUpdate(mockNuevosTratamientos.First())).Returns(mockNuevosTratamientos.First());
            mockRepositorioTratamiento.Setup(t => t.GetMany(It.IsAny <Expression <Func <Tratamiento, bool> > >())).Returns(mockViejosTratamientos);
            mockRepositorioTratamiento.Setup(t => t.RemoveRange(It.IsAny <IEnumerable <Tratamiento> >())).Verifiable();

            PacienteController controller = new PacienteController(mockRepositorioPaciente.Object, mockRepositorioTratamiento.Object);

            controller.Request       = new HttpRequestMessage();
            controller.Configuration = new HttpConfiguration();

            //Act
            var response = controller.Save(mockPaciente);

            //Assert
            Assert.IsTrue(response.StatusCode == System.Net.HttpStatusCode.OK);
        }
        public void TestGetbyId()
        {
            //Arrange
            Paciente mockPaciente = new Paciente()
            {
                Id = 0, Nombre = "Prueba"
            };

            mockRepositorioPaciente.Setup(r => r.GetById(It.IsAny <int>())).Returns(mockPaciente);
            PacienteController controller = new PacienteController(mockRepositorioPaciente.Object, mockRepositorioTratamiento.Object);

            controller.Request       = new HttpRequestMessage();
            controller.Configuration = new HttpConfiguration();

            //Act
            var response = controller.GetbyId(10);

            //Assert
            Paciente paciente;

            response.TryGetContentValue <Paciente>(out paciente);
            Assert.IsTrue(paciente.Id == 0);
        }
示例#21
0
        public void Refresh(string search)
        {
            List <Paciente> pacientes = new List <Paciente>();

            if (string.IsNullOrEmpty(search))
            {
                pacientes = (cbx_modo.SelectedIndex <= 0)
                    ? new PacienteController().ListarInternados()
                    : new PacienteController().ListarTodos();
            }
            else
            {
                pacientes = new PacienteController().Filtrar(search);
            }

            if (pacientes.Count > 0)
            {
                PageSystem.Update(pacientes);
            }

            grd_pacientes.Visibility = (pacientes.Count > 0) ? Visibility.Visible : Visibility.Hidden;
            tbk_pacientes.Visibility = (pacientes.Count > 0) ? Visibility.Hidden : Visibility.Visible;
        }
示例#22
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            PacienteController pacienteController = new PacienteController();

            dgPacientes.ItemsSource = pacienteController.readPacientes();
        }
        private void comboBox2_Format(object sender, ListControlConvertEventArgs e)
        {
            PacienteController pc = new PacienteController();

            e.Value = pc.search("id", e.Value.ToString())[0].nome;
        }
示例#24
0
 public Paciente()
 {
     InitializeComponent();
     PacienteController vistaPaciente = new PacienteController(this);
 }
        private void btnCadastrar_Click(object sender, EventArgs e)
        {
            DateTime datahora   = Convert.ToDateTime(null);
            string   enfermeiro = Session.codigo;
            string   paciente   = "";

            try
            {
                if (comboBox2.Text != "")
                {
                    paciente = comboBox2.SelectedItem.ToString();
                }
                else
                {
                    MessageBox.Show("Selecione um paciente!");
                    return;
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Selecione um paciente!");
                return;
            }

            double massaCorporal   = 0;
            double circAbdominal   = 0;
            double altura          = 0;
            bool   jejum           = false;
            double glicemia        = 0;
            string pressaoArterial = "0/0";
            int    respiracao      = 0;
            double temperatura     = 0;
            int    batimentos      = 0;

            if (maskedTextBox1.Text != "  /  /" && maskedTextBox2.Text != "  :")
            {
                try
                {
                    string[] dt = maskedTextBox1.Text.Split('/');
                    string[] hr = maskedTextBox2.Text.Split(':');
                    datahora = new DateTime(Convert.ToInt32(dt[2]), Convert.ToInt32(dt[1]), Convert.ToInt32(dt[0]), Convert.ToInt32(hr[0]), Convert.ToInt32(hr[1]), 0);
                    if (Data.consulta(datahora))
                    {
                        string id = Hash.md5(enfermeiro + paciente + datahora);
                        if (textBox1.Text != "")
                        {
                            if (Double.Parse(textBox1.Text) > 600)
                            {
                                MessageBox.Show("Massa corporal inválida!");
                                return;
                            }
                            else
                            {
                                massaCorporal = Double.Parse(textBox1.Text);
                            }
                        }
                        if (textBox2.Text != "")
                        {
                            circAbdominal = Double.Parse(textBox2.Text);
                        }
                        if (textBox3.Text != " ,")
                        {
                            if (textBox3.MaskCompleted)
                            {
                                if (Double.Parse(textBox3.Text) >= 3)
                                {
                                    MessageBox.Show("Altura inválida!");
                                    return;
                                }
                                else
                                {
                                    altura = Double.Parse(textBox3.Text);
                                }
                            }
                            else
                            {
                                MessageBox.Show("Altura inválida!");
                                return;
                            }
                        }
                        if (textBox4.Text != "")
                        {
                            glicemia = Double.Parse(textBox4.Text);
                        }
                        if (textBox5.Text != "   /")
                        {
                            if (textBox5.MaskCompleted)
                            {
                                pressaoArterial = textBox5.Text;
                            }
                            else
                            {
                                MessageBox.Show("Pressão Arterial inválida!");
                                return;
                            }
                        }
                        if (textBox6.Text != "")
                        {
                            respiracao = Convert.ToInt32(textBox6.Text);
                        }
                        if (textBox7.Text != "  ,")
                        {
                            if (textBox7.MaskCompleted)
                            {
                                temperatura = Double.Parse(textBox7.Text);
                            }
                            else
                            {
                                MessageBox.Show("Temperatura inválida!");
                                return;
                            }
                        }
                        if (textBox8.Text != "")
                        {
                            if (textBox8.MaskCompleted)
                            {
                                batimentos = Convert.ToInt32(textBox8.Text);
                            }
                            else
                            {
                                MessageBox.Show("Pulso inválido!");
                                return;
                            }
                        }
                        if (checkBox1.CheckState.ToString() != "Indeterminate")
                        {
                            jejum = checkBox1.Checked;
                        }

                        Model.Consulta     con = new Model.Consulta(id, enfermeiro, paciente, datahora, massaCorporal, circAbdominal, altura, jejum, glicemia, pressaoArterial, respiracao, temperatura, batimentos);
                        PacienteController pc  = new PacienteController();

                        Model.Paciente pac = pc.search("id", comboBox2.SelectedItem.ToString())[0];

                        Relatorio.EdicaoRelatorio form = new Relatorio.EdicaoRelatorio(con, pac.nome);
                        form.Show();
                    }
                    else
                    {
                        MessageBox.Show("É necessário o registro de uma data e de um horário válidos!");
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Todos os dados precisam ser válidos!");
                }
            }
            else
            {
                MessageBox.Show("É necessário o registro de uma data e de um horário válidos!");
            }
        }
示例#26
0
        private void AtualizarLista()
        {
            PacienteController pacienteController = new PacienteController();

            dgPacientes.ItemsSource = pacienteController.readPacientes();
        }
        public List <Problema> problematizar(Consulta consulta)
        {
            PacienteController pacC      = new PacienteController();
            List <string>      problemas = new List <string>();
            string             sexo      = pacC.search("id", consulta.paciente)[0].sexo;
            double             imc       = 0;

            if (consulta.massaCorporal != 0 && consulta.altura != 0)
            {
                imc = consulta.massaCorporal / Math.Pow(consulta.altura, 2);
            }
            double temperatura   = consulta.temperatura;
            int    pulso         = consulta.batimentoCardio;
            int    respiracao    = consulta.respiracao;
            double circAbdominal = consulta.circAbdominal;
            double glicemia      = consulta.glicemia;

            string[] pressaoArterial = consulta.pressaoArterial.Split('/');
            int      pas             = Convert.ToInt32(pressaoArterial[0]);
            int      pad             = Convert.ToInt32(pressaoArterial[1]);
            bool     jejum           = consulta.jejum;

            if (imc == 0)
            {
            }
            else if (imc <= 18)
            {
                problemas.Add(Hash.md5("Baixo Peso"));
            }
            else if (imc < 25)
            {
                problemas.Add(Hash.md5("Peso normal"));
            }
            else if (imc < 30)
            {
                problemas.Add(Hash.md5("Sobrepeso"));
            }
            else if (imc < 35)
            {
                problemas.Add(Hash.md5("Obesidade Grau I"));
            }
            else if (imc < 40)
            {
                problemas.Add(Hash.md5("Obesidade Grau II"));
            }
            else
            {
                problemas.Add(Hash.md5("Obesidade Grau III"));
            }

            if (temperatura == 0)
            {
            }
            else if (temperatura <= 27)
            {
                problemas.Add(Hash.md5("Hipotermia Profunda"));
            }
            else if (temperatura <= 30)
            {
                problemas.Add(Hash.md5("Hipotermia Grave"));
            }
            else if (temperatura <= 33)
            {
                problemas.Add(Hash.md5("Hipotermia Moderada"));
            }
            else if (temperatura < 36)
            {
                problemas.Add(Hash.md5("Hipotermia Leve"));
            }
            else if (temperatura <= 37)
            {
                problemas.Add(Hash.md5("Temperatura Normal"));
            }
            else if (temperatura < 39)
            {
                problemas.Add(Hash.md5("Febre"));
            }
            else if (temperatura <= 40)
            {
                problemas.Add(Hash.md5("Pirexia"));
            }
            else
            {
                problemas.Add(Hash.md5("Hiperpirexia"));
            }

            if (pulso == 0)
            {
            }
            else if (pulso <= 59)
            {
                problemas.Add(Hash.md5("Bradisfigmia"));
            }
            else if (pulso <= 100)
            {
                problemas.Add(Hash.md5("Normocardia"));
            }
            else
            {
                problemas.Add(Hash.md5("Taquisfigmia"));
            }

            if (respiracao == 0)
            {
            }
            else if (respiracao <= 11)
            {
                problemas.Add(Hash.md5("Bradipneia"));
            }
            else if (respiracao <= 20)
            {
                problemas.Add(Hash.md5("Eupneia"));
            }
            else
            {
                problemas.Add(Hash.md5("Taquipneia"));
            }

            if (circAbdominal == 0)
            {
            }
            else if ((sexo == "F" && circAbdominal <= 70) || (sexo == "M" && circAbdominal <= 60))
            {
                problemas.Add(Hash.md5("Sem Risco de Complicações Metabólicas"));
            }
            else if ((sexo == "F" && circAbdominal > 70 && circAbdominal <= 81) || (sexo == "M" && circAbdominal > 60 && circAbdominal <= 95))
            {
                problemas.Add(Hash.md5("Risco de Complicações Metabólicas Aumentado"));
            }
            else if ((sexo == "F" && circAbdominal > 70) || (sexo == "M" && circAbdominal > 95))
            {
                problemas.Add(Hash.md5("Risco de Complicações Metabólicas Aumentado Substancialmente"));
            }

            if (glicemia == 0)
            {
            }
            else if ((jejum == true && glicemia <= 50) || (jejum == false && glicemia <= 50))
            {
                problemas.Add(Hash.md5("Hipoglicemia"));
            }
            else if ((jejum == true && glicemia > 50 && glicemia < 110) || (jejum == false && glicemia > 50 && glicemia < 140))
            {
                problemas.Add(Hash.md5("Glicemia Normal"));
            }
            else if ((jejum == true && glicemia > 110 && glicemia <= 126) || (jejum == false && glicemia > 140 && glicemia <= 200))
            {
                problemas.Add(Hash.md5("Pré-diabetes"));
            }
            else if ((jejum == true && glicemia > 126) || (jejum == false && glicemia > 200))
            {
                problemas.Add(Hash.md5("Diabetes"));
            }

            if (pas == 0 && pad == 0)
            {
            }
            else if (pas <= 90 && pad <= 60)
            {
                problemas.Add(Hash.md5("Hipotensão"));
            }
            else if (pas > 90 && pas <= 130 && pad > 60 && pad <= 85)
            {
                problemas.Add(Hash.md5("Pressão Arterial Normal"));
            }
            else if (pas > 130 && pas <= 139 && pad > 85 && pad <= 89)
            {
                problemas.Add(Hash.md5("Pressão Arterial Normal Limítrofe"));
            }
            else if (pas > 139 && pas <= 159 && pad > 89 && pad <= 99)
            {
                problemas.Add(Hash.md5("Hipertensão Leve"));
            }
            else if (pas > 159 && pas <= 179 && pad > 99 && pad <= 109)
            {
                problemas.Add(Hash.md5("Hipertensão Moderada"));
            }
            else if (pas >= 180 && pad >= 110)
            {
                problemas.Add(Hash.md5("Hipertensão Grave"));
            }
            else if (pas >= 140 && pad < 90)
            {
                problemas.Add(Hash.md5("Hipertensão Sistólica Isolada"));
            }

            ConsultaController cc       = new ConsultaController();
            List <Problema>    prob     = cc.listaProblema(problemas);
            List <Problema>    probReal = new List <Problema>();

            try
            {
                foreach (Problema problema in prob)
                {
                    if (problema.stt)
                    {
                        probReal.Add(problema);
                    }
                }
                return(probReal);
            }
            catch (Exception)
            {
                return(null);
            }
        }