Exemplo n.º 1
0
$lock = CValue::get('lock', 1);
$user = CMediusers::get();
/** @var CCodable $codable */
$codable = CMbObject::loadFromGuid("{$codable_class}-{$codable_id}");
$codage = CCodageCCAM::get($codable, $praticien_id, 1, $date);
if (CAppUI::conf('ccam CCodable lock_codage_ccam') != 'password' && $codable_class != 'CSejour') {
    $codage = new CCodageCCAM();
    $codage->praticien_id = $praticien_id;
    $codage->codable_class = $codable_class;
    $codage->codable_id = $codable_id;
    $codages = $codage->loadMatchingList();
    foreach ($codages as $_codage) {
        $_codage->locked = $lock;
        $_codage->store();
    }
    $msg = $lock ? 'CCodageCCAM-msg-codage_locked' : 'CCodageCCAM-msg-codage_unlocked';
    CAppUI::setMsg($msg, UI_MSG_OK);
    echo CAppUI::getMsg();
    CApp::rip();
}
$smarty = new CSmartyDP();
$smarty->assign('praticien_id', $praticien_id);
$smarty->assign('praticien', $codage->loadPraticien());
$smarty->assign('codable_class', $codable->_class);
$smarty->assign('codable_id', $codable->_id);
$smarty->assign('date', $date);
$smarty->assign('lock', $lock);
if (CAppUI::conf('ccam CCodable lock_codage_ccam') == 'password' && $user->_id != $codage->praticien_id) {
    $smarty->assign('error', 1);
}
$smarty->display('inc_check_lock_codage.tpl');
Exemplo n.º 2
0
 /**
  * Return the CCodageCCAM linked to the given codable and practitioner, and create it if it not exists
  *
  * @param CCodable $codable         The codable object
  * @param integer  $praticien_id    The practitioner id
  * @param integer  $activite        Is the CCodage concern anesthesia activities or other activities
  * @param date     $date            The date
  *
  * @return CCodageCCAM
  */
 public static function get($codable, $praticien_id, $activite = 1, $date = null)
 {
     if (!$date) {
         switch ($codable->_class) {
             case 'CConsultation':
                 $codable->loadRefPlageConsult();
                 $date = $codable->_date;
                 break;
             case 'COperation':
                 $date = $codable->date;
                 break;
             case 'CSejour':
                 return new CCodageCCAM();
         }
     }
     $codage_ccam = new CCodageCCAM();
     $codage_ccam->codable_class = $codable->_class;
     $codage_ccam->codable_id = $codable->_id;
     $codage_ccam->praticien_id = $praticien_id;
     $codage_ccam->loadPraticien();
     $codage_ccam->activite_anesth = $activite == 4 && $codage_ccam->_ref_praticien->isAnesth() ? 1 : 0;
     $codage_ccam->date = $date;
     $codage_ccam->loadMatchingObject();
     if (!$codage_ccam->_id) {
         $codage_ccam->_apply_rules = false;
         $codage_ccam->store();
     }
     return $codage_ccam;
 }
Exemplo n.º 3
0
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 * @link       http://www.mediboard.org
 */
$codage_id = CValue::get('codage_id', 0);
$acte_id = CValue::get('acte_id', 0);
$codage = new CCodageCCAM();
$codage->load($codage_id);
if ($codage->_id) {
    $codage->canDo();
    if (!$codage->_can->edit) {
        CAppUI::redirect("m=system&a=access_denied");
    }
    $codage->loadCodable();
    $codage->loadPraticien()->loadRefFunction();
    $codage->_ref_praticien->isAnesth();
    $codage->loadActesCCAM();
    $codage->checkRules();
    // Chargement du codable et des actes possibles
    $codage->loadCodable();
    foreach ($codage->_ref_actes_ccam as $_acte) {
        $_acte->getTarif();
        $_activite = $_acte->_ref_code_ccam->activites[$_acte->code_activite];
        $_phase = $_activite->phases[$_acte->code_phase];
        /* Verification des modificateurs codés */
        foreach ($_phase->_modificateurs as $modificateur) {
            $position = strpos($_acte->modificateurs, $modificateur->code);
            if ($position !== false) {
                if ($modificateur->_double == "1") {
                    $modificateur->_checked = $modificateur->code;