Esempio n. 1
0
 /**
  * @see parent::send()
  */
 function send($docItem)
 {
     $this->initClientSOAP();
     $docItem->loadTargetObject();
     $object = $docItem->_ref_object;
     if ($object instanceof CConsultAnesth) {
         $object->loadRefConsultation();
         $object = $object->_ref_consultation;
     }
     $object->loadRefPraticien();
     $object->loadRefPatient();
     $object->_ref_praticien->loadRefSpecCPAM();
     if ($object instanceof CSejour) {
         $object->loadRefEtablissement();
         $sej_id = $object->_id;
         $doc_type = 29;
         $act_dateActe = CMbDT::date($object->entree_reelle);
         $act_dateValidationActe = CMbDT::date($object->entree_reelle);
         $etab_id = $object->_ref_group->_id;
         $etab_nom = $object->_ref_group->text;
     }
     if ($object instanceof COperation) {
         $object->_ref_sejour->loadRefEtablissement();
         $object->loadRefPlageOp();
         $sej_id = $object->sejour_id;
         $doc_type = 8;
         $act_dateActe = CMbDT::date($object->_datetime);
         $act_dateValidationActe = CMbDT::date($object->_datetime);
         $etab_id = $object->_ref_sejour->_ref_group->_id;
         $etab_nom = $object->_ref_sejour->_ref_group->text;
     }
     if ($object instanceof CConsultation) {
         $object->loadRefConsultAnesth();
         $act_dateActe = CMbDT::date($object->_ref_plageconsult->date);
         $act_dateValidationActe = CMbDT::date($object->_ref_plageconsult->date);
         if ($object->_ref_consult_anesth instanceof CConsultAnesth) {
             $object->_ref_consult_anesth->loadRefSejour();
             $sejour = $object->_ref_consult_anesth->_ref_sejour;
             $doc_type = 67;
         } else {
             $object->loadRefSejour();
             $sejour = $object->_ref_sejour;
             $doc_type = 7;
         }
         if ($sejour->sejour_id) {
             $sej_id = $sejour->sejour_id;
             $sejour->loadRefEtablissement();
             $etab_id = $sejour->_ref_group->_id;
             $etab_nom = $sejour->_ref_group->text;
         } else {
             $sej_id = -1;
             $object->_ref_praticien->loadRefFunction();
             $object->_ref_praticien->_ref_function->loadRefGroup();
             $etab_id = $object->_ref_praticien->_ref_function->_ref_group->_id;
             $etab_nom = $object->_ref_praticien->_ref_function->_ref_group->text;
         }
     }
     $praticien = $object->_ref_praticien;
     $aut_id = $praticien->_id;
     $aut_nom = $praticien->_user_last_name;
     $aut_prenom = $praticien->_user_first_name;
     $aut_numOrdre = $praticien->adeli ? $praticien->adeli : "";
     $patient = $object->_ref_patient;
     $pat_id = $patient->_id;
     $pat_civilite = CMedinetSender::$civiliteConversion[$patient->sexe];
     $pat_nomNaissance = $patient->nom_jeune_fille ? $patient->nom_jeune_fille : $patient->nom;
     $pat_nomUsuel = $patient->nom_jeune_fille ? $patient->nom : "";
     $pat_prenom = $patient->prenom;
     $pat_sexe = CMedinetSender::$sexeConversion[$patient->sexe];
     $pat_dateNaissance = $patient->naissance;
     $pat_cpNaissance = $patient->cp_naissance;
     $pat_villeNaissance = $patient->lieu_naissance ? $patient->lieu_naissance : "";
     $pat_cinseePaysNaissance = $patient->pays_naissance_insee ? $patient->pays_naissance_insee : -1;
     $pat_adresseVie = $patient->adresse;
     $pat_cpVie = $patient->cp;
     $pat_villeVie = $patient->ville;
     $pat_cinseePaysVie = $patient->pays_insee ? $patient->pays_insee : -1;
     $pat_telephone1 = $patient->tel;
     $pat_telephone2 = $patient->tel2;
     $act_id = $object->_id;
     $doc_id = $docItem->_id;
     $spec_cpam_id = $praticien->_ref_spec_cpam->spec_cpam_id;
     $act_pathologie = isset(CMedinetSender::$cpamConversion[$spec_cpam_id]) ? CMedinetSender::$cpamConversion[$spec_cpam_id] : 0;
     if ($docItem instanceof CCompteRendu) {
         $doc_nom = $docItem->nom;
         $doc_titre = $docItem->nom;
         $doc_nomReel = $docItem->nom;
         $doc_typeMime = "text/html";
         $log = new CUserLog();
         $log->type = "create";
         $log->object_id = $docItem->_id;
         $log->object_class = $docItem->_class;
         $log->loadMatchingObject();
         $act_dateCreationActe = CMbDT::date($log->date);
         $fichier = base64_encode($docItem->getBinaryContent());
     }
     if ($docItem instanceof CFile) {
         $doc_nom = $docItem->file_name;
         $doc_titre = $docItem->file_name;
         $doc_nomReel = $docItem->file_real_filename;
         $doc_typeMime = $docItem->file_type;
         $act_dateCreationActe = CMbDT::date($docItem->file_date);
         $fichier = base64_encode($docItem->getBinaryContent());
     }
     $doc_commentaire = "";
     $invalidation = 0;
     if ($messages = $this->checkParameters($object)) {
         CAppUI::setMsg($messages, UI_MSG_ERROR);
         return;
     }
     $parameters = array("sej_id" => $sej_id, "aut_id" => $aut_id, "aut_nom" => $aut_nom, "aut_prenom" => $aut_prenom, "aut_numOrdre" => $aut_numOrdre, "pat_id" => $pat_id, "pat_civilite" => $pat_civilite, "pat_nomNaissance" => $pat_nomNaissance, "pat_nomUsuel" => $pat_nomUsuel, "pat_prenom" => $pat_prenom, "pat_sexe" => $pat_sexe, "pat_dateNaissance" => $pat_dateNaissance, "pat_cpNaissance" => $pat_cpNaissance, "pat_villeNaissance" => $pat_villeNaissance, "pat_cinseePaysNaissance" => $pat_cinseePaysNaissance, "pat_adresseVie" => $pat_adresseVie, "pat_cpVie" => $pat_cpVie, "pat_villeVie" => $pat_villeVie, "pat_cinseePaysVie" => $pat_cinseePaysVie, "pat_telephone1" => $pat_telephone1, "pat_telephone2" => $pat_telephone2, "doc_id" => $doc_id, "doc_nom" => $doc_nom, "doc_titre" => $doc_titre, "doc_commentaire" => $doc_commentaire, "doc_type" => $doc_type, "doc_nomReel" => $doc_nomReel, "doc_typeMime" => $doc_typeMime, "act_id" => $act_id, "act_pathologie" => $act_pathologie, "act_dateActe" => $act_dateActe, "act_dateCreationActe" => $act_dateCreationActe, "act_dateValidationActe" => $act_dateValidationActe, "etab_id" => $etab_id, "etab_nom" => $etab_nom, "invalidation" => $invalidation, "fichier" => $fichier);
     $parameters = array_map("utf8_encode", $parameters);
     // Identifiant de la transaction
     if (null == ($transactionId = $this->clientSOAP->saveNewDocument_withStringFile($parameters))) {
         return;
     }
     $transactionId = $transactionId->saveNewDocument_withStringFileResult;
     $parameters = array("transactionId" => $transactionId);
     // Statut de la transaction
     if (null == ($status = $this->clientSOAP->getStatus($parameters))) {
         return;
     }
     $status = $status->getStatusResult;
     if (isset(CMedinetSender::$descriptifStatus[$status])) {
         CAppUI::setMsg(CMedinetSender::$descriptifStatus[$status]);
     } else {
         CAppUI::setMsg("Aucun statut n'a été transmis", UI_MSG_ALERT);
     }
     // Création de l'identifiant externe
     $idex = new CIdSante400();
     //Paramétrage de l'id 400
     $idex->object_class = $docItem->_class;
     $idex->tag = CMedinetSender::$tag;
     // Affectation de l'id400 a la transaction
     $idex->id400 = $transactionId;
     $idex->object_id = $docItem->_id;
     $idex->_id = null;
     $idex->last_update = CMbDT::dateTime();
     $idex->store();
     // Change l'etat du document
     $docItem->etat_envoi = "oui";
     return true;
 }
 /**
  * Get date last checklist for a type
  *
  * @param CMbObject $object Object to get the check lists of
  * @param string    $type   type de checklist
  *
  * @return date
  */
 static function getDateLastChecklist(CMbObject $object, $type)
 {
     $date_last_checklist = null;
     $ljoin = array();
     $ljoin["daily_check_list_type"] = "daily_check_list_type.daily_check_list_type_id = daily_check_list.list_type_id";
     $where = array();
     $where["daily_check_list.object_class"] = " = '{$object->_class}'";
     $where["daily_check_list.object_id"] = " = '{$object->_id}'";
     $where["daily_check_list_type.type"] = " = '{$type}'";
     $checklist = new self();
     $checklist->loadObject($where, "date DESC", null, $ljoin);
     if ($checklist->_id) {
         if ($checklist->date_validate) {
             $date_last_checklist = $checklist->date_validate;
         } else {
             $log = new CUserLog();
             $log->object_id = $checklist->_id;
             $log->object_class = $checklist->_class;
             $log->loadMatchingObject("date DESC", "user_log_id");
             $date_last_checklist = $log->date;
         }
     }
     if (!$checklist->_id || !$date_last_checklist) {
         $date_last_checklist = $checklist->date;
     }
     return $date_last_checklist;
 }
Esempio n. 3
0
    }
}
$anesth = new CMediusers();
$anesths = $anesth->loadAnesthesistes(PERM_READ);
$date_last_checklist = array();
foreach ($listSalles as $salle) {
    if ($salle->cheklist_man) {
        $checklist = new CDailyCheckList();
        $checklist->object_class = $salle->_class;
        $checklist->object_id = $salle->_id;
        $checklist->loadMatchingObject("date DESC");
        if ($checklist->_id) {
            $log = new CUserLog();
            $log->object_id = $checklist->_id;
            $log->object_class = $checklist->_class;
            $log->loadMatchingObject("date DESC");
            $date_last_checklist[$salle->_id] = $log->date;
        } elseif ($checklist->date) {
            $date_last_checklist[$salle->_id] = $checklist->date;
        } else {
            $date_last_checklist[$salle->_id] = "";
        }
    }
}
// Création du template
$smarty = new CSmartyDP();
$smarty->debugging = false;
$smarty->assign("urgences", $urgences);
$smarty->assign("listBlocs", $listBlocs);
$smarty->assign("listSalles", $listSalles);
$smarty->assign("anesths", $anesths);