public function setQueryParametersParticipantObjectDetail() { $participant_object_detail = $this->msg_xml->addElement($this->query_parameters, 'ParticipantObjectDetail'); $MSH = $this->hl7_xml->queryNode("MSH", null, $foo, true); $MSH_10 = $this->hl7_xml->queryTextNode("MSH.10", $MSH); $this->msg_xml->addAttribute($participant_object_detail, 'type', 'MSH-10'); $this->msg_xml->addAttribute($participant_object_detail, 'value', base64_encode($MSH_10)); $this->query_parameters_participant_object_detail = $participant_object_detail; }
/** * Export object config * * @return CMbXMLDocument */ function exportXMLConfigValues() { $doc = new CMbXMLDocument(); $root = $doc->addElement($doc, $this->_class); foreach ($this->getConfigValues() as $key => $value) { $node = $doc->addElement($root, "entry"); $node->setAttribute("config", $key); $node->setAttribute("value", $value); } return $doc; }
/** * Export XML * * @return CMbXMLDocument */ function exportXML() { $doc = new CMbXMLDocument(); $root = $doc->addElement($doc, $this->_class); foreach ($this->getConfigFields() as $field) { $node = $doc->addElement($root, "entry"); $node->setAttribute("config", $field); $node->setAttribute("value", $this->{$field}); } return $doc; }
/** * Add element * * @param string $elParent Parent element * @param string $elName Name * @param string $elValue Value * @param string $elNS Namespace * * @return mixed */ function addElement($elParent, $elName, $elValue = null, $elNS = "urn:hl7-org:v2xml") { return parent::addElement($elParent, $elName, $elValue, $elNS); }
/** * Création d'un noeud pour lcm * * @param DOMNode $nodeParent Noeud parent * @param String $name Nom du noeud * @param String $value Valeur du noeud * * @return DOMElement */ function createLcmElement($nodeParent, $name, $value = null) { return parent::addElement($nodeParent, "lcm:{$name}", $value, "urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0"); }
/** * Permet de créer le xsd contenant la définition d'élément pour tester les types * * @param String $nameFile String * @param String $glob String * * @return bool */ static function createTestSchemaClasses($nameFile, $glob) { $dom = new CMbXMLDocument("UTF-8"); //On enregistre pas les nodeText vide $dom->preserveWhiteSpace = false; $dom->load($nameFile); //on récupère tous les élements $xpath = new CMbXPath($dom); $nodeList = $xpath->query("//xs:element"); //on supprime tous les élements du fichier foreach ($nodeList as $_node) { $dom->documentElement->removeChild($_node); } //On sauvegarde le fichier sans élément file_put_contents($nameFile, $dom->saveXML()); //on récupère tous les class existant dans les dossier voc, base, datatype $file = glob($glob, GLOB_BRACE); /** * Pour chacun des fichier on créé un élément avec sont type correspondant */ foreach ($file as $_file) { //on créé l'élément $element = $dom->addElement($dom->documentElement, "xs:element"); //on formatte le nom du fichier $_file = CMbArray::get(explode(".", $_file), 0); $_file = substr($_file, strrpos($_file, "/") + 1); //on créé une instance de la classe /** @var CCDAClasseBase $instanceClass */ $instanceClass = new $_file(); //on récupère le nom quisera égale au type et au nom de l'élément $_file = $instanceClass->getNameClass(); //On ajoute les attribut type et nom $dom->addAttribute($element, "name", $_file); $dom->addAttribute($element, "type", $_file); //On ajoute un saut de ligne dans le schéma $dom->documentElement->appendChild($dom->createTextNode("\n")); } //on sauvegarde le fichier file_put_contents($nameFile, $dom->saveXML()); return true; }
/** * Add element * * @param DOMNode $elParent Parent element * @param string $elName Name * @param string $elValue Value * @param string $elNS Namespace * * @return DOMElement */ function addElement($elParent, $elName, $elValue = null, $elNS = null) { return parent::addElement($elParent, $elName, $elValue, $elNS); }
if ($mbPatient->civilite == "mme") { $titre_ = "Madame"; } } $transTitre["Monsieur"] = "1"; $transTitre["Madame"] = "2"; $transTitre["Mademoiselle"] = "3"; $transTitre["Enfant garçon"] = "4"; $transTitre["Enfant fille"] = "5"; $transTitre["Bébé garçon"] = "6"; $transTitre["Bébé fille"] = "7"; $transTitre["Docteur"] = "8"; $transTitre["Doctoresse"] = "A"; $doc->setDocument("tmp/Prescription-" . $mbPrescription->_id . ".xml"); // Creation de la prescription $prescription = $doc->addElement($doc, "Prescription"); // Prescription --> Numero $num_prat = str_pad($idSantePratCode4->id400, 4, '0', STR_PAD_LEFT); $num_presc = $idexPresc; $num_presc %= 1000; $num_presc = str_pad($num_presc, 4, '0', STR_PAD_LEFT); $numero = $doc->addElement($prescription, "numero", $num_prat . $num_presc); // Prescription --> Patient $patient = $doc->addElement($prescription, "Patient"); $nom = $doc->addElement($patient, "nom", $mbPatient->nom); $prenom = $doc->addElement($patient, "prenom", $mbPatient->prenom); $titre = $doc->addElement($patient, "titre", $transTitre[$titre_]); $sexe = $doc->addElement($patient, "sexe", $transSexe[$mbPatient->sexe]); $datenaissance = $doc->addElement($patient, "datenaissance", CMbDT::format($mbPatient->naissance, "%Y%m%d")); $adresseligne1 = $doc->addElement($patient, "adresseligne1", $mbPatient->adresse); $adresseligne2 = $doc->addElement($patient, "adresseligne2", "");
CPasswordKeeper::checkHTTPS(); CCanDo::checkAdmin(); $password_keeper_id = CValue::postOrSession("password_keeper_id"); $oldPassphrase = CValue::post("oldPassphrase"); $newPassphrase = CValue::post("newPassphrase"); $passphrase = CValue::sessionAbs("passphrase"); if ($passphrase != $oldPassphrase) { $msg = "Phrase de passe incorrecte."; CAppUI::stepAjax($msg, UI_MSG_ERROR); } $user = CMediusers::get(); $keeper = new CPasswordKeeper(); $keeper->load($password_keeper_id); if ($keeper->_id && $keeper->user_id == $user->_id) { $dom = new CMbXMLDocument("ISO-8859-1"); $keeperNode = $dom->addElement($dom, "keeper"); $dom->addAttribute($keeperNode, "name", $keeper->keeper_name); $categoriesNode = $dom->addElement($keeperNode, "categories"); foreach ($keeper->loadRefsCategories() as $_category) { $categoryNode = $dom->addElement($categoriesNode, "category"); $dom->addAttribute($categoryNode, "name", $_category->category_name); $passwordsNode = $dom->addElement($categoryNode, "passwords"); foreach ($_category->loadRefsPasswords() as $_password) { // Déchiffrement du mot de passe $_password->password = $_password->getPassword(); // Génération d'un nouveau vecteur d'inistalisation $_password->generateIV(); // Chiffrement avec la nouvelle phrase de passe saisie $newPass = $_password->encrypt($newPassphrase); $passwordNode = $dom->addElement($passwordsNode, "password"); $dom->insertTextElement($passwordNode, "description", $_password->password_description);
/** * @see parent::addElement */ function addElement(DOMNode $elParent, $elName, $elValue = null, $elNS = "http://www.hprim.org/hprimXML") { return parent::addElement($elParent, $elName, $elValue, $elNS); }
public function setSubmissionSetParticipantObjectIDTypeCode() { $participant_object_id_type_code = $this->msg_xml->addElement($this->submission_set, 'ParticipantObjectIDTypeCode'); $this->setEVAttributes($participant_object_id_type_code, 'urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd', 'submission set classificationNode', 'IHE XDS Metadata'); $this->submission_set_participant_object_id_type_code = $participant_object_id_type_code; }
/** * Dispatch error * * @param string $data Data * @param CInteropSender $actor Actor data * * @return bool Always false */ static function dispatchError($data, $actor = null) { foreach (self::$errors as $_error) { CAppUI::stepAjax($_error, UI_MSG_WARNING); } // Création d'un échange Any $exchange_any = new CExchangeAny(); $exchange_any->date_production = CMbDT::dateTime(); if ($actor) { $exchange_any->sender_id = $actor->_id; $exchange_any->sender_class = $actor->_class; $exchange_any->group_id = $actor->group_id; } $exchange_any->type = "None"; $exchange_any->_message = $data; $exchange_any->store(); // Création d'un message de retour $dom = new CMbXMLDocument(); $mb_errors = $dom->addElement($dom, "MB_Dispatch_Errors"); foreach (self::$errors as $_error) { $dom->addElement($mb_errors, "MB_Dispatch_Error", $_error); } self::$xml_error = $dom->saveXML(); return false; }