예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            ConsultaControl consultaControl = new ConsultaControl();

            PacienteControl pacienteControl = new PacienteControl();
            // pacienteControl.ValidaPaciente(new Paciente(null, "908098"));
        }
예제 #2
0
        private void btnPacienteSeleccionado_Click(object sender, EventArgs e)
        {
            if (dgvAgendamiento.SelectedRows.Count == 1)
            {
                FrmPaciente     frmPaciente     = new FrmPaciente();
                PacienteControl pacienteControl = new PacienteControl();
                try
                {
                    string codigoPaciente = (string)dgvAgendamiento.SelectedCells[0].Value;

                    Paciente  paciente  = PacienteControl.BuscarPaciente(codigoPaciente);
                    Estudio   estudio   = new Estudio(Convert.ToInt32(dgvAgendamiento.SelectedCells[9].Value), dgvAgendamiento.SelectedCells[8].Value.ToString(), dgvAgendamiento.SelectedCells[12].Value.ToString(), dgvAgendamiento.SelectedCells[13].Value.ToString(), Convert.ToDateTime(dgvAgendamiento.SelectedCells[10].Value));
                    Modalidad modalidad = new Modalidad(dgvAgendamiento.SelectedCells[6].Value.ToString());

                    frmPaciente.RellenarDatos(paciente, estudio, modalidad);
                    frmPaciente.Show();
                }
                catch (Exception error)
                {
                    MessageBox.Show("Debe seleccionar un paciente.", "¡Error!");
                    Consola.Imprimir(error.Message);
                }
            }
            else
            {
                MessageBox.Show("Debe seleccionar solamente una fila.", "¡Error!");
            }
        }
예제 #3
0
        /// <summary>
        /// Procesa la admisión de un paciente
        /// </summary>
        /// <param name="lista">Datos</param>
        private void ProcesarAdmision(List <Hashtable> lista)
        {
            foreach (Hashtable segmento in lista)
            {
                if (segmento["Segment Name"].Equals("PID"))
                {
                    if (segmento.ContainsKey("Patient ID"))
                    {
                        Consola.Imprimir("Insertando paciente...");

                        try
                        {
                            PacienteControl.Insertar(segmento);
                            Consola.Imprimir("Paciente insertado.");

                            listo = true;
                        }
                        catch (Exception e)
                        {
                            Consola.Imprimir(e.ToString());
                        }

                        break;
                    }
                    else
                    {
                        Consola.Imprimir("Faltan campos obligatorios en el PID...");
                    }
                }
            }
        }
예제 #4
0
        /// <summary>
        /// Verificar si existe un ID
        /// </summary>
        /// <param name="pid">PID</param>
        /// <returns>Verdadero o falso</returns>
        private bool VerificarPaciente(Hashtable pid)
        {
            if (pid.ContainsKey("Patient ID"))
            {
                return(PacienteControl.VerificarPacienteExistente(pid));
            }

            return(false);
        }
예제 #5
0
        private void btGetAllPaciente_Click(object sender, EventArgs e)
        {
            PacienteControl pacienteCtl = new PacienteControl();
            List <Paciente> pacientes   = pacienteCtl.GetAllPacientes();


            cmBoxPaciente.Items.Clear();
            cmBoxPaciente.Sorted = true;


            foreach (var paciente in pacientes)
            {
                cmBoxPaciente.Items.Add(paciente.Nome);
            }
        }
예제 #6
0
        public void InsertarPaciente()
        {
            LectorHL7        lector = new LectorHL7();
            List <Hashtable> lista  = lector.LeerMensaje("");
            Hashtable        PID    = new Hashtable();

            for (int i = 0; i < lista.Count; i++)
            {
                if (lista[i].ContainsKey(DefinicionSegmento.PID[3]))
                {
                    PID = lista[i];
                    break;
                }
            }

            if (!PacienteControl.VerificarPacienteExistente(PID))
            {
                PacienteControl.Insertar(PID);
            }
            else
            {
                Consola.Imprimir(MensajeACK.GenerarMensaje("AR", lista[0]));
            }
        }