本文整理汇总了PHP中CConsultation::createByDatetime方法的典型用法代码示例。如果您正苦于以下问题:PHP CConsultation::createByDatetime方法的具体用法?PHP CConsultation::createByDatetime怎么用?PHP CConsultation::createByDatetime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConsultation
的用法示例。
在下文中一共展示了CConsultation::createByDatetime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Handle receive order message
*
* @param CHL7v2ReceiveOrderMessageResponse $ack Acknowledgment
* @param CPatient $patient Person
* @param array $data Data
*
* @return string|void
*/
function handle(CHL7v2ReceiveOrderMessageResponse $ack, CPatient $patient, $data)
{
$exchange_hl7v2 = $this->_ref_exchange_hl7v2;
$sender = $exchange_hl7v2->_ref_sender;
$sender->loadConfigValues();
$this->_ref_sender = $sender;
$patientPI = CValue::read($data['personIdentifiers'], "PI");
if (!$patientPI) {
return $exchange_hl7v2->setORRError($ack, "E007");
}
$IPP = CIdSante400::getMatch("CPatient", $sender->_tag_patient, $patientPI);
// Patient non retrouvé par son IPP
if (!$IPP->_id) {
return $exchange_hl7v2->setORRError($ack, "E105");
}
$patient->load($IPP->object_id);
$venueAN = $this->getVenueAN($sender, $data);
$NDA = CIdSante400::getMatch("CSejour", $sender->_tag_sejour, $venueAN);
// Séjour non retrouvé par son NDA
if (!$NDA->_id) {
return $exchange_hl7v2->setORRError($ack, "E205");
}
$sejour = new CSejour();
$sejour->load($NDA->object_id);
// Common order - ORC
$orc = $data["ORC"];
$obr = $data["OBR"];
$event_request = $this->getEventRequest($orc);
$consultation = new CConsultation();
$placer_id = $this->getPlacerNumber($orc);
$filler_id = $this->getFillerNumber($orc);
switch ($event_request) {
// new order
case "SN":
$datetime = $this->getDate($orc);
$orc12 = $this->getDoctorNode($orc, $data);
$mediuser = new CMediusers();
$medisuer_id = $this->getDoctor($orc12, $mediuser);
if (!$medisuer_id) {
return $exchange_hl7v2->setORRError($ack, "E801");
}
$consultation->createByDatetime($datetime, $medisuer_id, $patient->_id);
if (!$consultation->_id) {
return $exchange_hl7v2->setORRError($ack, "E802");
}
$idex = new CIdSante400();
$idex->id400 = $filler_id;
$idex->tag = $sender->_tag_consultation;
$idex->setObject($consultation);
$idex->store();
break;
//Modification
//Modification
case "SC":
$consultation->load($placer_id);
$status_code = $this->getStatusCode($orc);
switch ($status_code) {
case "CM":
$status = CConsultation::TERMINE;
break;
case "OD":
$status = CConsultation::PLANIFIE;
break;
case "IP":
$status = CConsultation::EN_COURS;
break;
default:
return $exchange_hl7v2->setORRError($ack, "E803");
}
$consultation->chrono = $status;
if ($msg = $consultation->store()) {
return $exchange_hl7v2->setORRError($ack, "E804", $msg);
}
$obr4 = $this->getExamen("OBR.4", $obr, $data);
//Identifiant de l'élément de prescription
$examen_id = $this->getExamenID($obr4);
$examen_name = $this->getExamenName($obr4);
//todo gérer avec l'élément de prescription
break;
// cancel order request
// cancel order request
case "OC":
$consultation->annule = "1";
if ($msg = $consultation->store()) {
return $exchange_hl7v2->setORRError($ack, "E804", $msg);
}
$idex = CIdSante400::getMatchFor($consultation, $sender->_tag_consultation);
$idex->id400 = "trash_{$idex->id400}";
if ($msg = $idex->store()) {
return $exchange_hl7v2->setORRError($ack, "E805", $msg);
}
//.........这里部分代码省略.........