/** * Vue de la liste des patients HPRIM * * @category Hprim21 * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version SVN: $Id: vw_patients.php 19437 2013-06-05 22:38:47Z rhum1 $ * @link http://www.mediboard.org */ CCanDo::checkRead(); $showCount = 30; // Chargement du patient sélectionné $patient_id = CValue::getOrSession("patient_id"); $patient = new CHprim21Patient(); $patient->load($patient_id); // Récuperation des patients recherchés $patient_nom = CValue::getOrSession("nom", ""); $patient_prenom = CValue::getOrSession("prenom", ""); $patient_jeuneFille = CValue::getOrSession("jeuneFille", ""); $patient_ville = CValue::getOrSession("ville", ""); $patient_cp = CValue::getOrSession("cp", ""); $patient_day = CValue::get("Date_Day", ""); $patient_month = CValue::get("Date_Month", ""); $patient_year = CValue::get("Date_Year", ""); $patient_naissance = null; $where = array(); $whereSoundex = array(); $soundexObj = new soundex2(); if ($patient_nom) { $patient_nom = trim($patient_nom);
$hprimSejour = new CHprim21Sejour(); $where = array(); $where["date_mouvement"] = ">= '{$date_limite}'"; $where["sejour_id"] = "IS NULL"; $order = "date_mouvement DESC"; /** @var CHprim21Sejour[] $listHprimSejours */ $listHprimSejours = $hprimSejour->loadList($where, $order, $qte_limite); $total = count($listHprimSejours); // Liaison à un sejour existant $nouv = $anc = $nopat = $moresej = $err = 0; foreach ($listHprimSejours as $_sejour) { $_sejour->loadRefExchange(); $echg_hprim = $_sejour->_ref_echange_hprim21; // Vérification que le patient correspondant est bien lié $hprimPatient = new CHprim21Patient(); $hprimPatient->load($_sejour->hprim21_patient_id); if (!$hprimPatient->patient_id) { $nopat++; continue; } // Recherche si la liaison a déjà été faite $nda = new CIdSante400(); $nda->object_class = "CSejour"; $nda->tag = $tag_sejour; $nda->id400 = "{$_sejour->external_id}"; $nda->loadMatchingObject(); if ($nda->_id) { $_sejour->sejour_id = $nda->object_id; $_sejour->store(); $echg_hprim->object_class = $nda->object_class; $echg_hprim->object_id = $nda->object_id;