コード例 #1
0
 /**
  * Récupération des médecins
  *
  * @param DOMNode $node    Node
  * @param CSejour $mbVenue Venue
  *
  * @return CSejour
  */
 function getMedecins(DOMNode $node, CSejour $mbVenue)
 {
     $xpath = new CHPrimXPath($node->ownerDocument);
     $sender = $this->_ref_echange_hprim->_ref_sender;
     $medecins = $xpath->queryUniqueNode("hprim:medecins", $node);
     if ($medecins instanceof DOMElement) {
         $medecin = $medecins->childNodes;
         foreach ($medecin as $_med) {
             $mediuser_id = $this->getMedecin($_med);
             $lien = $xpath->getValueAttributNode($_med, "lien");
             if ($lien == "rsp") {
                 $mbVenue->praticien_id = $mediuser_id;
             }
         }
     }
     // Dans le cas ou la venue ne contient pas de medecin responsable
     // Attribution d'un medecin indeterminé
     if (!$mbVenue->praticien_id) {
         $user = new CUser();
         $mediuser = new CMediusers();
         $user->user_last_name = CAppUI::conf("hprimxml medecinIndetermine") . " {$sender->group_id}";
         if (!$user->loadMatchingObject()) {
             $mediuser->_user_last_name = $user->user_last_name;
             $mediuser->_id = $this->createPraticien($mediuser);
         } else {
             $user->loadRefMediuser();
             $mediuser = $user->_ref_mediuser;
         }
         $mbVenue->praticien_id = $mediuser->_id;
     }
     return $mbVenue;
 }