} // Parcours du tableau d'operations, et stockage dans un tableau de salle foreach ($operations as $op) { // Classement des actes par executant foreach ($op->_ref_actes_ccam as $acte_ccam) { // Mise a jour de la liste des praticiens if (!array_key_exists($acte_ccam->executant_id, $praticiens)) { $praticien = new CMediusers(); $praticien->load($acte_ccam->executant_id); $praticien->loadRefFunction(); $praticiens[$acte_ccam->executant_id] = $praticien; // initialisation du tableau d'actes non signés $nonSigne[$acte_ccam->executant_id] = 0; } // Chargement de l'executant de l'acte CCAM $acte_ccam->loadRefExecutant(); // Chargement du tarif $acte_ccam->getTarif(); @($tabOperations[$op->_id][$acte_ccam->executant_id][$acte_ccam->_id] = $acte_ccam); if (!$acte_ccam->signe) { @$nonSigne[$op->_id][$acte_ccam->executant_id]++; } } } ksort($tabOperations); // Création du template $smarty = new CSmartyDP(); $smarty->assign("tabOp", $tabOp); $smarty->assign("date", $date); $smarty->assign("nonSigne", $nonSigne); $smarty->assign("redirectUrl", $a);
/** * Charge les actes CCAM codables en fonction des code CCAM fournis * * @param integer $praticien_id L'id du praticien auquel seront liés les actes * * @return void */ function loadPossibleActes($praticien_id = 0) { $this->preparePossibleActes(); $depassement_affecte = false; $depassement_anesth_affecte = false; $this->guessActesAssociation(); // Check if depassement is already set $this->loadRefsActesCCAM(); foreach ($this->_ref_actes_ccam as $_acte) { if ($_acte->code_activite == 1 && $_acte->montant_depassement) { $depassement_affecte = true; } if ($_acte->code_activite == 4 && $_acte->montant_depassement) { $depassement_anesth_affecte = true; } } // existing acts may only be affected once to possible acts $used_actes = array(); if ($praticien_id) { $praticien = CMediusers::get($praticien_id); $executant_id = $praticien_id; } else { $praticien = $this->loadRefPraticien(); $executant_id = 0; } $praticien->loadRefDiscipline(); $this->loadRefPatient()->evalAge(); $this->loadExtCodesCCAM(); foreach ($this->_ext_codes_ccam as $code_ccam) { foreach ($code_ccam->activites as $activite) { foreach ($activite->phases as $phase) { $possible_acte = new CActeCCAM(); $possible_acte->montant_depassement = ""; $possible_acte->code_acte = $code_ccam->code; $possible_acte->code_activite = $activite->numero; $possible_acte->_anesth = $activite->numero == 4; $possible_acte->code_phase = $phase->phase; $possible_acte->execution = CAppUI::pref("use_acte_date_now") ? CMbDT::dateTime() : $this->_acte_execution; // Affectation du dépassement au premier acte de chirugie if (!$depassement_affecte and $possible_acte->code_activite == 1) { $possible_acte->montant_depassement = $this->_acte_depassement; $depassement_affecte = true; } // Affectation du dépassement au premier acte d'anesthésie if (!$depassement_anesth_affecte and $possible_acte->code_activite == 4) { $possible_acte->montant_depassement = $this->_acte_depassement_anesth; $depassement_anesth_affecte = true; } if (!$praticien_id) { $executant_id = CAppUI::pref("user_executant") ? CMediusers::get()->_id : $this->getExecutantId($possible_acte->code_activite); } $possible_acte->executant_id = $executant_id; $possible_acte->object_class = $this->_class; $possible_acte->object_id = $this->_id; if ($possible_acte->code_activite == 4) { $possible_acte->extension_documentaire = $this->getExtensionDocumentaire($possible_acte->executant_id); } /* Gestion du champ remboursé */ if ($code_ccam->remboursement == 1) { /* Cas ou l'acte est remboursable */ $possible_acte->rembourse = '1'; } else { /* Cas ou l'acte est non */ $possible_acte->rembourse = '0'; } $possible_acte->updateFormFields(); $possible_acte->loadRefExecutant(); $possible_acte->loadRefCodeCCAM(); if (CAppUI::conf('dPccam CCodeCCAM use_new_association_rules')) { $possible_acte->loadRefCodageCCAM(); } $possible_acte->getAnesthAssocie(); // Affect a loaded acte if exists foreach ($this->_ref_actes_ccam as $_acte) { if ($_acte->code_acte == $possible_acte->code_acte && $_acte->code_activite == $possible_acte->code_activite && $_acte->code_phase == $possible_acte->code_phase) { if (!isset($used_actes[$_acte->acte_id])) { $possible_acte = $_acte; $used_actes[$_acte->acte_id] = true; break; } } } if ($possible_acte->_id) { $possible_acte->getTarif(); } else { $possible_acte->getTarifSansAssociationNiCharge(); } // Keep references ! $phase->_connected_acte = $possible_acte; $listModificateurs = $phase->_connected_acte->modificateurs; if (!$possible_acte->_id) { $possible_acte->facturable = '1'; $possible_acte->checkFacturable(); if (CAppUI::conf('dPccam CCodeCCAM use_new_association_rules')) { CCodageCCAM::precodeModifiers($phase->_modificateurs, $possible_acte, $this); $possible_acte->getMontantModificateurs($phase->_modificateurs); } else { $possible_acte->getMontantModificateurs($phase->_modificateurs); foreach ($phase->_modificateurs as $modificateur) { $modificateur->_checked = $this->checkModificateur($modificateur->code, CMbDT::time($phase->_connected_acte->execution)); } } } else { // Récupération des modificateurs codés foreach ($phase->_modificateurs as $modificateur) { /* Dans le cas des modificateurs doubles, les 2 composantes peuvent être séparées (IJKO dans le cas de IO par exemple) */ if ($modificateur->_double == "2") { $position = strpos($listModificateurs, $modificateur->code[0]) !== false && strpos($listModificateurs, $modificateur->code[1]) !== false; } else { $position = strpos($listModificateurs, $modificateur->code); } if ($position !== false) { if ($modificateur->_double == "1") { $modificateur->_checked = $modificateur->code; } elseif ($modificateur->_double == "2") { $modificateur->_checked = $modificateur->code . $modificateur->_double; } else { $modificateur->_checked = null; } } else { $modificateur->_checked = null; } } /* Vérification et précodage des modificateurs */ if (CAppUI::conf('dPccam CCodeCCAM use_new_association_rules')) { CCodageCCAM::precodeModifiers($phase->_modificateurs, $possible_acte, $this); } $possible_acte->getMontantModificateurs($phase->_modificateurs); } } } } }
function addActeCCAM(DOMNode $elParent, CActeCCAM $mbActeCCAM, CCodable $codable) { $acteCCAM = $this->addElement($elParent, "acteCCAM"); // Gestion des attributs $this->addAttribute($acteCCAM, "action", "création"); $this->addAttribute($acteCCAM, "facturable", $mbActeCCAM->facturable ? "oui" : "non"); $this->addAttribute($acteCCAM, "valide", "oui"); $this->addAttribute($acteCCAM, "documentaire", "non"); $this->addAttribute($acteCCAM, "gratuit", $mbActeCCAM->gratuit ? "oui" : "non"); if ($mbActeCCAM->_rembex) { $this->addAttribute($acteCCAM, "remboursementExceptionnel", "oui"); } $identifiant = $this->addElement($acteCCAM, "identifiant"); $this->addElement($identifiant, "emetteur", "acte{$mbActeCCAM->_id}"); $this->addElement($acteCCAM, "codeActe", $mbActeCCAM->code_acte); $this->addElement($acteCCAM, "codeActivite", $mbActeCCAM->code_activite); $this->addElement($acteCCAM, "codePhase", $mbActeCCAM->code_phase); // Date et heure de l'opération if (CAppUI::conf("hprimxml date_heure_acte") == "operation" && $codable instanceof COperation) { $date = $codable->date ? $codable->date : $codable->_ref_plageop->date; $time_operation = $codable->time_operation == "00:00:00" ? null : $codable->time_operation; $heure = CValue::first($codable->debut_op, $codable->entree_salle, $time_operation, $codable->horaire_voulu); $sejour = $codable->_ref_sejour; if ("{$date} {$heure}" < $sejour->entree) { $date = CMbDT::date($sejour->entree); $heure = CMbDT::time($sejour->entree); } if ("{$date} {$heure}" > $sejour->sortie) { $date = CMbDT::date($sejour->sortie); $heure = CMbDT::time($sejour->sortie); } } else { $date = CMbDT::date($mbActeCCAM->execution); $heure = CMbDT::time($mbActeCCAM->execution); } $execute = $this->addElement($acteCCAM, "execute"); $this->addElement($execute, "date", $date); $this->addElement($execute, "heure", $heure); $mbExecutant = $mbActeCCAM->loadRefExecutant(); $executant = $this->addElement($acteCCAM, "executant"); $medecins = $this->addElement($executant, "medecins"); $medecinExecutant = $this->addElement($medecins, "medecinExecutant"); $this->addAttribute($medecinExecutant, "principal", "oui"); $medecin = $this->addElement($medecinExecutant, "medecin"); $this->addProfessionnelSante($medecin, $mbExecutant); //$this->addUniteFonctionnelle($executant, $codable); $modificateurs = $this->addElement($acteCCAM, "modificateurs"); foreach ($mbActeCCAM->_modificateurs as $mbModificateur) { $this->addElement($modificateurs, "modificateur", $mbModificateur); } if ($mbActeCCAM->code_association) { $this->addElement($acteCCAM, "codeAssociationNonPrevue", $mbActeCCAM->code_association); } if ($mbActeCCAM->_anesth && $mbActeCCAM->object_class == "COperation") { $type_anesth = $mbActeCCAM->loadTargetObject()->_ref_type_anesth; $extension_documentaire = $mbActeCCAM->extension_documentaire ? $mbActeCCAM->extension_documentaire : $type_anesth->ext_doc; $this->addElement($acteCCAM, "codeExtensionDocumentaire", $extension_documentaire); } // Gestion des dents if ($mbActeCCAM->_dents) { $positionsDentaires = $this->addElement($acteCCAM, "positionsDentaires"); foreach ($mbActeCCAM->_dents as $_dent) { $this->addElement($positionsDentaires, "positionDentaire", $_dent); } } $montant = $this->addElement($acteCCAM, "montant"); if ($mbActeCCAM->montant_depassement > 0) { $montantDepassement = $this->addElement($montant, "montantDepassement", sprintf("%.2f", $mbActeCCAM->montant_depassement)); if (CAppUI::conf("dPpmsi systeme_facturation") == "siemens") { if (CAppUI::conf("dPsalleOp CActeCCAM envoi_motif_depassement")) { $this->addAttribute($montantDepassement, "motif", "d"); } } else { if ($mbActeCCAM->motif_depassement) { $this->addAttribute($montantDepassement, "motif", $mbActeCCAM->motif_depassement); } } } return $acteCCAM; }