Example #1
0
 public function obtenerBD($idIncidencia)
 {
     $sql = "SELECT * FROM [incidencia] WHERE idIncidencia = " . $idIncidencia . ";";
     $consulta = ejecutaQueryClases($sql);
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
     } else {
         $tabla = devuelveRowAssoc($consulta);
         $this->idIncidencia = $tabla["idControl"];
         $this->idUsuario = $tabla["idDiagnostico"];
         $this->idCatEstadoIncidencia = $tabla["fecha"];
         $this->contenido = $tabla["contenido"];
         $this->fechaCaptura = $tabla["fechaCaptura"];
     }
 }
Example #2
0
 function imprimir()
 {
     $sql = "SELECT e.nombre AS estado, j.nombre AS jurisdiccion FROM catJurisdiccion j, catEstado e WHERE j.idCatEstado = e.idCatEstado AND e.idCatEstado = " . $this->idCatEstado . " AND j.idCatJurisdiccion = " . $this->idCatJurisdiccion . ";";
     if ($this->idCatJurisdiccion == 0) {
         $sql = "SELECT e.nombre AS estado FROM catEstado e WHERE e.idCatEstado = " . $this->idCatEstado . ";";
     }
     $jurisdiccion = "";
     $estado = "";
     $consulta = ejecutaQueryClases($sql);
     if (!is_string($consulta)) {
         $tabla = devuelveRowAssoc($consulta);
         $estado = $tabla["estado"];
         $jurisdiccion = "Estatal";
         if ($this->idCatJurisdiccion != 0) {
             $jurisdiccion = "Jurisdicción #" . $this->idCatJurisdiccion . " " . $tabla["jurisdiccion"];
         }
     }
     echo '<DIV CLASS="datagrid"><TABLE><THEAD><TR><TH COLSPAN="5">' . $estado . "<BR>" . $jurisdiccion . '</TH></TR>' . '<TR><TH>Indicador</TH><TH>Estándar</TH><TH>Resultado</TH><TH>Ponderacion</TH><TH>Índice</TH></TR></THEAD>' . '<TR><TD>' . $this->nombre . '</TD><TD>' . $this->estandar . "%" . '</TD><TD>' . $this->resultado . '</TD><TD>' . $this->ponderacion . '</TD><TD>' . $this->indice . '</TD></TR></TABLE></DIV>';
 }
Example #3
0
 public function obtenerBD($idContacto)
 {
     $sql = "SELECT [idControlContacto],[fecha],[idCatRevisionContacto],[observaciones] \n                FROM [controlContacto] WHERE [idContacto]=" . (int) $idContacto . " ORDER BY [fecha] ASC";
     $consulta = ejecutaQueryClases($sql);
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
     } else {
         $this->idContacto = $idContacto;
         $this->arrRevisionContacto = null;
         while ($registro = devuelveRowAssoc($consulta)) {
             $objRevision = new RevisionContacto();
             $objRevision->idControlContacto = $registro['idControlContacto'];
             $objRevision->fecha = formatFechaObj($registro['fecha']);
             $objRevision->idCatRevisionContacto = $registro['idCatRevisionContacto'];
             $objRevision->observaciones = $registro['observaciones'];
             $this->arrRevisionContacto[] = $objRevision;
         }
     }
 }
 public function obtenerBD($idPaciente, $fIni, $fFin, $idCatTipoEstudioDia, $idCatEstado, $idCatJurisdiccionLaboratorio)
 {
     $sql = "SELECT p.idPaciente, d.idDiagnostico, p.nombre, p.apellidoPaterno, p.apellidoMaterno, s.sexo, p.fechaNacimiento, \n\t\t\t\t\tb.folioLaboratorio, p.calle, p.noExterior, p.noInterior, p.colonia, l.nombre AS localidad, p.fechaDiagnostico, cb.descripcion as bac, b.bacIM, \n\t\t\t\t\tll.nombre AS LocalidadUnidad " . "FROM pacientes p, diagnostico d, estudiosBac b, catLocalidad l, catUnidad u, catLocalidad ll, catSexo s, catBaciloscopia cb " . "WHERE p.idPaciente = d.idPaciente " . "AND p.sexo = s.idSexo " . "AND cb.idCatBaciloscopia = b.idCatBac " . "AND l.idCatLocalidad = p.idCatLocalidad " . "AND l.idCatEstado = p.idCatEstado " . "AND l.idCatMunicipio = p.idCatMunicipio " . "AND u.idCatUnidad = p.idCatUnidadNotificante " . "AND u.idCatLocalidad = ll.idCatLocalidad " . "AND u.idCatEstado = ll.idCatEstado " . "AND u.idCatMunicipio = ll.idCatMunicipio " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaSolicitud BETWEEN '" . $fIni . "' AND '" . $fFin . "' " . "AND b.idCatTipoEstudio = " . $idCatTipoEstudioDia . " " . "AND b.bacIM IS NOT NULL " . "AND b.idCatEstadoLaboratorio = " . $idCatEstado . " " . "AND p.idPaciente = " . $idPaciente . " ";
     //"AND b.idCatJurisdiccionLaboratorio = " . $idCatJurisdiccionLaboratorio . ";";
     $consulta = ejecutaQueryClases($sql);
     //echo $sql.'<br><br>';
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql . '<br><br>';
     } else {
         $tabla = devuelveRowAssoc($consulta);
         if (!empty($tabla["idPaciente"])) {
             $this->idPaciente = $tabla["idPaciente"];
             $this->idDiagnostico = $tabla["idDiagnostico"];
             $this->folioLaboratorio = $tabla["folioLaboratorio"];
             $this->nombreCompleto = $tabla["nombre"] . " " . $tabla["apellidoPaterno"] . " " . $tabla["apellidoMaterno"];
             $this->edad = calEdad(formatFechaObj($tabla["fechaNacimiento"], 'Y-m-d'));
             $this->sexo = $tabla["sexo"];
             $this->domicilio = $tabla["calle"] . " " . $tabla["noExterior"] . " " . $tabla["noInterior"] . " " . $tabla["colonia"] . " " . $tabla["localidad"];
             $this->fechaDiagnostico = formatFechaObj($tabla["fechaDiagnostico"]);
             $this->Baciloscopia = 'IB: ' . $tabla["bac"] . ' <br>IM: ' . $tabla['bacIM'] . '%';
             $this->localizacionUnidadMedica = $tabla["LocalidadUnidad"];
             $sql = "SELECT TOP 1 h.idCatHisto, ch.descripcion FROM estudiosHis h, catHistopatologia ch, diagnostico d WHERE h.idCatHisto = ch.idCatHisto " . "AND d.idPaciente = " . $idPaciente . " AND h.idCatTipoEstudio = " . $idCatTipoEstudioDia . " AND d.idDiagnostico = h.idDiagnostico ORDER BY h.fechaSolicitud desc;";
             $consulta = ejecutaQueryClases($sql);
             //echo $sql.'<br><br>';
             if (is_string($consulta)) {
                 $this->error = true;
                 $this->msgError = $consulta . " SQL:" . $sql . '<br><br>';
             } else {
                 $tabla = devuelveRowAssoc($consulta);
                 $this->histopatologia = $tabla["descripcion"];
             }
         }
     }
 }
Example #5
0
File: Sis.php Project: p4scu41/sail
 public function levantarDatos()
 {
     $timTem = strtotime($this->fechaIni);
     $mesIni = date("F", $timTem);
     $anoIni = date("Y", $timTem);
     $timTem = strtotime($this->fechaFin);
     $mesFin = date("F", $timTem);
     $anoFin = date("Y", $timTem);
     $sql = "SELECT u.idCatUnidad " . "FROM catUnidad u, catJurisdiccion j, catMunicipio m " . "WHERE u.idCatEstado = j.idCatEstado " . "AND m.idCatEstado = j.idCatEstado " . "AND j.idCatJurisdiccion = m.idCatJurisdiccion " . "AND m.idCatMunicipio = u.idCatMunicipio " . "AND j.idCatEstado = " . $this->idCatEstado;
     if (!is_null($this->idCatJurisdiccion) && $this->idCatJurisdiccion != 0) {
         $sql .= "AND j.idCatJurisdiccion = " . $this->idCatJurisdiccion . " ";
     }
     if (!is_null($this->idCatMunicipio) && $this->idCatMunicipio != 0) {
         $sql .= "AND m.idCatMunicipio = " . $this->idCatMunicipio . " ";
     }
     if (!is_null($this->idCatUnidad) && $this->idCatUnidad != 0) {
         $this->clues = array($this->idCatUnidad);
     } else {
         $sql .= ";";
         $result = ejecutaQueryClases($sql);
         if (is_string($result)) {
             $this->error = true;
             $this->msgError = $result . " SQL:" . $sql;
         } else {
             $arr = array();
             $c = 0;
             while ($registro = devuelveRowAssoc($result)) {
                 $arr[$c] = $registro['idCatTipoLesion'];
                 $c++;
             }
             $this->clues = $arr;
         }
     }
     try {
         $noFila = 1;
         if (($handler = fopen($this->ubicacionBD . $this->idCatEstado . ".csv", "r")) !== FALSE) {
             while (($fila = fgetcsv($handler, 1000, ",")) !== FALSE) {
                 foreach ($this->clues as $clue) {
                     if ($clue == $fila[self::$noColumnaClues] && ($mesIni >= $fila[self::$noColumnaMes] && $anoIni >= $fila[self::$noColumnaAno]) && ($mesFin <= $fila[self::$noColumnaMes] && $anoFin <= $fila[self::$noColumnaAno])) {
                         if ($fila[self::$noColumnaIndice] == $claveIngCon) {
                             $this->ingCon += (int) $fila[self::$noColumnaCasos];
                         } elseif ($fila[self::$noColumnaIndice] == $claveReiCon) {
                             $this->reiCon += (int) $fila[self::$noColumnaCasos];
                         } elseif ($fila[self::$noColumnaIndice] == $claveConTx) {
                             $this->conTx += (int) $fila[self::$noColumnaCasos];
                         } elseif ($fila[self::$noColumnaIndice] == $claveSinTx) {
                             $this->sinTx += (int) $fila[self::$noColumnaCasos];
                         } elseif ($fila[self::$noColumnaIndice] == $claveVigPosTx) {
                             $this->vigPosTx += (int) $fila[self::$noColumnaCasos];
                         } elseif ($fila[self::$noColumnaIndice] == $claveBacDiaPos) {
                             $this->bacDiaPos += (int) $fila[self::$noColumnaCasos];
                         } elseif ($fila[self::$noColumnaIndice] == $claveBacDiaNeg) {
                             $this->bacDiaNeg += (int) $fila[self::$noColumnaCasos];
                         } elseif ($fila[self::$noColumnaIndice] == $claveBacConPos) {
                             $this->bacConPos += (int) $fila[self::$noColumnaCasos];
                         } elseif ($fila[self::$noColumnaIndice] == $claveBacConNeg) {
                             $this->bacConNeg += (int) $fila[self::$noColumnaCasos];
                         }
                     }
                 }
             }
             fclose($handler);
         } else {
             $this->error = true;
             $this->msgError = "No fue posible abrir el archivo " . $this->ubicacionBD . $this->idCatEstado . ".csv ";
         }
     } catch (Exception $e) {
         $this->error = true;
         $this->msgError = "Error al acceder al archivo: " . $e->getMessage();
     }
 }
