/** * @see parent::store() */ function store() { if (!$this->_id && $this->rpu_id) { $echelle = new self(); $echelle->rpu_id = $this->rpu_id; $echelle->loadMatchingObject(); $this->_id = $echelle->_id; } $glasgow = null; if ($this->fieldModified("ouverture_yeux") || $this->fieldModified("rep_motrice") || $this->fieldModified("rep_verbale")) { $glasgow = $this->calculGlasgow(); } // Standard Store if ($msg = parent::store()) { return $msg; } if ($glasgow != null) { $sejour = $this->loadRefRPU()->loadRefSejour(); $constante = new CConstantesMedicales(); $constante->_new_constantes_medicales = 1; $constante->patient_id = $sejour->loadRefPatient()->_id; $constante->context_class = $sejour->_class; $constante->context_id = $sejour->_id; $constante->glasgow = $glasgow; $constante->datetime = 'now'; if ($msg = $constante->store()) { return $msg; } } return null; }
/** * Get segement OBX * * @param DOMNode $node Node * @param CMbObject $object Object * @param array $data Data * * @return void */ function getOBX(DOMNode $node, CMbObject $object, $data) { $type = $this->queryTextNode("OBX.3/CE.2", $node); $value = floatval($this->queryTextNode("OBX.5", $node)); $constante_medicale = new CConstantesMedicales(); if ($object instanceof CSejour) { $constante_medicale->context_class = "CSejour"; $constante_medicale->context_id = $object->_id; $constante_medicale->patient_id = $object->patient_id; } else { if ($object instanceof CPatient) { $constante_medicale->context_class = "CPatient"; $constante_medicale->context_id = $object->_id; $constante_medicale->patient_id = $object->_id; } } $constante_medicale->datetime = $this->queryTextNode("EVN.2/TS.1", $data["EVN"]); $constante_medicale->loadMatchingObject(); switch ($type) { case "WEIGHT": $constante_medicale->poids = $value; break; case "HEIGHT": $constante_medicale->taille = $value; break; default: } $constante_medicale->_new_constantes_medicales = true; // Pour le moment pas de retour d'erreur dans l'acquittement $constante_medicale->store(); }