コード例 #1
0
        $medecin_adresse_par->load($sejour->adresse_par_prat_id);
    }
    // Fiche autonomie
    $fiche_autonomie->sejour_id = $sejour->_id;
    $fiche_autonomie->loadMatchingObject();
    // Bilan SSR
    $bilan->sejour_id = $sejour->_id;
    $bilan->loadMatchingObject();
    // Prescription SSR
    $prescription = $sejour->loadRefPrescriptionSejour();
    // Chargement des lignes de la prescription
    if ($prescription && $prescription->_id) {
        $line = new CPrescriptionLineElement();
        $line->prescription_id = $prescription->_id;
        /** @var CPrescriptionLineElement $_lines */
        $_lines = $line->loadMatchingList("debut ASC");
        foreach ($_lines as $_line) {
            $line->getRecentModification();
            $lines[$_line->_ref_element_prescription->category_prescription_id][$_line->element_prescription_id][] = $_line;
        }
    }
    if ($patient->_ref_medecin_traitant->_id) {
        $correspondantsMedicaux["traitant"] = $patient->_ref_medecin_traitant;
    }
    foreach ($patient->_ref_medecins_correspondants as $correspondant) {
        $correspondantsMedicaux["correspondants"][] = $correspondant->_ref_medecin;
    }
} else {
    $sejour->group_id = $group_id;
    $sejour->praticien_id = $user->_id;
    $sejour->entree_prevue = CMbDT::date() . " 08:00:00";