$where["status"] = "!= 'VALI'"; } if ($state == "dpot") { $patient_link = new CPatientLink(); $patient_links = $patient_link->loadList(null, null, "{$page}, 30"); $patient_ids1 = CMbArray::pluck($patient_links, "patient_id1"); $patient_ids2 = CMbArray::pluck($patient_links, "patient_id2"); $where = array("patient_id" => CSQLDataSource::prepareIn(array_merge($patient_ids1, $patient_ids2))); $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) {
/** * @see parent::store() */ function store() { $this->completeField("patient_link_id"); if ($this->_id && $this->_id == $this->patient_link_id) { $this->patient_link_id = ""; } // Création d'un patient en mode cabinets distincts if (CAppUI::conf('dPpatients CPatient function_distinct') && !$this->_id) { $this->function_id = CMediusers::get()->function_id; } if ($this->fieldModified("naissance") || $this->fieldModified("sexe")) { // _guid is not valued yet !! DSHM::remKeys("alertes-*-CPatient-" . $this->_id); } // Si changement de sexe on essaie de retrouver la civilité if ($this->fieldModified("sexe") && !$this->fieldModified("civilite")) { $this->civilite = "guess"; } $this->_anonyme = $this->checkAnonymous(); if ($state = CPatientState::getState($this)) { $this->status = $state; } // Standard store if ($msg = parent::store()) { return $msg; } if ($this->_anonyme) { $this->nom = $this->_id; $this->store(); } CPatientState::storeState($this); // Vitale if (CModule::getActive("fse")) { $cv = CFseFactory::createCV(); if ($cv) { if ($msg = $cv->bindVitale($this)) { return $msg; } } } // Génération de l'IPP ? if ($this->_generate_IPP) { if ($msg = $this->generateIPP()) { return $msg; } } if ($this->_vitale_nir_certifie) { if ($msg = CINSPatient::createINSC($this)) { return $msg; } } return null; }
<?php /** * $Id$ * * @category DPpatients * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ * @link http://www.mediboard.org */ if (!CAppUI::pref("allowed_modify_identity_status")) { CAppUI::redirect("m=system&a=access_denied"); } $date_min = CValue::getOrSession("_date_min"); $date_max = CValue::getOrSession("_date_max"); CValue::setSession("patient_state_date_min", $date_min); CValue::setSession("patient_state_date_max", $date_max); $patients_count = CPatientState::getAllNumberPatient($date_min, $date_max); $smarty = new CSmartyDP(); $smarty->assign("patients_count", $patients_count); $smarty->assign("date_min", $date_min); $smarty->assign("date_max", $date_max); $smarty->display("patient_state/inc_manage_patient_state.tpl");