function fillLimitedTemplate(&$template) { $this->loadRefsFwd(1); $this->loadRefPraticien(); $this->loadRefChir2(); $this->loadRefChir3(); $this->loadRefChir4(); $this->loadRefsFiles(); $this->loadAffectationsPersonnel(); $plageop = $this->_ref_plageop; $plageop->loadAffectationsPersonnel(); foreach ($this->_ext_codes_ccam as $_code) { $_code->getRemarques(); $_code->getActivites(); } $this->notify("BeforeFillLimitedTemplate", $template); for ($i = 1; $i < 5; $i++) { $prop = "_ref_chir" . ($i == 1 ? "" : "_{$i}"); $praticien = $this->{$prop}; $praticien->loadRefFunction(); $praticien->loadRefDiscipline(); $praticien->loadRefSpecCPAM(); $number = $i == 1 ? "" : " {$i}"; $template->addProperty("Opération - Chirurgien{$number}", $praticien->_id ? "Dr " . $praticien->_view : ''); $template->addProperty("Opération - Chirurgien{$number} - Nom", $praticien->_user_last_name); $template->addProperty("Opération - Chirurgien{$number} - Prénom", $praticien->_user_first_name); $template->addProperty("Opération - Chirurgien{$number} - Initiales", $praticien->_shortview); $template->addProperty("Opération - Chirurgien{$number} - Discipline", $praticien->_ref_discipline->_view); $template->addProperty("Opération - Chirurgien{$number} - Spécialité", $praticien->_ref_spec_cpam->_view); $template->addProperty("Opération - Chirurgien{$number} - CAB", $praticien->cab); $template->addProperty("Opération - Chirurgien{$number} - CONV", $praticien->conv); $template->addProperty("Opération - Chirurgien{$number} - ZISD", $praticien->zisd); $template->addProperty("Opération - Chirurgien{$number} - IK", $praticien->ik); $template->addProperty("Opération - Chirurgien{$number} - Titres", $praticien->titres); $template->addProperty("Opération - Chirurgien{$number} - ADELI", $praticien->adeli); $template->addBarcode("Opération - Chirurgien{$number} - Code barre ADELI", $praticien->adeli, array("barcode" => array("title" => CAppUI::tr("CMediusers-adeli")))); $template->addProperty("Opération - Chirurgien{$number} - RPPS", $praticien->rpps); $template->addBarcode("Opération - Chirurgien{$number} - Code barre RPPS", $praticien->rpps, array("barcode" => array("title" => CAppUI::tr("CMediusers-rpps")))); $template->addProperty("Opération - Chirurgien{$number} - E-mail", $praticien->_user_email); $template->addProperty("Opération - Chirurgien{$number} - E-mail Apicrypt", $praticien->mail_apicrypt); } $template->addProperty("Opération - Anesthésiste - nom", @$this->_ref_anesth->_user_last_name); $template->addProperty("Opération - Anesthésiste - prénom", @$this->_ref_anesth->_user_first_name); $template->addProperty("Opération - Anesthésie", $this->_lu_type_anesth); $template->addProperty("Opération - libellé", $this->libelle); $template->addProperty("Opération - CCAM1 - code", @$this->_ext_codes_ccam[0]->code); $template->addProperty("Opération - CCAM1 - description", @$this->_ext_codes_ccam[0]->libelleLong); $template->addProperty("Opération - CCAM1 - montant activité 1", @$this->_ext_codes_ccam[0]->activites[1]->phases[0]->tarif); $template->addProperty("Opération - CCAM1 - montant activité 4", @$this->_ext_codes_ccam[0]->activites[4]->phases[0]->tarif); $template->addProperty("Opération - CCAM2 - code", @$this->_ext_codes_ccam[1]->code); $template->addProperty("Opération - CCAM2 - description", @$this->_ext_codes_ccam[1]->libelleLong); $template->addProperty("Opération - CCAM2 - montant activité 1", @$this->_ext_codes_ccam[1]->activites[1]->phases[0]->tarif); $template->addProperty("Opération - CCAM2 - montant activité 4", @$this->_ext_codes_ccam[1]->activites[4]->phases[0]->tarif); $template->addProperty("Opération - CCAM3 - code", @$this->_ext_codes_ccam[2]->code); $template->addProperty("Opération - CCAM3 - description", @$this->_ext_codes_ccam[2]->libelleLong); $template->addProperty("Opération - CCAM3 - montant activité 1", @$this->_ext_codes_ccam[2]->activites[1]->phases[0]->tarif); $template->addProperty("Opération - CCAM3 - montant activité 4", @$this->_ext_codes_ccam[2]->activites[4]->phases[0]->tarif); $template->addProperty("Opération - CCAM - codes", implode(" - ", $this->_codes_ccam)); if (CModule::getActive("tarmed") && CAppUI::conf("tarmed CCodeTarmed use_cotation_tarmed")) { $this->loadRefsActes(); $template->addProperty("Opération - TARMED - codes", CActeTarmed::actesHtml($this), '', false); $template->addProperty("Opération - Caisse - codes", CActeCaisse::actesHtml($this), '', false); } $template->addProperty("Opération - CCAM - descriptions", implode(" - ", CMbArray::pluck($this->_ext_codes_ccam, "libelleLong"))); $template->addProperty("Opération - salle", @$this->_ref_salle->nom); $template->addProperty("Opération - côté", $this->cote); $template->addProperty("Opération - position", $this->getFormattedValue("position")); $template->addDateProperty("Opération - date", $this->_datetime_best != " 00:00:00" ? $this->_datetime_best : ""); $template->addLongDateProperty("Opération - date longue", $this->_datetime_best != " 00:00:00" ? $this->_datetime_best : ""); $template->addTimeProperty("Opération - heure", $this->time_operation); $template->addTimeProperty("Opération - durée", $this->temp_operation); $template->addTimeProperty("Opération - durée réelle", $this->_duree_interv); $template->addTimeProperty("Opération - entrée bloc", $this->entree_salle); $template->addTimeProperty("Opération - pose garrot", $this->pose_garrot); $template->addTimeProperty("Opération - début induction", $this->induction_debut); $template->addTimeProperty("Opération - début op", $this->debut_op); $template->addTimeProperty("Opération - fin op", $this->fin_op); $template->addTimeProperty("Opération - fin induction", $this->induction_fin); $template->addTimeProperty("Opération - retrait garrot", $this->retrait_garrot); $template->addTimeProperty("Opération - sortie bloc", $this->sortie_salle); $template->addTimeProperty("Opération - entrée SSPI", $this->entree_reveil); $template->addTimeProperty("Opération - sortie SSPI", $this->sortie_reveil_reel); $template->addProperty("Opération - dépassement anesth", $this->depassement_anesth); $template->addProperty("Opération - Passage USCPO", "{$this->duree_uscpo} nuit(s)"); if (CModule::getActive("mvsante")) { $template->addTimeProperty("Opération - Remise au chirurgien", $this->remise_chir); /** @var CLiaisonLibelleInterv[] $liaisons_libelles */ $liaisons_libelles = $this->loadBackRefs("liaison_libelle", "numero"); CMbObject::massLoadFwdRef($liaisons_libelles, "libelleop_id"); $libelles = array(0 => "", 1 => "", 2 => "", 3 => ""); foreach ($liaisons_libelles as $_liaison) { $libelles[$_liaison->numero - 1] = $_liaison->loadRefLibelle()->nom; } $template->addProperty("Opération - Libellé 1", $libelles[0]); $template->addProperty("Opération - Libellé 2", $libelles[1]); $template->addProperty("Opération - Libellé 3", $libelles[2]); $template->addProperty("Opération - Libellé 4", $libelles[3]); } $template->addProperty("Opération - depassement", $this->depassement); $template->addProperty("Opération - exams pre-op", $this->examen); $template->addProperty("Opération - matériel", $this->materiel); $template->addProperty("Opération - exam per-op", $this->exam_per_op); $template->addProperty("Opération - convalescence", $this->_ref_sejour->convalescence); $template->addProperty("Opération - remarques", $this->rques); $template->addProperty("Opération - Score ASA", $this->getFormattedValue("ASA")); $consult_anesth = $this->_ref_consult_anesth; $consult = $consult_anesth->loadRefConsultation(); $consult->loadRefPlageConsult(); $prat = $consult->loadRefPraticien(); $template->addDateProperty("Opération - Consultation anesthésie - Date", $consult->_id ? $consult->_datetime : ""); $template->addLongDateProperty("Opération - Consultation anesthésie - Date (longue)", $consult->_id ? $consult->_datetime : ""); $template->addLongDateProperty("Opération - Consultation anesthésie - Date (longue, minuscule)", $consult->_id ? $consult->_datetime : "", true); $template->addTimeProperty("Opération - Consultation anesthésie - Heure", $consult->_id ? $consult->_datetime : ""); $template->addProperty("Opération - Consultation anesthésie - Praticien - Prénom", $consult->_id ? $prat->_user_first_name : ""); $template->addProperty("Opération - Consultation anesthésie - Praticien - Nom", $consult->_id ? $prat->_user_last_name : ""); $template->addProperty("Opération - Consultation anesthésie - Remarques", $consult->rques); /** @var CMediusers $prat_visite */ $prat_visite = $this->loadFwdRef("prat_visite_anesth_id", true); $template->addDateProperty("Opération - Visite pré anesthésie - Date", $this->date_visite_anesth); $template->addLongDateProperty("Opération - Visite pré anesthésie - Date (longue)", $this->date_visite_anesth); $template->addProperty("Opération - Visite pré anesthésie - Rques", $this->getFormattedValue("rques_visite_anesth")); $template->addProperty("Opération - Visite pré anesthésie - Autorisation", $this->getFormattedValue("autorisation_anesth")); $template->addProperty("Opération - Visite pré anesthésie - Praticien - Prénom", $prat_visite->_user_first_name); $template->addProperty("Opération - Visite pré anesthésie - Praticien - Nom", $prat_visite->_user_last_name); $template->addBarcode("Opération - Code Barre ID", $this->_id); $list = CMbArray::pluck($this->_ref_files, "file_name"); $template->addListProperty("Opération - Liste des fichiers", $list); foreach ($this->_ref_affectations_personnel as $emplacement => $affectations) { $locale = CAppUI::tr("CPersonnel.emplacement.{$emplacement}"); $property = implode(" - ", CMbArray::pluck($affectations, "_ref_personnel", "_ref_user", "_view")); $template->addProperty("Opération - personnel réel - {$locale}", $property); } foreach ($plageop->_ref_affectations_personnel as $emplacement => $affectations) { $locale = CAppUI::tr("CPersonnel.emplacement.{$emplacement}"); $property = implode(" - ", CMbArray::pluck($affectations, "_ref_personnel", "_ref_user", "_view")); $template->addProperty("Opération - personnel prévu - {$locale}", $property); } $evts = $incidents = array(); foreach ($this->loadRefsAnesthPerops() as $_evt) { if ($_evt->incident) { $incidents[] = $_evt; continue; } $evts[] = $_evt; } $template->addListProperty("Opération - Evenements per-opératoires", $evts); $template->addListProperty("Opération - Incidents per-opératoires", $incidents); CSupervisionGraph::addObservationDataToTemplate($template, $this, "Opération"); if (CModule::getActive("forms")) { CExObject::addFormsToTemplate($template, $this, "Opération"); } if (CAppUI::conf("dPsalleOp enable_surveillance_perop")) { $obs_view = ""; if ($template->valueMode && $this->_id && $this->graph_pack_id) { /** @var CObservationResultSet[] $list_obr */ list($list, $grid, $graphs, $labels, $list_obr) = CObservationResultSet::getChronological($this, $this->graph_pack_id); foreach ($grid as $_row) { /** @var CObservationResult[] $_row */ foreach ($_row as $_cell) { if ($_cell && $_cell->file_id) { $_cell->loadRefFile()->getDataUri(); } } } $smarty = new CSmartyDP("modules/dPpatients"); // Horizontal $smarty->assign("observation_grid", $grid); $smarty->assign("observation_labels", $labels); $smarty->assign("observation_list", $list_obr); $smarty->assign("in_compte_rendu", true); $obs_view = $smarty->fetch("inc_observation_results_grid.tpl", '', '', 0); $obs_view = preg_replace('`([\\n\\r])`', '', $obs_view); } $template->addProperty("Opération - Tableau supervision", $obs_view, '', false); } $this->notify("AfterFillLimitedTemplate", $template); }
/** * Charge les actes Tarmed codés * * @param int $num_facture numéro de la facture concernée * @param bool $show_alerte chargement des alertes * * @return array */ function loadRefsActesTarmed($num_facture = null, $show_alerte = false) { $this->_ref_actes_tarmed = array(); $totaux = array("base" => 0, "dh" => 0); if (CModule::getActive("tarmed") && CAppUI::conf("tarmed CCodeTarmed use_cotation_tarmed")) { $where = array(); $ljoin = array(); $order = null; $acte_tarmed = new CActeTarmed(); //Dans le cas d'une consultation if ($this->_class == "CConsultation") { //Classement des actes par ordre chonologique et par code $ljoin["consultation"] = "acte_tarmed.object_id = consultation.consultation_id"; $ljoin["plageconsult"] = "plageconsult.plageconsult_id = consultation.plageconsult_id"; $where["acte_tarmed.object_class"] = " = '{$this->_class}'"; $where["acte_tarmed.object_id"] = " = '{$this->_id}'"; if ($num_facture) { $where["acte_tarmed.num_facture"] = " = '{$num_facture}'"; } //Dans le cas ou la date est nulle on prend celle de la plage de consultation correspondante $order = "IFNULL(acte_tarmed.date, plageconsult.date), acte_tarmed.num_facture, code ASC"; $this->_ref_actes_tarmed = $acte_tarmed->loadList($where, $order, null, null, $ljoin); } else { //Dans les cas d'un séjour ou d'une intervention $where["object_class"] = " = '{$this->_class}'"; $where["object_id"] = " = '{$this->_id}'"; if ($num_facture) { $where["num_facture"] = " = '{$num_facture}'"; } $order = "acte_tarmed.num_facture, code ASC"; $this->_ref_actes_tarmed = $acte_tarmed->loadList($where, $order); } if (null === $this->_ref_actes_tarmed) { return null; } $this->_codes_tarmed = array(); foreach ($this->_ref_actes_tarmed as $_acte_tarmed) { /** @var CActeTarmed $_acte_tarmed */ $this->_codes_tarmed[] = $_acte_tarmed->makeFullCode(); $_acte_tarmed->loadRefExecutant(); $_acte_tarmed->loadRefTarmed(); if ($show_alerte) { $_acte_tarmed->loadAlertes(); } $totaux["base"] += $_acte_tarmed->montant_base * $_acte_tarmed->quantite; $totaux["dh"] += $_acte_tarmed->montant_depassement; } $this->_tokens_tarmed = implode("|", $this->_codes_tarmed); } return $totaux; }
/** * Register the object's template properties * * @param CTemplateManager $template * * @return void * * @see parent::fillTemplate() */ public function fillLimitedTemplate(&$template) { $this->notify("BeforeFillLimitedTemplate", $template); $template->addDateProperty('Devis - Date', $this->date); $template->addProperty('Devis - Type d\'événement', $this->event_type); $template->addProperty('Devis - Libellé', $this->libelle); $template->addProperty('Devis - Actes NGAP', $this->printActesNGAP(), '', false); $template->addProperty('Devis - Actes CCAM', $this->printActesCCAM(), '', false); $template->addProperty('Devis - Frais divers', $this->printFraisDivers(), '', false); if (CModule::getActive("tarmed") && CAppUI::conf("tarmed CCodeTarmed use_cotation_tarmed")) { $this->loadRefsActes(); $template->addProperty("Devis - TARMED - codes", CActeTarmed::actesHtml($this), '', false); $template->addProperty("Devis - Caisse - codes", CActeCaisse::actesHtml($this), '', false); } $template->addProperty('Devis - Commentaire', $this->comment); $template->addProperty('Devis - Base', $this->base); $template->addProperty('Devis - Dépassements d\'honoraire', $this->dh); $template->addProperty('Devis - Hors taxe', $this->ht); $template->addProperty('Devis - TTC', $this->_ttc); $template->addProperty('Devis - Total', $this->_total); $this->notify("AfterFillLimitedTemplate", $template); }