/**
  * Build ProvideAndRegisterDocumentSetRequest event
  *
  * @param CXDSQueryRegistryStoredQuery $object compte rendu
  *
  * @see parent::build()
  *
  * @return void
  */
 function build($object)
 {
     //Récupération de l'objet mediboard concerné par la requête à effectuer(présence du loadLastLog dans le parent)
     $mb_object = $object->document_item ? $object->document_item : $object->patient;
     parent::build($mb_object);
     $this->message = $object->createQuery();
     $this->updateExchange(false);
 }
 /**
  * Build RetrieveDocumentSetRequest event
  *
  * @param CPatient $object Patient
  *
  * @see parent::build()
  *
  * @throws CMbException
  * @return void
  */
 function build($object)
 {
     parent::build($object);
     $xml = new CXDSXmlDocument();
     $root = $xml->createDocumentRepositoryElement($xml, "RetrieveDocumentSetRequest");
     $document_request = $xml->createDocumentRepositoryElement($root, "DocumentRequest");
     $xml->createDocumentRepositoryElement($document_request, "RepositoryUniqueId", $this->repository_id);
     $xml->createDocumentRepositoryElement($document_request, "DocumentUniqueId", $this->oid);
     $this->message = $xml->saveXML();
     $this->updateExchange(false);
 }
 /**
  * Build ProvideAndRegisterDocumentSetRequest event
  *
  * @param CCompteRendu|CFile $object compte rendu
  *
  * @see parent::build()
  *
  * @throws CMbException
  * @return void
  */
 function build($object)
 {
     parent::build($object);
     $xml = new CXDSXmlDocument();
     $message = $xml->createDocumentRepositoryElement($xml, "ProvideAndRegisterDocumentSetRequest");
     $factory = CCDAFactory::factory($object);
     $factory->old_version = $this->old_version;
     $factory->old_id = $this->old_id;
     $factory->receiver = $this->_receiver;
     $cda = null;
     $cda = $factory->generateCDA();
     try {
         //CCdaTools::validateCDA($cda);
     } catch (CMbException $e) {
         throw $e;
     }
     $xds = CXDSFactory::factory($factory);
     $xds->type = $this->type;
     $xds->doc_uuid = $this->uuid;
     switch ($this->hide) {
         case "0":
             $xds->hide_ps = true;
             break;
         case "1":
             $xds->hide_patient = true;
             break;
         default:
             $xds->hide_patient = false;
     }
     $xds->extractData();
     $xds->xcn_mediuser = $this->xcn_mediuser ? $this->xcn_mediuser : $xds->xcn_mediuser;
     $xds->xon_etablissement = $this->xon_etablissement ? $this->xon_etablissement : $xds->xon_etablissement;
     $xds->specialty = $this->specialty ? $this->specialty : $xds->specialty;
     $xds->practice_setting = $this->pratice_setting ? $this->pratice_setting : $xds->practice_setting;
     $xds->health_care_facility = $this->healtcare ? $this->healtcare : $xds->health_care_facility;
     $header_xds = $xds->generateXDS41();
     $xml->importDOMDocument($message, $header_xds);
     //ajout d'un document
     $document = $xml->createDocumentRepositoryElement($message, "Document");
     $xml->addAttribute($document, "id", $xds->uuid["extrinsic"]);
     $document->nodeValue = base64_encode($cda);
     //ajout de la signature
     CEAIHandler::notify("AfterBuild", $this, $xml, $factory, $xds);
     $this->message = $xml->saveXML($message);
     $this->updateExchange(false);
 }
 /**
  * Build ProvideAndRegisterDocumentSetRequest event
  *
  * @param CCompteRendu|CFile $object compte rendu
  *
  * @see parent::build()
  *
  * @throws CMbException
  * @return void
  */
 function build($object)
 {
     parent::build($object);
     $uuid = $this->uuid;
     $factory = CCDAFactory::factory($object);
     $cda = $factory->generateCDA();
     try {
         CCdaTools::validateCDA($cda);
     } catch (CMbException $e) {
         throw $e;
     }
     $xml = new CXDSXmlDocument();
     $xds = CXDSFactory::factory($factory);
     $xds->type = $this->type;
     $xds->extractData();
     $header_xds = $xds->generateXDS57($uuid, $this->action);
     $xml->importDOMDocument($xml, $header_xds);
     $this->message = $xml->saveXML();
     $this->updateExchange(false);
 }