Example #1
0
 /**
  * Génération du xml
  *
  * @return CXDSXmlDocument
  */
 function toXML()
 {
     $xml = new CXDSXmlDocument();
     $xml->createNameDescriptionRoot($this->name);
     $xml->importDOMDocument($xml->documentElement, $this->value->toXML());
     return $xml;
 }
Example #2
0
 /**
  * Génération de xml
  *
  * @return CXDSXmlDocument
  */
 function toXML()
 {
     $xml = new CXDSXmlDocument();
     $xml->createSlotRoot($this->name);
     $xml->createSlotValue($this->data);
     return $xml;
 }
 /**
  * Génère le XML
  *
  * @param boolean $registry XML pour le lot de soumission
  *
  * @return CXDSXmlDocument|void
  */
 function toXML($registry)
 {
     $xml = new CXDSXmlDocument();
     $variables = $this->getPropertie();
     if ($registry) {
         $xml->createRegistryPackageRoot($this->id);
     } else {
         $xml->createExtrinsicObjectRoot($this->id, $this->mimeType, $this->objectType, $this->lid);
     }
     $base_xml = $xml->documentElement;
     foreach ($variables as $_variable) {
         $class = $this->{$_variable};
         if (!$class || $_variable === "mimeType" || $_variable === "lid") {
             continue;
         }
         if (is_array($this->{$_variable})) {
             foreach ($this->{$_variable} as $_instance) {
                 $xml->importDOMDocument($base_xml, $_instance->toXML());
             }
         } else {
             $xml->importDOMDocument($base_xml, $class->toXML());
         }
     }
     return $xml;
 }
 /**
  * Génération du XML pour l'instance en cours
  *
  * @return CXDSXmlDocument
  */
 function toXML()
 {
     $xml = new CXDSXmlDocument();
     $xml->createExternalIdentifierRoot($this->id, $this->identificationScheme, $this->registryObject, $this->value);
     if ($this->name) {
         $xml->importDOMDocument($xml->documentElement, $this->name->toXML());
     }
     return $xml;
 }
 /**
  * Génération du xml pour l'instance en cours
  *
  * @param bool $submissionSet false
  *
  * @return CXDSXmlDocument
  */
 function toXML($submissionSet = false)
 {
     $xml = new CXDSXmlDocument();
     if ($submissionSet) {
         $xml->createSubmissionRoot($this->id, $this->classificationNode, $this->classifiedObject);
     }
     $xml->createClassificationRoot($this->id, $this->classificationScheme, $this->classifiedObject, $this->nodeRepresentation);
     return $xml;
 }
 /**
  * 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);
 }
Example #7
0
 /**
  * Retourne l'ensemble des valeurs d'un jeux de valeur
  *
  * @param String $name Nom du jeux de valeur
  *
  * @return array
  */
 static function loadJV($name)
 {
     $path = "modules/xds/resources/jeux_de_valeurs/{$name}";
     $dom = new CXDSXmlDocument();
     $dom->load($path);
     $xpath = new CMbXPath($dom);
     $nodes = $xpath->query("//line");
     $jeux_valeurs = array();
     foreach ($nodes as $_node) {
         $id = $xpath->queryAttributNode(".", $_node, "id");
         $oid = $xpath->queryAttributNode(".", $_node, "oid");
         $name = $xpath->queryAttributNode(".", $_node, "name");
         $jeux_valeurs["{$oid}^{$id}"] = $name;
     }
     return $jeux_valeurs;
 }
 /**
  * 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);
 }
 /**
  * Génération du xml
  *
  * @return CXDSXmlDocument
  */
 function toXML()
 {
     $xml = new CXDSXmlDocument();
     $xml->createRegistryObjectListRoot();
     $base_xml = $xml->documentElement;
     foreach ($this->registryPackage as $_registryPackage) {
         $xml->importDOMDocument($base_xml, $_registryPackage->toXML());
     }
     foreach ($this->extrinsicObject as $_extrinsicObject) {
         $xml->importDOMDocument($base_xml, $_extrinsicObject->toXML());
     }
     foreach ($this->association as $_association) {
         $xml->importDOMDocument($base_xml, $_association->toXML());
     }
     $xml->createSubmitObjectsRequestRoot();
     return $xml;
 }
 /**
  * @see parent::toXML()
  *
  * @return CXDSXmlDocument
  */
 function toXML()
 {
     $xml = new CXDSXmlDocument();
     $root = $xml->createAssociationRoot($this->id, $this->associationType, $this->sourceObject, $this->targetObject, $this->objectType);
     if ($this->OriginalStatus) {
         $xml->importDOMDocument($root, $this->OriginalStatus->toXML());
     }
     if ($this->NewStatus) {
         $xml->importDOMDocument($root, $this->NewStatus->toXML());
     }
     if ($this->SubmissionSetStatus) {
         $xml->importDOMDocument($root, $this->SubmissionSetStatus->toXML());
     }
     if ($this->PreviousVersion) {
         $xml->importDOMDocument($root, $this->PreviousVersion->toXML());
     }
     return $xml;
 }
 /**
  * Génération du xml
  *
  * @return CXDSXmlDocument
  */
 function toXML()
 {
     $xml = new CXDSXmlDocument();
     $xml->createVersionInfo($this->value);
     return $xml;
 }
 /**
  * Create the XDS query
  *
  * @return string
  */
 function createQuery()
 {
     $xml = new CXDSXmlDocument();
     $message = $xml->createQueryElement($xml, "AdhocQueryRequest");
     $response_option = $xml->createQueryElement($message, "ResponseOption");
     $xml->addAttribute($response_option, "returnComposedObjects", $this->returnComposedObjects);
     $xml->addAttribute($response_option, "returnType", $this->returnType);
     $adhocQuery = $xml->createRimRoot("AdhocQuery", null, $message);
     $xml->addAttribute($adhocQuery, "id", $this->query);
     foreach ($this->values as $_name => $_values) {
         //And statement
         if (is_array($_values)) {
             foreach ($_values as $_value) {
                 $data = self::formatData($_value, $_name);
                 $slot = new CXDSSlot("{$_name}", array($data));
                 $xml->importDOMDocument($adhocQuery, $slot->toXML());
             }
         } else {
             $parts = explode("|", $_values);
             $value = "";
             foreach ($parts as $_part) {
                 $data = self::formatData($_part, $_name, true);
                 $value .= "{$data},";
             }
             $value = rtrim($value, ",");
             $slot = new CXDSSlot("{$_name}", array("({$value})"));
             $xml->importDOMDocument($adhocQuery, $slot->toXML());
         }
     }
     return $xml->saveXML();
 }
 /**
  * Génération du xml
  *
  * @return CXDSXmlDocument
  */
 function toXML()
 {
     $xml = new CXDSXmlDocument();
     $xml->createLocalized($this->value, $this->charset, $this->lang);
     return $xml;
 }
Example #15
0
 /**
  * Get aAcknowledgment object
  *
  * @param string $ack_data Data
  *
  * @return CHL7v3AcknowledgmentPRPA|null
  */
 static function getAcknowledgment($ack_data)
 {
     $dom = new CXDSXmlDocument();
     $dom->loadXMLSafe($ack_data);
     $element = $dom->documentElement;
     $localName = $element->localName;
     $name_event = str_replace("Response", "", $localName);
     $class_name = "CHL7v3Acknowledgment{$name_event}";
     switch ($class_name) {
         case "CHL7v3AcknowledgmentRetrieveDocumentSet":
             $hl7event = new $class_name();
             break;
         default:
             $hl7event = new CHL7v3AcknowledgmentXDSb();
     }
     $hl7event->dom = $dom;
     return $hl7event;
 }