Exemplo n.º 1
0
if ($order_col == "_entree") {
    $order = "entree {$order_way}, rpu.ccmu {$order_way}";
}
if ($order_col == "ccmu") {
    $order = "rpu.ccmu {$order_way}, entree {$order_way}";
}
if ($order_col == "_patient_id") {
    $order = "patients.nom {$order_way}, ccmu {$order_way}";
}
/** @var CSejour[] $listSejours */
$listSejours = $sejour->loadList($where, $order, null, null, $ljoin);
foreach ($listSejours as &$sejour) {
    // Chargement du numero de dossier
    $sejour->loadNDA();
    $sejour->loadRefsFwd();
    $sejour->loadRefRPU();
    $sejour->_ref_rpu->loadRefSejourMutation();
    $sejour->loadRefsConsultations();
    $sejour->loadRefsNotes();
    $sejour->countDocItems();
    $sejour->loadRefPrescriptionSejour();
    $prescription = $sejour->_ref_prescription_sejour;
    if ($prescription) {
        $prescription->loadRefsPrescriptionLineMixes();
        $prescription->loadRefsLinesMedByCat();
        $prescription->loadRefsLinesElementByCat();
        $sejour->_ref_prescription_sejour->countRecentModif();
    }
    // Chargement de l'IPP
    $sejour->_ref_patient->loadIPP();
    // Séjours antérieurs
Exemplo n.º 2
0
$sejours_chambre = array();
$sejour = new CSejour();
/** @var CSejour[] $sejours */
$sejours = $sejour->loadList($where_temp, null, null, "sejour_id", $ljoin, "entree");
if (!CAppUI::conf("dPurgences view_rpu_uhcd")) {
    $where["sejour.uhcd"] = " = '1'";
    $sejours_uhcd = $sejour->loadList($where, null, null, "sejour_id", $ljoin, "entree");
    foreach ($sejours_uhcd as $sejour_uhcd) {
        $sejours[$sejour_uhcd->_id] = $sejour_uhcd;
    }
}
foreach ($sejours as $sejour) {
    $sejour->loadRefPatient();
    $sejour->loadRefPraticien();
    $sejour->loadRefCurrAffectation()->loadRefService();
    if (!$sejour->loadRefRPU()->_id) {
        $sejour->_ref_rpu = $sejour->loadUniqueBackRef("rpu_mute");
        if (!$sejour->_ref_rpu) {
            $sejour->_ref_rpu = new CRPU();
        }
    }
    $sejour->_ref_rpu->loadRefMotifSFMU();
    $prescription = $sejour->loadRefPrescriptionSejour();
    if ($prescription->_id) {
        if (@CAppUI::conf("object_handlers CPrescriptionAlerteHandler")) {
            $prescription->_count_fast_recent_modif = $prescription->countAlertsNotHandled("medium");
            $prescription->_count_urgence["all"] = $prescription->countAlertsNotHandled("high");
        } else {
            $prescription->countFastRecentModif();
            $prescription->loadRefsLinesMedByCat();
            $prescription->loadRefsLinesElementByCat();
 /**
  * Récupération de la nature de la venue
  *
  * @param DOMNode $node    Node
  * @param CSejour $mbVenue Venue
  *
  * @return CSejour
  */
 function getNatureVenue(DOMNode $node, CSejour $mbVenue)
 {
     $xpath = new CHPrimXPath($node->ownerDocument);
     if (CAppUI::conf("dPpmsi passage_facture") == "reception" && self::getEtatVenue($node) == "clôturée") {
         $mbVenue->facture = 1;
     }
     $sender = $this->_ref_echange_hprim->_ref_sender;
     // Obligatoire pour MB
     $nature = $xpath->queryAttributNode("hprim:natureVenueHprim", $node, "valeur", "", false);
     $attrNatureVenueHprim = array("hsp" => "comp", "cslt" => "consult", "sc" => "seances", "ambu" => "ambu", "exte" => "exte");
     // Détermine le type de venue depuis la config des numéros de dossier
     $type_config = self::getVenueType($sender, $mbVenue->_NDA);
     if ($type_config) {
         $mbVenue->type = $type_config;
     }
     // Cas des urgences : dans tous les cas ce sera de l'hospi comp.
     $rpu = $mbVenue->loadRefRPU();
     if ($rpu && $rpu->_id && $rpu->sejour_id == $rpu->mutation_sejour_id) {
         $mbVenue->type = "comp";
     }
     if (!$mbVenue->type) {
         if ($nature) {
             $mbVenue->type = $attrNatureVenueHprim[$nature];
         }
     }
     if (!$mbVenue->type) {
         $mbVenue->type = "comp";
     }
     return $mbVenue;
 }
Exemplo n.º 4
0
 */
$sejour_id = CValue::get("sejour_id");
$module = CValue::get("module");
$callback = CValue::get("callback");
$modify_sortie_prevue = CValue::get("modify_sortie_prevue", true);
$sejour = new CSejour();
$sejour->load($sejour_id);
$can_admission = CModule::getCanDo("dPadmissions");
if (!$sejour->canDo()->edit && !$can_admission->edit && !CModule::getCanDo("dPhospi")->edit && !CModule::getCanDo("dPurgences")->edit && !CModule::getCanDo("soins")->edit) {
    $can_admission->redirect();
}
$sejour->loadRefServiceMutation();
$sejour->loadRefEtablissementTransfert();
//Cas des urgences
if (CModule::getActive("dPurgences")) {
    $sejour->loadRefRPU()->loadRefSejourMutation();
}
$patient = $sejour->loadRefPatient();
if (CModule::getActive("maternite") && $sejour->grossesse_id) {
    $sejour->loadRefsNaissances();
    foreach ($sejour->_ref_naissances as $_naissance) {
        /** @var CNaissance $_naissance */
        $_naissance->loadRefSejourEnfant()->loadRefPatient();
    }
    $sejour->_sejours_enfants_ids = CMbArray::pluck($sejour->_ref_naissances, "sejour_enfant_id");
}
//Cas du mode sortie personnalisé
$list_mode_sortie = array();
if (CAppUI::conf("dPplanningOp CSejour use_custom_mode_sortie")) {
    $mode_sortie = new CModeSortieSejour();
    $where = array("actif" => "= '1'");