Example #6
0
 public function getAllEstudiosHisFromPaciente($idPaciente)
 {
     $sql = 'SELECT [idEstudioHis] FROM [estudiosHis] WHERE [idPaciente]=' . $idPaciente;
     $arreglo = null;
     $result = ejecutaQueryClases($sql);
     if (is_string($result)) {
         $this->error = true;
         $this->msgError = $result . " SQL:" . $sql;
     } else {
         $registro = devuelveRowAssoc($result);
         $arreglo[] = $registro['idEstudioHis'];
     }
     return $arreglo;
 }
Example #7
0
 public function getRecepMuestraHis()
 {
     $arrEstudios = array();
     $sql = 'SELECT [idDiagnostico]
             ,[idContacto]
             ,[idPaciente]
             ,[idEstudioHis]
             ,[fechaRecepcion]
             ,[folioLaboratorio]
             ,[folioSolicitud]
             ,[idCatSolicitante]
             ,[idCatTipoEstudio]
             ,[fechaTomaMuestra]
             ,[fechaSolicitud]
             ,[fechaSolicitudEstudio]
             ,[muestraRechazada]
             ,[idCatMotivoRechazo]
             ,[otroMotivoRechazo]
       FROM [estudiosHis]
       WHERE [folioLaboratorio] IS NULL AND 
            [idCatSolicitante] IN 
                 (SELECT [idCatUnidad] FROM [catUnidad] WHERE 1=1 ';
     if ($_SESSION[EDO_USR_SESSION] != 0) {
         $sql .= ' AND [idCatEstado]=' . $_SESSION[EDO_USR_SESSION];
     }
     $sql .= ')';
     $result = ejecutaQueryClases($sql);
     if (is_string($result)) {
         return array();
     } else {
         $help = new Helpers();
         while ($registro = devuelveRowAssoc($result)) {
             if (!empty($registro['idContacto'])) {
                 $temp = devuelveRowAssoc(ejecutaQueryClases('SELECT [nombre] FROM [contactos] WHERE [idContacto]=' . $registro['idContacto']));
                 $temp['cveExpediente'] = 'Estudio de Contacto';
             } else {
                 if (!empty($registro['idPaciente'])) {
                     $temp = devuelveRowAssoc(ejecutaQueryClases('SELECT ([nombre]+\' \'+[apellidoPaterno]+\' \'+[apellidoMaterno]) AS nombre, cveExpediente 
                         FROM [pacientes] WHERE idPaciente = ' . $registro['idPaciente']));
                 } else {
                     if (!empty($registro['idDiagnostico'])) {
                         $temp = devuelveRowAssoc(ejecutaQueryClases('SELECT ([nombre]+\' \'+[apellidoPaterno]+\' \'+[apellidoMaterno]) AS nombre, cveExpediente 
                         FROM [pacientes] WHERE idPaciente = 
                         (SELECT [idPaciente] FROM [diagnostico] WHERE [idDiagnostico]=' . $registro['idDiagnostico'] . ')'));
                     }
                 }
             }
             $arrEstudios[] = array('id' => $registro['idEstudioHis'], 'folio_solicitud' => $registro['folioSolicitud'], 'clave_paciente' => $temp['cveExpediente'], 'nombre' => $temp['nombre'], 'solicitante' => $registro['idCatSolicitante'] . ' ' . $help->getNameUnidad($registro['idCatSolicitante']), 'fecha_muestreo' => formatFechaObj($registro['fechaTomaMuestra']), 'fecha_solicitud' => formatFechaObj($registro['fechaSolicitudEstudio']), 'tipo_analisis' => 'Histopatólogia', 'estudio' => $help->getDescripTipoEstudio($registro['idCatTipoEstudio']), 'tipo' => 'histo');
         }
     }
     return $arrEstudios;
 }
Example #8
0
 function imprimir()
 {
     $sql = "SELECT p.idCatUnidadTratante, u.nombreUnidad, u.nombreLocalidad " . "FROM pacientes p, catUnidad u " . "WHERE p.fechaDiagnostico BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "' " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatUnidadTratante = u.idCatUnidad " . "GROUP BY p.idCatUnidadTratante, u.nombreUnidad, u.nombreLocalidad " . "ORDER BY u.nombreUnidad ";
     if ($this->idCatJurisdiccion != 0) {
         $sql = "SELECT p.idCatUnidadTratante, u.nombreUnidad, u.nombreLocalidad " . "FROM pacientes p, catUnidad u, catMunicipio m " . "WHERE p.fechaDiagnostico BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "' " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatUnidadTratante = u.idCatUnidad " . "AND p.idCatEstado = m.idCatEstado " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatJurisdiccion = " . $this->idCatJurisdiccion . " " . "GROUP BY p.idCatUnidadTratante, u.nombreUnidad, u.nombreLocalidad, m.idCatJurisdiccion  " . "ORDER BY m.idCatJurisdiccion, u.nombreUnidad ";
     }
     $consulta = ejecutaQueryClases($sql);
     //echo '<BR>'. $sql;
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
     } else {
         echo '<DIV CLASS="datagrid"><TABLE>';
         echo '<THEAD><TR><TH COLSPAN="3">Unidad</TH><TH COLSPAN="2">< 1 a&ntilde;o</TH><TH COLSPAN="2">1-4</TH><TH COLSPAN="2">5-9</TH><TH COLSPAN="2">10-14</TH><TH COLSPAN="2">15-19</TH><TH COLSPAN="2">20-24</TH><TH COLSPAN="2">25-44</TH><TH COLSPAN="2">45-49</TH><TH COLSPAN="2">50-59</TH><TH COLSPAN="2">60-64</TH><TH COLSPAN="2">65 y ></TH><TH COLSPAN="2">Ign</TH><TH COLSPAN="2">total</TH><TH></TH></TR>';
         echo '<TR><TH>Clave</TH><TH>Nombre</TH><TH>Localidad</TH><TH>M</TH><TH>F</TH><TH>M</TH><TH>F</TH><TH>M</TH><TH>F</TH><TH>M</TH><TH>F</TH><TH>M</TH><TH>F</TH><TH>M</TH><TH>F</TH><TH>M</TH><TH>F</TH><TH>M</TH><TH>F</TH><TH>M</TH><TH>F</TH><TH>M</TH><TH>F</TH><TH>M</TH><TH>F</TH><TH>M</TH><TH>F</TH><TH>M</TH><TH>F</TH><TH>Total</TH></TR></THEAD>';
         $m1 = 0;
         $f1 = 0;
         $m1_4 = 0;
         $f1_4 = 0;
         $m5_9 = 0;
         $f5_9 = 0;
         $m10_14 = 0;
         $f10_14 = 0;
         $m15_19 = 0;
         $f15_19 = 0;
         $m20_24 = 0;
         $f20_24 = 0;
         $m25_44 = 0;
         $f25_44 = 0;
         $m45_49 = 0;
         $f45_49 = 0;
         $m50_59 = 0;
         $f50_59 = 0;
         $m60_64 = 0;
         $f60_64 = 0;
         $m65 = 0;
         $f65 = 0;
         while ($tabla = devuelveRowAssoc($consulta)) {
             $uniVal = $this->arrUnidades[$tabla["idCatUnidadTratante"]];
             echo '<TR><TD>' . $tabla["idCatUnidadTratante"] . '</TD><TD>' . $tabla["nombreUnidad"] . '</TD><TD>' . $tabla["nombreLocalidad"] . '</TD><TD>' . $uniVal->m1 . '</TD><TD>' . $uniVal->f1 . '</TD><TD>' . $uniVal->m1_4 . '</TD><TD>' . $uniVal->f1_4 . '</TD><TD>' . $uniVal->m5_9 . '</TD><TD>' . $uniVal->f5_9 . '</TD><TD>' . $uniVal->m10_14 . '</TD><TD>' . $uniVal->f10_14 . '</TD><TD>' . $uniVal->m15_19 . '</TD><TD>' . $uniVal->f15_19 . '</TD><TD>' . $uniVal->m20_24 . '</TD><TD>' . $uniVal->f20_24 . '</TD><TD>' . $uniVal->m25_44 . '</TD><TD>' . $uniVal->f25_44 . '</TD><TD>' . $uniVal->m45_49 . '</TD><TD>' . $uniVal->f45_49 . '</TD><TD>' . $uniVal->m50_59 . '</TD><TD>' . $uniVal->f50_59 . '</TD><TD>' . $uniVal->m60_64 . '</TD><TD>' . $uniVal->f60_64 . '</TD><TD>' . $uniVal->m65 . '</TD><TD>' . $uniVal->f65 . '</TD><TD>0</TD><TD>0' . '</TD><TD>' . ($uniVal->m1 + $uniVal->m1_4 + $uniVal->m5_9 + $uniVal->m10_14 + $uniVal->m15_19 + $uniVal->m20_24 + $uniVal->m25_44 + $uniVal->m45_49 + $uniVal->m50_59 + $uniVal->m60_64 + $uniVal->m65) . '</TD><TD>' . ($uniVal->f1 + $uniVal->f1_4 + $uniVal->f5_9 + $uniVal->f10_14 + $uniVal->f15_19 + $uniVal->f20_24 + $uniVal->f25_44 + $uniVal->f45_49 + $uniVal->f50_59 + $uniVal->f60_64 + $uniVal->f65) . '</TD><TD>' . ($uniVal->m1 + $uniVal->m1_4 + $uniVal->m5_9 + $uniVal->m10_14 + $uniVal->m15_19 + $uniVal->m20_24 + $uniVal->m25_44 + $uniVal->m45_49 + $uniVal->m50_59 + $uniVal->m60_64 + $uniVal->m65 + $uniVal->f1 + $uniVal->f1_4 + $uniVal->f5_9 + $uniVal->f10_14 + $uniVal->f15_19 + $uniVal->f20_24 + $uniVal->f25_44 + $uniVal->f45_49 + $uniVal->f50_59 + $uniVal->f60_64 + $uniVal->f65) . '</TR>';
             $m1 += $uniVal->m1;
             $f1 += $uniVal->f1;
             $m1_4 += $uniVal->m1_4;
             $f1_4 += $uniVal->f1_4;
             $m5_9 += $uniVal->m5_9;
             $f5_9 += $uniVal->f5_9;
             $m10_14 += $uniVal->m10_14;
             $f10_14 += $uniVal->f10_14;
             $m15_19 += $uniVal->m15_19;
             $f15_19 += $uniVal->f15_19;
             $m20_24 += $uniVal->m20_24;
             $f20_24 += $uniVal->f20_24;
             $m25_44 += $uniVal->m25_44;
             $f25_44 += $uniVal->f25_44;
             $m45_49 += $uniVal->m45_49;
             $f45_49 += $uniVal->f45_49;
             $m50_59 += $uniVal->m50_59;
             $f50_59 += $uniVal->f50_59;
             $m60_64 += $uniVal->m60_64;
             $f60_64 += $uniVal->f60_64;
             $m65 += $uniVal->m65;
             $f65 += $uniVal->f65;
         }
         echo '<TFOOT><TR><TD COLSPAN="3">TOTAL</TD>' . '</TD><TD>' . $m1 . '</TD><TD>' . $f1 . '</TD><TD>' . $m1_4 . '</TD><TD>' . $f1_4 . '</TD><TD>' . $m5_9 . '</TD><TD>' . $f5_9 . '</TD><TD>' . $m10_14 . '</TD><TD>' . $f10_14 . '</TD><TD>' . $m15_19 . '</TD><TD>' . $f15_19 . '</TD><TD>' . $m20_24 . '</TD><TD>' . $f20_24 . '</TD><TD>' . $m25_44 . '</TD><TD>' . $f25_44 . '</TD><TD>' . $m45_49 . '</TD><TD>' . $f45_49 . '</TD><TD>' . $m50_59 . '</TD><TD>' . $f50_59 . '</TD><TD>' . $m60_64 . '</TD><TD>' . $f60_64 . '</TD><TD>' . $m65 . '</TD><TD>' . $f65 . '</TD><TD>0</TD><TD>0' . '</TD><TD>' . ($m1 + $m1_4 + $m5_9 + $m10_14 + $m15_19 + $m20_24 + $m25_44 + $m45_49 + $m50_59 + $m60_64 + $m65) . '</TD><TD>' . ($f1 + $f1_4 + $f5_9 + $f10_14 + $f15_19 + $f20_24 + $f25_44 + $f45_49 + $f50_59 + $f60_64 + $f65) . '</TD><TD>' . ($m1 + $m1_4 + $m5_9 + $m10_14 + $m15_19 + $m20_24 + $m25_44 + $m45_49 + $m50_59 + $m60_64 + $m65 + $f1 + $f1_4 + $f5_9 + $f10_14 + $f15_19 + $f20_24 + $f25_44 + $f45_49 + $f50_59 + $f60_64 + $f65) . '</TR></TFOOT>';
         echo '</TABLE></DIV>';
     }
 }
Example #9
0
 public function buscarCalidad()
 {
     $sql = "SELECT idEstudioHis as idEstudio, folioLaboratorio, folioSolicitud, personaSolicitudEstudio, fechaTomaMuestra, fechaSolicitudEstudio, idCatTipoEstudio, 'histo' AS tipo, estudiosHis.idDiagnostico, diagnostico.idPaciente as idPacienteDiag, estudiosHis.idPaciente, idContacto, fechaResultado  " . "FROM estudiosHis LEFT JOIN diagnostico ON diagnostico.idDiagnostico = estudiosHis.idDiagnostico " . "WHERE idCatSolicitante IN (SELECT idCatUnidad FROM catUnidad WHERE fechaResultado is NOT NULL ";
     if ($this->idCatEstado != 0) {
         $sql .= " AND idCatEstado = " . $this->idCatEstado;
     }
     $sql .= " ) ";
     if (!is_null($this->fechaInicio) && $this->fechaInicio != '') {
         $sql .= "AND fechaResultado >= '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' ";
     }
     if (!is_null($this->fechaFin) && $this->fechaFin != '') {
         $sql .= "AND fechaResultado <= '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "' ";
     }
     if (!is_null($this->folioLaboratorio) && $this->folioLaboratorio != '') {
         $sql .= "AND folioLaboratorio = '" . $this->folioLaboratorio . "' ";
     }
     if (!is_null($this->folioSolicitud) && $this->folioSolicitud != '') {
         $sql .= "AND folioSolicitud = '" . $this->folioSolicitud . "' ";
     }
     $sql .= " UNION " . "SELECT idEstudioBac as idEstudio,folioLaboratorio, folioSolicitud, personaSolicitudEstudio, fechaTomaMuestra, fechaSolicitudEstudio, idCatTipoEstudio, 'bacilos' AS tipo, estudiosBac.idDiagnostico, diagnostico.idPaciente as idPacienteDiag, estudiosBac.idPaciente, idContacto, fechaResultado  " . "FROM estudiosBac LEFT JOIN diagnostico ON diagnostico.idDiagnostico = estudiosBac.idDiagnostico " . "WHERE idCatSolicitante IN (SELECT idCatUnidad FROM catUnidad WHERE fechaResultado is NOT NULL ";
     if ($this->idCatEstado != 0) {
         $sql .= " AND idCatEstado = " . $this->idCatEstado;
     }
     $sql .= " ) ";
     if (!is_null($this->fechaInicio) && $this->fechaInicio != '') {
         $sql .= "AND fechaResultado >= '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' ";
     }
     if (!is_null($this->fechaFin) && $this->fechaFin != '') {
         $sql .= "AND fechaResultado <= '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "' ";
     }
     if (!is_null($this->folioLaboratorio) && $this->folioLaboratorio != '') {
         $sql .= "AND folioLaboratorio = '" . $this->folioLaboratorio . "' ";
     }
     if (!is_null($this->folioSolicitud) && $this->folioSolicitud != '') {
         $sql .= "AND folioSolicitud = '" . $this->folioSolicitud . "' ";
     }
     $sql .= "ORDER BY fechaResultado DESC;";
     $help = new Helpers();
     $consulta = ejecutaQueryClases($sql);
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
     } else {
         $arr = array();
         $c = 0;
         while ($registro = devuelveRowAssoc($consulta)) {
             $estudio = new resultadoBusquedaEstudio();
             $estudio->idEstudio = $registro['idEstudio'];
             $estudio->idPaciente = $registro['idPacienteDiag'] ? $registro['idPacienteDiag'] : $registro['idPaciente'];
             $estudio->folioLaboratorio = $registro['folioLaboratorio'];
             $estudio->folioSolicitud = $registro['folioSolicitud'];
             $estudio->solicitante = $registro['personaSolicitudEstudio'];
             $estudio->fechaMuestreo = $registro['fechaTomaMuestra'];
             $estudio->fechaSolicitud = $registro['fechaSolicitudEstudio'];
             $estudio->fechaResultado = $registro['fechaResultado'];
             $estudio->idCatTipoEstudio = $registro['idCatTipoEstudio'];
             $estudio->estudio = $registro['tipo'];
             if (!empty($registro['idContacto'])) {
                 // CONTACTO
                 $estudio->nombre = $help->getNombreContacto($registro['idContacto']);
                 $estudio->clavePaciente = "Contacto: Sin Clave";
             } else {
                 if (!empty($registro['idDiagnostico'])) {
                     // CONFIRMADO
                     $estudio->nombre = $help->getNamePacienteDiagnostico($registro['idDiagnostico']);
                     $estudio->clavePaciente = $help->getClavePacienteDiagnostico($registro['idDiagnostico']);
                 } else {
                     // SOSPECHOSO
                     $estudio->nombre = $help->getNamePaciente($registro['idPaciente']);
                     $estudio->clavePaciente = $help->getClavePaciente($registro['idPaciente']);
                 }
             }
             $arr[$c] = $estudio;
             $c++;
         }
         $this->resultado = $arr;
     }
 }
Example #10
0
 public function countByDiagnostico($idDiagnostico)
 {
     $sql = "SELECT COUNT(*) AS total FROM [control] WHERE idDiagnostico = " . $idDiagnostico . ";";
     $consulta = ejecutaQueryClases($sql);
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
         return null;
     } else {
         $result = devuelveRowAssoc($consulta);
         return $result['total'];
     }
 }
Example #11
0
 public function getExamen($idEstudioHis)
 {
     $sql = "SELECT fechaResultado, ch.descripcion AS res " . "FROM [estudiosHis] eh, [catHistopatologia] ch " . "WHERE eh.idEstudioHis = " . $idEstudioHis . " " . "AND ch.idCatHisto = eh.idCatHisto;";
     $consulta = ejecutaQueryClases($sql);
     //echo "<BR>" . $sql . "<BR>";
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
     } else {
         $tabla = devuelveRowAssoc($consulta);
         if (!is_null($tabla)) {
             $this->fecha = formatFechaObj($tabla["fechaResultado"], 'Y-m-d');
             $this->resultado = $tabla["res"];
         } else {
             $this->fecha = NULL;
             $this->resultado = NULL;
         }
     }
 }
Example #12
0
 public function eliminarBD($idCasoRelacionado)
 {
     $sql = "DELETE FROM [casosRelacionados] WHERE idCasoRelacionado = " . (int) $idCasoRelacionado . ";";
     $consulta = ejecutaQueryClases($sql);
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
         return false;
     }
     return true;
 }
