Exemple #1
0
 /**
  * mixed Test(int $idProblem = 0, int $idTest = 0)
  *
  * Constructor
  *
  * @param int $idProblem (optional) medical problem identificator
  * @param int $idTest (optional) medical test identificator
  * @return mixed void if not argument, null if not exists problem, object otherwise
  * @access public
  */
 public function Test($idProblem = 0, $idTest = 0)
 {
     $this->_trans = array_flip(get_html_translation_table(HTML_SPECIALCHARS));
     if ($idProblem && $idTest) {
         $_testQ = new Query_Test();
         if (!$_testQ->select($idProblem, $idTest)) {
             return null;
         }
         foreach (get_object_vars($_testQ->fetch()) as $key => $value) {
             $this->{$key} = $value;
         }
         $_testQ->freeResult();
         $_testQ->close();
     }
 }
Exemple #2
0
require_once "../layout/header.php";
/**
 * Breadcrumb
 */
$links = array(_("Medical Records") => "../medical/index.php", $patient->getName() => "../medical/patient_view.php", _("Medical Problems Report") => "../medical/problem_list.php", $problem->getWordingPreview() => "../medical/problem_view.php", $title => "");
echo HTML::breadcrumb($links, "icon icon_patient");
unset($links);
echo $patient->getHeader();
echo $problem->getHeader();
if ($_SESSION['auth']['is_administrative']) {
    echo HTML::para(HTML::link(_("Add New Medical Test"), '../medical/test_new_form.php', array('id_problem' => $idProblem, 'id_patient' => $idPatient)));
    echo HTML::rule();
}
$testQ = new Query_Test();
if (!$testQ->select($idProblem)) {
    $testQ->close();
    echo Msg::info(_("No medical tests defined for this medical problem."));
    include_once "../layout/footer.php";
    exit;
}
echo HTML::section(2, _("Medical Tests List:"));
$thead = array(_("Function") => array('colspan' => $_SESSION['auth']['is_administrative'] ? 3 : 1), _("Document Type"), _("Path Filename"));
$tbody = array();
while ($test = $testQ->fetch()) {
    $temp = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
    $temp = substr($temp, 0, strrpos($temp, "/")) . "/tests/" . String::translateBrowser($test->getPathFilename(false));
    $row = HTML::link(HTML::image('../img/action_view.png', _("view")), $temp, null, array('class' => 'popup'));
    $row .= OPEN_SEPARATOR;
    if ($_SESSION['auth']['is_administrative']) {
        $row .= HTML::link(HTML::image('../img/action_edit.png', _("edit")), '../medical/test_edit_form.php', array('id_problem' => $idProblem, 'id_patient' => $idPatient, 'id_test' => $test->getIdTest()));
        $row .= OPEN_SEPARATOR;