/** * Get AN identifier * * @param DOMNode $node Node * @param array &$data Data * @param CInteropSender $sender Sender * * @return void */ function getANIdentifier(DOMNode $node, &$data, CInteropSender $sender) { if (CHL7v2Message::$handle_mode == "simple") { $data["AN"] = $this->queryTextNode("CX.1", $node); return; } $control_identifier_type_code = CValue::read($sender->_configs, "control_identifier_type_code"); $search_master_NDA = CValue::read($sender->_configs, "search_master_NDA"); if ($search_master_NDA) { $domain = CDomain::getMasterDomain("CSejour", $sender->group_id); if ($domain->namespace_id != $this->queryTextNode("CX.4/HD.1", $node)) { return; } if ($control_identifier_type_code) { if ($this->queryTextNode("CX.5", $node) == "AN") { $data["AN"] = $this->queryTextNode("CX.1", $node); } } else { $data["AN"] = $this->queryTextNode("CX.1", $node); } return; } if ($control_identifier_type_code) { if ($this->queryTextNode("CX.5", $node) == "AN") { $data["AN"] = $this->queryTextNode("CX.1", $node); } } else { $data["AN"] = $this->queryTextNode("CX.1", $node); } }
/** * Construit le tag IPP en fonction des variables de configuration * * @param int $group_id Permet de charger l'IPP pour un établissement donné si non null * * @return string|null */ static function getTagIPP($group_id = null) { // Recherche de l'établissement $group = CGroups::get($group_id); if (!$group_id) { $group_id = $group->_id; } $cache = new Cache(__METHOD__, array($group_id), Cache::INNER); if ($cache->exists()) { return $cache->get(); } // Gestion du tag IPP par son domaine d'identification if (CAppUI::conf("eai use_domain")) { return $cache->put(CDomain::getMasterDomain("CPatient", $group_id)->tag, false); } // Pas de tag IPP => pas d'affichage d'IPP if (null == ($tag_ipp = CAppUI::conf("dPpatients CPatient tag_ipp"))) { return $cache->put(null, false); } // Si on est dans le cas d'un établissement gérant la numérotation $group->loadConfigValues(); if ($group->_configs["sip_idex_generator"]) { $tag_ipp = CAppUI::conf("sip tag_ipp"); } // Préférer un identifiant externe de l'établissement if ($tag_group_idex = CAppUI::conf("dPpatients CPatient tag_ipp_group_idex")) { $idex = new CIdSante400(); $idex->loadLatestFor($group, $tag_group_idex); $group_id = $idex->id400; } return $cache->put(str_replace('$g', $group_id, $tag_ipp), false); }
/** * Construit le tag NDA en fonction des variables de configuration * * @param int $group_id Permet de charger le NDA pour un établissement donné si non null * @param string $type_tag Permet de spécifier le type de tag * * @return string|void */ static function getTagNDA($group_id = null, $type_tag = "tag_dossier") { // Recherche de l'établissement $group = CGroups::get($group_id); if (!$group_id) { $group_id = $group->_id; } $cache = new Cache(__METHOD__, array($group_id, $type_tag), Cache::INNER); if ($cache->exists()) { return $cache->get(); } // Gestion du tag NDA par son domaine d'identification if (CAppUI::conf("eai use_domain")) { $tag_NDA = CDomain::getMasterDomain("CSejour", $group_id)->tag; if ($type_tag != "tag_dossier") { $tag_NDA = CAppUI::conf("dPplanningOp CSejour {$type_tag}") . $tag_NDA; } return $cache->put($tag_NDA, false); } $tag_NDA = CAppUI::conf("dPplanningOp CSejour tag_dossier"); if ($type_tag != "tag_dossier") { $tag_NDA = CAppUI::conf("dPplanningOp CSejour {$type_tag}") . $tag_NDA; } // Si on est dans le cas d'un établissement gérant la numérotation $group->loadConfigValues(); if ($group->_configs["smp_idex_generator"]) { $tag_NDA = CAppUI::conf("smp tag_nda"); } // Pas de tag Num dossier if (null == $tag_NDA) { return $cache->put(null, false); } // Préférer un identifiant externe de l'établissement if ($tag_group_idex = CAppUI::conf("dPplanningOp CSejour tag_dossier_group_idex")) { $idex = new CIdSante400(); $idex->loadLatestFor($group, $tag_group_idex); $group_id = $idex->id400; } return $cache->put(str_replace('$g', $group_id, $tag_NDA), false); }