for ($i = 0; $i < $numRows; $i++) { $rel[] = $relQ->fetch(); } $relQ->freeResult(); while ($aux = array_shift($rel)) { $relQ->delete($idPatient, $aux[1]); } $relQ->close(); unset($relQ); unset($rel); /** * Delete patient */ $patQ = new Query_Page_Patient(); if (defined("OPEN_DEMO") && !OPEN_DEMO) { if (!$patQ->select($idPatient)) { $patQ->close(); FlashMsg::add(_("That patient does not exist."), OPEN_MSG_ERROR); header("Location: " . $returnLocation); exit; } $patient = $patQ->fetch(); if (!$patient) { $patQ->close(); Error::fetch($patQ); } $historyQ = new Query_History(); $historyQ->selectPersonal($idPatient); $historyP = $historyQ->fetch(); $historyQ->selectFamily($idPatient); $historyF = $historyQ->fetch();
$options = array(0 => array('align' => 'right')); $recordset = null; while ($problem = $problemQ->fetch()) { $row = $problemQ->getCurrentRow(); eval("\$aux = {$val};"); $recordset[$row] = $row . OPEN_SEPARATOR . $problem->getIdProblem() . OPEN_SEPARATOR . $problem->getIdPatient() . OPEN_SEPARATOR . $aux . OPEN_SEPARATOR . I18n::localDate($problem->getOpeningDate()) . OPEN_SEPARATOR . I18n::localDate($problem->getClosingDate()); } // end while $problemQ->freeResult(); $problemQ->close(); unset($problemQ); $tbody = array(); foreach ($recordset as $arrKey => $arrValue) { $array = explode(OPEN_SEPARATOR, $arrValue, 6); $patQ = new Query_Page_Patient(); if ($patQ->select($array[2])) { $pat = $patQ->fetch(); if (!$pat) { $patQ->close(); Error::fetch($patQ); } $row = $array[0] . '.'; $row .= OPEN_SEPARATOR; $row .= HTML::link($pat->getSurname1() . " " . $pat->getSurname2() . ", " . $pat->getFirstName(), '../medical/problem_view.php', array('id_problem' => $array[1], 'id_patient' => $array[2])); $row .= "<br />" . PHP_EOL . $key . " " . $array[3] . "<br />" . PHP_EOL; $row .= _("Opening Date") . ": " . $array[4]; if ($array[5] != "") { $row .= "<br />" . _("Closing Date") . ": " . $array[5]; } $tbody[] = explode(OPEN_SEPARATOR, $row); }
/** * mixed Patient(int $id = 0) * * Constructor * * @param int $id (optional) * @return mixed void if not argument, null if not exists patient, object otherwise * @access public */ public function Patient($id = 0) { $this->_trans = array_flip(get_html_translation_table(HTML_SPECIALCHARS)); if ($id) { $_patQ = new Query_Page_Patient(); if (!$_patQ->select($id)) { return null; } foreach (get_object_vars($_patQ->fetch()) as $key => $value) { $this->{$key} = $value; } $_patQ->freeResult(); $_patQ->close(); } }
} // end if if (count($relArray) == 0) { echo Msg::info(_("No relatives defined for this patient.")); include_once "../layout/footer.php"; exit; } echo HTML::rule(); echo HTML::section(2, _("Relatives List:")); $thead = array(_("#"), _("Function") => array('colspan' => $_SESSION['auth']['is_administrative'] ? 2 : 1), _("Surname 1"), _("Surname 2"), _("First Name")); $options = array(0 => array('align' => 'right')); $patQ = new Query_Page_Patient(); $patQ->captureError(true); $tbody = array(); for ($i = 0; $i < count($relArray); $i++) { $patQ->select($relArray[$i]); if ($patQ->isError()) { Error::query($patQ, false); continue; } $pat = $patQ->fetch(); if (!$pat) { $patQ->close(); Error::fetch($patQ); } $relName = $pat->getFirstName() . " " . $pat->getSurname1() . " " . $pat->getSurname2(); $row = $i + 1 . '.'; $row .= OPEN_SEPARATOR; $row .= HTML::link(HTML::image('../img/action_view.png', _("view")), '../medical/patient_view.php', array('id_patient' => $pat->getIdPatient())); $row .= OPEN_SEPARATOR; if ($_SESSION['auth']['is_administrative']) {