Пример #1
0
 /**
  * Construct
  *
  * @return \CPIX
  */
 function __construct()
 {
     $this->domain = "ITI";
     $this->type = "PIX";
     $this->_categories = array("ITI-9" => self::$transaction_iti9);
     parent::__construct();
 }
 /**
  * Construct
  *
  * @param string $i18n i18n
  *
  * @return \CHL7v2EventADT
  */
 function __construct($i18n = null)
 {
     parent::__construct($i18n);
     $this->profil = $i18n ? "PAM_{$i18n}" : "PAM";
     $this->msg_codes = array(array($this->event_type, $this->code, "{$this->event_type}_{$this->struct_code}"));
     $this->transaction = CIHE::getPAMTransaction($this->code, $i18n);
 }
Пример #3
0
 /**
  * Construct
  *
  * @return CHL7v2EventDEC
  */
 function __construct()
 {
     parent::__construct();
     $this->profil = "DEC";
     $this->msg_codes = array(array($this->event_type, $this->code));
     $this->transaction = CIHE::getDECTransaction($this->code);
 }
Пример #4
0
 /**
  * Construct
  *
  * @return \CHL7v2EventORM
  */
 function __construct()
 {
     parent::__construct();
     $this->profil = "SWF";
     $this->msg_codes = array(array($this->event_type, $this->code, "{$this->event_type}_{$this->code}"));
     $this->transaction = CIHE::getSWFTransaction($this->code);
 }
Пример #5
0
 /**
  * Construct
  *
  * @return CSVS
  */
 function __construct()
 {
     $this->domain = "ITI";
     $this->type = "SVS";
     $this->_categories = array("ITI-48" => self::$transaction_iti48, "ITI-60" => self::$transaction_iti60);
     parent::__construct();
 }
Пример #6
0
 /**
  * Construct
  *
  * @return \CDEC
  */
 function __construct()
 {
     $this->domain = "PCD";
     $this->type = "DEC";
     $this->_categories = array("PDC-01" => self::$transaction_pcdO1);
     parent::__construct();
 }
Пример #7
0
 /**
  * Construct
  *
  * @return CPDQ
  */
 function __construct()
 {
     $this->domain = "ITI";
     $this->type = "PDQ";
     $this->_categories = array("ITI-21" => self::$transaction_iti21, "ITI-22" => self::$transaction_iti22);
     parent::__construct();
 }
Пример #8
0
 /**
  * Construct
  *
  * @return \CPAM
  */
 function __construct()
 {
     $this->domain = "ITI";
     $this->type = "PAM";
     $this->_categories = array("ITI-30" => self::$transaction_iti30, "ITI-31" => self::$transaction_iti31);
     parent::__construct();
 }
Пример #9
0
 /**
  * Construct
  *
  * @return CSWF
  */
 function __construct()
 {
     $this->domain = "RAD";
     $this->type = "SWF";
     $this->_categories = array("RAD-3" => self::$transaction_rad3, "RAD-48" => self::$transaction_rad48);
     parent::__construct();
 }
