예제 #1
0
$risques_cis = array();
global $atc_classes;
$atc_classes = array();
$hidden_lines_count = 0;
$hide_inactive_count = 0;
if (CModule::getActive("dPprescription")) {
    // Chargement des cis à risque
    $where = array();
    $where["risque"] = " = '1'";
    $risques_cis = CProduitLivretTherapeutique::getCISList($where);
    // Chargement de la prescription à partir du sejour
    $prescription = new CPrescription();
    $prescription->object_id = $sejour_id;
    $prescription->object_class = "CSejour";
    $prescription->type = "sejour";
    $prescription->loadMatchingObject();
    // Chargement de toutes les planifs systemes si celles-ci ne sont pas deja chargées
    $prescription->calculAllPlanifSysteme();
    // Chargement des configs de service
    $sejour->loadRefCurrAffectation($date);
    if (!$sejour->_ref_curr_affectation->_id) {
        $sejour->loadRefsAffectations();
        $sejour->_ref_curr_affectation = $sejour->_ref_last_affectation;
    }
    if ($sejour->_ref_curr_affectation->_id) {
        $service_id = $sejour->_ref_curr_affectation->service_id;
    } else {
        $service_id = "none";
    }
    $configs = CConfigService::getAllFor($service_id);
    if (!$nb_decalage) {
    }
    foreach ($prescriptions as $_presc) {
        $_presc->_ref_object->loadRefPatient();
    }
    array_multisort(CMbArray::pluck($prescriptions, "_ref_object", "_ref_patient", "nom"), SORT_ASC, $prescriptions);
} else {
    $prescriptions = $prescription->loadList($where, "patients.nom", null, "prescription_id", $ljoin);
}
if ($type_prescription == "sortie_manquante") {
    foreach ($prescriptions as $_prescription) {
        // Recherche d'une prescription de sortie correspondant à la prescription de sejour
        $_prescription_sortie = new CPrescription();
        $_prescription_sortie->type = "sortie";
        $_prescription_sortie->object_id = $_prescription->object_id;
        $_prescription_sortie->object_class = $_prescription->object_class;
        $_prescription_sortie->loadMatchingObject();
        if ($_prescription_sortie->_id) {
            unset($prescriptions[$_prescription->_id]);
        }
    }
}
$sejour = new CSejour();
$sejour->_date_min = $date_min;
$sejour->_date_max = $date_max;
if (!$praticien_id && $user->isPraticien()) {
    $praticien_id = $user->_id;
}
foreach ($prescriptions as $_prescription) {
    $_prescription->loadRefPatient();
    $patient = $_prescription->_ref_patient;
    $sejour = $_prescription->_ref_object;
예제 #3
0
 /**
  * Chargement de la prescription d'hospitalisation
  *
  * @return CPrescription
  */
 function loadRefPrescriptionSejour()
 {
     if (!CModule::getActive("dPprescription")) {
         return null;
     }
     $this->_ref_prescription_sejour = new CPrescription();
     if (!$this->_id) {
         return $this->_ref_prescription_sejour;
     }
     $this->_ref_prescription_sejour->object_class = "CSejour";
     $this->_ref_prescription_sejour->object_id = $this->_id;
     $this->_ref_prescription_sejour->type = "sejour";
     $this->_ref_prescription_sejour->loadMatchingObject();
     return $this->_ref_prescription_sejour;
 }