Example #13
0
 public function buscar()
 {
     //Se crea la vista para manejarla
     $sqlP1 = $this->queryBusquedaDiagnostico("p.idPaciente, m.idCatMunicipio, j.idCatJurisdiccion, e.idCatEstado, p.nombre, p.apellidoPaterno, p.apellidoMaterno, p.sexo, p.cveExpediente, p.idCatTipoPaciente, p.idCatUnidadNotificante, p.idCatUnidadTratante, d.idCatEstadoPaciente");
     $sqlP2 = $this->queryBusquedaSospechoso("p.idPaciente, m.idCatMunicipio, j.idCatJurisdiccion, e.idCatEstado, p.nombre, p.apellidoPaterno, p.apellidoMaterno, p.sexo, p.cveExpediente, p.idCatTipoPaciente, p.idCatUnidadNotificante, p.idCatUnidadTratante, 0");
     $sql = "DROP VIEW view_pacientes";
     ejecutaQueryClases($sql);
     $sql = "\n\t\t\tCREATE VIEW view_pacientes\n\t\t\tAS\n\t\t\t" . $sqlP1 . "\n\t\t\tUNION\n\t\t\t" . $sqlP2 . ";\n\t\t";
     ejecutaQueryClases($sql);
     $sql = "SELECT COUNT(*) as totalRegistros FROM view_pacientes;";
     $totalRows = ejecutaQueryClases($sql);
     //echo 'adafdfasd'.devuelveNumRows($totalRows);
     while ($totalRow = devuelveRowAssoc($totalRows)) {
         $this->totalRegistro = $totalRow['totalRegistros'];
     }
     $this->maxPages = ceil($this->totalRegistro / MAX_PER_PAGE);
     $sql = "SELECT TOP " . MAX_PER_PAGE . " * FROM view_pacientes WHERE 1=1 ";
     //"AND e.idCatEstado = " . $this->idCatEstado . " ";
     // p4scu41
     if (!is_null($this->idCatEstado) && $this->idCatEstado != '') {
         $sql .= "AND idCatEstado = " . $this->idCatEstado . " ";
     }
     if (!is_null($this->idCatJurisdiccion) && $this->idCatJurisdiccion != '') {
         $sql .= "AND idCatJurisdiccion = " . $this->idCatJurisdiccion . " ";
     }
     if (!is_null($this->idCatMunicipio) && $this->idCatMunicipio != '') {
         $sql .= "AND idCatMunicipio = " . $this->idCatMunicipio . " ";
     }
     if (!is_null($this->apellidoP) && $this->apellidoP != '') {
         $sql .= "AND apellidoPaterno = '" . $this->apellidoP . "' ";
     }
     if (!is_null($this->apellidoM) && $this->apellidoM != '') {
         $sql .= "AND apellidoMaterno = '" . $this->apellidoM . "' ";
     }
     if (!is_null($this->nombre) && $this->nombre != '') {
         $sqlP .= "AND nombre like '%" . $this->nombre . "%' ";
     }
     if (!is_null($this->clavePaciente) && $this->clavePaciente != '') {
         $sql .= "AND cveExpediente = '" . $this->clavePaciente . "' ";
     }
     if (!is_null($this->idCatUnidad) && $this->idCatUnidad != '') {
         $sql .= "AND idCatUnidadTratante = '" . $this->idCatUnidad . "' ";
     }
     if (!is_null($this->statusPaciente) && $this->statusPaciente != '') {
         $sql .= "AND idCatEstadoPaciente = " . $this->statusPaciente;
     }
     if (!is_null($this->idCatTipoPaciente) && $this->idCatTipoPaciente != '') {
         $sql .= "AND idCatTipoPaciente = " . $this->idCatTipoPaciente . "";
     }
     $sql2 = "SELECT TOP " . ($this->page - 1) * MAX_PER_PAGE . " idPaciente FROM view_pacientes WHERE 1=1 ";
     if (!is_null($this->idCatEstado) && $this->idCatEstado != '') {
         $sql2 .= "AND idCatEstado = " . $this->idCatEstado . " ";
     }
     if (!is_null($this->idCatJurisdiccion) && $this->idCatJurisdiccion != '') {
         $sql2 .= "AND idCatJurisdiccion = " . $this->idCatJurisdiccion . " ";
     }
     if (!is_null($this->idCatMunicipio) && $this->idCatMunicipio != '') {
         $sql2 .= "AND idCatMunicipio = " . $this->idCatMunicipio . " ";
     }
     if (!is_null($this->apellidoP) && $this->apellidoP != '') {
         $sql2 .= "AND apellidoPaterno = '" . $this->apellidoP . "' ";
     }
     if (!is_null($this->apellidoM) && $this->apellidoM != '') {
         $sql2 .= "AND apellidoMaterno = '" . $this->apellidoM . "' ";
     }
     if (!is_null($this->nombre) && $this->nombre != '') {
         $sql2 .= "AND nombre like '%" . $this->nombre . "%' ";
     }
     if (!is_null($this->clavePaciente) && $this->clavePaciente != '') {
         $sql2 .= "AND cveExpediente = '" . $this->clavePaciente . "' ";
     }
     if (!is_null($this->idCatUnidad) && $this->idCatUnidad != '') {
         $sql2 .= "AND idCatUnidadTratante = '" . $this->idCatUnidad . "' ";
     }
     if (!is_null($this->statusPaciente) && $this->statusPaciente != '') {
         $sql2 .= "AND idCatEstadoPaciente = " . $this->statusPaciente;
     }
     if (!is_null($this->idCatTipoPaciente) && $this->idCatTipoPaciente != '') {
         $sql2 .= "AND idCatTipoPaciente = " . $this->idCatTipoPaciente . "";
     }
     $sql2 .= " ORDER BY idPaciente";
     $sql .= " AND idPaciente NOT IN (" . $sql2 . ")";
     /*	$sql3 = $this->queryBusquedaSospechoso("TOP ".MAX_PER_PAGE." p.idPaciente, p.nombre, p.apellidoPaterno, p.apellidoMaterno, p.sexo, p.cveExpediente, p.idCatTipoPaciente, p.idCatUnidadNotificante, p.idCatUnidadTratante, p.idPaciente ");
     		//$sql2 = $this->queryBusquedaSospechoso("TOP ".(($this->page-1)*MAX_PER_PAGE)." p.idPaciente ");
     			
     		//$sql2 .= " ORDER BY p.idPaciente";
     		//$sql3 .= " AND p.idPaciente NOT IN (".$sql2.")";
     		
     		$sqlCompleto = $sql." UNION ".$sql3;
     		
     		$sqlCompleto .= " ORDER BY p.idPaciente";*/
     //$sql .= ";";
     $consulta = ejecutaQueryClases($sql);
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
     } else {
         $arr = array();
         $c = 0;
         while ($registro = devuelveRowAssoc($consulta)) {
             $paciente = new resultadoBusquedaPaciente();
             $paciente->idPaciente = $registro['idPaciente'];
             $paciente->nombre = $registro['nombre'];
             $paciente->apellidoPaterno = $registro['apellidoPaterno'];
             $paciente->apellidoMaterno = $registro['apellidoMaterno'];
             $paciente->sexo = $registro['sexo'];
             $paciente->cveExpediente = $registro['cveExpediente'];
             $paciente->idCatTipoPaciente = $registro['idCatTipoPaciente'];
             $paciente->idCatUnidadNotificante = $registro['idCatUnidadNotificante'];
             $paciente->idCatUnidadTratante = $registro['idCatUnidadTratante'];
             $arr[$c] = $paciente;
             $c++;
         }
         $this->resultado = $arr;
     }
 }
