Exemplo n.º 1
0
        private void btnGuardar_Click(object sender, RoutedEventArgs e)
        {
            //Validar que  tenga un historial activo
            DataTable lDtVerifyHistorial = new DataTable();

            ControlDePacientes.Dal.HistorialMedico lHistorialMedicoVerify = new HistorialMedico();
            lDtVerifyHistorial = lHistorialMedicoVerify.HistorialMedicoVerify(mIdPaciente, 10); //10 es Iniciado

            if (lDtVerifyHistorial.Rows.Count > 0)
            {
                mIdHistorialMedico = (int)lDtVerifyHistorial.Rows[0]["IdHistorialMedico"];


                string lMessage = ValidateFields();
                if (lMessage == "")
                {
                    SaveExamenFisico();
                    ControlOperation.alertInformation("Se Guardó el exámen físico del paciente");
                    btnDelete.Visibility = Visibility.Visible;
                    btnCancel.Visibility = Visibility.Collapsed;
                }
                else
                {
                    ControlOperation.alertWarning(lMessage);
                }
            }
            else
            {
                ControlOperation.alertWarning("El Paciente no tiene un Registro Médico, no se puede guardar el examen físico");
            }
        }
Exemplo n.º 2
0
        public ActionResult CrearHistorialMedico(HistorialMedico historialMedico, string checkAntecedentes)
        {
            string creado = "si";

            try
            {
                List <Antecedente> antecedentes = JsonConvert.DeserializeObject <List <Antecedente> >(checkAntecedentes).ToList();

                historialMedico.Pulmonares     = antecedentes.Where(x => x.nombre == "PULMONARES").FirstOrDefault().estado;
                historialMedico.Digestivos     = antecedentes.Where(x => x.nombre == "DIGESTIVOS").FirstOrDefault().estado;
                historialMedico.Diabetes       = antecedentes.Where(x => x.nombre == "DIABETES").FirstOrDefault().estado;
                historialMedico.Renales        = antecedentes.Where(x => x.nombre == "RENALES").FirstOrDefault().estado;
                historialMedico.Quirurjicos    = antecedentes.Where(x => x.nombre == "QUIRURJICOS").FirstOrDefault().estado;
                historialMedico.Alergicos      = antecedentes.Where(x => x.nombre == "ALERGICOS").FirstOrDefault().estado;
                historialMedico.Transfuciones  = antecedentes.Where(x => x.nombre == "TRANSFUCIONES").FirstOrDefault().estado;
                historialMedico.Alcohol        = antecedentes.Where(x => x.nombre == "ALCOHOL").FirstOrDefault().estado;
                historialMedico.Tabaquismo     = antecedentes.Where(x => x.nombre == "TABAQUISMO").FirstOrDefault().estado;
                historialMedico.Drogas         = antecedentes.Where(x => x.nombre == "DROGAS").FirstOrDefault().estado;
                historialMedico.Inmunizaciones = antecedentes.Where(x => x.nombre == "INMUNIZACIONES").FirstOrDefault().estado;
                historialMedico.Cardiovascular = antecedentes.Where(x => x.nombre == "CARDIOVASCULAR").FirstOrDefault().estado;
                historialMedico.Fecha          = DateTime.Now;
                historialMedico.MODIFICADO     = DateTime.Now;
                context.HistorialMedico.Add(historialMedico);
                context.SaveChanges();
            }
            catch (Exception e)
            {
                creado = "no";
            }

            TempData["Creado"] = creado;

            return(RedirectToAction("HistorialMedico"));
        }
