Exemplo n.º 1
0
$user = CMediusers::get();
$user->loadRefs();
$canUser = $user->canDo();
$consult = new CConsultation();
if ($consult_id) {
    $consult->load($consult_id);
    $consult->loadRefsFwd();
}
// Chargement des aides à la saisie
$antecedent = new CAntecedent();
$antecedent->loadAides($user->_id);
$aides_antecedent = $antecedent->_aides_all_depends["rques"] ? $antecedent->_aides_all_depends["rques"] : array();
// On charge le patient pour connaitre ses antécedents et traitements actuels
$patient = new CPatient();
$patient->load($patient_id);
$patient->loadRefDossierMedical();
$dossier_medical = $patient->_ref_dossier_medical;
$dossier_medical->loadRefsAntecedents();
$dossier_medical->loadRefsTraitements();
$applied_antecedents = array();
foreach ($dossier_medical->_ref_antecedents_by_type as $list) {
    foreach ($list as $a) {
        if (!isset($applied_antecedents[$a->type])) {
            $applied_antecedents[$a->type] = array();
        }
        $applied_antecedents[$a->type][] = $a->rques;
    }
}
$order_mode_grille = CAppUI::pref("order_mode_grille");
$fill_pref = $order_mode_grille != "";
$order_decode = array();
Exemplo n.º 2
0
 * @package    Mediboard
 * @subpackage Patients
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkEdit();
$patient_id = CValue::get("patient_id");
$type = CValue::get("type");
$antecedent_id = CValue::get("antecedent_id");
$callback = CValue::get('callback', 0);
$patient = new CPatient();
$patient->load($patient_id);
$antecedents = array();
if ($type) {
    $dossier_medical = $patient->loadRefDossierMedical();
    /** @var CAntecedent[] $antecedents */
    $antecedents = $dossier_medical->loadRefsAntecedentsOfType($type);
    foreach ($antecedents as $_antecedent) {
        $_antecedent->updateOwnerAndDates();
    }
}
$antecedent = new CAntecedent();
$antecedent->load($antecedent_id);
$smarty = new CSmartyDP();
$smarty->assign("patient", $patient);
$smarty->assign("antecedents", $antecedents);
$smarty->assign("is_anesth", CAppUI::$user->isAnesth());
$smarty->assign("antecedent", $antecedent);
$smarty->assign("type", $type);
if ($callback) {
         $request_b->setLimit("{$start},30");
     }
     $results = array_merge($results, $ds->loadList($request_b->makeSelect()));
 }
 foreach ($results as $_result) {
     $_patient_id = $_result["patient_id"];
     $pat = new CPatient();
     $pat->load($_patient_id);
     // Recherche sur un antécédent
     if (isset($_result["antecedent_id"])) {
         $_atcd = new CAntecedent();
         $_atcd->load($_result["antecedent_id"]);
         $pat->_ref_antecedent = $_atcd;
     } else {
         // On affiche tous les antécédents du patient
         $dossier_medical = $pat->loadRefDossierMedical(false);
         $pat->_refs_antecedents = $dossier_medical->loadRefsAntecedents();
         $pat->_refs_allergies = $dossier_medical->loadRefsAllergies();
         $pat->_ext_codes_cim = $dossier_medical->_ext_codes_cim;
     }
     if (isset($_result["prescription_line_medicament_id"])) {
         $line = new CPrescriptionLineMedicament();
         $line->load($_result["prescription_line_medicament_id"]);
         $pat->_distant_line = $line;
     } else {
         if (isset($_result["prescription_line_mix_item_id"])) {
             $line = new CPrescriptionLineMixItem();
             $line->load($_result["prescription_line_mix_item_id"]);
             $pat->_distant_line = $line;
         }
     }