/**
  * Get NK1 segment
  *
  * @param DOMNode  $node       Node
  * @param CPatient $newPatient Person
  *
  * @return void
  */
 function getNK1(DOMNode $node, CPatient $newPatient)
 {
     $sender = $this->_ref_sender;
     $NK1_2 = $this->queryNode("NK1.2", $node);
     $nom = $this->queryTextNode("XPN.1/FN.1", $NK1_2);
     $prenom = $this->queryTextNode("XPN.2", $NK1_2);
     if ($prenom == "") {
         $prenom = null;
     }
     $parente = $this->queryTextNode("NK1.3/CE.1", $node);
     $parente_autre = null;
     if ($parente == "OTH") {
         $parente_autre = $this->queryTextNode("NK1.3/CE.2", $node);
     }
     $NK1_4 = $this->queryNode("NK1.4", $node);
     $adresse = $this->queryTextNode("XAD.1/SAD.1", $NK1_4);
     $cp = $this->queryTextNode("XAD.5", $NK1_4);
     $ville = $this->queryTextNode("XAD.3", $NK1_4);
     $NK1_5 = $this->queryNodes("NK1.5", $node)->item(0);
     $tel = null;
     if ($NK1_5) {
         $tel = $this->queryTextNode("XTN.12", $NK1_5);
         if (!$tel) {
             $tel = $this->queryTextNode("XTN.1", $NK1_5);
         }
     }
     $relation = $this->queryTextNode("NK1.7/CE.1", $node);
     $relation_autre = null;
     if ($relation == "O") {
         $relation_autre = $this->queryTextNode("NK1.7/CE.2", $node);
     }
     $corres_patient = new CCorrespondantPatient();
     $corres_patient->patient_id = $newPatient->_id;
     $corres_patient->nom = $nom;
     $corres_patient->prenom = $prenom;
     $corres_patient->loadMatchingObjectEsc();
     $corres_patient->adresse = $adresse;
     $corres_patient->cp = $cp;
     $corres_patient->ville = $ville;
     $corres_patient->tel = $tel;
     $corres_patient->parente = CHL7v2TableEntry::mapFrom("63", $parente);
     $corres_patient->parente_autre = $parente_autre;
     $corres_patient->relation = CHL7v2TableEntry::mapFrom("131", $relation);
     $corres_patient->relation_autre = $relation_autre;
     // Notifier les autres destinataires autre que le sender
     $corres_patient->_eai_sender_guid = $sender->_guid;
     $corres_patient->store();
 }
 /**
  * Récupération du mode de sortie PMSI
  *
  * @param DOMNode $node     ZFM Node
  * @param CSejour $newVenue Admit
  *
  * @return void
  */
 function getModeSortiePMSI(DOMNode $node, CSejour $newVenue)
 {
     $newVenue->mode_sortie = CHL7v2TableEntry::mapFrom("9001", $this->queryTextNode("ZFM.2", $node));
 }
 /**
  * Get PV1 QPD element
  *
  * @param DOMNode $node QPD element
  *
  * @return array
  */
 function getRequestSejour(DOMNode $node)
 {
     $PV1 = array();
     // Patient class
     if (($PV1_2 = $this->getDemographicsFields($node, "CSejour", "2")) || ($PV1_2 = $this->getDemographicsFields($node, "CSejour", "2.1"))) {
         $PV1 = array_merge($PV1, array("type" => CHL7v2TableEntry::mapFrom(4, $PV1_2)));
     }
     return $PV1;
 }