$patients = $patient->loadList($where); } else { $patients = $patient->loadList($where, "nom, prenom", "{$page}, 30", null, $leftjoin); } CPatient::massLoadIPP($patients); /** @var CPatientState $patients_state */ $patients_state = CPatient::massLoadBackRefs($patients, "patient_state", "datetime DESC"); $mediusers = CPatientState::massLoadFwdRef($patients_state, "mediuser_id"); /** @var CPatientLink[] $link1 */ $link1 = CPatient::massLoadBackRefs($patients, "patient_link1"); /** @var CPatientLink[] $link2 */ $link2 = CPatient::massLoadBackRefs($patients, "patient_link2"); $patient_link1 = CPatientLink::massLoadFwdRef($link1, "patient_id2"); $patient_link2 = CPatientLink::massLoadFwdRef($link2, "patient_id1"); $patient_link = $patient_link1 + $patient_link2; CPatient::massLoadIPP($patient_link); foreach ($link1 as $_link1) { $_link1->_ref_patient_doubloon = $patient_link[$_link1->patient_id2]; } foreach ($link2 as $_link2) { $_link2->_ref_patient_doubloon = $patient_link[$_link2->patient_id1]; } foreach ($patients_state as $_patient_state) { /** @var CPatient $patient */ $patient = $patients[$_patient_state->patient_id]; $_patient_state->_ref_patient = $patient; $_patient_state->_ref_mediuser = $mediusers[$_patient_state->mediuser_id]; } foreach ($patients as $_patient) { $_patient->_ref_last_patient_states = current($_patient->_back["patient_state"]); if ($state == "dpot") {
$where["nom"] = "LIKE '{$nom}%'"; if ($sexe != "") { $where["sexe"] = "= '{$sexe}'"; } /*if ($IPP) { /*$patient = new CPatient; $patient->_IPP = $patient_ipp; $patient->loadFromIPP(); }*/ $order = "nom, prenom, naissance"; $step = 30; $limit = "{$page}, {$step}"; $patient = new CPatient(); $patient->nom = $nom; $patient->prenom = $prenom; $patient->nom_jeune_fille = $nom_jeune_fille; $patient->sexe = $sexe; //$patient->_IPP = $IPP; $nb_pat = $patient->countList($where); /** @var CPatient[] $patients CPatient[] */ $patients = $patient->loadList($where, $order, $limit); CPatient::massLoadIPP($patients); foreach ($patients as $_patient) { $_patient->loadFirstLog()->loadRefUser(); } $smarty = new CSmartyDP(); $smarty->assign("patient", $patient); $smarty->assign("patients", $patients); $smarty->assign("nb_pat", $nb_pat); $smarty->assign("page", $page); $smarty->display("inc_list_demographic.tpl");
/** * Mass load mechanism for forward references of an object collection * * @param self[] $sejours Array of objects * @param string $group_id Tag * * @return self[] Loaded collection, null if unavailable, with ids as keys of guids for meta references */ static function massLoadNRA($sejours, $group_id = null) { // Utilise t-on le rang pour le dossier if (!CAppUI::conf("dPplanningOp CSejour use_dossier_rang")) { return null; } // Aucune configuration du numero de rang if (null == ($tag_NRA = self::getTagNRA($group_id))) { return null; } // Récupération de la valeur des idex $ideces = CIdSante400::massGetMatchFor($sejours, $tag_NRA); /** @var CPatient[] $patients */ $patients = CMbObject::massLoadFwdRef($sejours, "patient_id"); CPatient::massLoadIPP($patients, $group_id); // Association idex-séjours foreach ($ideces as $_idex) { $sejour = $sejours[$_idex->object_id]; $patient = $patients[$sejour->patient_id]; $sejour->_ref_NRA = $_idex; $NRA = $_idex->_id ? $_idex->id400 : "-"; $sejour->_NDA_view = $patient->_IPP . "/" . $NRA; } foreach ($sejours as $_sejour) { if ($_sejour->_ref_NRA) { continue; } $_sejour->_ref_NRA = new CIdSante400(); } return null; }