} $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(); //Error::debug($patient); Error::debug($historyP); Error::debug($historyF, "", true); $delPatientQ = new Query_DelPatient(); $delPatientQ->insert($patient, $historyP, $historyF, $_SESSION['auth']['user_id'], $_SESSION['auth']['login_session']); unset($delPatientQ); unset($patient); unset($historyQ);
/** * 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(); } }
* Search database for patient */ $patQ = new Query_Page_Patient(); if (!$patQ->select($idPatient)) { $patQ->close(); include_once "../layout/xhtml_start.php"; echo $style; echo HTML::end('head'); echo HTML::start('body'); echo Msg::error(_("That patient does not exist.")); echo HTML::para(HTML::link(_("Close Window"), '#', null, array('onclick' => 'window.close(); return false;'))); echo HTML::end('body'); echo HTML::end('html'); exit; } $pat = $patQ->fetch(); if (!$pat) { $patQ->close(); Error::fetch($patQ); } $patQ->freeResult(); $patQ->close(); unset($patQ); $patName = $pat->getFirstName() . " " . $pat->getSurname1() . " " . $pat->getSurname2(); /** * Show medical record */ $title = $patName . " " . date(_("Y-m-d H:i:s")); require_once "../layout/xhtml_start.php"; echo $style; echo HTML::end('head');
$patQ->setItemsPerPage(OPEN_ITEMS_PER_PAGE); $patQ->search($searchType, $arraySearch, $currentPage, $logical, $limit); /** * No results message if no results returned from search. */ if ($patQ->getRowCount() == 0) { $patQ->close(); FlashMsg::add(sprintf(_("No results found for '%s'."), $searchText)); header("Location: ../medical/patient_search_form.php"); exit; } /** * Show patient view screen if only one result from query */ if ($patQ->getRowCount() == 1) { $pat = $patQ->fetch(); $patQ->freeResult(); $patQ->close(); header("Location: ../medical/patient_view.php?id_patient=" . $pat->getIdPatient()); exit; } /** * Show page */ $title = _("Search Results"); require_once "../layout/header.php"; /** * Breadcrumb */ $links = array(_("Medical Records") => "../medical/index.php", _("Search Patient") => "../medical/patient_search_form.php", $title => ""); echo HTML::breadcrumb($links, "icon icon_search");