Exemplo n.º 3
0
        public async Task <IHttpActionResult> PutHistorialMedico(int id, HistorialMedico historialMedico)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != historialMedico.ID)
            {
                return(BadRequest());
            }

            db.Entry(historialMedico).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!HistorialMedicoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        //POST://
        public ActionResult ModificarcmMedico(HistorialMedico_Usuarios historialU)
        {
            #region ViewBag
            List <SelectListItem> lst = new List <SelectListItem>();

            lst.Add(new SelectListItem {
                Text = "Si", Value = "1"
            });
            lst.Add(new SelectListItem {
                Text = "No", Value = "2"
            });

            ViewBag.Opciones = lst;
            #endregion

            HistorialMedico historial = historialU.historialMedicO;
            historial.IDUsuario = (int)TempData["id"];

            if (ModelState.IsValid)
            {
                historial = Cliente.ModificarHM(historial);
                return(RedirectToAction("medidasMantenimiento"));
            }

            return(View(historial));
        }
        private void fillDtgHistorialMedico()
        {
            HistorialMedico lHistorialMedicoPaciente   = new HistorialMedico();
            DataTable       lDtHistorialMedicoPaciente = lHistorialMedicoPaciente.HistorialMedicoGetAllByIdPaciente(mIdPaciente);

            dtgHistorialPaciente.ItemsSource = lDtHistorialMedicoPaciente.DefaultView;
        }
        // private void SaveRegistroMedico()
        //{
        //    if (mIdPaciente != 0)
        //    {
        //        if (mIdHistorial == "")
        //        {
        //            // Cuenta los historiales para el correlativo
        //            ControlDePacientes.Dal.HistorialMedico lHistorialMedico = new HistorialMedico();
        //            int lCountHistory = lHistorialMedico.HistorialMedicoCountByYear(mIdPaciente);
        //            lCountHistory += 1;

        //            ControlDePacientes.Entities.historialmedico lHistorialmedicoEntity = new historialmedico();
        //            lHistorialmedicoEntity.Historialmediconame = "Historial No. " + lCountHistory + " del paciente No. " + mIdPaciente;
        //            lHistorialmedicoEntity.Codestado = 1;
        //            lHistorialmedicoEntity.Codpaciente = mIdPaciente;
        //            //lHistorialmedicoEntity.Registromedico = lCountHistory.ToString() + "-" + DateTime.Today.Date.Year;
        //            lHistorialmedicoEntity.Fecha = DateTime.Today;
        //            mIdHistorialForDelete = lHistorialMedico.AddNewHistorialMedico(lHistorialmedicoEntity);

        //           // mIdHistorial = lHistorialmedicoEntity.Registromedico;

        //           // txtRegistroMedico.Text = lHistorialmedicoEntity.Registromedico;//mIdHistorial.ToString() + "-" + DateTime.Today.Date.Year;
        //            txtRegistroMedico.Visibility = Visibility.Visible;
        //            lblRegistroMedico.Visibility = Visibility.Visible;

        //            // Microsoft.Windows.Controls.MessageBox.Show("Registro Médico no: " + lHistorialmedicoEntity.Registromedico + " Guardado éxitosamente del paciente No. " + mIdPaciente, "Validación del Sistema");
        //        }
        //        else
        //        {
        //            ControlOperation.alertWarning("Ya se genero el Registro Médico no: " + mIdHistorial);
        //        }
        //    }
        //    else
        //    {
        //        ControlOperation.alertWarning("Debe registrar el paciente para generar un registro médico nuevo");
        //    }

        //}

        private void btnHistorial_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (mIdPaciente != 0)
                {
                    if (mIdHistorial == "")
                    {
                        //verifica si no tiene un historial ya generado
                        ControlDePacientes.Dal.HistorialMedico lHistorialMedico = new HistorialMedico();
                        DataTable lDtCheck = lHistorialMedico.HistorialMedicoPendienteCheck(mIdPaciente);

                        if (lDtCheck.Rows.Count > 0)
                        {
                            ControlOperation.alertWarning("El Paciente tiene un historial pendiente de terminar, debe realizarse el exámen físico");
                        }
                        else
                        {
                            // Cuenta los historiales para el correlativo
                            //ControlDePacientes.Dal.HistorialMedico lHistorialMedico = new HistorialMedico();
                            int lCountHistory = lHistorialMedico.HistorialMedicoCountByYear(mIdPaciente);
                            lCountHistory += 1;

                            ControlDePacientes.Entities.historialmedico lHistorialmedicoEntity = new historialmedico();
                            lHistorialmedicoEntity.Historialmediconame = "Historial No. " + lCountHistory +
                                                                         " del paciente No. " + mIdPaciente;
                            lHistorialmedicoEntity.Codestado   = 10; //ESTADO INICIADO PARA HISTORIAL
                            lHistorialmedicoEntity.Codpaciente = mIdPaciente;
                            lHistorialmedicoEntity.Correlativo = lCountHistory.ToString() + "-" + DateTime.Today.Date.Year;
                            lHistorialmedicoEntity.Fecha       = DateTime.Today;

                            mIdHistorialForDelete = lHistorialMedico.AddNewHistorialMedico(lHistorialmedicoEntity);

                            mIdHistorial = lHistorialmedicoEntity.Correlativo;

                            txtRegistroMedico.Text = lHistorialmedicoEntity.Correlativo;
                            //mIdHistorial.ToString() + "-" + DateTime.Today.Date.Year;
                            txtRegistroMedico.Visibility = Visibility.Visible;
                            lblRegistroMedico.Visibility = Visibility.Visible;

                            loadInfoAdicional(lCountHistory);

                            ControlOperation.alertInformation("Historial Médico Generado con éxito");
                        }
                    }
                    else
                    {
                        ControlOperation.alertWarning("Ya se genero el Historial Médico para el paciente");
                    }
                }
                else
                {
                    ControlOperation.alertWarning("Debe registrar el paciente para generar un Historial Médico nuevo");
                }
            }
            catch (Exception ex)
            {
                ControlOperation.alertWarning(ex.Message);
            }
        }
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (ControlOperation.alertConfirm("Desea eliminar el Historial Médico del paciente?") == MessageBoxResult.Yes)
                {
                    ControlDePacientes.Dal.HistorialMedico lHistorialMedico = new HistorialMedico();
                    lHistorialMedico.DeleteHistorialMedico(mIdHistorialMedico);

                    ControlOperation.alertInformation("El Historial Médico se eliminó con éxito");
                    cmbDiagnosticoFinal.IsEnabled   = false;
                    txtEstadoNutricional.IsEnabled  = false;
                    txtEstudioInicial.IsEnabled     = false;
                    txtImpresion.IsEnabled          = false;
                    txtTratamiento.IsEnabled        = false;
                    cmbDestinoCaso.IsEnabled        = false;
                    txtObservaciones.IsEnabled      = false;
                    txtNotaDescargo.IsEnabled       = false;
                    cmbDiagnosticoInicial.IsEnabled = false;
                }
            }
            catch (Exception ex)
            {
                ControlOperation.alertWarning(ex.Message);
            }
        }
