echo HTML::para(nl2br($history->getBrothersStatusHealth())); } if ($history->getSpouseChildsStatusHealth()) { echo HTML::section(3, _("Spouse and Childs Status Health")); echo HTML::para(nl2br($history->getSpouseChildsStatusHealth())); } if ($history->getFamilyIllness()) { echo HTML::section(3, _("Family Illness")); echo HTML::para(nl2br($history->getFamilyIllness())); } echo HTML::rule(); /** * Show closed medical problems */ echo HTML::section(2, _("Closed Medical Problems List:")); $problemQ = new Query_Page_Problem(); if (!$problemQ->selectProblems($idPatient, true)) { echo Msg::info(_("No closed medical problems defined for this patient.")); echo HTML::rule(); } while ($problem = $problemQ->fetch()) { echo HTML::section(3, _("Order Number")); echo HTML::para($problem->getOrderNumber()); if ($problem->getIdMember()) { $staffQ = new Query_Staff(); if ($staffQ->select($problem->getIdMember())) { $staff = $staffQ->fetch(); if ($staff) { echo HTML::section(3, _("Attending Physician")); echo HTML::para($staff->getSurname1() . ' ' . $staff->getSurname2() . ', ' . $staff->getFirstName()); }
$numRows = $problemQ->selectProblems($idPatient, true); if ($numRows) { $array = array(); for ($i = 0; $i < $numRows; $i++) { $array[$i] = $problemQ->fetch(); } $problemQ->freeResult(); $problemQ->close(); unset($problemQ); $delProblemQ = new Query_DelProblem(); for ($i = 0; $i < $numRows; $i++) { $delProblemQ->insert($array[$i], $_SESSION['auth']['user_id'], $_SESSION['auth']['login_session']); } $delProblemQ->close(); unset($delProblemQ); $problemQ = new Query_Page_Problem(); /** * Record log process (before deleting process) */ $recordQ = new Query_Page_Record(); for ($i = 0; $i < $numRows; $i++) { $recordQ->log("Query_Page_Problem", "DELETE", array($array[$i]->getIdProblem())); } $recordQ->close(); unset($recordQ); for ($i = 0; $i < $numRows; $i++) { $problemQ->delete($array[$i]->getIdProblem()); } $problemQ->close(); unset($problemQ); unset($array);
$numRows = $connQ->select($idProblem); $conn = array(); for ($i = 0; $i < $numRows; $i++) { $conn[] = $connQ->fetch(); } $connQ->freeResult(); while ($aux = array_shift($conn)) { $connQ->delete($idProblem, $aux[1]); } $connQ->close(); unset($connQ); unset($conn); /** * Delete problem */ $problemQ = new Query_Page_Problem(); if (defined("OPEN_DEMO") && !OPEN_DEMO) { if (!$problemQ->select($idProblem)) { $problemQ->close(); FlashMsg::add(_("That medical problem does not exist."), OPEN_MSG_ERROR); header("Location: " . $returnLocation); exit; } $problem = $problemQ->fetch(); if (!$problem) { $problemQ->close(); Error::fetch($problemQ); } $wording = $problem->getWording(); $delProblemQ = new Query_DelProblem(); $delProblemQ->insert($problem, $_SESSION['auth']['user_id'], $_SESSION['auth']['login_session']);
exit; } /** * Show page */ $title = _("Medical Problems Report"); $titlePage = $patient->getName() . ' (' . $title . ')'; require_once "../layout/header.php"; /** * Breadcrumb */ $links = array(_("Medical Records") => "../medical/index.php", $patient->getName() => "../medical/patient_view.php", $title => ""); echo HTML::breadcrumb($links, "icon icon_patient"); unset($links); echo $patient->getHeader(); $problemQ = new Query_Page_Problem(); $lastOrderNumber = $problemQ->getLastOrderNumber($idPatient); if ($_SESSION['auth']['is_administrative']) { echo HTML::para(HTML::link(_("Add New Medical Problem"), '../medical/problem_new_form.php', array('id_patient' => $idPatient, 'order_number' => $lastOrderNumber))); } echo HTML::rule(); echo HTML::section(2, _("Medical Problems List:")); if (!$problemQ->selectProblems($idPatient)) { $problemQ->close(); echo Msg::info(_("No medical problems defined for this patient.")); include_once "../layout/footer.php"; exit; } $thead = array(_("Order Number"), _("Function") => array('colspan' => $_SESSION['auth']['is_administrative'] ? 5 : 3), _("Wording"), _("Opening Date"), _("Last Update Date")); $options = array(0 => array('align' => 'right')); $tbody = array();
*/ $problem = new Problem(); $problem->setIdProblem($idProblem); require_once "../medical/problem_validate_post.php"; /** * Destroy form values and errors */ Form::unsetSession(); /** * Prevent user from aborting script */ $oldAbort = ignore_user_abort(true); /** * Update problem */ $problemQ = new Query_Page_Problem(); $problemQ->update($problem); if ($problem->getClosingDate(false)) { FlashMsg::add(sprintf(_("Medical problem, %s, has been added to closed medical problems list."), $problem->getWording())); } else { FlashMsg::add(sprintf(_("Medical problem, %s, has been updated."), $problem->getWording())); } $problemQ->close(); unset($problemQ); unset($problem); /** * Record log process */ $recordQ = new Query_Page_Record(); $recordQ->log("Query_Page_Problem", "UPDATE", array($idProblem)); $recordQ->close();
/** * mixed Problem(int $id = 0) * * Constructor * * @param int $id (optional) * @return mixed void if not argument, null if not exists problem, object otherwise * @access public */ function Problem($id = 0) { $this->_trans = array_flip(get_html_translation_table(HTML_SPECIALCHARS)); if ($id) { $_problemQ = new Query_Page_Problem(); if (!$_problemQ->select($id)) { return null; } foreach (get_object_vars($_problemQ->fetch()) as $key => $value) { $this->{$key} = $value; } $_problemQ->freeResult(); $_problemQ->close(); } }
*/ //$currentPage = Check::postGetSessionInt('page_problem', 1); $currentPage = Check::postGetSessionInt('page', 1); $searchType = Check::postGetSessionInt('search_type_problem'); $logical = Check::postGetSessionString('logical_problem'); $limit = Check::postGetSessionInt('limit_problem'); // remove slashes added by form post $searchText = stripslashes(Check::postGetSessionString('search_text_problem')); // remove redundant whitespace $searchText = preg_replace("/[[:space:]]+/i", " ", $searchText); // transform string in array of strings $arraySearch = Search::explodeQuoted($searchText); /** * Search database */ $problemQ = new Query_Page_Problem(); $problemQ->setItemsPerPage(OPEN_ITEMS_PER_PAGE); $problemQ->search($searchType, $arraySearch, $currentPage, $logical, $limit); /** * No results message if no results returned from search. */ if ($problemQ->getRowCount() == 0) { $problemQ->close(); FlashMsg::add(sprintf(_("No results found for '%s'."), $searchText)); header("Location: ../medical/patient_search_form.php"); exit; } /** * Show problem view screen if only one result from query */ if ($problemQ->getRowCount() == 1) {
if ($connQ->select($idProblem)) { while ($conn = $connQ->fetch()) { $connArray[] = $conn[1]; } $connQ->freeResult(); } $connQ->close(); unset($connQ); if (count($connArray) == 0) { echo Msg::info(_("No connections defined for this medical problem.")); include_once "../layout/footer.php"; exit; } echo HTML::section(2, _("Connection Problems List:")); $thead = array(_("#"), _("Function") => array('colspan' => $_SESSION['auth']['is_administrative'] ? 2 : 1), _("Opening Date"), _("Wording")); $problemQ = new Query_Page_Problem(); $problemQ->captureError(true); $tbody = array(); for ($i = 0; $i < count($connArray); $i++) { $problemQ->select($connArray[$i]); if ($problemQ->isError()) { Error::query($problemQ, false); continue; } $problem = $problemQ->fetch(); if (!$problem) { $problemQ->close(); Error::fetch($problemQ); } $row = $i + 1 . '.'; $row .= OPEN_SEPARATOR;
* Validate data */ $problem = new Problem(); require_once "../medical/problem_validate_post.php"; /** * Destroy form values and errors */ Form::unsetSession(); /** * Prevent user from aborting script */ $oldAbort = ignore_user_abort(true); /** * Insert new medical problem */ $problemQ = new Query_Page_Problem(); $problemQ->insert($problem); $idProblem = $problemQ->getLastId(); if ($problem->getClosingDate(false)) { FlashMsg::add(sprintf(_("Medical problem, %s, has been added to closed medical problems list."), $problem->getWording())); } else { FlashMsg::add(sprintf(_("Medical problem, %s, has been added."), $problem->getWording())); } $problemQ->close(); unset($problemQ); unset($problem); /** * Record log process */ $recordQ = new Query_Page_Record(); $recordQ->log("Query_Page_Problem", "INSERT", array($idProblem));