Пример #10
0
 /**
  * Construct
  *
  * @return CXDSb
  */
 function __construct()
 {
     $this->domain = "ITI";
     $this->type = "XDSb";
     $this->_categories = array("ITI-41" => self::$interaction_ITI41, "ITI-18" => self::$interaction_ITI18, "ITI-57" => self::$interaction_ITI57, "ITI-43" => self::$interaction_ITI43);
     parent::__construct();
 }
 /**
  * Send exchange
  *
  * @throws CMbException
  *
  * @return void
  */
 function send()
 {
     $this->loadRefsInteropActor();
     if (!$this->message_valide) {
         throw new CMbException("CExchangeDataFormat-msg-Invalid exchange");
     }
     $receiver = $this->_ref_receiver;
     $receiver->loadConfigValues();
     $evenement = null;
     $msg = $this->_message;
     if ($receiver instanceof CReceiverHL7v2) {
         if ($receiver->_configs["encoding"] == "UTF-8") {
             $msg = utf8_encode($msg);
         }
         $evenement = "evenementsPatient";
         $data_format = CIHE::getEvent($this);
     }
     if ($receiver instanceof CDestinataireHprim) {
         if ($receiver->_configs["encoding"] == "UTF-8") {
             $msg = utf8_encode($msg);
         }
         if ($this->type == "patients") {
             $evenement = "evenementPatient";
             $data_format = CHPrimXMLEventPatient::getHPrimXMLEvenements($this->_message);
         }
         if ($this->type == "pmsi") {
             $data_format = CHPrimXMLEventServeurActivitePmsi::getHPrimXMLEvenements($this->_message);
             $evenement = $data_format->sous_type;
         }
     }
     if ($receiver instanceof CPhastDestinataire) {
         $data_format = CPhastEvenementsPN13::getXMLEvenementsPN13($this->_message);
         $evenement = $data_format->sous_type;
     }
     if (!$evenement) {
         throw new CMbException("CExchangeDataFormat-msg-No events defined");
     }
     $source = CExchangeSource::get("{$receiver->_guid}-{$evenement}");
     if (!$source->_id || !$source->active) {
         throw new CMbException("CExchangeDataFormat-msg-No source for this actor");
     }
     // Si on n'a pas d'IPP et NDA
     if ($this->master_idex_missing) {
         throw new CMbException("CExchangeDataFormat-msg-Master idex missing");
     }
     $source->setData($msg, false, $this);
     $source->send();
     $this->date_echange = CMbDT::dateTime();
     // Si on n'a pas d'acquittement
     if (!($ack_data = $source->getACQ())) {
         $this->store();
         return;
     }
     if ($this instanceof CEchangeHprim) {
         $ack_data = utf8_decode($ack_data);
         $ack = CHPrimXMLAcquittements::getAcquittementEvenementXML($data_format);
         $ack->loadXML($ack_data);
         $doc_valid = $ack->schemaValidate();
         if ($doc_valid) {
             $this->statut_acquittement = $ack->getStatutAcquittement();
         }
     }
     if ($this instanceof CExchangeHL7v2) {
         $ack = new CHL7v2Acknowledgment($data_format);
         $ack->handle($ack_data);
         $this->statut_acquittement = $ack->getStatutAcknowledgment();
         $this->acquittement_valide = $ack->message->isOK(CHL7v2Error::E_ERROR) ? 1 : 0;
     }
     if ($this instanceof CExchangePhast) {
         $ack = new CPhastAcquittementsPN13();
         $ack->loadXML($ack_data);
         $doc_valid = $ack->schemaValidate();
         if ($doc_valid) {
             $this->statut_acquittement = $ack->getCodeAcquittement();
         }
     }
     $this->_acquittement = $ack_data;
     $this->store();
 }
 /**
  * Send event
  *
  * @param CHL7v2Event $evenement Event type
  * @param CMbObject   $mbObject  Object
  *
  * @return null|string
  *
  * @throws CMbException
  */
 function sendEvent($evenement, CMbObject $mbObject)
 {
     $evenement->_receiver = $this;
     // build_mode = Mode simplifié lors de la génération du message
     $this->loadConfigValues();
     CHL7v2Message::setBuildMode($this->_configs["build_mode"]);
     $evenement->build($mbObject);
     CHL7v2Message::resetBuildMode();
     if (!($msg = $evenement->flatten())) {
         return null;
     }
     $exchange = $evenement->_exchange_hl7v2;
     // Si l'échange est invalide
     if (!$exchange->message_valide) {
         return null;
     }
     // Si on n'est pas en synchrone
     if (!$this->synchronous) {
         return null;
     }
     // Si on n'a pas d'IPP et NDA
     if ($exchange->master_idex_missing) {
         return null;
     }
     $evt = $this->getEventMessage($evenement->profil);
     $source = CExchangeSource::get("{$this->_guid}-{$evt}");
     if (!$source->_id || !$source->active) {
         return null;
     }
     if ($this->_configs["encoding"] == "UTF-8") {
         $msg = utf8_encode($msg);
     }
     $source->setData($msg, null, $exchange);
     try {
         $source->send();
     } catch (Exception $e) {
         throw new CMbException("CExchangeSource-no-response");
     }
     $exchange->date_echange = CMbDT::dateTime();
     $ack_data = $source->getACQ();
     if (!$ack_data) {
         $exchange->store();
         return null;
     }
     $data_format = CIHE::getEvent($exchange);
     $ack = new CHL7v2Acknowledgment($data_format);
     $ack->handle($ack_data);
     $exchange->date_echange = CMbDT::dateTime();
     $exchange->statut_acquittement = $ack->getStatutAcknowledgment();
     $exchange->acquittement_valide = $ack->message->isOK(CHL7v2Error::E_ERROR) ? 1 : 0;
     $exchange->_acquittement = $ack_data;
     $exchange->store();
     return $ack_data;
 }
Пример #13
0
     $sejour->loadNDA();
     if (!$sejour->_NDA || $sejour->_NDA === "waiting") {
         $_exchange->date_echange = "";
         $_exchange->store();
         continue;
     }
 }
 //S'il n'y a pas de séjour ou de patient en focntion de la transaction, on passe au prochaine échange
 if ($present_sejour && $present_patient) {
     $_exchange->date_echange = "";
     $_exchange->store();
     continue;
 }
 $object->_receiver = $receiver;
 /** @var CHL7v2Event $data_format */
 $data_format = CIHE::getEvent($_exchange);
 $data_format->handle($_exchange->_message);
 $data_format->_exchange_hl7v2 = $_exchange;
 $data_format->_receiver = $receiver;
 /** @var CHL7v2MessageXML $xml */
 $xml = $data_format->message->toXML();
 $PID = $xml->queryNode("PID");
 $ipp = $xml->queryNode("PID.3", $PID);
 $PV1 = $xml->queryNode("PV1");
 $nda = $xml->queryNode("PV1.19", $PV1);
 if (!$ipp || $ipp && $ipp->nodeValue == "waiting" || (!$nda || $nda && $nda->nodeValue == "waiting")) {
     CHL7v2Message::setBuildMode($receiver->_configs["build_mode"]);
     $data_format->build($object);
     CHL7v2Message::resetBuildMode();
     $data_format->flatten();
     if (!$data_format->message->isOK(CHL7v2Error::E_ERROR)) {