Exemplo n.º 8
0
        public ActionResult HistorialMedico()
        {
            ViewBag.Seudonimo = "Historial Médico";
            HistorialMedico historialMedico = new HistorialMedico();

            if (TempData["Creado"] != null)
            {
                if (TempData["Creado"].ToString() == "si")
                {
                    ViewBag.Creado = "si";
                }
                else
                {
                    ViewBag.Creado = "no";
                }
            }

            if (TempData["Actualizado"] != null)
            {
                if (TempData["Actualizado"].ToString() == "si")
                {
                    ViewBag.Actualizado = "si";
                }
                else
                {
                    ViewBag.Actualizado = "no";
                }
            }

            return(View(historialMedico));
        }
Exemplo n.º 9
0
        public static HistorialMedico ModificarHM(HistorialMedico historialMedico)
        {
            try
            {
                using (PROMETHEUS_DBEntities db = new PROMETHEUS_DBEntities())
                {
                    if (db.HistorialMedico.Any(o => o.IDUsuario == historialMedico.IDUsuario))
                    {
                        db.HistorialMedico.Where(o => o.IDUsuario == historialMedico.IDUsuario).FirstOrDefault().alcohol              = historialMedico.alcohol;
                        db.HistorialMedico.Where(o => o.IDUsuario == historialMedico.IDUsuario).FirstOrDefault().fumado               = historialMedico.fumado;
                        db.HistorialMedico.Where(o => o.IDUsuario == historialMedico.IDUsuario).FirstOrDefault().hipertension         = historialMedico.hipertension;
                        db.HistorialMedico.Where(o => o.IDUsuario == historialMedico.IDUsuario).FirstOrDefault().diabetes             = historialMedico.diabetes;
                        db.HistorialMedico.Where(o => o.IDUsuario == historialMedico.IDUsuario).FirstOrDefault().medicamentos         = historialMedico.medicamentos;
                        db.HistorialMedico.Where(o => o.IDUsuario == historialMedico.IDUsuario).FirstOrDefault().fracturas            = historialMedico.fracturas;
                        db.HistorialMedico.Where(o => o.IDUsuario == historialMedico.IDUsuario).FirstOrDefault().cirugias             = historialMedico.cirugias;
                        db.HistorialMedico.Where(o => o.IDUsuario == historialMedico.IDUsuario).FirstOrDefault().alergias             = historialMedico.alergias;
                        db.HistorialMedico.Where(o => o.IDUsuario == historialMedico.IDUsuario).FirstOrDefault().problemasArticulares = historialMedico.problemasArticulares;
                        db.HistorialMedico.Where(o => o.IDUsuario == historialMedico.IDUsuario).FirstOrDefault().otras = historialMedico.otras;
                    }
                    else
                    {
                        db.HistorialMedico.Add(historialMedico);
                    }


                    db.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(historialMedico);
        }
Exemplo n.º 10
0
        //public static Medidas_Usuarios mu;

        public static void AgregarhistorialMedico(HistorialMedico historialMedico)
        {
            PROMETHEUS_DBEntities db = new PROMETHEUS_DBEntities();

            try
            {
                db.insertHistorialMedico(historialMedico.alcohol,
                                         historialMedico.fumado,
                                         historialMedico.hipertension,
                                         historialMedico.diabetes,
                                         historialMedico.medicamentos,
                                         historialMedico.fracturas,
                                         historialMedico.cirugias,
                                         historialMedico.alergias,
                                         historialMedico.problemasArticulares,
                                         historialMedico.otras,
                                         historialMedico.IDUsuario);

                db.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 11
0
        public override global::System.Data.DataSet Clone()
        {
            HistorialMedico cln = ((HistorialMedico)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
Exemplo n.º 12
0
        public ActionResult DeleteConfirmed(int id)
        {
            HistorialMedico historialMedico = db.HistorialMedicoes.Find(id);

            db.HistorialMedicoes.Remove(historialMedico);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 13
0
        private void SaveExamenFisico()
        {
            try
            {
                ControlDePacientes.Entities.historialmedico lHistorialmedico = new historialmedico();
                lHistorialmedico.Idhistorialmedico = mIdHistorialMedico;
                lHistorialmedico.Motivoconsulta    = txtMotivoConsulta.Text != "" ? txtMotivoConsulta.Text : "";
                //lHistorialmedico.Dxingreso = (int)cmbDiagnosticoInicial.SelectedValue;
                lHistorialmedico.Fecha                 = DateTime.Now;
                lHistorialmedico.Codusuario            = ControlDePacientes.Entities.GlobalUser.Idusuario;
                lHistorialmedico.Presionarterial       = txtPA.Text != "" ? txtPA.Text : "";
                lHistorialmedico.Frecuenciacardiaca    = txtFC.Text != "" ? txtFC.Text : "";
                lHistorialmedico.Rayosx                = txtRX.Text != "" ? txtRX.Text : "";
                lHistorialmedico.Frecuenciarespiratora = txtFR.Text != "" ? txtFR.Text : "";
                lHistorialmedico.Temperatura           = txtTemp.Text != "" ? txtTemp.Text : "";
                lHistorialmedico.Cc                      = txtCC.Text != "" ? txtCC.Text : "";
                lHistorialmedico.Peso                    = txtPeso.Text != "" ? txtPeso.Text : "";
                lHistorialmedico.Talla                   = txtTalla.Text != "" ? txtTalla.Text : "";
                lHistorialmedico.Masacorporal            = txtMC.Text != "" ? txtMC.Text : "";
                lHistorialmedico.Te                      = txtTE.Text != "" ? txtTE.Text : "";
                lHistorialmedico.Pe                      = txtPE.Text != "" ? txtPE.Text : "";
                lHistorialmedico.Saturaciono2            = txtSaturacion.Text != "" ? txtSaturacion.Text : "";
                lHistorialmedico.Examenfisico            = txtExamenFisico.Text != "" ? txtExamenFisico.Text : "";
                lHistorialmedico.Antecedentesimportancia = txtAntecedentes.Text != "" ? txtAntecedentes.Text : "";
                lHistorialmedico.Codservicio             = (int)cmbServicio.SelectedValue;
                lHistorialmedico.Codestado               = 1;
                lHistorialmedico.Pesotalla               = txtPesoTalla.Text != "" ? txtPesoTalla.Text : "";

                ControlDePacientes.Dal.HistorialMedico lHistorialMedicos = new HistorialMedico();
                lHistorialMedicos.AddHistorialMedicoUpdExamenFisico(lHistorialmedico);


                txtMotivoConsulta.IsEnabled = false;
                //cmbDiagnosticoInicial.IsEnabled = false;
                cmbServicio.IsEnabled     = false;
                txtPA.IsEnabled           = false;
                txtFR.IsEnabled           = false;
                txtRX.IsEnabled           = false;
                txtFR.IsEnabled           = false;
                txtTemp.IsEnabled         = false;
                txtCC.IsEnabled           = false;
                txtPeso.IsEnabled         = false;
                txtTalla.IsEnabled        = false;
                txtMC.IsEnabled           = false;
                txtTE.IsEnabled           = false;
                txtPE.IsEnabled           = false;
                txtSaturacion.IsEnabled   = false;
                txtExamenFisico.IsEnabled = false;
                txtAntecedentes.IsEnabled = false;
                txtFC.IsEnabled           = false;
                txtPesoTalla.IsEnabled    = false;
            }
            catch (Exception ex)
            {
                ControlOperation.alertWarning("" + ex);
            }
        }
        private void txtIdPacienteSearch_KeyDown(object sender, KeyEventArgs e)
        {
            LoopVisualTree(expDetail);

            DataTable lDtRegistroMedico = new DataTable();

            ControlDePacientes.Dal.HistorialMedico lHistorialMedico = new HistorialMedico();
            lDtRegistroMedico             = lHistorialMedico.HistorialMedicoByIdPaciente(txtIdPacienteSearch.Text);
            dtgRegistroMedico.ItemsSource = lDtRegistroMedico.DefaultView;
        }
        private void BtnSearch_Click(object sender, RoutedEventArgs e)
        {
            LoopVisualTree(expDetail);

            DataTable lDtRegistroMedico = new DataTable();

            ControlDePacientes.Dal.HistorialMedico lHistorialMedico = new HistorialMedico();
            lDtRegistroMedico             = lHistorialMedico.HistorialMedicoByIdPaciente(txtIdPacienteSearch.Text);
            dtgRegistroMedico.ItemsSource = lDtRegistroMedico.DefaultView;
            //expDetail.IsExpanded = false;
        }
Exemplo n.º 16
0
        public async Task <IHttpActionResult> GetHistorialMedico(int id)
        {
            HistorialMedico historialMedico = await db.HistorialMedico.FindAsync(id);

            if (historialMedico == null)
            {
                return(NotFound());
            }

            return(Ok(historialMedico));
        }
Exemplo n.º 17
0
 public ActionResult Edit([Bind(Include = "HistorialMedicoID,Diagnostico,Tratamiento,ExamenMedico,Peso,Altura,FechaRealizacion,PacienteID,DoctorID")] HistorialMedico historialMedico)
 {
     if (ModelState.IsValid)
     {
         db.Entry(historialMedico).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DoctorID   = new SelectList(db.Doctors, "DoctorID", "Nombre", historialMedico.DoctorID);
     ViewBag.PacienteID = new SelectList(db.Pacientes, "PacienteID", "Nombre", historialMedico.PacienteID);
     return(View(historialMedico));
 }
Exemplo n.º 18
0
        public async Task <IHttpActionResult> PostHistorialMedico(HistorialMedico historialMedico)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.HistorialMedico.Add(historialMedico);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = historialMedico.ID }, historialMedico));
        }
Exemplo n.º 19
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            HistorialMedico ds = new HistorialMedico();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
Exemplo n.º 20
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            if (mIdHistorialMedico != 0)
            {
                if (ControlOperation.alertConfirm("Desea Eliminar el Exámen Físico del paciente?") == MessageBoxResult.Yes)
                {
                    ControlDePacientes.Dal.HistorialMedico lHistorialMedico = new HistorialMedico();
                    lHistorialMedico.DeleteHistorialMedico(mIdHistorialMedico);

                    ControlOperation.alertInformation("El Exámen Físico se eliminó con éxito");
                    CleanControls();
                }
            }
        }
Exemplo n.º 21
0
        public async Task <IHttpActionResult> DeleteHistorialMedico(int id)
        {
            HistorialMedico historialMedico = await db.HistorialMedico.FindAsync(id);

            if (historialMedico == null)
            {
                return(NotFound());
            }

            db.HistorialMedico.Remove(historialMedico);
            await db.SaveChangesAsync();

            return(Ok(historialMedico));
        }
Exemplo n.º 22
0
        // GET: HistorialMedicoes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HistorialMedico historialMedico = db.HistorialMedicoes.Find(id);

            if (historialMedico == null)
            {
                return(HttpNotFound());
            }
            return(View(historialMedico));
        }
        private void btnGuardar_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ControlDePacientes.Dal.HistorialMedico      lHistorialMedico       = new HistorialMedico();
                ControlDePacientes.Entities.historialmedico lHistorialmedicoEntity = new historialmedico();


                lHistorialmedicoEntity.Idhistorialmedico = mIdHistorialMedico;
                if ((int)cmbDiagnosticoFinal.SelectedIndex != 0)
                {
                    lHistorialmedicoEntity.Dxegreso = (int)cmbDiagnosticoFinal.SelectedValue;
                }
                if ((int)cmbDiagnosticoInicial.SelectedIndex != 0)
                {
                    lHistorialmedicoEntity.Dxingreso = (int)cmbDiagnosticoInicial.SelectedValue;
                }
                //else lHistorialmedicoEntity.Dxegreso = 0;
                lHistorialmedicoEntity.Estadonutricinal           = txtEstadoNutricional.Text;
                lHistorialmedicoEntity.Estudiosiniciales          = txtEstudioInicial.Text;
                lHistorialmedicoEntity.Impresionclinica           = txtImpresion.Text;
                lHistorialmedicoEntity.Tratamientoconsultaexterna = txtTratamiento.Text;
                lHistorialmedicoEntity.Notasdescargo  = txtNotaDescargo.Text;
                lHistorialmedicoEntity.Coddestinocaso = (int)cmbDestinoCaso.SelectedValue;
                lHistorialmedicoEntity.Observaciones  = txtObservaciones.Text;
                lHistorialmedicoEntity.Codestado      = 11;//estado finalizado
                lHistorialmedicoEntity.Coddoctor      = ControlDePacientes.Entities.GlobalUser.Idusuario;

                lHistorialMedico.UpdHistorialMedico(lHistorialmedicoEntity);

                ControlOperation.alertInformation("Se Guardó la Información éxitosamente");



                cmbDiagnosticoFinal.IsEnabled   = false;
                txtEstadoNutricional.IsEnabled  = false;
                txtEstudioInicial.IsEnabled     = false;
                txtImpresion.IsEnabled          = false;
                txtTratamiento.IsEnabled        = false;
                cmbDestinoCaso.IsEnabled        = false;
                txtObservaciones.IsEnabled      = false;
                txtNotaDescargo.IsEnabled       = false;
                cmbDiagnosticoInicial.IsEnabled = false;
            }
            catch (Exception ex)
            {
                ControlOperation.alertWarning(ex.Message);
            }
        }
