Ejemplo n.º 1
0
 /**
  * The action AA-4
  * 
  * @param mixed $datas The datas
  * 
  * @return string
  * 
  * @see DICOM Standard PS 3.8 Section 9.2
  */
 protected function doAA4($datas)
 {
     $pdu = CDicomPDUFactory::decodePDU($datas);
     $this->addMessage($pdu->type_str, $pdu);
     $this->status = "Aborted";
     $this->state = self::STA1;
 }
Ejemplo n.º 2
0
 /**
  * Check if we can understand the message
  * 
  * @param string        $msg           The message
  * 
  * @param CInteropActor $actor         The actor
  * 
  * @param array         $pres_contexts The presentation contexts
  * 
  * @return boolean
  */
 function understand($msg, CInteropActor $actor = null, $pres_contexts = null)
 {
     $this->_presentation_contexts = $pres_contexts;
     if (!$this->isWellFormed($msg)) {
         return false;
     }
     $pdu = CDicomPDUFactory::decodePDU($msg, $this->_presentation_contexts);
     $pdvs = $pdu->getPDVs();
     $msg_types = array();
     $msg_classes = array();
     foreach ($pdvs as $pdv) {
         $msg = $pdv->getMessage();
         $msg_types[] = $msg->type;
         $msg_classes[] = get_class($msg);
     }
     if ($msg_types[0] == "C-Find-RQ" || $msg_types[0] == "C-Echo-RQ") {
         if (!$this->_requests) {
             $this->_requests = array();
         }
         $this->_requests[] = $pdu;
     } elseif ($msg_types[0] == "C-Echo-RSP" || $msg_types[0] == "C-Find-RSP") {
         if (!$this->_responses) {
             $this->_responses = array();
         }
         $this->_responses[] = $pdu;
     } elseif ($msg_types[0] == "Datas") {
         if ($this->_responses) {
             $this->_responses[] = $pdu;
         } else {
             $this->_requests[] = $pdu;
         }
     }
     foreach ($this->getFamily() as $_family) {
         $family_class = new $_family();
         $events = $family_class->getEvenements();
         if (array_key_exists($msg_types[0], $events)) {
             $this->_family_message_class = $_family;
             $this->_family_message = $msg_classes[0];
             $this->message_valide = 1;
             return true;
         }
     }
     return false;
 }