Beispiel #1
0
 /**
  * bool insert(Problem $problem, int $idUser, string $login)
  *
  * Inserts a new medical problem into the deleted problems table.
  *
  * @param Problem $problem medical problem to insert
  * @param int $idUser key of user that makes deletion
  * @param string $login login session of user that makes deletion
  * @return boolean returns false, if error occurs
  * @access public
  */
 function insert($problem, $idUser, $login)
 {
     $sql = "INSERT INTO " . $this->_table;
     $sql .= " (id_problem, last_update_date, id_patient, id_member, collegiate_number, order_number, ";
     $sql .= "opening_date, closing_date, meeting_place, wording, subjective, objective, ";
     $sql .= "appreciation, action_plan, prescription, create_date, id_user, login) VALUES (";
     $sql .= "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW(), ?, ?);";
     $params = array($problem->getIdProblem(), $problem->getLastUpdateDate(), $problem->getIdPatient(), $problem->getIdMember(), urlencode($problem->getCollegiateNumber()), $problem->getOrderNumber(), $problem->getOpeningDate(), $problem->getClosingDate(), urlencode($problem->getMeetingPlace()), $problem->getWording(), urlencode($problem->getSubjective()), urlencode($problem->getObjective()), urlencode($problem->getAppreciation()), urlencode($problem->getActionPlan()), urlencode($problem->getPrescription()), intval($idUser), urlencode($login));
     return $this->exec($sql, $params);
 }
if (!$problem) {
    FlashMsg::add(_("Nenhum atendimento foi realizado até o momento."), OPEN_MSG_ERROR);
    header("Location: ../medical/patient_search_form.php");
    exit;
}
$formVar["id_problem"] = $idProblem;
$formVar["id_patient"] = $idPatient;
$formVar["order_number"] = $problem->getOrderNumber();
$formVar["opening_date"] = $problem->getOpeningDate();
if (!isset($formError)) {
    $formVar["last_update_date"] = $problem->getLastUpdateDate();
    $formVar["id_member"] = $problem->getIdMember();
    $formVar["closed_problem"] = $problem->getClosingDate() != "" && $problem->getClosingDate() != "0000-00-00" ? "checked" : "";
    $formVar["meeting_place"] = $problem->getMeetingPlace();
    $formVar["wording"] = $problem->getWording();
    $formVar["subjective"] = $problem->getSubjective();
    $formVar["objective"] = $problem->getObjective();
    $formVar["appreciation"] = $problem->getAppreciation();
    $formVar["action_plan"] = $problem->getActionPlan();
    $formVar["prescription"] = $problem->getPrescription();
}
/**
 * Show page
 */
$title = _("Editar Atendimento");
$titlePage = $patient->getName() . ' [' . $problem->getWordingPreview() . '] (' . $title . ')';
$focusFormField = "wording";
// to avoid JavaScript mistakes in demo version
require_once "../layout/header.php";
//$returnLocation = "../medical/problem_view.php?id_problem=" . $idProblem . "&id_patient=" . $idPatient;
$returnLocation = "../medical/problem_view.php";
Beispiel #3
0
echo HTML::para(I18n::localDate($problem->getOpeningDate()));
if ($problem->getLastUpdateDate() != "" && $problem->getLastUpdateDate() != "0000-00-00") {
    echo HTML::section(3, _("Last Update Date"));
    echo HTML::para(I18n::localDate($problem->getLastUpdateDate()));
}
if ($problem->getClosingDate() != "" && $problem->getClosingDate() != "0000-00-00") {
    echo HTML::section(3, _("Closing Date"));
    echo HTML::para(I18n::localDate($problem->getClosingDate()));
}
if ($problem->getMeetingPlace()) {
    echo HTML::section(3, _("Meeting Place"));
    echo HTML::para($problem->getMeetingPlace());
}
echo HTML::section(3, _("Wording"));
echo HTML::para(nl2br($problem->getWording()));
if ($problem->getSubjective()) {
    echo HTML::section(3, _("Subjective"));
    echo HTML::para(nl2br($problem->getSubjective()));
}
if ($problem->getObjective()) {
    echo HTML::section(3, _("Objective"));
    echo HTML::para(nl2br($problem->getObjective()));
}
if ($problem->getAppreciation()) {
    echo HTML::section(3, _("Appreciation"));
    echo HTML::para(nl2br($problem->getAppreciation()));
}
if ($problem->getActionPlan()) {
    echo HTML::section(3, _("Action Plan"));
    echo HTML::para(nl2br($problem->getActionPlan()));
}
Beispiel #4
0
 /**
  * bool update(Problem $problem)
  *
  * Update a medical problem in the problems table.
  *
  * @param Problem $problem medical problem to update
  * @return boolean returns false, if error occurs
  * @access public
  */
 function update($problem)
 {
     if (!$problem instanceof Problem) {
         $this->_error = "Argument is an inappropriate object.";
         return false;
     }
     $sql = "UPDATE " . $this->_table . " SET " . "last_update_date=CURDATE(), " . "id_member=?, " . "closing_date=?, " . "meeting_place=?, " . "wording=?, " . "subjective=?, " . "objective=?, " . "appreciation=?, " . "action_plan=?, " . "prescription=? " . "WHERE id_problem=?;";
     $params = array($problem->getIdMember(), urlencode($problem->getClosingDate(false)), urlencode($problem->getMeetingPlace()), urlencode($problem->getWording()), urlencode($problem->getSubjective()), urlencode($problem->getObjective()), urlencode($problem->getAppreciation()), urlencode($problem->getActionPlan()), urlencode($problem->getPrescription()), $problem->getIdProblem());
     return $this->exec($sql, $params);
 }