Example #14
0
 public function eliminarBD($idLesion)
 {
     $sql = "DELETE FROM [diagramaDermatologico] WHERE idLesion = " . (int) $idLesion . ";";
     $consulta = ejecutaQueryClases($sql);
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
         return false;
     }
     return true;
 }
Example #15
0
 public function eliminarBD($idPaciente)
 {
     $sql = "DELETE FROM [sospechoso] WHERE idPaciente = " . $idPaciente . ";";
     $consulta = ejecutaQueryClases($sql);
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
     }
 }
Example #16
0
 public function obtenerBD($idPaciente)
 {
     $sql = "SELECT p.*, m.idCatJurisdiccion, d.idDiagnostico, d.fechaCaptura, ctp.descripcion as tipoPaciente, s.sexo as sexoP,  cfd.descripcion as formaDeteccion, ce.nombre as estado, cl.nombre as localidad" . " FROM [pacientes] p, [catMunicipio] m, [diagnostico] d, [catTipoPaciente] ctp, [catSexo] s, [catFormaDeteccion] cfd, [catEstado] ce, [catLocalidad] cl" . " WHERE p.idPaciente = " . $idPaciente . " AND d.idPaciente = p.idPaciente" . " AND m.idCatMunicipio = p.idCatMunicipio" . " AND m.idCatEstado = p.idCatEstado" . " AND ctp.idCatTipoPaciente = p.idCatTipoPaciente" . " AND s.idSexo = p.sexo" . " AND cfd.idCatFormaDeteccion = p.idCatFormaDeteccion" . " AND ce.idCatEstado = p.idCatEstado" . " AND cl.idCatEstado = p.idCatEstado" . " AND cl.idCatMunicipio = p.idCatMunicipio" . " AND cl.idCatLocalidad = p.idCatLocalidad;";
     $consulta = ejecutaQueryClases($sql);
     //echo $sql;
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
     } else {
         $tabla = devuelveRowAssoc($consulta);
         $this->idPaciente = $tabla["idPaciente"];
         $this->idDiagnostico = $tabla["idDiagnostico"];
         $this->folio = $tabla["cveExpediente"];
         $this->fechaNotificacion = formatFechaObj($tabla["fechaNotificacion"], 'Y-m-d');
         $this->fechaCaptura = formatFechaObj($tabla["fechaCaptura"], 'Y-m-d');
         $this->idCatTipoPaciente = $tabla["tipoPaciente"];
         $this->idCatFormaDeteccion = $tabla["formaDeteccion"];
         $this->nombreCompleto = $tabla["nombre"] . ' ' . $tabla["apellidoPaterno"] . ' ' . $tabla["apellidoMaterno"];
         $this->fechaNacimiento = formatFechaObj($tabla["fechaNacimiento"], 'Y-m-d');
         $this->edad = calEdad(formatFechaObj($this->fechaNacimiento, 'Y-m-d'));
         $this->sexo = $tabla["sexoP"];
         $this->idCatEstado = $tabla["estado"];
         $this->idCatMunicipio = $tabla["localidad"];
         $this->jurisdiccion = $tabla["idCatJurisdiccion"];
         $this->domicilio = $tabla["calle"] . ' ' . $tabla["noExterior"] . ' ' . $tabla["noInterior"] . ' ' . $tabla["colonia"];
         if (!is_null($tabla["anosRadicando"])) {
             $this->anosRadicando = $tabla["anosRadicando"];
         }
         if (!is_null($tabla["mesesRadicando"])) {
             $this->mesesRadicando = $tabla["mesesRadicando"];
         }
         $this->fechaInicioPadecimiento = formatFechaObj($tabla["fechaInicioPadecimiento"], 'Y-m-d');
         $this->fechaDiagnostico = formatFechaObj($tabla["fechaDiagnostico"], 'Y-m-d');
         $sql = "SELECT " . "(SELECT COUNT(idLesion) FROM [diagramaDermatologico] WHERE idDiagnostico = " . $this->idDiagnostico . " AND idCatTipoLesion = " . self::$idManchasHipocrom . " ) AS cMH, " . "(SELECT COUNT(idLesion) FROM [diagramaDermatologico] WHERE idDiagnostico = " . $this->idDiagnostico . " AND idCatTipoLesion = " . self::$idManchasEritemat . " ) AS cME, " . "(SELECT COUNT(idLesion) FROM [diagramaDermatologico] WHERE idDiagnostico = " . $this->idDiagnostico . " AND idCatTipoLesion = " . self::$idPlacasInfiltrad . " ) AS cPI, " . "(SELECT COUNT(idLesion) FROM [diagramaDermatologico] WHERE idDiagnostico = " . $this->idDiagnostico . " AND (idCatTipoLesion = " . self::$idNodulosAislados . " OR idCatTipoLesion = " . self::$idNodulosAgrupados . ")) AS cNo, " . "(SELECT COUNT(idLesion) FROM [diagramaDermatologico] WHERE idDiagnostico = " . $this->idDiagnostico . " AND idCatTipoLesion = " . self::$idOtrasLesiones . " ) AS cOL, " . "(SELECT COUNT(idLesion) FROM [diagramaDermatologico] WHERE idDiagnostico = " . $this->idDiagnostico . " AND idCatTipoLesion = " . self::$idZonasAnestesia . " ) AS cZA;";
         $consulta = ejecutaQueryClases($sql);
         //echo "<BR><BR>" . $sql . "<BR><BR>";
         if (is_string($consulta)) {
             $this->error = true;
             $this->msgError = $consulta . " SQL:" . $sql;
         } else {
             $tabla = devuelveRowAssoc($consulta);
             $this->cuentaManchasHipocrom = $tabla["cMH"];
             $this->cuentaManchasEritemat = $tabla["cME"];
             $this->cuentaPlacasInfiltrad = $tabla["cPI"];
             $this->cuentaNodulos = $tabla["cNo"];
             $this->cuentaOtrasLesiones = $tabla["cOL"];
             $this->cuentaZonasAnestesia = $tabla["cZA"];
         }
         $sql = "SELECT TOP 1 muestraRechazada, fechaSolicitud, fechaResultado, bacIM, idCatBac  \n\t\t\t\tFROM [estudiosBac] \n\t\t\t\tWHERE idDiagnostico = " . $this->idDiagnostico . " \n\t\t\t\tAND muestraRechazada = 0 \n\t\t\t\tAND idCatTipoEstudio = " . self::$idCatTipoEstudioDia . " \n\t\t\t\tORDER BY fechaResultado ASC;";
         //echo $sql;
         $help = new Helpers();
         $arrIdCatBac = $help->getArrayCatBaciloscopia();
         $consulta = ejecutaQueryClases($sql);
         //echo "<BR><BR>" . $sql . "<BR><BR>";
         if (is_string($consulta)) {
             $this->error = true;
             $this->msgError = $consulta . " SQL:" . $sql;
         } else {
             $tabla = devuelveRowAssoc($consulta);
             //var_dump( $tabla);
             if (is_null($tabla)) {
                 $this->fechaBaciloscopia = "-";
                 $this->resultadoBaciloscopia = "Sin Estudio";
                 $this->imBaciloscopia = "Sin Estudio";
             } else {
                 if (!is_null($tabla["fechaResultado"])) {
                     $this->fechaBaciloscopia = formatFechaObj($tabla["fechaResultado"], 'Y-m-d');
                 } else {
                     $this->fechaBaciloscopia = formatFechaObj($tabla["fechaSolicitud"], 'Y-m-d');
                 }
                 if (!is_null($tabla["idCatBac"])) {
                     $this->resultadoBaciloscopia = $arrIdCatBac[$tabla["idCatBac"]];
                 } else {
                     $this->resultadoBaciloscopia = "Esperando Resultado";
                 }
                 if (!is_null($tabla["bacIM"])) {
                     $this->imBaciloscopia = $tabla["bacIM"];
                 } else {
                     $this->imBaciloscopia = "Esperando Resultado";
                 }
             }
         }
         $sql = "SELECT muestraRechazada, fechaSolicitud, fechaResultado, hisResultado \n\t\t\t\tFROM [estudiosHis] \n\t\t\t\tWHERE idDiagnostico = " . $this->idDiagnostico . " \n\t\t\t\tAND muestraRechazada = 0 \n\t\t\t\tAND idCatTipoEstudio = " . self::$idCatTipoEstudioDia . " \t\t\t\t\n\t\t\t\tORDER BY fechaResultado ASC;";
         $consulta = ejecutaQueryClases($sql);
         //echo "<BR><BR>" . $sql . "<BR><BR>";
         if (is_string($consulta)) {
             $this->error = true;
             $this->msgError = $consulta . " SQL:" . $sql;
         } else {
             $tabla = devuelveRowAssoc($consulta);
             if (is_null($tabla)) {
                 $this->resultadoHistopatologia = "Sin Estudio";
                 $this->fechaHistopatologia = "-";
             } else {
                 if (!is_null($tabla["fechaResultado"])) {
                     $this->fechaHistopatologia = formatFechaObj($tabla["fechaResultado"], 'Y-m-d');
                 } else {
                     $this->fechaHistopatologia = formatFechaObj($tabla["fechaSolicitud"], 'Y-m-d');
                 }
                 if (!is_null($tabla["hisResultado"])) {
                     $this->resultadoHistopatologia = $tabla["hisResultado"];
                 } else {
                     $this->fechaHistopatologia = "Esperando Resultado";
                 }
             }
         }
         $this->observaciones;
     }
 }
