/**
  * @see parent::updateFormFields()
  */
 function updateFormFields()
 {
     parent::updateFormFields();
     $this->calculTVA();
     $this->_somme = $this->secteur1 + $this->secteur2 + $this->secteur3 + $this->du_tva;
     if ($this->patient_date_reglement === "0000-00-00") {
         $this->patient_date_reglement = null;
     }
     $this->du_patient = round($this->du_patient, 2);
     $this->du_tiers = round($this->du_tiers, 2);
     $this->_hour = intval(substr($this->heure, 0, 2));
     $this->_min = intval(substr($this->heure, 3, 2));
     $this->_check_adresse = $this->adresse;
     $this->_view = "Consultation " . $this->getEtat();
     // si _coded vaut 1 alors, impossible de modifier la cotation
     $this->_coded = $this->valide;
     $this->_exam_fields = $this->getExamFields();
 }
Beispiel #2
0
 /**
  * @see parent::updateFormFields()
  */
 function updateFormFields()
 {
     parent::updateFormFields();
     $this->updateEntreeSortie();
     if (CAppUI::conf("dPplanningOp CSejour systeme_isolement") == "expert") {
         $this->updateIsolement();
     }
     // Durées
     if (CMbDT::date($this->entree_prevue) == CMbDT::date($this->sortie_prevue)) {
         $this->_duree_prevue = 0;
     } else {
         $this->_duree_prevue = CMbDT::daysRelative($this->entree_prevue, $this->sortie_prevue);
     }
     if (!$this->_duree_prevue_heure) {
         $this->_duree_prevue_heure = CMbDT::timeRelative(CMbDT::time($this->entree_prevue), CMbDT::time($this->sortie_prevue), "%02d");
     }
     $this->_duree_reelle = CMbDT::daysRelative($this->entree_reelle, $this->sortie_reelle);
     $this->_duree = CMbDT::daysRelative($this->_entree, $this->_sortie);
     // Dates
     $this->_date_entree_prevue = CMbDT::date(null, $this->entree_prevue);
     $this->_date_sortie_prevue = CMbDT::date(null, $this->sortie_prevue);
     // Horaires
     // @todo: A supprimer
     $this->_time_entree_prevue = CMbDT::format($this->entree_prevue, "%H:%M:00");
     $this->_time_sortie_prevue = CMbDT::format($this->sortie_prevue, "%H:%M:00");
     $this->_hour_entree_prevue = CMbDT::format($this->entree_prevue, "%H");
     $this->_hour_sortie_prevue = CMbDT::format($this->sortie_prevue, "%H");
     $this->_min_entree_prevue = CMbDT::format($this->entree_prevue, "%M");
     $this->_min_sortie_prevue = CMbDT::format($this->sortie_prevue, "%M");
     switch (CAppUI::conf("dPpmsi systeme_facturation")) {
         case "siemens":
             $this->_guess_NDA = CMbDT::format($this->entree_prevue, "%y");
             $this->_guess_NDA .= $this->type == "exte" ? "5" : $this->type == "ambu" ? "4" : "0";
             $this->_guess_NDA .= "xxxxx";
             break;
         default:
             $this->_guess_NDA = "-";
     }
     $this->_at_midnight = $this->_date_entree_prevue != $this->_date_sortie_prevue;
     if ($this->entree_prevue && $this->sortie_prevue) {
         $this->_view = "Séjour du " . CMbDT::format($this->_entree, CAppUI::conf("date"));
         $this->_shortview = "Du " . CMbDT::format($this->_entree, CAppUI::conf("date"));
         if (CMbDT::format($this->_entree, CAppUI::conf("date")) != CMbDT::format($this->_sortie, CAppUI::conf("date"))) {
             $this->_view .= " au " . CMbDT::format($this->_sortie, CAppUI::conf("date"));
             $this->_shortview .= " au " . CMbDT::format($this->_sortie, CAppUI::conf("date"));
         }
     }
     $this->_acte_execution = CMbDT::dateTime($this->entree_prevue);
     $this->_praticien_id = $this->praticien_id;
     $this->_adresse_par = $this->etablissement_entree_id || $this->adresse_par_prat_id;
     if ($this->adresse_par_prat_id) {
         $medecin_adresse_par = $this->loadRefAdresseParPraticien();
         $this->_adresse_par_prat = $medecin_adresse_par->_view;
     }
     if ($this->etablissement_entree_id) {
         $etab = $this->loadRefEtablissementProvenance();
         $this->_ref_etablissement_provenance = $etab->_view;
     }
     // Etat d'un sejour : encours, clôturé ou preadmission
     $this->_etat = "preadmission";
     if ($this->entree_reelle) {
         $this->_etat = "encours";
     }
     if ($this->sortie_reelle) {
         $this->_etat = "cloture";
     }
     // Motif complet du séjour
     $this->_motif_complet .= $this->libelle;
     $this->_motif_complet = "";
     if ($this->recuse == -1) {
         $this->_motif_complet .= "[Att] ";
     }
     $this->_motif_complet .= $this->libelle;
     if (!$this->annule && $this->recuse == -1) {
         $this->_view = "[Att] " . $this->_view;
     }
     if (CModule::getActive("dPfacturation") && CAppUI::conf("dPplanningOp CFactureEtablissement use_facture_etab")) {
         $this->loadRefsFactureEtablissement();
         if ($this->_ref_last_facture) {
             $facture = $this->_ref_last_facture;
             $this->_type_sejour = $facture->type_facture;
             $this->_statut_pro = $facture->statut_pro;
             $this->_dialyse = $facture->dialyse;
             $this->_cession_creance = $facture->cession_creance;
             $this->_assurance_maladie = $facture->assurance_maladie;
             $this->_assurance_accident = $facture->assurance_accident;
             $this->_rques_assurance_maladie = $facture->rques_assurance_maladie;
             $this->_rques_assurance_accident = $facture->rques_assurance_accident;
         }
     }
 }