/** * Get others PV1 QPD element * * @param DOMNode $node QPD element * * @return array */ function getOtherRequestSejour(DOMNode $node) { // Recherche du service $service = new CService(); $ds = $service->getDS(); $where_returns = array(); if ($service_name = $this->getDemographicsFields($node, "CSejour", "3.1")) { $service_name = preg_replace("/\\*+/", "%", $service_name); $where["code"] = $ds->prepare("LIKE %", $service_name); $ids = array_unique($service->loadIds($where, null, 100)); // FIXME prendre les affectations en compte $where_returns["sejour.service_id"] = $ds->prepareIn($ids); } // Praticien if (($attending_doctor_name = $this->getDemographicsFields($node, "CSejour", "7.2.1")) || ($attending_doctor_name = $this->getDemographicsFields($node, "CSejour", "17.2.1"))) { $user = new CUser(); $attending_doctor_name = preg_replace("/\\*+/", "%", $attending_doctor_name); $where["user_last_name"] = $ds->prepare("LIKE %", $attending_doctor_name); $ids = array_unique($user->loadIds($where, null, 100)); $where_returns["sejour.praticien_id"] = $ds->prepareIn($ids); } // Médecin adressant if ($referring_doctor_name = $this->getDemographicsFields($node, "CSejour", "8.2.1")) { $medecin = new CMedecin(); $referring_doctor_name = preg_replace("/\\*+/", "%", $referring_doctor_name); $where["nom"] = $ds->prepare("LIKE %", $referring_doctor_name); $ids = array_unique($medecin->loadIds($where, null, 100)); $where_returns["sejour.adresse_par_prat_id"] = $ds->prepareIn($ids); } return $where_returns; }