當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CMbObject::loadObject方法代碼示例

本文整理匯總了PHP中CMbObject::loadObject方法的典型用法代碼示例。如果您正苦於以下問題:PHP CMbObject::loadObject方法的具體用法?PHP CMbObject::loadObject怎麽用?PHP CMbObject::loadObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CMbObject的用法示例。


在下文中一共展示了CMbObject::loadObject方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getDoctor

 /**
  * Return the Object with the information of the medecin in the message
  *
  * @param DOMNode   $node   Node
  * @param CMbObject $object object
  *
  * @return int|null|string
  */
 function getDoctor(DOMNode $node, CMbObject $object)
 {
     $type_id = $this->queryTextNode("XCN.13", $node);
     $id = $this->queryTextNode("XCN.1", $node);
     $last_name = $this->queryTextNode("XCN.2/FN.1", $node);
     $first_name = $this->queryTextNode("XCN.3", $node);
     switch ($type_id) {
         case "RPPS":
             $object->rpps = $id;
             break;
         case "ADELI":
             $object->adeli = $id;
             break;
         case "RI":
             // Notre propre RI
             if ($this->queryTextNode("XCN.9/HD.2", $node) == CAppUI::conf("hl7 assigning_authority_universal_id")) {
                 return $id;
             }
         default:
             // Recherche du praticien par son idex
             $idex = CIdSante400::getMatch($object->_class, $this->_ref_sender->_tag_mediuser, $id);
             if ($idex->_id) {
                 return $idex->object_id;
             }
             if ($object instanceof CMediusers) {
                 $object->_user_first_name = $first_name;
                 $object->_user_last_name = $last_name;
             }
             if ($object instanceof CMedecin) {
                 $object->prenom = $first_name;
                 $object->nom = $last_name;
             }
             break;
     }
     // Cas où l'on a aucune information sur le médecin
     if (!$object->rpps && !$object->adeli && !$object->_id && ($object instanceof CMediusers && !$object->_user_last_name || $object instanceof CMedecin && !$object->nom)) {
         return null;
     }
     if ($object instanceof CMedecin && $object->loadMatchingObjectEsc()) {
         return $object->_id;
     }
     $sender = $this->_ref_sender;
     $ds = $object->getDS();
     if ($object instanceof CMediusers) {
         $ljoin = array();
         $ljoin["functions_mediboard"] = "functions_mediboard.function_id = users_mediboard.function_id";
         $where = array();
         $where["functions_mediboard.group_id"] = " = '{$sender->group_id}'";
         if ($object->rpps || $object->adeli) {
             if ($object->rpps) {
                 $where[] = $ds->prepare("rpps = %", $object->rpps);
             }
             if ($object->adeli) {
                 $where[] = $ds->prepare("adeli = %", $object->adeli);
             }
             // Dans le cas où le praticien recherché par son ADELI ou RPPS est multiple
             if ($object->countList($where, null, $ljoin) > 1) {
                 $ljoin["users"] = "users_mediboard.user_id = users.user_id";
                 $where[] = $ds->prepare("users.user_last_name = %", $last_name);
             }
             $object->loadObject($where, null, null, $ljoin);
             if ($object->_id) {
                 return $object->_id;
             }
         }
         $user = new CUser();
         $ljoin = array();
         $ljoin["users_mediboard"] = "users.user_id = users_mediboard.user_id";
         $ljoin["functions_mediboard"] = "functions_mediboard.function_id = users_mediboard.function_id";
         $where = array();
         $where["functions_mediboard.group_id"] = " = '{$sender->group_id}'";
         $where[] = $ds->prepare("users.user_first_name = %", $first_name);
         $where[] = $ds->prepare("users.user_last_name = %", $last_name);
         $order = "users.user_id ASC";
         if ($user->loadObject($where, $order, null, $ljoin)) {
             return $user->_id;
         }
         $object->_user_first_name = $first_name;
         $object->_user_last_name = $last_name;
         return $this->createDoctor($object);
     }
 }
開發者ID:OpenXtrem,項目名稱:mediboard-test,代碼行數:90,代碼來源:CHL7v2MessageXML.class.php


注:本文中的CMbObject::loadObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。