/** * Test A02 - Transfer the patient to a new room * * @param CCnStep $step Step * * @throws CMbException * * @return void */ static function testA02(CCnStep $step) { // PES-PAM_Encounter_Management_IN_OUT $patient = self::loadPatientPES($step, 40); $sejour = self::loadAdmitPES($patient); $lit = new C**t(); $lit->loadMatchingObject(); $affectation = new CAffectation(); $affectation->lit_id = $lit->_id; $affectation->sejour_id = $sejour->_id; $affectation->entree = $sejour->entree; $affectation->sortie = CMbDT::dateTime("+2 day", $affectation->entree); self::storeObject($affectation); }
$chambre->lits_alpha = 0; $chambre->annule = 0; $msg = $chambre->store(); if ($msg) { CAppUI::setMsg($msg, UI_MSG_ERROR); $results[$i]["error"] = $msg; $i++; continue; } CAppUI::setMsg("Chambre créée", UI_MSG_OK); } // Lit $lit = new C**t(); $lit->nom = $results[$i]["nom"]; $lit->chambre_id = $chambre->_id; $lit->loadMatchingObject(); $lit->nom_complet = $results[$i]["nomcomplet"]; if ($lit->_id) { $msg = "Lit existant"; CAppUI::setMsg($msg, UI_MSG_ERROR); $results[$i]["error"] = $msg; $i++; continue; } $msg = $lit->store(); if ($msg) { CAppUI::setMsg($msg, UI_MSG_ERROR); $results[$i]["error"] = $msg; $i++; continue; }