Exemplo n.º 24
0
        // GET: HistorialMedicoes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HistorialMedico historialMedico = db.HistorialMedicoes.Find(id);

            if (historialMedico == null)
            {
                return(HttpNotFound());
            }
            ViewBag.DoctorID   = new SelectList(db.Doctors, "DoctorID", "Nombre", historialMedico.DoctorID);
            ViewBag.PacienteID = new SelectList(db.Pacientes, "PacienteID", "Nombre", historialMedico.PacienteID);
            return(View(historialMedico));
        }
Exemplo n.º 25
0
        public static HistorialMedico visualizarHM(int?id)
        {
            HistorialMedico hm = new HistorialMedico();

            try
            {
                using (PROMETHEUS_DBEntities db = new PROMETHEUS_DBEntities())
                {
                    Usuarios user = db.Usuarios.Find(id);
                    hm = db.HistorialMedico.Where(o => o.IDUsuario == id).FirstOrDefault();
                    return(hm);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void txtIdPaciente_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Return)
            {
                try
                {
                    ControlDePacientes.Dal.Paciente lPacienteDal = new Paciente();
                    DataTable lDtPaciente = lPacienteDal.GetPacienteByRegistroMedico(txtIdPaciente.Text);
                    if (lDtPaciente.Rows.Count > 0)
                    {
                        mIdPaciente = (int)lDtPaciente.Rows[0]["IdPaciente"];


                        DataTable lDtVerifyHistorial = new DataTable();
                        ControlDePacientes.Dal.HistorialMedico lHistorialMedicoVerify = new HistorialMedico();
                        lDtVerifyHistorial = lHistorialMedicoVerify.HistorialMedicoVerify(mIdPaciente, 10);
                        //1 es Iniciado


                        if (lDtVerifyHistorial.Rows.Count > 0)
                        {
                            fillCmbDiagnosticoSalida();
                            fillCmbDiagnosticoEntrada();
                            fillCmbDiagnosticoEntrada();
                            fillCmbServicio();
                            fillDestinoCaso();
                            mIdHistorialMedico = (int)lDtVerifyHistorial.Rows[0]["IdHistorialMedico"];
                            mIdPaciente        = (int)lDtVerifyHistorial.Rows[0]["CodPaciente"];
                            fillData();
                            fillDataExamenFisico(mIdHistorialMedico);
                            fillDtgHistorialMedico();
                        }
                        else
                        {
                            ControlOperation.alertWarning("El Paciente no tiene exámen físico realizado");
                        }
                    }
                }
                catch (Exception ex)
                {
                    ControlOperation.alertWarning("Error:--> " + ex);
                }
            }
        }
        public ActionResult AgregarcmMedico(HistorialMedico hMedico)
        {
            #region ViewBag
            List <SelectListItem> lst = new List <SelectListItem>();

            lst.Add(new SelectListItem {
                Text = "Si", Value = "1"
            });
            lst.Add(new SelectListItem {
                Text = "No", Value = "2"
            });

            ViewBag.Opciones = lst;
            #endregion

            if (ModelState.IsValid)
            {
                Cliente.AgregarhistorialMedico(hMedico);
                return(RedirectToAction("medidasMantenimiento"));
            }

            return(View());
        }
        public static string CargarHistorialMed(string ced)
        {
            string          txt = "";
            HistorialMedico hm  = manejador.TraerHistorial(ced);

            if (hm != null)
            {
                string l = "";
                string f = "";
                if (hm.ConsumeLicor == 1)
                {
                    l = "Sí";
                }
                else
                {
                    l = "No";
                }
                if (hm.Fuma == 1)
                {
                    f = "Sí";
                }
                else
                {
                    f = "No";
                }
                txt +=
                    "Antecedentes Familiares: " + hm.Antecedentes + "<br />Patologías que padece: " + hm.Patologias + "<br /> Consume Licor: " + l + ", Frecuencia: " + hm.FrecLicor + "</div><div class=\"col-50\">" +
                    "Fuma: " + f + ", Frecuencia: " + hm.FrecFuma + "<br />Fecha de últimos exámenes de sangre o revisión médica: " + hm.UltimoExamen.ToString("dd/MM/yyyy") +
                    "</div></div><div class=\"row\"><div class=\"col-75\">Medicamentos o suplementos que consume:<br />" + CargarSuplemnto(ced);
            }
            else
            {
                txt = "No existe registro de historial médico.";
            }

            return(txt);
        }
Exemplo n.º 29
0
        public ActionResult ActualizarHistorialMedico(HistorialMedico historialMedico, string checkAntecedentes)
        {
            string actualizado = "si";

            try
            {
                HistorialMedico          histMedDB        = context.HistorialMedico.ToList().Where(x => x.ID == historialMedico.ID).FirstOrDefault();
                HistorialMedicoHistorial histMedHistorial = new HistorialMedicoHistorial();
                List <Antecedente>       antecedentes     = JsonConvert.DeserializeObject <List <Antecedente> >(checkAntecedentes).ToList();

                histMedHistorial.Pulmonares         = histMedDB.Pulmonares;
                histMedHistorial.Digestivos         = histMedDB.Digestivos;
                histMedHistorial.Diabetes           = histMedDB.Diabetes;
                histMedHistorial.Renales            = histMedDB.Renales;
                histMedHistorial.Quirurjicos        = histMedDB.Quirurjicos;
                histMedHistorial.Alergicos          = histMedDB.Alergicos;
                histMedHistorial.Transfuciones      = histMedDB.Transfuciones;
                histMedHistorial.Alcohol            = histMedDB.Alcohol;
                histMedHistorial.Tabaquismo         = histMedDB.Tabaquismo;
                histMedHistorial.Drogas             = histMedDB.Drogas;
                histMedHistorial.Inmunizaciones     = histMedDB.Inmunizaciones;
                histMedHistorial.Cardiovascular     = histMedDB.Cardiovascular;
                histMedHistorial.Sala               = histMedDB.Sala;
                histMedHistorial.Cuarto             = histMedDB.Cuarto;
                histMedHistorial.MotivoConsulta     = histMedDB.MotivoConsulta;
                histMedHistorial.Medicamentos       = histMedDB.Medicamentos;
                histMedHistorial.Especifique        = histMedDB.Especifique;
                histMedHistorial.OtrosNoPatologicos = histMedDB.OtrosNoPatologicos;
                histMedHistorial.Fecha              = DateTime.Now;
                histMedHistorial.HistorialMedicoID  = histMedDB.ID;
                context.HistorialMedicoHistorial.Add(histMedHistorial);
                context.SaveChanges();


                histMedDB.Pulmonares         = antecedentes.Where(x => x.nombre == "PULMONARES").FirstOrDefault().estado;
                histMedDB.Digestivos         = antecedentes.Where(x => x.nombre == "DIGESTIVOS").FirstOrDefault().estado;
                histMedDB.Diabetes           = antecedentes.Where(x => x.nombre == "DIABETES").FirstOrDefault().estado;
                histMedDB.Renales            = antecedentes.Where(x => x.nombre == "RENALES").FirstOrDefault().estado;
                histMedDB.Quirurjicos        = antecedentes.Where(x => x.nombre == "QUIRURJICOS").FirstOrDefault().estado;
                histMedDB.Alergicos          = antecedentes.Where(x => x.nombre == "ALERGICOS").FirstOrDefault().estado;
                histMedDB.Transfuciones      = antecedentes.Where(x => x.nombre == "TRANSFUCIONES").FirstOrDefault().estado;
                histMedDB.Alcohol            = antecedentes.Where(x => x.nombre == "ALCOHOL").FirstOrDefault().estado;
                histMedDB.Tabaquismo         = antecedentes.Where(x => x.nombre == "TABAQUISMO").FirstOrDefault().estado;
                histMedDB.Drogas             = antecedentes.Where(x => x.nombre == "DROGAS").FirstOrDefault().estado;
                histMedDB.Inmunizaciones     = antecedentes.Where(x => x.nombre == "INMUNIZACIONES").FirstOrDefault().estado;
                histMedDB.Cardiovascular     = antecedentes.Where(x => x.nombre == "CARDIOVASCULAR").FirstOrDefault().estado;
                histMedDB.Sala               = historialMedico.Sala;
                histMedDB.Cuarto             = historialMedico.Cuarto;
                histMedDB.MotivoConsulta     = historialMedico.MotivoConsulta;
                histMedDB.Medicamentos       = historialMedico.Medicamentos;
                histMedDB.Especifique        = historialMedico.Especifique;
                histMedDB.OtrosNoPatologicos = historialMedico.OtrosNoPatologicos;
                histMedDB.MODIFICADO         = DateTime.Now;
                context.SaveChanges();
            }
            catch (Exception e)
            {
                actualizado = "no";
            }

            TempData["Actualizado"] = actualizado;

            return(RedirectToAction("HistorialMedico"));
        }
Exemplo n.º 30
0
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                HistorialMedico ds = new HistorialMedico();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "HistorialDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }