public List <HistoriaMedica> GetHistoriasMedicas(
            int idPaciente,
            DateTime fechaIngreso,
            int idTipoVisa,
            string codigoSolicitud,
            bool tieneRevisonLab,
            bool showAllTieneRevisonLab,
            Constants.EstadoRevision estadoRevisionLab,
            bool showAllEstadoRevisionLab,
            bool tieneRevisionRad,
            bool showAllTieneRevisionRad,
            Constants.EstadoRevision estadoRevisionRad,
            bool showAllEstadoRevisionRad,
            bool tieneRevisionMed,
            bool showAllTieneRevisionMed,
            Constants.EstadoRevision estadoRevisionMed,
            bool showAllEstadoRevisionMed,
            bool finalizada,
            bool showAllFinalizada,
            bool liberado,
            bool showAllLiberado,
            int idMedico)
        {
            HistoriaMedicaDao     historiaMedicaDao = new HistoriaMedicaDao();
            List <HistoriaMedica> historiaMedicas   = historiaMedicaDao.GetHistoriaMedicas(idPaciente, fechaIngreso, idTipoVisa, codigoSolicitud, tieneRevisonLab, showAllTieneRevisonLab, estadoRevisionLab, showAllEstadoRevisionLab, tieneRevisionRad, showAllTieneRevisionRad, estadoRevisionRad, showAllEstadoRevisionRad, tieneRevisionMed, showAllTieneRevisionMed, estadoRevisionMed, showAllEstadoRevisionMed, finalizada, showAllFinalizada, liberado, showAllLiberado, idMedico);

            this.error = historiaMedicaDao.Error;
            return(historiaMedicas);
        }
Пример #2
0
        public List <HistoriaMedica> GetHistoriaMedicas(
            int idPaciente,
            DateTime fechaIngreso,
            int idTipoVisa,
            string codigoSolicitud,
            bool tieneRevisonLab,
            bool showAllTieneRevisonLab,
            Constants.EstadoRevision estadoRevisionLab,
            bool showAllEstadoRevisionLab,
            bool tieneRevisionRad,
            bool showAllTieneRevisionRad,
            Constants.EstadoRevision estadoRevisionRad,
            bool showAllEstadoRevisionRad,
            bool tieneRevisionMed,
            bool showAllTieneRevisionMed,
            Constants.EstadoRevision estadoRevisionMed,
            bool showAllEstadoRevisionMed,
            bool finalizada,
            bool showAllFinalizada,
            bool liberado,
            bool showAllLiberado,
            int idMedico)
        {
            List <HistoriaMedica> historiaMedicaList = new List <HistoriaMedica>();

            try
            {
                foreach (DataRow row in (InternalDataCollectionBase)this.GetList(idPaciente, fechaIngreso, idTipoVisa, codigoSolicitud, tieneRevisonLab, showAllTieneRevisonLab, estadoRevisionLab, showAllEstadoRevisionLab, tieneRevisionRad, showAllTieneRevisionRad, estadoRevisionRad, showAllEstadoRevisionRad, tieneRevisionMed, showAllTieneRevisionMed, estadoRevisionMed, showAllEstadoRevisionMed, finalizada, showAllFinalizada, liberado, showAllLiberado, idMedico).Rows)
                {
                    HistoriaMedica objToLoad = new HistoriaMedica();
                    this.LoadFromDataRow(ref objToLoad, row);
                    historiaMedicaList.Add(objToLoad);
                }
            }
            catch (Exception ex)
            {
                this.error = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
            }
            return(historiaMedicaList);
        }
