} else { $notification->date_echange = ""; $notification->store(); } } else { $notification->date_echange = ""; $notification->store(); } } } else { // Chargement de l'objet /** @var CEchangeHprim $echange_hprim */ $echange_hprim = new $echange_hprim_classname(); $echange_hprim->load($echange_hprim_id); $dest_hprim = new CDestinataireHprim(); $dest_hprim->load($echange_hprim->receiver_id); $source = CExchangeSource::get("{$dest_hprim->_guid}-evenementPatient"); $source->setData($echange_hprim->_message); $source->send(); $acquittement = $source->getACQ(); if ($acquittement) { $domGetAcquittement = new CHPrimXMLAcquittementsPatients(); $domGetAcquittement->loadXML($acquittement); $doc_valid = $domGetAcquittement->schemaValidate(null, false, $dest_hprim->display_errors); if ($doc_valid) { $echange_hprim->statut_acquittement = $domGetAcquittement->getStatutAcquittementPatient(); } $echange_hprim->acquittement_valide = $doc_valid ? 1 : 0; $echange_hprim->date_echange = CMbDT::dateTime(); $echange_hprim->_acquittement = $acquittement; $echange_hprim->store();
$max = min($max, $count); CAppUI::stepAjax("Export de {$max} sur {$count} objets de type 'CPatient' à partir de l'ID '{$idMin}'", UI_MSG_OK); // Time limit $seconds = max($max / 20, 120); CAppUI::stepAjax("Limite de temps du script positionné à '{$seconds}' secondes", UI_MSG_OK); CApp::setTimeLimit($seconds); // Export réel $errors = 0; $patients = $patient->loadList($where, $patient->_spec->key, "0, {$max}"); $echange = 0; foreach ($patients as $patient) { $patient->loadIPP(); $patient->loadRefsSejours(); $patient->_ref_last_log->type = "create"; $receiver = new CDestinataireHprim(); $receiver->load(CAppUI::conf("sip export_dest")); $receiver->loadConfigValues(); if (!$patient->_IPP) { $IPP = new CIdSante400(); //Paramétrage de l'id 400 $IPP->object_class = "CPatient"; $IPP->object_id = $patient->_id; $IPP->tag = $receiver->_tag_patient; $IPP->loadMatchingObject(); $patient->_IPP = $IPP->id400; } if (CAppUI::conf("sip pat_no_ipp") && $patient->_IPP && $patient->_IPP != "-" || !$receiver->_configs["send_all_patients"] && empty($patient->_ref_sejours)) { continue; } $dom = new CHPrimXMLEnregistrementPatient(); $dom->_ref_receiver = $receiver;
$sejour->loadRefsPrescripteurs(); } $sejour->loadRefAdresseParPraticien(); $sejour->_ref_patient->loadRefsFwd(); $sejour->loadRefsActes(); foreach ($sejour->_ref_actes_ccam as $actes_ccam) { $actes_ccam->loadRefPraticien(); } $sejour->loadRefsAffectations(); $sejour->loadNDA(); $sejour->loadLogs(); $sejour->loadRefsConsultations(); $sejour->loadRefsConsultAnesth(); $sejour->_ref_last_log->type = "create"; $dest_hprim = new CDestinataireHprim(); $dest_hprim->load(CAppUI::conf("sip export_dest")); $dest_hprim->loadConfigValues(); if (!$sejour->_NDA) { $nda = new CIdSante400(); //Paramétrage de l'id 400 $nda->object_class = "CSejour"; $nda->object_id = $sejour->_id; $nda->tag = $dest_hprim->_tag_sejour; $nda->loadMatchingObject(); $sejour->_NDA = $nda->id400; } if (!$sejour->_ref_patient->_IPP) { $IPP = new CIdSante400(); $IPP->object_class = "CPatient"; $IPP->object_id = $sejour->_ref_patient->_id; $IPP->tag = $dest_hprim->_tag_patient;