Example #17
0
 public function cargarEstudiosHis()
 {
     $sql = "SELECT [idEstudioHis] FROM [estudiosHis] WHERE idContacto = " . $this->idContacto . " ORDER BY fechaResultado ASC;";
     $result = ejecutaQueryClases($sql);
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sqlA;
     } else {
         while ($tabla = devuelveRowAssoc($result)) {
             $idTemp = $tabla["idEstudioHis"];
             $objTemp = new EstudioHis();
             $objTemp->obtenerBD($idTemp);
             array_push($this->arrEstudiosHis, $objTemp);
         }
     }
 }
Example #18
0
 public function CalcularMunicipios($ano, $idCatClaEstPacPrevalentes, $idCriterioMunicipiosPrioritarios)
 {
     $municipiosPrioritarios = array();
     $sql = "SELECT u.idCatEstado, u.idCatMunicipio, COUNT(d.idDiagnostico) AS total, m.pob" . $ano . " AS pob, m.nombre, e.nombre AS estado " . "FROM pacientes p, diagnostico d, catUnidad u, catMunicipio m, catEstado e " . "WHERE p.idPaciente = d.idDiagnostico " . "AND p.idCatUnidadNotificante = u.idCatUnidad " . "AND d.idCatEstadoPaciente IN (" . $idCatClaEstPacPrevalentes . ") " . "AND m.idCatMunicipio = u.idCatMunicipio " . "AND m.idCatEstado = u.idCatEstado " . "AND e.idCatEstado = u.idCatEstado " . "GROUP BY u.idCatEstado, u.idCatMunicipio, m.nombre, m.pob" . $ano . ", e.nombre " . "ORDER BY u.idCatEstado, u.idCatMunicipio;";
     $consulta = ejecutaQueryClases($sql);
     if (!is_string($consulta)) {
         while ($tabla = devuelveRowAssoc($consulta)) {
             $indice = $tabla["total"] / $tabla["pob"];
             if ($indice > $idCriterioMunicipiosPrioritarios) {
                 $objTemp = new MunicipiosPrioritarios();
                 $objTemp->idCatEstado = $tabla["idCatEstado"];
                 $objTemp->idCatMunicipio = $tabla["idCatMunicipio"];
                 $objTemp->estado = $tabla["estado"];
                 $objTemp->nombre = $tabla["nombre"];
                 $objTemp->enfermos = $tabla["total"];
                 $objTemp->tasa = $indice;
                 $key = $tabla["idCatEstado"] . "-" . $tabla["idCatMunicipio"];
                 $municipiosPrioritarios[$key] = $objTemp;
             }
         }
     }
     return $municipiosPrioritarios;
 }
