当前位置: 首页>>代码示例>>PHP>>正文


PHP CIdSante400::getMatch方法代码示例

本文整理汇总了PHP中CIdSante400::getMatch方法的典型用法代码示例。如果您正苦于以下问题:PHP CIdSante400::getMatch方法的具体用法?PHP CIdSante400::getMatch怎么用?PHP CIdSante400::getMatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIdSante400的用法示例。


在下文中一共展示了CIdSante400::getMatch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: build

 /**
  * Build ZBE segement
  *
  * @param CHL7v2Event $event Event
  *
  * @return null
  */
 function build(CHL7v2Event $event)
 {
     parent::build($event);
     $receiver = $event->_receiver;
     $sejour = $this->sejour;
     $movement = $this->movement;
     $affectation = $this->curr_affectation;
     if ($this->other_affectation) {
         $affectation = $this->other_affectation;
     }
     $action_movement = null;
     if ($sejour->_cancel_hospitalization) {
         $action_movement = "CANCEL";
     } else {
         foreach (self::$actions as $action => $events) {
             if (in_array($event->code, $events)) {
                 $action_movement = $action;
             }
         }
     }
     // ZBE-1: Movement ID (EI) (optional)
     $identifiers[] = array($movement->_view, CAppUI::conf("hl7 assigning_authority_namespace_id"), CAppUI::conf("hl7 assigning_authority_universal_id"), CAppUI::conf("hl7 assigning_authority_universal_type_id"));
     $idexMovement = CIdSante400::getMatch("CMovement", $receiver->_tag_movement, null, $movement->_id);
     if ($idexMovement->_id) {
         $configs = $receiver->_configs;
         $identifiers[] = array($idexMovement->id400, $configs["assigning_authority_namespace_id"], $configs["assigning_authority_universal_id"], $configs["assigning_authority_universal_type_id"]);
     }
     $data[] = $identifiers;
     // ZBE-2: Start of Movement Date/Time (TS)
     $start_of_movement = $action_movement == "CANCEL" ? $movement->last_update : $movement->start_of_movement;
     $data[] = $start_of_movement > $sejour->sortie ? $sejour->sortie : $start_of_movement;
     // ZBE-3: End of Movement Date/Time (TS) (optional)
     // Forbidden (IHE France)
     $data[] = null;
     // ZBE-4: Action on the Movement (ID)
     $data[] = $action_movement;
     // ZBE-5: Indicator "Historical Movement" (ID)
     $data[] = $movement->_current ? "N" : "Y";
     // ZBE-6: Original trigger event code (ID) (optional)
     $data[] = $action_movement == "UPDATE" || $action_movement == "CANCEL" ? $movement->original_trigger_code : null;
     $ufs = $sejour->getUFs(null, $affectation->_id);
     // ZBE-7: Ward of medical responsibility in the period starting with this movement (XON) (optional)
     $uf_type = $receiver->_configs["build_ZBE_7"];
     $uf_medicale = isset($ufs[$uf_type]) ? $ufs[$uf_type] : null;
     if (isset($uf_medicale->_id)) {
         $data[] = array(array($uf_medicale->libelle, null, null, null, null, $this->getAssigningAuthority("mediboard"), "UF", null, null, $uf_medicale->code));
     } else {
         $data[] = null;
     }
     // Traitement des segments spécifiques extension PAM
     $this->fillOtherSegments($data, $ufs, $event);
     $this->fill($data);
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:60,代码来源:CHL7v2SegmentZBE.class.php

示例2: importFile

/**
 * import the patient file
 *
 * @param string   $file        path to the file
 * @param int      $start       start int
 * @param int      $count       number of iterations
 * @param resource $file_import file for report
 *
 * @return null
 */
function importFile($file, $start, $count, $file_import)
{
    $fp = fopen($file, 'r');
    $patient = new CPatient();
    $patient_specs = CModelObjectFieldDescription::getSpecList($patient);
    CModelObjectFieldDescription::addBefore($patient->_specs["_IPP"], $patient_specs);
    /** @var CMbFieldSpec[] $_patient_specs */
    $_patient_specs = CModelObjectFieldDescription::getArray($patient_specs);
    echo count($_patient_specs) . " traits d'import";
    //0 = first line
    if ($start == 0) {
        $start++;
    }
    $line_nb = 0;
    while ($line = fgetcsv($fp, null, ";")) {
        $patient = new CPatient();
        if ($line_nb >= $start && $line_nb < $start + $count) {
            $line_rapport = "ligne {$line_nb} - ";
            //foreach SPECS, first load
            foreach ($_patient_specs as $key => $_specs) {
                $field = $_specs->fieldName;
                $data = iconv("UTF-8", "ISO-8859-1//TRANSLIT", $line[$key]);
                //specific cleanups
                if ($_specs instanceof CPhoneSpec) {
                    $data = preg_replace('/\\D/', '', $data);
                }
                if ($field == "sexe") {
                    $data = strtolower($data);
                }
                if ($field == "deces" && $data == "0000-00-00") {
                    $data = null;
                }
                $patient->{$field} = $data;
            }
            $line_rapport .= "Patient {$patient->nom} {$patient->prenom} ({$patient->naissance})";
            //clone and IPP
            $IPP = $patient->_IPP;
            $patient->_generate_IPP = false;
            $patient_full = new CPatient();
            $patient_full->extendsWith($patient);
            // load by ipp if basic didn't find.
            if (!$patient->_id) {
                $patient->loadFromIPP();
                if ($patient->_id) {
                    $line_rapport .= " (trouvé par IPP)";
                }
            }
            //load patient with basics
            if (!$patient->_id) {
                $patient->_IPP = null;
                $patient->loadMatchingPatient();
                if ($patient->_id) {
                    $line_rapport .= " (trouvé par matching)";
                }
            }
            //update fields if import have more data
            foreach ($patient->getPlainFields() as $field => $value) {
                if (!$patient->{$field}) {
                    $patient->{$field} = $patient_full->{$field};
                }
            }
            // fields created by store, let the store do the job for these
            $patient->civilite = "guess";
            //found
            if ($patient->_id) {
                //check IPP
                $patient->loadIPP();
                //update
                $patient->store();
                if (!$patient->_IPP) {
                    $idex = CIdSante400::getMatch($patient->_class, CPatient::getTagIPP(), $IPP, $patient->_id);
                    $idex->last_update = CMbDT::dateTime();
                    $idex->store();
                    if ($idex->_id) {
                        $line_rapport .= ", IPP créé : {$IPP}";
                    }
                    echo "<tr style=\"color:#c98000\"><td>{$line_nb}</td><td>patient [{$patient->nom} {$patient->prenom}] déjà existant (MAJ ipp : {$idex->id400})</td></tr>";
                } else {
                    $line_rapport .= " déjà existant";
                    if ($patient->_IPP != $IPP) {
                        mbLog($patient->_view . " [ipp: " . $patient->_IPP . " / ipp_import:" . $IPP);
                        $line_rapport .= " [IPP du fichier: {$IPP} / ipp en base: {$patient->_IPP} ]";
                    }
                    $line_rapport .= " [IPP en base et fichier identiques]";
                    echo "<tr style=\"color:#c98000\"><td>{$line_nb}</td><td>patient [{$patient->nom} {$patient->prenom}] déjà existant (ipp : {$patient->_IPP})</td></tr>";
                }
            } else {
                $result = $patient->store();
                if (!$result) {
                    $line_rapport .= " créé avec succes";
//.........这里部分代码省略.........
开发者ID:fbone,项目名称:mediboard4,代码行数:101,代码来源:do_import_patient.php

示例3: loadFromIPP

 function loadFromIPP($group_id = null)
 {
     if (!$this->_IPP) {
         return;
     }
     // Pas de tag IPP => pas d'affichage d'IPP
     if (null == ($tag_ipp = $this->getTagIPP($group_id))) {
         return;
     }
     // Recuperation de la valeur de l'id400
     $idex = CIdSante400::getMatch('CPatient', $tag_ipp, $this->_IPP);
     $this->load($idex->object_id);
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:13,代码来源:CPatient.class.php

示例4: storeActe

 /**
  * Store Acte
  *
  * @param String[] $data    Value
  * @param String   $type    CCAM or NGAP
  * @param CSejour  $sejour  Sejour
  * @param CPatient $patient Patient
  * @param String   $tag     Tag
  *
  * @return String|CActe;
  */
 function storeActe($data, $type, $sejour, $patient, $tag)
 {
     $code_acte = "code";
     if ($type == "CCAM") {
         $field_object = "codes_ccam";
         $code_acte = "code_acte";
     }
     $action = $data["action"];
     $idex = CIdSante400::getMatch("CActe{$type}", $tag, $data["idSourceActe{$type}"]);
     $executant_id = $data["executant_id"];
     if ($idex->_id) {
         $class = "CActe{$type}";
         /** @var CActeCCAM|CActeNGAP $acte */
         $acte = new $class();
         $acte->load($idex->object_id);
         $object = $acte->loadTargetObject();
         if ($action === "suppression") {
             if ($type == "CCAM") {
                 $code = $acte->{$code_acte};
                 $replace = explode("|", $object->{$field_object});
                 CMbArray::removeValue($code, $replace);
                 $object->{$field_object} = $replace ? implode("|", $replace) : "";
             }
             if ($msg = $this->deleteActe($acte, $object, $idex)) {
                 return $msg;
             }
             return $acte;
         }
         /** @var CActeCCAM|CActeNGAP $new_acte */
         $new_acte = $this->{"createActe{$type}"}($data["acte{$type}"], $object, $executant_id);
         $modification = $new_acte->{$code_acte} != $acte->{$code_acte};
         if ($modification) {
             if ($type == "CCAM") {
                 $new_code = preg_replace("#{$acte}->{$code_acte}#", $new_acte->{$code_acte}, $object->{$field_object}, 1);
                 $object->{$field_object} = $new_code;
             }
             if ($msg = $this->deleteActe($acte, $object, $idex)) {
                 return $msg;
             }
             $acte = new $class();
         }
         $acte->extendsWith($new_acte, true);
         if ($msg = $acte->store()) {
             return $msg;
         }
         if ($modification) {
             $idex->setObject($acte);
             if ($msg = $idex->store()) {
                 return $msg;
             }
         }
         return $acte;
     }
     if ($action !== "création") {
         return "{$action} impossible car l'acte n'a pas été trouvé";
     }
     $date = CMbDT::date($data["acte{$type}"]["date"]);
     $object = $this->getObject($date, $executant_id, $patient->_id);
     $object = $object ? $object : $sejour;
     /** @var CActe $acte */
     $acte = $this->{"createActe{$type}"}($data["acte{$type}"], $object, $executant_id);
     if ($type == "CCAM") {
         $object->{$field_object} .= $object->{$field_object} ? "|{$acte->{$code_acte}}" : $acte->{$code_acte};
     }
     if ($msg = $object->store()) {
         return $msg;
     }
     if ($msg = $acte->store()) {
         return $msg;
     }
     $idex = new CIdSante400();
     $idex->id400 = $data["idSourceActe{$type}"];
     $idex->tag = $tag;
     $idex->setObject($acte);
     if ($msg = $idex->store()) {
         return $msg;
     }
     return $acte;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:90,代码来源:CHPrimXMLEvenementsServeurActes.class.php

示例5: getZBE

 /**
  * Récupération du segment ZBE
  *
  * @param DOMNode   $node     Node
  * @param CSejour   $newVenue Admit
  * @param CMovement $movement Movement
  *
  * @return CMovement|string|null
  */
 function getZBE(DOMNode $node, CSejour $newVenue, CMovement $movement)
 {
     $sender = $this->_ref_sender;
     $idex_create = false;
     $event_code = $this->_ref_exchange_hl7v2->code;
     $own_movement = null;
     $sender_movement = null;
     foreach ($this->queryNodes("ZBE.1", $node) as $ZBE_1) {
         $EI_1 = $this->queryTextNode("EI.1", $ZBE_1);
         $EI_2 = $this->queryTextNode("EI.2", $ZBE_1);
         $EI_3 = $this->queryTextNode("EI.3", $ZBE_1);
         // Notre propre identifiant de mouvement
         if ($EI_2 == CAppUI::conf("hl7 assigning_authority_namespace_id") || $EI_3 == CAppUI::conf("hl7 assigning_authority_universal_id")) {
             $own_movement = $EI_1;
             break;
         }
         // L'identifiant de mouvement du sender
         if ($EI_3 == $sender->_configs["assigning_authority_universal_id"] || $EI_2 == $sender->_configs["assigning_authority_universal_id"]) {
             $sender_movement = $EI_1;
             continue;
         }
     }
     if (!$own_movement && !$sender_movement) {
         return "Impossible d'identifier le mouvement";
     }
     $movement_id = $own_movement ? $own_movement : $sender_movement;
     if (!$movement_id) {
         return null;
     }
     $start_movement_dt = $this->queryTextNode("ZBE.2/TS.1", $node);
     $action = $this->queryTextNode("ZBE.4", $node);
     $original_trigger = $this->queryTextNode("ZBE.6", $node);
     if (!$original_trigger) {
         $original_trigger = $event_code;
     }
     $movement->sejour_id = $newVenue->_id;
     $movement->original_trigger_code = $original_trigger;
     $movement->cancel = 0;
     $idexMovement = new CIdSante400();
     // Notre propre ID de mouvement
     if ($own_movement) {
         $movement_id_split = explode("-", $movement_id);
         $movement->movement_type = $movement_id_split[0];
         $movement->_id = $movement_id_split[1];
         $movement->loadMatchingObjectEsc();
         if (!$movement->_id) {
             return null;
         }
         if ($sender_movement) {
             $idexMovement = CIdSante400::getMatch("CMovement", $sender->_tag_movement, $sender_movement);
             if (!$idexMovement->_id) {
                 $idex_create = true;
             }
         }
     } else {
         $idexMovement = CIdSante400::getMatch("CMovement", $sender->_tag_movement, $movement_id);
         if ($idexMovement->_id) {
             $movement->load($idexMovement->object_id);
         } else {
             $idex_create = true;
             if ($event_code != "A02" && $event_code != "A21") {
                 $movement->cancel = 0;
                 $movement->loadMatchingObjectEsc();
             }
         }
         $movement->movement_type = $newVenue->getMovementType($original_trigger);
     }
     // Erreur dans le cas où le type du mouvement est UPDATE ou CANCEL et que l'on a pas retrouvé le mvt
     if (($action == "UPDATE" || $action == "CANCEL") && !$movement->_id) {
         return null;
     }
     if ($action == "CANCEL") {
         $movement->cancel = true;
     }
     $movement->start_of_movement = $start_movement_dt;
     $movement->last_update = CMbDT::dateTime();
     $movement->_eai_sender_guid = $sender->_guid;
     if ($msg = $movement->store()) {
         return $msg;
     }
     if ($idex_create) {
         $idexMovement->last_update = CMbDT::dateTime();
         $idexMovement->object_id = $movement->_id;
         $idexMovement->_eai_sender_guid = $sender->_guid;
         if ($msg = $idexMovement->store()) {
             return $msg;
         }
     }
     return $movement;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:99,代码来源:CHL7v2RecordAdmit.class.php

示例6: admitFound

 function admitFound($NDA, CSejour $sejour)
 {
     $sender = $this->_ref_sender;
     // NDA
     $idexNDA = CIdSante400::getMatch("CSejour", $sender->_tag_sejour, $NDA);
     if ($idexNDA->_id) {
         $sejour->load($idexNDA->object_id);
         return true;
     }
     return false;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:11,代码来源:CHprim21RecordPayment.class.php

示例7: lookupObject

 /**
  * Lookup an object already imported
  *
  * @param string $guid Guid of the object to lookup
  * @param string $tag  Tag of it's Idex
  *
  * @return CIdSante400
  */
 function lookupObject($guid, $tag = "migration")
 {
     list($class, ) = explode("-", $guid);
     $idex = CIdSante400::getMatch($class, $tag, $guid);
     return $idex;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:14,代码来源:CProductCategoryXMLImport.class.php

示例8: getTypeAnesthesie

 /**
  * Récupération du type d'anesthésie
  *
  * @param DOMNode    $node      Node
  * @param COperation $operation Intervention
  *
  * @return void
  */
 function getTypeAnesthesie(DOMNode $node, COperation $operation)
 {
     $xpath = new CHPrimXPath($node->ownerDocument);
     if (!($typeAnesthesie = $xpath->queryTextNode("hprim:typeAnesthesie", $node))) {
         return;
     }
     $operation->type_anesth = CIdSante400::getMatch("CTypeAnesth", $this->_ref_sender->_tag_hprimxml, $typeAnesthesie)->object_id;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:16,代码来源:CHPrimXMLEvenementsServeurActivitePmsi.class.php

示例9: isRobot

 /**
  * Is the user a robot?
  *
  * @return bool
  */
 function isRobot()
 {
     if (!$this->_id) {
         return false;
     }
     $tag_software = CMediusers::getTagSoftware();
     if (CModule::getActive("dPsante400") && $tag_software) {
         if (CIdSante400::getMatch($this->_class, $tag_software, null, $this->_id)->_id != null) {
             return true;
         }
     }
     if (!$this->_ref_user || !$this->_ref_user->_id) {
         $this->loadRefUser();
     }
     return $this->_ref_user->dont_log_connection;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:21,代码来源:CMediusers.class.php

示例10: getMedecin

 /**
  * Récupération du médecin
  *
  * @param DOMNode $node Node
  *
  * @return int
  */
 function getMedecin(DOMNode $node)
 {
     $xpath = new CHPrimXPath($node->ownerDocument);
     $code = $xpath->queryTextNode("hprim:identification/hprim:code", $node);
     $mediuser = new CMediusers();
     $tag = $this->_ref_echange_hprim->_ref_sender->_tag_mediuser;
     $idex = CIdSante400::getMatch("CMediusers", $tag, $code);
     if ($idex->_id) {
         return $idex->object_id;
     }
     $rpps = $xpath->queryTextNode("hprim:noRPPS", $node);
     if ($rpps) {
         $mediuser = new CMediusers();
         $where = array();
         $where["users_mediboard.rpps"] = " = '{$rpps}'";
         $mediuser->loadObject($where);
         return $mediuser->_id;
     }
     $adeli = $xpath->queryTextNode("hprim:numeroAdeli", $node);
     if ($adeli) {
         $mediuser = CMediusers::loadFromAdeli($adeli);
         return $mediuser->_id;
     }
     // Récupération du typePersonne
     // Obligatoire pour MB
     $personne = $xpath->queryUniqueNode("hprim:personne", $node, false);
     $mediuser = self::getPersonne($personne, $mediuser);
     $mediuser->_id = $this->createPraticien($mediuser);
     $idex->object_id = $mediuser->_id;
     $idex->last_update = CMbDT::dateTime();
     $idex->store();
     return $mediuser->_id;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:40,代码来源:CHPrimXMLEvenements.class.php

示例11: handle

 /**
  * Enregistrement des interventions
  * 
  * @param CHPrimXMLAcquittementsServeurActivitePmsi $dom_acq  DOM Acquittement
  * @param CMbObject                                 $mbObject Object
  * @param array                                     $data     Data that contain the nodes
  * 
  * @return string Acquittement 
  **/
 function handle(CHPrimXMLAcquittementsServeurActivitePmsi $dom_acq, CMbObject $mbObject, $data)
 {
     $operation = $mbObject;
     $exchange_hprim = $this->_ref_echange_hprim;
     $sender = $exchange_hprim->_ref_sender;
     $sender->loadConfigValues();
     $this->_ref_sender = $sender;
     $warning = null;
     $comment = null;
     // Acquittement d'erreur : identifiants source du patient / séjour non fournis
     if (!$data['idSourcePatient'] || !$data['idSourceVenue']) {
         return $exchange_hprim->setAckError($dom_acq, "E206", null, $mbObject);
     }
     // IPP non connu => message d'erreur
     $IPP = CIdSante400::getMatch("CPatient", $sender->_tag_patient, $data['idSourcePatient']);
     if (!$IPP->_id) {
         return $exchange_hprim->setAckError($dom_acq, "E013", null, $mbObject);
     }
     // Chargement du patient
     $patient = new CPatient();
     $patient->load($IPP->object_id);
     // Num dossier non connu => message d'erreur
     $NDA = CIdSante400::getMatch("CSejour", $sender->_tag_sejour, $data['idSourceVenue']);
     if (!$NDA->_id) {
         return $exchange_hprim->setAckError($dom_acq, "E014", null, $mbObject);
     }
     // Chargement du séjour
     $sejour = new CSejour();
     $sejour->load($NDA->object_id);
     // Si patient H'XML est différent du séjour
     if ($sejour->patient_id != $patient->_id) {
         return $exchange_hprim->setAckError($dom_acq, "E015", null, $mbObject);
     }
     // Chargement du patient du séjour
     $sejour->loadRefPatient();
     $operation->sejour_id = $sejour->_id;
     // Mapping du séjour
     $sejour = $this->mappingVenue($data['venue'], $sejour);
     // Notifier les autres destinataires autre que le sender
     $sejour->_eai_sender_guid = $sender->_guid;
     /* TODO Supprimer ceci après l'ajout des times picker */
     $sejour->_hour_entree_prevue = null;
     $sejour->_min_entree_prevue = null;
     $sejour->_hour_sortie_prevue = null;
     $sejour->_min_sortie_prevue = null;
     if ($msgVenue = $sejour->store()) {
         return $exchange_hprim->setAck($dom_acq, "A102", $msgVenue, null, $sejour);
     }
     // idex de l'intervention
     $idex = CIdSante400::getMatch("COperation", $sender->_tag_hprimxml, $data['idSourceIntervention']);
     if ($idex->_id) {
         $operation_source = new COperation();
         $operation_source->load($idex->object_id);
         if ($operation_source->sejour_id != $sejour->_id) {
             return $exchange_hprim->setAckError($dom_acq, "E204", null, $mbObject);
         }
         $operation = $operation_source;
     }
     // ID Mediboard de l'intervention
     if ($data['idCibleIntervention']) {
         $operation_source = new COperation();
         $operation_source->load($data['idCibleIntervention']);
         if ($operation_source->sejour_id != $sejour->_id) {
             return $exchange_hprim->setAckError($dom_acq, "E204", null, $mbObject);
         }
         if ($idex->_id && $operation->_id != $operation_source->_id) {
             return $exchange_hprim->setAckError($dom_acq, "E205", null, $mbObject);
         }
         $operation = $operation_source;
     }
     // Recherche de la salle
     $salle = $this->getSalle($data['intervention'], $sejour);
     if ($salle->nom && !$salle->_id) {
         $comment = "Salle '{$salle->nom}' inconnue dans l'infrastructure de l'établissement";
         return $exchange_hprim->setAckError($dom_acq, "E202", $comment, $mbObject);
     }
     $operation->salle_id = $salle->_id;
     // Mapping du chirurgien
     $mediuser = $this->getParticipant($data['intervention'], $sejour);
     if ($mediuser->adeli && !$mediuser->_id || !$mediuser->adeli) {
         $comment = $mediuser->adeli ? "Participant '{$mediuser->adeli}' inconnu" : "Le code ADELI n'est pas renseigné";
         return $exchange_hprim->setAckError($dom_acq, "E203", $comment, $mbObject);
     }
     $operation->chir_id = $mediuser->_id;
     // Mapping de la plage
     $this->mappingPlage($data['intervention'], $operation);
     $plageop_id = $operation->plageop_id;
     // Recherche d'une intervention existante sinon création
     if (!$operation->_id) {
         $operation->loadMatchingObject();
     }
//.........这里部分代码省略.........
开发者ID:fbone,项目名称:mediboard4,代码行数:101,代码来源:CHPrimXMLEvenementsServeurIntervention.class.php

示例12: handleA50

 /**
  * Handle event A50 - change visit number
  *
  * @param CHL7Acknowledgment $ack        Acknowledgment
  * @param CPatient           $newPatient Person
  * @param array              $data       Datas
  *
  * @return string
  */
 function handleA50(CHL7Acknowledgment $ack, CPatient $newPatient, $data)
 {
     // Traitement du message des erreurs
     $comment = "";
     $venue = new CSejour();
     $exchange_hl7v2 = $this->_ref_exchange_hl7v2;
     $sender = $exchange_hl7v2->_ref_sender;
     // Prise en charge du A50 seulement pour le NRA
     if (!CAppUI::conf("dPplanningOp CSejour use_dossier_rang")) {
         return $exchange_hl7v2->setAckAR($ack, "E801", null, $venue);
     }
     $patientPI = CValue::read($data['personIdentifiers'], "PI");
     $venueAN = $this->getVenueAN($sender, $data);
     // Acquittement d'erreur : identifiants RI et PI non fournis
     if (!$patientPI || !$venueAN) {
         return $exchange_hl7v2->setAckAR($ack, "E100", null, $newPatient);
     }
     $idexVenue = CIdSante400::getMatch("CSejour", $sender->_tag_sejour, $venueAN);
     $venue->load($idexVenue->object_id);
     if (!$venue->_id) {
         return $exchange_hl7v2->setAckAR($ack, "E802", null, $venue);
     }
     // Chargement du NRA
     $venue->loadNRA($sender->group_id);
     $NRA = $venue->_ref_NRA;
     // MRG-6 Ancien FID
     $MRG_6 = $this->queryTextNode("MRG.6/CX.1", $data["MRG"]);
     if ($NRA->id400 != $MRG_6) {
         return $exchange_hl7v2->setAckAR($ack, "E803", null, $venue);
     }
     // Réattribution du nouveau NRA
     $PV1_50 = $this->queryTextNode("PV1.50/CX.1", $data["PV1"]);
     $NRA->id400 = $PV1_50;
     $NRA->last_update = CMbDT::dateTime();
     if ($msg = $NRA->store()) {
         return $exchange_hl7v2->setAckAR($ack, "E804", $msg, $venue);
     }
     return $exchange_hl7v2->setAckAA($ack, "I800", $comment, $venue);
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:48,代码来源:CHL7v2MoveAccountInformation.class.php

示例13: mergePatient

 /**
  * merge the patient
  *
  * @param String   $identifier identifier
  * @param String   $tag        tag
  * @param CPatient $patient    patient
  *
  * @return null|CHPrimSanteError
  */
 function mergePatient($identifier, $tag, CPatient $patient)
 {
     $idex = CIdSante400::getMatch("CPatient", $tag, $identifier["identifier"]);
     if (!$idex->_id) {
         return new CHPrimSanteError($this->_ref_exchange_hpr, "P", "02", array("P", $this->loop, $this->identifier_patient), "8.3.1");
     }
     $idex2 = CIdSante400::getMatch("CPatient", $tag, $identifier["identifier_merge"]);
     if (!$idex2->_id) {
         return new CHPrimSanteError($this->_ref_exchange_hpr, "P", "02", array("P", $this->loop, $this->identifier_patient), "8.3.2");
     }
     $patient->load($idex->object_id);
     $patient2 = new CPatient();
     $patient2->load($idex2->object_id);
     $patientsElimine_array = array($patient2);
     $first_patient_id = $patient->_id;
     // Erreur sur le check du merge
     if ($checkMerge = $patient->checkMerge($patientsElimine_array)) {
         return new CHPrimSanteError($this->_ref_exchange_hpr, "P", "12", array("P", $this->loop, $this->identifier_patient), "8.3.3", $checkMerge);
     }
     $mbPatientElimine_id = $patient2->_id;
     /** @todo mergePlainFields resets the _id */
     $patient->_id = $first_patient_id;
     // Notifier les autres destinataires
     $patient->_eai_sender_guid = $this->_ref_sender->_guid;
     $patient->_merging = CMbArray::pluck($patientsElimine_array, "_id");
     if ($msg = $patient->merge($patientsElimine_array)) {
         return new CHPrimSanteError($this->_ref_exchange_hpr, "P", "12", array("P", $this->loop, $this->identifier_patient), "8.3.3", $msg);
     }
     $patient->_mbPatientElimine_id = $mbPatientElimine_id;
     return null;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:40,代码来源:CHPrimSanteRecordADM.class.php

示例14: fusionPatient

 /**
  * Fusion and recording a patient with an IPP in the system
  *
  * @param CHPrimXMLAcquittementsPatients $dom_acq    Acquittement
  * @param CPatient                       $newPatient Patient
  * @param array                          $data       Datas
  *
  * @return string acquittement 
  **/
 function fusionPatient(CHPrimXMLAcquittementsPatients $dom_acq, CPatient $newPatient, $data)
 {
     $echg_hprim = $this->_ref_echange_hprim;
     $commentaire = $avertissement = "";
     $codes = array();
     $sender = $echg_hprim->_ref_sender;
     $sender->loadConfigValues();
     $this->_ref_sender = $sender;
     // Si CIP
     if (!CAppUI::conf('sip server')) {
         $mbPatientElimine = new CPatient();
         $mbPatient = new CPatient();
         $sender = $echg_hprim->_ref_sender;
         // Acquittement d'erreur : identifiants source et cible non fournis pour le patient / patientElimine
         if (!$data['idSourcePatient'] && !$data['idCiblePatient'] && !$data['idSourcePatientElimine'] && !$data['idCiblePatientElimine']) {
             return $echg_hprim->setAckError($dom_acq, "E005", $commentaire, $newPatient);
         }
         $idexPatient = CIdSante400::getMatch("CPatient", $sender->_tag_patient, $data['idSourcePatient']);
         if ($mbPatient->load($data['idCiblePatient'])) {
             if ($mbPatient->_id != $idexPatient->object_id) {
                 $commentaire = "L'identifiant source fait référence au patient : {$idexPatient->object_id} et l'identifiant cible";
                 $commentaire .= "au patient : {$mbPatient->_id}.";
                 return $echg_hprim->setAckError($dom_acq, "E004", $commentaire, $newPatient);
             }
         }
         if (!$mbPatient->_id) {
             $mbPatient->load($idexPatient->object_id);
         }
         $idexPatientElimine = CIdSante400::getMatch("CPatient", $sender->_tag_patient, $data['idSourcePatientElimine']);
         if ($mbPatientElimine->load($data['idCiblePatientElimine'])) {
             if ($mbPatientElimine->_id != $idexPatientElimine->object_id) {
                 $commentaire = "L'identifiant source fait référence au patient : {$idexPatientElimine->object_id} et l'identifiant cible";
                 $commentaire .= "au patient : {$mbPatientElimine->_id}.";
                 return $echg_hprim->setAckError($dom_acq, "E041", $commentaire, $newPatient);
             }
         }
         if (!$mbPatientElimine->_id) {
             $mbPatientElimine->load($idexPatientElimine->object_id);
         }
         if (!$mbPatient->_id || !$mbPatientElimine->_id) {
             $commentaire = !$mbPatient->_id ? "Le patient {$mbPatient->_id} est inconnu dans Mediboard." : "Le patient {$mbPatientElimine->_id} est inconnu dans Mediboard.";
             return $echg_hprim->setAckError($dom_acq, "E012", $commentaire, $newPatient);
         }
         // Passage en trash de l'IPP du patient a éliminer
         $idexPatientElimine->tag = CAppUI::conf('dPpatients CPatient tag_ipp_trash') . $sender->_tag_patient;
         $idexPatientElimine->store();
         $avertissement = null;
         $patientsElimine_array = array($mbPatientElimine);
         $first_patient_id = $mbPatient->_id;
         $checkMerge = $mbPatient->checkMerge($patientsElimine_array);
         // Erreur sur le check du merge
         if ($checkMerge) {
             $commentaire = "La fusion de ces deux patients n'est pas possible à cause des problèmes suivants : {$checkMerge}";
             return $echg_hprim->setAckError($dom_acq, "E010", $commentaire, $newPatient);
         }
         $mbPatientElimine->_id;
         /** @todo mergePlainFields resets the _id */
         $mbPatient->_id = $first_patient_id;
         // Notifier les autres destinataires
         $mbPatient->_eai_sender_guid = $sender->_guid;
         $mbPatient->_merging = CMbArray::pluck($patientsElimine_array, "_id");
         $msg = $mbPatient->merge($patientsElimine_array);
         $commentaire = CEAIPatient::getComment($newPatient, $mbPatientElimine);
         $codes = array($msg ? "A010" : "I010");
         if ($msg) {
             $avertissement = $msg . " ";
         }
     }
     return $echg_hprim->setAck($dom_acq, $codes, $avertissement, $commentaire, $newPatient);
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:79,代码来源:CHPrimXMLFusionPatient.class.php

示例15: venuePatient

 /**
  * Record admit
  *
  * @param CHPrimXMLAcquittementsPatients $dom_acq    Acquittement
  * @param CPatient                       $newPatient Patient
  * @param array                          $data       Data
  * @param CSejour                        &$newVenue  Admit
  *
  * @return CHPrimXMLAcquittementsPatients $msgAcq 
  **/
 function venuePatient(CHPrimXMLAcquittementsPatients $dom_acq, CPatient $newPatient, $data, &$newVenue = null)
 {
     $echg_hprim = $this->_ref_echange_hprim;
     // Cas 1 : Traitement du patient
     $domEnregistrementPatient = new CHPrimXMLEnregistrementPatient();
     $domEnregistrementPatient->_ref_echange_hprim = $echg_hprim;
     $msgAcq = $domEnregistrementPatient->enregistrementPatient($dom_acq, $newPatient, $data);
     if ($echg_hprim->statut_acquittement != "OK") {
         return $msgAcq;
     }
     // Cas 2 : Traitement de la venue
     $dom_acq = new CHPrimXMLAcquittementsPatients();
     $dom_acq->_identifiant_acquitte = $data['identifiantMessage'];
     $dom_acq->_sous_type_evt = $this->sous_type;
     $dom_acq->_ref_echange_hprim = $echg_hprim;
     // Traitement du message des erreurs
     $avertissement = $msgID400 = $msgVenue = $msgNDA = "";
     $_code_Venue = $_code_NumDos = $_num_dos_create = $_modif_venue = false;
     $sender = $echg_hprim->_ref_sender;
     $sender->loadConfigValues();
     $this->_ref_sender = $sender;
     $idSourceVenue = $data['idSourceVenue'];
     $idCibleVenue = $data['idCibleVenue'];
     if (!$newVenue) {
         $newVenue = new CSejour();
     }
     // Cas d'une annulation
     $cancel = false;
     if ($data['action'] == "suppression") {
         $cancel = true;
     }
     // Affectation du patient
     $newVenue->patient_id = $newPatient->_id;
     // Affectation de l'établissement
     $newVenue->group_id = $sender->group_id;
     $commentaire = "";
     $codes = array();
     // Si CIP
     if (!CAppUI::conf('smp server')) {
         // Acquittement d'erreur : identifiants source et cible non fournis pour le patient / venue
         if (!$idSourceVenue && !$idCibleVenue) {
             return $echg_hprim->setAckError($dom_acq, "E100", $commentaire, $newVenue);
         }
         $nda = CIdSante400::getMatch("CSejour", $sender->_tag_sejour, $idSourceVenue);
         // idSource non connu
         if (!$nda->_id) {
             // idCible fourni
             if ($idCibleVenue) {
                 if ($newVenue->load($idCibleVenue)) {
                     // Dans le cas d'une annulation de la venue
                     if ($cancel) {
                         if ($msgAcq = $this->doNotCancelVenue($newVenue, $dom_acq, $echg_hprim)) {
                             return $msgAcq;
                         }
                     }
                     // Recherche d'un num dossier déjà existant pour cette venue
                     // Mise en trash du numéro de dossier reçu
                     $newVenue->loadNDA();
                     if ($this->trashNDA($newVenue, $sender)) {
                         $nda->_trash = true;
                     } else {
                         // Mapping du séjour si pas de numéro de dossier
                         $newVenue = $this->mappingVenue($data['venue'], $newVenue, $cancel);
                         $msgVenue = CEAISejour::storeSejour($newVenue, $sender);
                         $commentaire = CEAISejour::getComment($newVenue);
                         $_code_NumDos = "I121";
                         $_code_Venue = true;
                     }
                 } else {
                     $_code_NumDos = "I120";
                 }
             } else {
                 $_code_NumDos = "I122";
             }
             if (!$newVenue->_id) {
                 // Mapping du séjour
                 $newVenue->_NDA = $nda->id400;
                 $newVenue = $this->mappingVenue($data['venue'], $newVenue, $cancel);
                 // Séjour retrouvé
                 if (CAppUI::conf("hprimxml strictSejourMatch")) {
                     if ($newVenue->loadMatchingSejour(null, true, $sender->_configs["use_sortie_matching"])) {
                         // Dans le cas d'une annulation de la venue
                         if ($cancel) {
                             if ($msgAcq = $this->doNotCancelVenue($newVenue, $dom_acq, $echg_hprim)) {
                                 return $msgAcq;
                             }
                         }
                         // Recherche d'un num dossier déjà existant pour cette venue
                         // Mise en trash du numéro de dossier reçu
                         $newVenue->loadNDA();
//.........这里部分代码省略.........
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:101,代码来源:CHPrimXMLVenuePatient.class.php


注:本文中的CIdSante400::getMatch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。