/** * Retourne l'oid, l'identifiant et le nom d'une classe selon le code * * @param String $code Code * * @return array */ function getClassCodeFromCode($code) { $entry = CXDSTools::loadEntryJV("ASIP-SANTE_X04.xml", $code); $entry = CXDSTools::loadEntryJV("ASIP-SANTE_classCode.xml", $entry["name"]); $id = $entry["id"]; $oid = $entry["oid"]; $name = $entry["name"]; return array($id, $oid, $name); }
/** * @see parent::createRegistryPackage */ function createRegistryPackage($id) { /** @var CCDAFactory $factory */ $factory = $this->mbObject; $cla_id =& $this->id_classification; $ei_id =& $this->id_external; $ins = $this->ins_patient; $this->name_submission = $id; $specialty = $this->specialty; $object = $this->targetObject; $registry = new CXDSRegistryPackage($id); //date de soumission $registry->setSubmissionTime(array(CXDSTools::getTimeUtc())); //PS qui envoie le document $document = new CXDSDocumentEntryAuthor("cla{$cla_id}", $id, true); $this->setClaId(); $document->setAuthorPerson(array($this->xcn_mediuser)); $document->setAuthorSpecialty(array($specialty)); //Institution qui envoie le document $document->setAuthorInstitution(array($this->xon_etablissement)); $registry->appendDocumentEntryAuthor($document); //type d'activité pour lequel on envoie les documents $code = ""; switch (get_class($object)) { case "COperation": $object = $object->loadRefSejour(); case "CSejour": switch ($object->type) { case "comp": $code = "03"; break; case "ambu": $code = "23"; break; case "urg": $code = "10"; break; default: $code = "07"; } break; case "CConsultation": $code = "07"; break; default: } $entry = CXDSTools::loadEntryJV("ASIP-SANTE_contentTypeCode.xml", $code); $content = new CXDSContentType("cla{$cla_id}", $id, $entry["id"]); $this->setClaId(); $content->setCodingScheme(array($entry["oid"])); $content->setContentTypeCodeDisplayName($entry["name"]); $registry->setContentType($content); //spécification d'un SubmissionSet ou d'un folder, ici submissionSet $registry->setSubmissionSet("cla{$cla_id}", $id, false); $this->setClaId(); //patient du document $registry->setPatientId("ei{$ei_id}", $id, $ins); $this->setEiId(); $receiver = $factory->receiver; //OID de l'instance serveur $oid_instance = CMbOID::getOIDOfInstance($registry, $receiver); $registry->setSourceId("ei{$ei_id}", $id, $oid_instance); $this->setEiId(); //OID unique $oid = CMbOID::getOIDFromClass($registry, $receiver); $cxds_submissionlot = new CXDSSubmissionLot(); $cxds_submissionlot->date = "now"; $cxds_submissionlot->type = $this->type; if ($msg = $cxds_submissionlot->store()) { throw new CMbException($msg); } $this->id_submission = $cxds_submissionlot->_id; $this->oid["lot"] = "{$oid}.{$cxds_submissionlot->_id}"; $registry->setUniqueId("ei{$ei_id}", $id, $this->oid["lot"]); $this->setEiId(); return $registry; }