Пример #3
0
        public DataTable GetList(
            int idPaciente,
            DateTime fechaIngreso,
            int idTipoVisa,
            string codigoSolicitud,
            bool tieneRevisonLab,
            bool showAllTieneRevisonLab,
            Constants.EstadoRevision estadoRevisionLab,
            bool showAllEstadoRevisionLab,
            bool tieneRevisionRad,
            bool showAllTieneRevisionRad,
            Constants.EstadoRevision estadoRevisionRad,
            bool showAllEstadoRevisionRad,
            bool tieneRevisionMed,
            bool showAllTieneRevisionMed,
            Constants.EstadoRevision estadoRevisionMed,
            bool showAllEstadoRevisionMed,
            bool finalizada,
            bool showAllfinalizada,
            bool liberado,
            bool showAllLiberado,
            int idMedico)
        {
            DataTable dtEstructure = HistoriaMedicaDao.DtEstructure;

            try
            {
                DbConnection connection = this.instance.CreateConnection();
                try
                {
                    connection.Open();
                    DbCommand storedProcCommand = this.instance.GetStoredProcCommand("PA_HISTORIA_MEDICA_GET_LIST");
                    storedProcCommand.Connection = connection;
                    if (idPaciente != int.MinValue)
                    {
                        this.instance.AddInParameter(storedProcCommand, "@ID_PACIENTE", DbType.Int32, (object)idPaciente);
                    }
                    else
                    {
                        this.instance.AddInParameter(storedProcCommand, "@ID_PACIENTE", DbType.Int32, (object)DBNull.Value);
                    }
                    if (fechaIngreso != DateTime.MinValue)
                    {
                        this.instance.AddInParameter(storedProcCommand, "@FECHA_INGRESO", DbType.DateTime, (object)fechaIngreso);
                    }
                    else
                    {
                        this.instance.AddInParameter(storedProcCommand, "@FECHA_INGRESO", DbType.DateTime, (object)DBNull.Value);
                    }
                    if (idTipoVisa != int.MinValue)
                    {
                        this.instance.AddInParameter(storedProcCommand, "@ID_TIPO_VISA", DbType.Int32, (object)idTipoVisa);
                    }
                    else
                    {
                        this.instance.AddInParameter(storedProcCommand, "@ID_TIPO_VISA", DbType.Int32, (object)DBNull.Value);
                    }
                    if (codigoSolicitud != string.Empty)
                    {
                        this.instance.AddInParameter(storedProcCommand, "@CODIGO_SOLICITUD", DbType.String, (object)codigoSolicitud);
                    }
                    else
                    {
                        this.instance.AddInParameter(storedProcCommand, "@CODIGO_SOLICITUD", DbType.String, (object)DBNull.Value);
                    }
                    if (!showAllTieneRevisonLab)
                    {
                        this.instance.AddInParameter(storedProcCommand, "@TIENE_REVISON_LAB", DbType.Boolean, (object)tieneRevisonLab);
                    }
                    else
                    {
                        this.instance.AddInParameter(storedProcCommand, "@TIENE_REVISON_LAB", DbType.Boolean, (object)DBNull.Value);
                    }
                    if (!showAllEstadoRevisionLab)
                    {
                        this.instance.AddInParameter(storedProcCommand, "@ESTADO_REVISION_LAB", DbType.Int16, (object)Convert.ToInt16((object)estadoRevisionLab));
                    }
                    else
                    {
                        this.instance.AddInParameter(storedProcCommand, "@ESTADO_REVISION_LAB", DbType.Int16, (object)DBNull.Value);
                    }
                    if (!showAllTieneRevisionRad)
                    {
                        this.instance.AddInParameter(storedProcCommand, "@TIENE_REVISION_RAD", DbType.Boolean, (object)tieneRevisionRad);
                    }
                    else
                    {
                        this.instance.AddInParameter(storedProcCommand, "@TIENE_REVISION_RAD", DbType.Boolean, (object)DBNull.Value);
                    }
                    if (!showAllEstadoRevisionRad)
                    {
                        this.instance.AddInParameter(storedProcCommand, "@ESTADO_REVISION_RAD", DbType.Int16, (object)Convert.ToInt16((object)estadoRevisionRad));
                    }
                    else
                    {
                        this.instance.AddInParameter(storedProcCommand, "@ESTADO_REVISION_RAD", DbType.Int16, (object)DBNull.Value);
                    }
                    if (!showAllTieneRevisionMed)
                    {
                        this.instance.AddInParameter(storedProcCommand, "@TIENE_REVISION_MED", DbType.Boolean, (object)tieneRevisionMed);
                    }
                    else
                    {
                        this.instance.AddInParameter(storedProcCommand, "@TIENE_REVISION_MED", DbType.Boolean, (object)DBNull.Value);
                    }
                    if (!showAllEstadoRevisionMed)
                    {
                        this.instance.AddInParameter(storedProcCommand, "@ESTADO_REVISION_MED", DbType.Int16, (object)Convert.ToInt16((object)estadoRevisionMed));
                    }
                    else
                    {
                        this.instance.AddInParameter(storedProcCommand, "@ESTADO_REVISION_MED", DbType.Int16, (object)DBNull.Value);
                    }
                    if (!showAllfinalizada)
                    {
                        this.instance.AddInParameter(storedProcCommand, "@FINALIZADA", DbType.Boolean, (object)finalizada);
                    }
                    else
                    {
                        this.instance.AddInParameter(storedProcCommand, "@FINALIZADA", DbType.Boolean, (object)DBNull.Value);
                    }
                    if (!showAllLiberado)
                    {
                        this.instance.AddInParameter(storedProcCommand, "@LIBERADO", DbType.Boolean, (object)liberado);
                    }
                    else
                    {
                        this.instance.AddInParameter(storedProcCommand, "@LIBERADO", DbType.Boolean, (object)DBNull.Value);
                    }
                    if (idMedico != int.MinValue)
                    {
                        this.instance.AddInParameter(storedProcCommand, "@ID_MEDICO ", DbType.Int32, (object)idMedico);
                    }
                    else
                    {
                        this.instance.AddInParameter(storedProcCommand, "@ID_MEDICO ", DbType.Int32, (object)DBNull.Value);
                    }
                    DbDataAdapter dataAdapter = this.instance.GetDataAdapter();
                    dataAdapter.SelectCommand = storedProcCommand;
                    dataAdapter.Fill(dtEstructure);
                }
                catch (Exception ex)
                {
                    this.error = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                }
                finally
                {
                    connection.Close();
                }
            }
            catch (Exception ex)
            {
                this.error = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
            }
            return(dtEstructure);
        }