Example #19
0
 public function cargarArreglosPaciente()
 {
     if ($this->idPaciente != 0) {
         $sql = "SELECT [idDiagnostico] FROM [diagnostico] WHERE idPaciente = " . $this->idPaciente . ";";
         $result = ejecutaQueryClases($sql);
         if (is_string($consulta)) {
             $this->error = true;
             $this->msgError = $consulta . " SQL:" . $sqlA;
         } else {
             while ($tabla = devuelveRowAssoc($result)) {
                 $idTemp = $tabla["idDiagnostico"];
                 $objTemp = new Diagnostico();
                 $objTemp->obtenerBD($idTemp);
                 array_push($this->arrDiagnosticos, $objTemp);
             }
         }
     }
 }
Example #20
0
 function validNombreUsuario()
 {
     $sql = 'SELECT count(*) as total FROM [usuarios] WHERE nombreUsuario = \'' . $this->nombreUsuario . '\'';
     $consulta = ejecutaQueryClases($sql);
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . ' SQL:' . $sql;
     } else {
         $tabla = devuelveRowAssoc($consulta);
         if ($tabla['total'] == 0) {
             return true;
         } else {
             return false;
         }
     }
 }
Example #21
0
 public function calcular()
 {
     if (is_null($this->idCatEstado) || is_null($this->idCatJurisdiccion) || is_null($this->idCatMunicipio) || is_null($this->idCatUnidad) || is_null($this->fechaInicio) || is_null($this->fechaFin)) {
         $this->error = true;
         $this->msgError = "El indicador requiere del identificador de estado y jurisdiccion, asi como de una fecha de inicio y fin.";
     } else {
         $caso = "E";
         if ($this->idCatJurisdiccion != 0) {
             $caso = "EJ";
         } elseif ($this->idCatMunicipio != 0) {
             $caso = "EJM";
         } elseif ($this->idCatUnidad != 0) {
             $caso = "EJMU";
         }
         switch ($caso) {
             case "EJ":
                 $sql = "SELECT ( " . "SELECT COUNT (idPaciente) " . "FROM pacientes p, catMunicipio m " . "WHERE p.idCatEstado = " . $this->idCatEstado . " " . "AND p.fechaInicioPQT BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatEstado = p.idCatEstado " . "AND m.idCatJurisdiccion = " . $this->idCatJurisdiccion . " " . ") AS ingresosControl, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c, catMunicipio m " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL02 . ") " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatJurisdiccion = " . $this->idCatJurisdiccion . " " . "AND m.idCatEstado = p.idCatEstado " . ") AS reingresosControl, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c, catMunicipio m " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL03 . ") " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatJurisdiccion = " . $this->idCatJurisdiccion . " " . "AND m.idCatEstado = p.idCatEstado " . ") AS casosConTratamiento, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c, catMunicipio m " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL04 . ") " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatJurisdiccion = " . $this->idCatJurisdiccion . " " . "AND m.idCatEstado = p.idCatEstado " . ") AS casosSinTratamiento, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c, catMunicipio m " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL05 . ") " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatJurisdiccion = " . $this->idCatJurisdiccion . " " . "AND m.idCatEstado = p.idCatEstado " . ") AS casosVigPosTratamiento;";
                 break;
             case "EJM":
                 $sql = "SELECT ( " . "SELECT COUNT (idPaciente) " . "FROM pacientes p, catMunicipio m " . "WHERE p.idCatEstado = " . $this->idCatEstado . " " . "AND p.fechaInicioPQT BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatMunicipio = " . $this->idCatMunicipio . " " . "AND m.idCatEstado = p.idCatEstado " . ") AS ingresosControl, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c, catMunicipio m " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL02 . ") " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatMunicipio = " . $this->idCatMunicipio . " " . "AND m.idCatEstado = p.idCatEstado " . ") AS reingresosControl, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c, catMunicipio m " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL03 . ") " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatMunicipio = " . $this->idCatMunicipio . " " . "AND m.idCatEstado = p.idCatEstado " . ") AS casosConTratamiento, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c, catMunicipio m " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL04 . ") " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatMunicipio = " . $this->idCatMunicipio . " " . "AND m.idCatEstado = p.idCatEstado " . ") AS casosSinTratamiento, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c, catMunicipio m " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL05 . ") " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatMunicipio = " . $this->idCatMunicipio . " " . "AND m.idCatEstado = p.idCatEstado " . ") AS casosVigPosTratamiento;";
                 break;
             case "EJMU":
                 $sql = "SELECT ( " . "SELECT COUNT (idPaciente) " . "FROM pacientes p " . "WHERE p.idCatUnidadTratante = " . $this->idCatUnidad . " " . "AND p.fechaInicioPQT BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . ") AS ingresosControl, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatUnidadTratante = " . $this->idCatUnidad . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL02 . ") " . ") AS reingresosControl, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatUnidadTratante = " . $this->idCatUnidad . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL03 . ") " . ") AS casosConTratamiento, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatUnidadTratante = " . $this->idCatUnidad . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL04 . ") " . ") AS casosSinTratamiento, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatUnidadTratante = " . $this->idCatUnidad . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL05 . ") " . ") AS casosVigPosTratamiento;";
                 break;
             default:
                 $sql = "SELECT ( " . "SELECT COUNT (idPaciente) " . "FROM pacientes p " . "WHERE p.idCatEstado = " . $this->idCatEstado . " " . "AND p.fechaInicioPQT BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . ") AS ingresosControl, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL02 . ") " . ") AS reingresosControl, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL03 . ") " . ") AS casosConTratamiento, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL04 . ") " . ") AS casosSinTratamiento, ( " . "SELECT COUNT (DISTINCT p.idPaciente) " . "FROM pacientes p, diagnostico d, control c " . "WHERE d.idPaciente = p.idPaciente " . "AND c.idDiagnostico = d.idDiagnostico " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND c.fecha BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND c.idCatEstadoPaciente IN (" . self::$restriccionMBL05 . ") " . ") AS casosVigPosTratamiento;";
                 break;
         }
         $consulta = ejecutaQueryClases($sql);
         if (is_string($consulta)) {
             $this->error = true;
             $this->msgError = $consulta . " SQL:" . $sql;
         } else {
             $tabla = devuelveRowAssoc($consulta);
             $this->ingresosControl = $tabla["ingresosControl"];
             $this->reingresosControl = $tabla["reingresosControl"];
             $this->casosConTratamiento = $tabla["casosConTratamiento"];
             $this->casosSinTratamiento = $tabla["casosSinTratamiento"];
             $this->casosVigPosTratamiento = $tabla["casosVigPosTratamiento"];
             switch ($caso) {
                 case "EJ":
                     $sql = "SELECT ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b, catMunicipio m " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosDiagnostico . " " . "AND b.idCatBac NOT IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatEstado = m.idCatEstado " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatJurisdiccion = " . $this->idCatJurisdiccion . " " . ") AS bacDiagnosticoPos, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b, catMunicipio m  " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosDiagnostico . " " . "AND b.idCatBac IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatEstado = m.idCatEstado " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatJurisdiccion = " . $this->idCatJurisdiccion . " " . ") AS bacDiagnosticoNeg, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b, catMunicipio m  " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 1 " . "AND b.idCatTipoEstudio = " . self::$estudiosDiagnostico . " " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatEstado = m.idCatEstado " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatJurisdiccion = " . $this->idCatJurisdiccion . " " . ") AS bacDiagnosticoCon, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b, catMunicipio m  " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosControl . " " . "AND b.idCatBac NOT IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatEstado = m.idCatEstado " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatJurisdiccion = " . $this->idCatJurisdiccion . " " . ") AS bacControlPos, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b, catMunicipio m  " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosControl . " " . "AND b.idCatBac IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatEstado = m.idCatEstado " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatJurisdiccion = " . $this->idCatJurisdiccion . " " . ") AS bacControlNeg, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b, catMunicipio m  " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 1 " . "AND b.idCatTipoEstudio = " . self::$estudiosControl . "\t" . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatEstado = m.idCatEstado " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatJurisdiccion = " . $this->idCatJurisdiccion . " " . ") AS bacControlCon";
                     break;
                 case "EJM":
                     $sql = "SELECT ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b, catMunicipio m " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosDiagnostico . " " . "AND b.idCatBac NOT IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatEstado = m.idCatEstado " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatMunicipio = " . $this->idCatMunicipio . " " . ") AS bacDiagnosticoPos, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b, catMunicipio m  " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosDiagnostico . " " . "AND b.idCatBac IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatEstado = m.idCatEstado " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatMunicipio = " . $this->idCatMunicipio . " " . ") AS bacDiagnosticoNeg, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b, catMunicipio m  " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 1 " . "AND b.idCatTipoEstudio = " . self::$estudiosDiagnostico . " " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatEstado = m.idCatEstado " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatMunicipio = " . $this->idCatMunicipio . " " . ") AS bacDiagnosticoCon, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b, catMunicipio m  " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosControl . " " . "AND b.idCatBac NOT IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatEstado = m.idCatEstado " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatMunicipio = " . $this->idCatMunicipio . " " . ") AS bacControlPos, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b, catMunicipio m  " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosControl . " " . "AND b.idCatBac IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatEstado = m.idCatEstado " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatMunicipio = " . $this->idCatMunicipio . " " . ") AS bacControlNeg, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b, catMunicipio m  " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 1 " . "AND b.idCatTipoEstudio = " . self::$estudiosControl . "\t" . "AND p.idCatEstado = " . $this->idCatEstado . " " . "AND p.idCatEstado = m.idCatEstado " . "AND p.idCatMunicipio = m.idCatMunicipio " . "AND m.idCatMunicipio = " . $this->idCatMunicipio . " " . ") AS bacControlCon";
                     break;
                 case "EJMU":
                     $sql = "SELECT ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosDiagnostico . " " . "AND b.idCatBac NOT IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatUnidadTratante = " . $this->idCatUnidad . " " . ") AS bacDiagnosticoPos, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosDiagnostico . " " . "AND b.idCatBac IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatUnidadTratante = " . $this->idCatUnidad . " " . ") AS bacDiagnosticoNeg, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 1 " . "AND b.idCatTipoEstudio = " . self::$estudiosDiagnostico . " " . "AND p.idCatUnidadTratante = " . $this->idCatUnidad . " " . ") AS bacDiagnosticoCon, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN'" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosControl . " " . "AND b.idCatBac NOT IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatUnidadTratante = " . $this->idCatUnidad . " " . ") AS bacControlPos, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosControl . " " . "AND b.idCatBac IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatUnidadTratante = " . $this->idCatUnidad . " " . ") AS bacControlNeg, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 1 " . "AND b.idCatTipoEstudio = " . self::$estudiosControl . "\t" . "AND p.idCatUnidadTratante = " . $this->idCatUnidad . " " . ") AS bacControlCon";
                     break;
                 default:
                     $sql = "SELECT ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosDiagnostico . " " . "AND b.idCatBac NOT IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatEstado = " . $this->idCatEstado . " " . ") AS bacDiagnosticoPos, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosDiagnostico . " " . "AND b.idCatBac IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatEstado = " . $this->idCatEstado . " " . ") AS bacDiagnosticoNeg, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 1 " . "AND b.idCatTipoEstudio = " . self::$estudiosDiagnostico . " " . "AND p.idCatEstado = " . $this->idCatEstado . " " . ") AS bacDiagnosticoCon, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN'" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosControl . " " . "AND b.idCatBac NOT IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatEstado = " . $this->idCatEstado . " " . ") AS bacControlPos, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 0 " . "AND b.idCatTipoEstudio = " . self::$estudiosControl . " " . "AND b.idCatBac IN (" . self::$baciloscopiasNegativas . ") " . "AND p.idCatEstado = " . $this->idCatEstado . " " . ") AS bacControlNeg, ( " . "SELECT COUNT (b.idEstudioBac) " . "FROM pacientes p, diagnostico d, estudiosBac b " . "WHERE d.idPaciente = p.idPaciente " . "AND b.idDiagnostico = d.idDiagnostico " . "AND b.fechaRecepcion BETWEEN '" . formatFechaObj($this->fechaInicio, 'Y-m-d') . "' AND '" . formatFechaObj($this->fechaFin, 'Y-m-d') . "'" . "AND b.muestraRechazada = 1 " . "AND b.idCatTipoEstudio = " . self::$estudiosControl . "\t" . "AND p.idCatEstado = " . $this->idCatEstado . " " . ") AS bacControlCon";
                     break;
             }
             $consulta = ejecutaQueryClases($sql);
             if (is_string($consulta)) {
                 $this->error = true;
                 $this->msgError = $consulta . " SQL:" . $sql;
             } else {
                 $tabla = devuelveRowAssoc($consulta);
                 $this->bacDiagnosticoPos = $tabla["bacDiagnosticoPos"];
                 $this->bacDiagnosticoNeg = $tabla["bacDiagnosticoNeg"];
                 $this->bacDiagnosticoCon = $tabla["bacDiagnosticoCon"];
                 $this->bacControlPos = $tabla["bacControlPos"];
                 $this->bacControlNeg = $tabla["bacControlNeg"];
                 $this->bacControlCon = $tabla["bacControlCon"];
             }
         }
     }
 }
