Exemplo n.º 1
0
 /**
  * Charge les actes Caisse codés
  *
  * @param int $num_facture numéro de la facture concernée
  *
  * @return array
  */
 function loadRefsActesCaisse($num_facture = null)
 {
     $this->_ref_actes_caisse = array();
     $totaux = array("base" => 0, "dh" => 0);
     if (CModule::getActive("tarmed") && CAppUI::conf("tarmed CCodeTarmed use_cotation_tarmed")) {
         //Classement des actes par ordre chonologique et par code
         $where = array();
         $where["acte_caisse.object_class"] = " = '{$this->_class}'";
         $where["acte_caisse.object_id"] = " = '{$this->_id}'";
         if ($num_facture) {
             $where["acte_caisse.num_facture"] = " = '{$num_facture}'";
         }
         $order = "acte_caisse.num_facture, caisse_maladie_id, code ASC";
         $acte_caisse = new CActeCaisse();
         $this->_ref_actes_caisse = $acte_caisse->loadList($where, $order);
         if (null === $this->_ref_actes_caisse) {
             return null;
         }
         $this->_codes_caisse = array();
         foreach ($this->_ref_actes_caisse as $_acte_caisse) {
             /** @var CActeCaisse $_acte_caisse */
             $this->_codes_caisse[] = $_acte_caisse->makeFullCode();
             $_acte_caisse->loadRefExecutant();
             $_acte_caisse->loadRefPrestationCaisse();
             $_acte_caisse->loadRefCaisseMaladie();
             $totaux["base"] += $_acte_caisse->montant_base * $_acte_caisse->quantite;
             $totaux["dh"] += $_acte_caisse->montant_depassement;
         }
         $this->_tokens_caisse = implode("|", $this->_codes_caisse);
     }
     return $totaux;
 }
Exemplo n.º 2
0
 /**
  * Calcul des totaux
  * 
  * @return void
  */
 function loadTotaux()
 {
     $pm = 0;
     $pt = 0;
     $medicaments = 0;
     $this->autre_tarmed = 0;
     foreach ($this->facture->_ref_actes_tarmed as $acte) {
         $tmp_pt = $acte->pt * $acte->coeff_pt * $acte->quantite;
         $tmp_pm = $acte->pm * $acte->coeff_pm * $acte->quantite;
         $pt += $tmp_pt;
         $pm += $tmp_pm;
     }
     foreach ($this->facture->_ref_actes_caisse as $acte) {
         $add = true;
         if ($acte->code_caisse) {
             $caisse = new CActeCaisse();
             $caisse->code = $acte->code;
             $caisse->loadRefPrestationCaisse();
             if ($caisse->_ref_caisse_maladie->nom == "Medicament") {
                 $medicaments += $acte->montant_base;
                 $add = false;
             }
         }
         if ($acte->use_tarmed_bill && $add) {
             $this->autre_tarmed += $acte->montant_base;
         }
     }
     $pt = sprintf("%.2f", $pt * $this->facture->_coeff);
     $pm = sprintf("%.2f", $pm * $this->facture->_coeff);
     $this->pre_tab["Medical:"] = $pm;
     $this->pre_tab["Tarmed:"] = $pt;
     $this->pre_tab["Médicaments:"] = sprintf("%.2f", $medicaments);
     $autres = $pm + $pt + $medicaments;
     $total = 0;
     foreach ($this->facture->_montant_factures_caisse as $montant_facture) {
         $total += $montant_facture;
     }
     $this->pre_tab["Autres:"] = sprintf("%.2f", $total - $autres);
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 /**
  * 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);
 }