$sejour->_ref_consult_anesth->loadRefConsultation();
$sejour->canRead();
// Chargement des affectations
$sejour->loadRefCurrAffectation()->loadRefLit();
foreach ($sejour->loadRefsAffectations() as $_affectation) {
    $_affectation->loadRefLit();
}
// Chargement des tâches
foreach ($sejour->loadRefsTasks() as $_task) {
    $_task->loadRefPrescriptionLineElement();
    $_task->setDateAndAuthor();
    $_task->loadRefAuthor();
    $_task->loadRefAuthorRealise();
}
// Chargement des opérations
$sejour->loadRefsOperations();
foreach ($sejour->_ref_operations as $_interv) {
    $_interv->loadRefChir();
    $_interv->loadRefAnesth();
    $_interv->loadRefPlageOp();
    $_interv->_ref_chir->loadRefFunction();
    $_interv->loadRefsConsultAnesth();
    $_interv->loadBrancardage();
    /** @var CDailyCheckList[] $check_lists  */
    $check_lists = $_interv->loadBackRefs("check_lists", "date");
    foreach ($check_lists as $_check_list_id => $_check_list) {
        // Remove check lists not signed
        if (!$_check_list->validator_id) {
            unset($_interv->_back["check_lists"][$_check_list_id]);
            unset($check_lists[$_check_list_id]);
            continue;
$patient->loadIPP();
// Dossier médical
$dossier_medical = $patient->loadRefDossierMedical(false);
// Chargement du numéro de dossier
$sejour->loadNDA();
// Chargement des notes sur le séjourw
$sejour->loadRefsNotes();
// Chargement des modes d'entrée
$sejour->loadRefEtablissementProvenance();
// Chargement des appels
$sejour->loadRefsAppel('admission');
// Chargement de l'affectation
$affectation = $sejour->loadRefFirstAffectation();
// Chargement des interventions
$whereOperations = array("annulee" => "= '0'");
$operations = $sejour->loadRefsOperations($whereOperations);
// Chargement optimisée des prestations
CSejour::massCountPrestationSouhaitees(array($sejour));
foreach ($operations as $operation) {
    $operation->loadRefsActes();
    $dossier_anesth = $operation->loadRefsConsultAnesth();
    $consultation = $dossier_anesth->loadRefConsultation();
    $consultation->loadRefPlageConsult();
    $dossier_anesth->_date_consult = $consultation->_date;
}
if (CAppUI::conf("dPadmissions show_deficience")) {
    CDossierMedical::massCountAntecedentsByType(array($dossier_medical), "deficience");
}
$list_mode_entree = array();
if (CAppUI::conf("dPplanningOp CSejour use_custom_mode_entree")) {
    $mode_entree = new CModeEntreeSejour();
Ejemplo n.º 3
0
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: $
 */
CCanDo::checkEdit();
// Chargement du séjour et des ses actes
$sejour = new CSejour();
$sejour->load(CValue::get("sejour_id"));
$sejour->loadRefPatient();
$sejour->loadRefPraticien();
$sejour->loadRefsActes();
$sejour->canDo();
$sejour->countExchanges();
$sejour->loadRefDossierMedical()->loadComplete();
$sejour->_ref_patient->loadRefDossierMedical()->loadComplete();
// Chargement des interventions et de leurs actes
foreach ($sejour->loadRefsOperations() as $_op) {
    $_op->loadRefPatient();
    $_op->loadRefAnesth()->loadRefFunction();
    $_op->loadRefPraticien()->loadRefFunction();
    $_op->loadRefPlageOp();
    $_op->loadRefSalle();
    $_op->loadRefsActes();
    $_op->canDo();
    $_op->countExchanges();
    $_op->loadRefsConsultAnesth()->loadRefConsultation()->loadRefPlageConsult();
}
// Chargement des consultations et de leurs actes
foreach ($sejour->loadRefsConsultations() as $_consult) {
    $_consult->loadRefPatient();
    $_consult->loadRefPraticien()->loadRefFunction();
    $_consult->loadRefsActes();
Ejemplo n.º 4
0
 /**
  * Chargement de tous les séjours de la facture
  *
  * @return object
  **/
 function loadRefsSejour()
 {
     if (count($this->_ref_sejours)) {
         return $this->_ref_sejours;
     }
     if (CModule::getActive("dPfacturation")) {
         $ljoin = array();
         $ljoin["facture_liaison"] = "facture_liaison.object_id = sejour.sejour_id";
         $where = array();
         $where["facture_liaison.facture_id"] = " = '{$this->_id}'";
         $where["facture_liaison.facture_class"] = " = '{$this->_class}'";
         $where["facture_liaison.object_class"] = " = 'CSejour'";
         $sejour = new CSejour();
         $this->_ref_sejours = $sejour->loadList($where, "sejour_id", null, "sejour_id", $ljoin);
         // Chargement des actes de séjour
         foreach ($this->_ref_sejours as $sejour) {
             /** @var CSejour $sejour*/
             $sejour->loadRefsOperations();
             foreach ($sejour->_ref_operations as $op) {
                 $op->loadRefsActes($this->numero, 1);
                 $this->rangeActes($op);
             }
             $sejour->loadRefsActes($this->numero, 1);
             $this->rangeActes($sejour);
         }
     }
     if (count($this->_ref_sejours) > 0) {
         $this->_ref_last_sejour = end($this->_ref_sejours);
         $this->_ref_first_sejour = reset($this->_ref_sejours);
         $this->_ref_last_sejour->loadRefLastOperation();
         $this->_ref_last_sejour->_ref_last_operation->loadRefAnesth();
     } else {
         $this->_ref_last_sejour = new CSejour();
         $this->_ref_first_sejour = new CSejour();
     }
     return $this->_ref_sejours;
 }
Ejemplo n.º 5
0
 $phonings = $patient->getPhoning($_sejour->entree);
 foreach ($guess["phonings"] = array_keys($phonings) as $phoning_id) {
     if (array_key_exists($phoning_id, $patients)) {
         $guesses[$phoning_id]["mergeable"] = true;
         $guess["mergeable"] = true;
     }
 }
 // Multiple séjours
 if (count($patient->_ref_sejours) > 1) {
     $guess["mergeable"] = true;
 }
 $where = array();
 $where["annulee"] = " = '0'";
 // Multiple Interventions
 foreach ($patient->_ref_sejours as $_sejour) {
     $operations = $_sejour->loadRefsOperations($where);
     foreach ($operations as $_operation) {
         $_operation->loadView();
     }
     if (count($operations) > 1) {
         $guess["mergeable"] = true;
     }
     // Multiple RPU
     if ($module == "dPurgences") {
         if (count($_sejour->_back["rpu"]) > 1) {
             $guess["mergeable"] = true;
         }
     }
 }
 if ($guess["mergeable"]) {
     $mergeables_count++;