Example #22
0
 public function obtenerByHisto($idEstudioHis)
 {
     $sql = "SELECT * FROM [controlCalidad] WHERE idEstudioHis = " . $idEstudioHis;
     $consulta = ejecutaQueryClases($sql);
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
     } else {
         $tabla = devuelveRowAssoc($consulta);
         $this->idcontrolCalidad = $tabla["idcontrolCalidad"];
         $this->idEstudioHis = $idEstudioHis;
         $this->idEstudioBac = $tabla["idEstudioBac"];
         ////////////							Posibles nulos
         if (!is_null($tabla["calidadMuestra"])) {
             $this->calidadMuestra = $tabla["calidadMuestra"];
         }
         if (!is_null($tabla["sinMuestra"])) {
             $this->sinMuestra = $tabla["sinMuestra"];
         }
         if (!is_null($tabla["sinElemeCelu"])) {
             $this->sinElemeCelu = $tabla["sinElemeCelu"];
         }
         if (!is_null($tabla["abunEritro"])) {
             $this->abunEritro = $tabla["abunEritro"];
         }
         if (!is_null($tabla["otrosCalidadMuestra"])) {
             $this->otrosCalidadMuestra = $tabla["otrosCalidadMuestra"];
         }
         if (!is_null($tabla["calidadFrotis"])) {
             $this->calidadFrotis = $tabla["calidadFrotis"];
         }
         if (!is_null($tabla["calidadFrotisTipo"])) {
             $this->calidadFrotisTipo = $tabla["calidadFrotisTipo"];
         }
         if (!is_null($tabla["otrosCalidadFrotis"])) {
             $this->otrosCalidadFrotis = $tabla["otrosCalidadFrotis"];
         }
         if (!is_null($tabla["calidadTincion"])) {
             $this->calidadTincion = $tabla["calidadTincion"];
         }
         if (!is_null($tabla["crisFucsi"])) {
             $this->crisFucsi = $tabla["crisFucsi"];
         }
         if (!is_null($tabla["preciFucsi"])) {
             $this->preciFucsi = $tabla["preciFucsi"];
         }
         if (!is_null($tabla["calenExce"])) {
             $this->calenExce = $tabla["calenExce"];
         }
         if (!is_null($tabla["decoInsufi"])) {
             $this->decoInsufi = $tabla["decoInsufi"];
         }
         if (!is_null($tabla["otrosCalidadTincion"])) {
             $this->otrosCalidadTincion = $tabla["otrosCalidadTincion"];
         }
         if (!is_null($tabla["calidadLectura"])) {
             $this->calidadLectura = $tabla["calidadLectura"];
         }
         if (!is_null($tabla["falPosi"])) {
             $this->falPosi = $tabla["falPosi"];
         }
         if (!is_null($tabla["falNega"])) {
             $this->falNega = $tabla["falNega"];
         }
         if (!is_null($tabla["difMas2IB"])) {
             $this->difMas2IB = $tabla["difMas2IB"];
         }
         if (!is_null($tabla["difMas25IM"])) {
             $this->difMas25IM = $tabla["difMas25IM"];
         }
         if (!is_null($tabla["otrosCalidadLectura"])) {
             $this->otrosCalidadLectura = $tabla["otrosCalidadLectura"];
         }
         if (!is_null($tabla["calidadResultado"])) {
             $this->calidadResultado = $tabla["calidadResultado"];
         }
         if (!is_null($tabla["soloSimbCruz"])) {
             $this->soloSimbCruz = $tabla["soloSimbCruz"];
         }
         if (!is_null($tabla["soloPosiNega"])) {
             $this->soloPosiNega = $tabla["soloPosiNega"];
         }
         if (!is_null($tabla["noEmiteIM"])) {
             $this->noEmiteIM = $tabla["noEmiteIM"];
         }
         if (!is_null($tabla["otrosCalidadResultado"])) {
             $this->otrosCalidadResultado = $tabla["otrosCalidadResultado"];
         }
         if (!is_null($tabla["recomendacion"])) {
             $this->recomendacion = $tabla["recomendacion"];
         }
     }
 }
Example #23
0
 public function obtenerBD($idEstudioHis)
 {
     $sql = "SELECT * FROM [estudiosHis] WHERE idEstudioHis = " . $idEstudioHis;
     // p4scu41
     /*if($this->idContacto != '' && !is_null($this->idContacto)) { 
     			$sql .= " and idContacto = ".$this->idContacto.";";
     		}
     		else {
     			$sql .= " and idContacto is null;";
     		}*/
     $consulta = ejecutaQueryClases($sql);
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
     } else {
         $tabla = devuelveRowAssoc($consulta);
         //var_dump($tabla);
         $this->idEstudioHis = $tabla["idEstudioHis"];
         $this->idDiagnostico = $tabla["idDiagnostico"];
         $this->fechaSolicitud = $tabla["fechaSolicitud"];
         ////////////							Posibles nulos
         if (!is_null($tabla["idContacto"])) {
             $this->idContacto = $tabla["idContacto"];
         }
         if (!is_null($tabla["idPaciente"])) {
             $this->idPaciente = $tabla["idPaciente"];
         }
         if (!is_null($tabla["fechaRecepcion"])) {
             $this->fechaRecepcion = $tabla["fechaRecepcion"];
         }
         if (!is_null($tabla["folioLaboratorio"])) {
             $this->folioLaboratorio = $tabla["folioLaboratorio"];
         }
         if (!is_null($tabla["folioSolicitud"])) {
             $this->folioSolicitud = $tabla["folioSolicitud"];
         }
         if (!is_null($tabla["idCatSolicitante"])) {
             $this->idCatSolicitante = $tabla["idCatSolicitante"];
         }
         if (!is_null($tabla["idCatTipoEstudio"])) {
             $this->idCatTipoEstudio = $tabla["idCatTipoEstudio"];
         }
         if (!is_null($tabla["lesionTomoMuestra"])) {
             $this->lesionTomoMuestra = $tabla["lesionTomoMuestra"];
         }
         if (!is_null($tabla["regionTomoMuestra"])) {
             $this->regionTomoMuestra = $tabla["regionTomoMuestra"];
         }
         if (!is_null($tabla["fechaTomaMuestra"])) {
             $this->fechaTomaMuestra = $tabla["fechaTomaMuestra"];
         }
         if (!is_null($tabla["personaTomaMuestra"])) {
             $this->personaTomaMuestra = $tabla["personaTomaMuestra"];
         }
         if (!is_null($tabla["fechaSolicitudEstudio"])) {
             $this->fechaSolicitudEstudio = $tabla["fechaSolicitudEstudio"];
         }
         if (!is_null($tabla["personaSolicitudEstudio"])) {
             $this->personaSolicitudEstudio = $tabla["personaSolicitudEstudio"];
         }
         if (!is_null($tabla["muestraRechazada"])) {
             $this->muestraRechazada = $tabla["muestraRechazada"];
         }
         if (!is_null($tabla["idCatMotivoRechazo"])) {
             $this->idCatMotivoRechazo = $tabla["idCatMotivoRechazo"];
         }
         if (!is_null($tabla["otroMotivoRechazo"])) {
             $this->otroMotivoRechazo = $tabla["otroMotivoRechazo"];
         }
         if (!is_null($tabla["fechaResultado"])) {
             $this->fechaResultado = $tabla["fechaResultado"];
         }
         if (!is_null($tabla["hisDescMacro"])) {
             $this->hisDescMacro = $tabla["hisDescMacro"];
         }
         if (!is_null($tabla["hisDescMicro"])) {
             $this->hisDescMicro = $tabla["hisDescMicro"];
         }
         if (!is_null($tabla["hisResultado"])) {
             $this->hisResultado = $tabla["hisResultado"];
         }
         if (!is_null($tabla["idCatHisto"])) {
             $this->idCatHisto = $tabla["idCatHisto"];
         }
         if (!is_null($tabla["idCatEstadoLaboratorio"])) {
             $this->idCatEstadoLaboratorio = $tabla["idCatEstadoLaboratorio"];
         }
         if (!is_null($tabla["idCatJurisdiccionLaboratorio"])) {
             $this->idCatJurisdiccionLaboratorio = $tabla["idCatJurisdiccionLaboratorio"];
         }
         if (!is_null($tabla["idCatAnalistaLab"])) {
             $this->idCatAnalistaLab = $tabla["idCatAnalistaLab"];
         }
         if (!is_null($tabla["idCatSupervisorLab"])) {
             $this->idCatSupervisorLab = $tabla["idCatSupervisorLab"];
         }
         if (!is_null($tabla["idCatEstadoTratante"])) {
             $this->idCatEstadoTratante = $tabla["idCatEstadoTratante"];
         }
         if (!is_null($tabla["IdCatJurisdiccionTratante"])) {
             $this->IdCatJurisdiccionTratante = $tabla["IdCatJurisdiccionTratante"];
         }
     }
 }
Example #24
0
 public function obtenerBD($idEstudioBac)
 {
     $sql = "SELECT * FROM [estudiosBac] WHERE idEstudioBac = " . $idEstudioBac;
     // p4scu41
     /*if($this->idContacto != '' && !is_null($this->idContacto)) { 
     			$sql .= " and idContacto = ".$this->idContacto.";";
     		}
     		else {
     			$sql .= " and idContacto is null;";
     		}*/
     $consulta = ejecutaQueryClases($sql);
     if (is_string($consulta)) {
         $this->error = true;
         $this->msgError = $consulta . " SQL:" . $sql;
     } else {
         $tabla = devuelveRowAssoc($consulta);
         $this->idEstudioBac = $tabla["idEstudioBac"];
         $this->idDiagnostico = $tabla["idDiagnostico"];
         $this->fechaSolicitud = $tabla["fechaSolicitud"];
         ////////////							Posibles nulos
         if (!is_null($tabla["idContacto"])) {
             $this->idContacto = $tabla["idContacto"];
         }
         if (!is_null($tabla["idPaciente"])) {
             $this->idPaciente = $tabla["idPaciente"];
         }
         if (!is_null($tabla["fechaRecepcion"])) {
             $this->fechaRecepcion = $tabla["fechaRecepcion"];
         }
         if (!is_null($tabla["folioLaboratorio"])) {
             $this->folioLaboratorio = $tabla["folioLaboratorio"];
         }
         if (!is_null($tabla["folioSolicitud"])) {
             $this->folioSolicitud = $tabla["folioSolicitud"];
         }
         if (!is_null($tabla["idCatSolicitante"])) {
             $this->idCatSolicitante = $tabla["idCatSolicitante"];
         }
         if (!is_null($tabla["idCatTipoEstudio"])) {
             $this->idCatTipoEstudio = $tabla["idCatTipoEstudio"];
         }
         if (!is_null($tabla["tomMueFrotis1"])) {
             $this->tomMueFrotis1 = $tabla["tomMueFrotis1"];
         }
         if (!is_null($tabla["tomMueFrotis2"])) {
             $this->tomMueFrotis2 = $tabla["tomMueFrotis2"];
         }
         if (!is_null($tabla["tomMueFrotis3"])) {
             $this->tomMueFrotis3 = $tabla["tomMueFrotis3"];
         }
         if (!is_null($tabla["lesionTomoMuestra"])) {
             $this->lesionTomoMuestra = $tabla["lesionTomoMuestra"];
         }
         if (!is_null($tabla["regionTomoMuestra"])) {
             $this->regionTomoMuestra = $tabla["regionTomoMuestra"];
         }
         if (!is_null($tabla["fechaTomaMuestra"])) {
             $this->fechaTomaMuestra = $tabla["fechaTomaMuestra"];
         }
         if (!is_null($tabla["personaTomaMuestra"])) {
             $this->personaTomaMuestra = $tabla["personaTomaMuestra"];
         }
         if (!is_null($tabla["fechaSolicitudEstudio"])) {
             $this->fechaSolicitudEstudio = $tabla["fechaSolicitudEstudio"];
         }
         if (!is_null($tabla["personaSolicitudEstudio"])) {
             $this->personaSolicitudEstudio = $tabla["personaSolicitudEstudio"];
         }
         if (!is_null($tabla["muestraRechazada"])) {
             $this->muestraRechazada = $tabla["muestraRechazada"];
         }
         if (!is_null($tabla["idCatMotivoRechazo"])) {
             $this->idCatMotivoRechazo = $tabla["idCatMotivoRechazo"];
         }
         if (!is_null($tabla["otroMotivoRechazo"])) {
             $this->otroMotivoRechazo = $tabla["otroMotivoRechazo"];
         }
         if (!is_null($tabla["fechaResultado"])) {
             $this->fechaResultado = $tabla["fechaResultado"];
         }
         if (!is_null($tabla["idCatBacFrotis1"])) {
             $this->idCatBacFrotis1 = $tabla["idCatBacFrotis1"];
         }
         if (!is_null($tabla["idCatBacFrotis2"])) {
             $this->idCatBacFrotis2 = $tabla["idCatBacFrotis2"];
         }
         if (!is_null($tabla["idCatBacFrotis3"])) {
             $this->idCatBacFrotis3 = $tabla["idCatBacFrotis3"];
         }
         if (!is_null($tabla["bacPorcViaFrotis1"])) {
             $this->bacPorcViaFrotis1 = $tabla["bacPorcViaFrotis1"];
         }
         if (!is_null($tabla["bacPorcViaFrotis2"])) {
             $this->bacPorcViaFrotis2 = $tabla["bacPorcViaFrotis2"];
         }
         if (!is_null($tabla["bacPorcViaFrotis3"])) {
             $this->bacPorcViaFrotis3 = $tabla["bacPorcViaFrotis3"];
         }
         if (!is_null($tabla["bacCalidadAdecFrotis1"])) {
             $this->bacCalidadAdecFrotis1 = $tabla["bacCalidadAdecFrotis1"];
         }
         if (!is_null($tabla["bacCalidadAdecFrotis2"])) {
             $this->bacCalidadAdecFrotis2 = $tabla["bacCalidadAdecFrotis2"];
         }
         if (!is_null($tabla["bacCalidadAdecFrotis3"])) {
             $this->bacCalidadAdecFrotis3 = $tabla["bacCalidadAdecFrotis3"];
         }
         if (!is_null($tabla["bacIdCatTiposBacilosFrotis1"])) {
             $this->bacIdCatTiposBacilosFrotis1 = $tabla["bacIdCatTiposBacilosFrotis1"];
         }
         if (!is_null($tabla["bacIdCatTiposBacilosFrotis2"])) {
             $this->bacIdCatTiposBacilosFrotis2 = $tabla["bacIdCatTiposBacilosFrotis2"];
         }
         if (!is_null($tabla["bacIdCatTiposBacilosFrotis3"])) {
             $this->bacIdCatTiposBacilosFrotis3 = $tabla["bacIdCatTiposBacilosFrotis3"];
         }
         if (!is_null($tabla["idCatBac"])) {
             $this->idCatBac = $tabla["idCatBac"];
         }
         if (!is_null($tabla["bacIM"])) {
             $this->bacIM = $tabla["bacIM"];
         }
         if (!is_null($tabla["bacObservaciones"])) {
             $this->bacObservaciones = $tabla["bacObservaciones"];
         }
         if (!is_null($tabla["idCatEstadoLaboratorio"])) {
             $this->idCatEstadoLaboratorio = $tabla["idCatEstadoLaboratorio"];
         }
         if (!is_null($tabla["idCatJurisdiccionLaboratorio"])) {
             $this->idCatJurisdiccionLaboratorio = $tabla["idCatJurisdiccionLaboratorio"];
         }
         if (!is_null($tabla["idCatAnalistaLab"])) {
             $this->idCatAnalistaLab = $tabla["idCatAnalistaLab"];
         }
         if (!is_null($tabla["idCatSupervisorLab"])) {
             $this->idCatSupervisorLab = $tabla["idCatSupervisorLab"];
         }
         if (!is_null($tabla["idCatEstadoTratante"])) {
             $this->idCatEstadoTratante = $tabla["idCatEstadoTratante"];
         }
         if (!is_null($tabla["IdCatJurisdiccionTratante"])) {
             $this->IdCatJurisdiccionTratante = $tabla["IdCatJurisdiccionTratante"];
         }
     }
 }