$rel_patient->loadIPP();
    } else {
        $rel_patient = new CPatient();
        if ($preview) {
            $rel_patient->_view = "Patient exemple";
            $rel_patient->_IPP = "0123456";
            $ex_object->_ref_object->_view = CAppUI::tr($ex_object->_ref_object->_class) . " test";
        }
    }
    $ex_object->_rel_patient = $rel_patient;
}
$can_delete = false;
if ($ex_object->_id) {
    $can_delete = $ex_object->owner_id == CUser::get()->_id;
}
$can_delete = $can_delete || CModule::getInstalled("forms")->canAdmin();
// Load IPP and NDA
$ref_objects = array($ex_object->_ref_object, $ex_object->_ref_reference_object_1, $ex_object->_ref_reference_object_2);
foreach ($ref_objects as $_object) {
    if ($_object instanceof CPatient) {
        $_object->loadIPP();
        continue;
    }
    if ($_object instanceof CSejour) {
        $_object->loadNDA();
        $_object->loadRefCurrAffectation($creation_date);
        continue;
    }
}
/** @var CExConcept[] $concepts */
$concepts = CStoredObject::massLoadFwdRef($fields, "concept_id");
 *
 * @category Admin
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkEdit();
$user = CUser::get(CValue::getOrSession("user_id"));
$user_id = CValue::getOrSession("user_id", $user->_id);
if (!$user_id) {
    CAppUI::setMsg("Vous devez sélectionner un utilisateur");
    CAppUI::redirect("m=admin&tab=vw_edit_users");
}
$modulesInstalled = CModule::getInstalled();
$isAdminPermSet = false;
$profile = new CUser();
if ($user->profile_id) {
    $where["user_id"] = "= '{$user->profile_id}'";
    $profile->loadObject($where);
}
$order = "mod_id";
//Droit de l'utilisateur sur les modules
$whereUser = array();
$whereUser["user_id"] = "= '{$user->user_id}'";
$whereProfil = array();
$whereProfil["user_id"] = "= '{$user->profile_id}'";
// DROITS SUR LES MODULES
$permModule = new CPermModule();
$permsModule = array();
 /**
  * Launches module upgrade process
  *
  * @param string $oldRevision  Revision before upgrade
  * @param bool   $core_upgrade True if it's a core module upgrade
  *
  * @return string|null New revision, null on error
  */
 function upgrade($oldRevision, $core_upgrade = false)
 {
     /*if (array_key_exists($this->mod_version, $this->queries)) {
         CAppUI::setMsg("Latest revision '%s' should not have upgrade queries", UI_MSG_ERROR, $this->mod_version);
         return;
       }*/
     if (!array_key_exists($oldRevision, $this->queries) && !array_key_exists($oldRevision, $this->config_moves) && !array_key_exists($oldRevision, $this->functions)) {
         CAppUI::setMsg("No queries, functions or config moves for '%s' setup at revision '%s'", UI_MSG_WARNING, $this->mod_name, $oldRevision);
         return null;
     }
     // Point to the current revision
     reset($this->revisions);
     while ($oldRevision != ($currRevision = current($this->revisions))) {
         next($this->revisions);
     }
     $depFailed = false;
     do {
         // Check for dependencies
         foreach ($this->dependencies[$currRevision] as $dependency) {
             $module = @CModule::getInstalled($dependency->module);
             if (!$module || $module->mod_version < $dependency->revision) {
                 $depFailed = true;
                 CAppUI::setMsg("Failed module depency for '%s' at revision '%s'", UI_MSG_WARNING, $dependency->module, $dependency->revision);
             }
         }
         if ($depFailed) {
             return $currRevision;
         }
         // Set Time Limit
         if ($this->timeLimit[$currRevision]) {
             CApp::setTimeLimit($this->timeLimit[$currRevision]);
         }
         // Query upgrading
         foreach ($this->queries[$currRevision] as $_query) {
             list($query, $ignore_errors, $dsn) = $_query;
             $ds = $dsn ? CSQLDataSource::get($dsn) : $this->ds;
             if (!$ds->exec($query)) {
                 if ($ignore_errors) {
                     CAppUI::setMsg("Errors ignored for revision '%s'", UI_MSG_OK, $currRevision);
                     continue;
                 }
                 CAppUI::setMsg("Error in queries for revision '%s': see logs", UI_MSG_ERROR, $currRevision);
                 return $currRevision;
             }
         }
         // Callback upgrading
         foreach ($this->functions[$currRevision] as $function) {
             if (!call_user_func($function)) {
                 $function_name = get_class($function[0]) . "->" . $function[1];
                 CAppUI::setMsg("Error in function '%s' call back for revision '%s': see logs", UI_MSG_ERROR, $function_name, $currRevision);
                 return $currRevision;
             }
         }
         // Preferences
         foreach ($this->preferences[$currRevision] as $_pref) {
             list($_name, $_default, $_restricted) = $_pref;
             // Former pure SQL system
             // Cannot check against module version or fresh install will generate errors
             if (self::isOldPrefSystem($core_upgrade)) {
                 $query = "SELECT * FROM `user_preferences` WHERE `pref_user` = '0' AND `pref_name` = '{$_name}'";
                 $result = $this->ds->exec($query);
                 if (!$this->ds->numRows($result)) {
                     $query = "INSERT INTO `user_preferences` (`pref_user` , `pref_name` , `pref_value`)\n              VALUES ('0', '{$_name}', '{$_default}');";
                     $this->ds->exec($query);
                 }
             } else {
                 $pref = new CPreferences();
                 $where = array();
                 $where["user_id"] = " IS NULL";
                 $where["key"] = " = '{$_name}'";
                 if (!$pref->loadObject($where)) {
                     $pref->key = $_name;
                     $pref->value = $_default;
                     $pref->restricted = $_restricted ? "1" : "0";
                     $pref->store();
                 }
             }
         }
         // Config moves
         if (count($this->config_moves[$currRevision])) {
             foreach ($this->config_moves[$currRevision] as $config) {
                 CAppUI::setConf($config[1], CAppUI::conf($config[0]));
             }
         }
     } while ($currRevision = next($this->revisions));
     return $this->mod_version;
 }
Exemple #4
0
 /**
  * @see parent::__construct()
  */
 function __construct()
 {
     parent::__construct();
     $this->mod_name = "dPcompteRendu";
     $this->makeRevision("all");
     $query = "CREATE TABLE compte_rendu (\r\n                compte_rendu_id BIGINT NOT NULL AUTO_INCREMENT ,\r\n                chir_id BIGINT DEFAULT '0' NOT NULL ,\r\n                nom VARCHAR(50) ,\r\n                source TEXT,\r\n                type ENUM('consultation', 'operation', 'hospitalisation', 'autre') DEFAULT 'autre' NOT NULL ,\r\n                PRIMARY KEY (compte_rendu_id) ,\r\n                INDEX (chir_id)\r\n                ) /*! ENGINE=MyISAM */ COMMENT = 'Table des modeles de compte-rendu';";
     $this->addQuery($query);
     $query = "ALTER TABLE permissions\r\n                CHANGE permission_grant_on permission_grant_on VARCHAR(25) NOT NULL";
     $this->addQuery($query);
     $this->makeRevision("0.1");
     $query = "CREATE TABLE `aide_saisie` (\r\n                `aide_id` INT NOT NULL AUTO_INCREMENT ,\r\n                `user_id` INT NOT NULL ,\r\n                `module` VARCHAR(20) NOT NULL ,\r\n                `class` VARCHAR(20) NOT NULL ,\r\n                `field` VARCHAR(20) NOT NULL ,\r\n                `name` VARCHAR(40) NOT NULL ,\r\n                `text` TEXT NOT NULL ,\r\n                PRIMARY KEY (`aide_id`)) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $this->makeRevision("0.11");
     $query = "CREATE TABLE `liste_choix` (\r\n                  `liste_choix_id` BIGINT NOT NULL AUTO_INCREMENT ,\r\n                  `chir_id` BIGINT NOT NULL ,\r\n                  `nom` VARCHAR(50) NOT NULL ,\r\n                  `valeurs` TEXT,\r\n                  PRIMARY KEY (`liste_choix_id`) ,\r\n                  INDEX (`chir_id`)\r\n                ) /*! ENGINE=MyISAM */ COMMENT = 'table des listes de choix personnalisées';";
     $this->addQuery($query);
     $this->makeRevision("0.12");
     $query = "CREATE TABLE `pack` (\r\n                  `pack_id` BIGINT NOT NULL AUTO_INCREMENT ,\r\n                  `chir_id` BIGINT NOT NULL ,\r\n                  `nom` VARCHAR(50) NOT NULL ,\r\n                  `modeles` TEXT,\r\n                  PRIMARY KEY (`pack_id`) ,\r\n                  INDEX (`chir_id`)\r\n                ) /*! ENGINE=MyISAM */ COMMENT = 'table des packs post hospitalisation';";
     $this->addQuery($query);
     $this->makeRevision("0.13");
     $query = "ALTER TABLE `liste_choix` ADD `compte_rendu_id` BIGINT DEFAULT '0' NOT NULL AFTER `chir_id` ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `liste_choix` ADD INDEX (`compte_rendu_id`) ;";
     $this->addQuery($query);
     $this->makeRevision("0.14");
     $query = "ALTER TABLE `compte_rendu` ADD `object_id` BIGINT DEFAULT NULL AFTER `chir_id` ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu` ADD INDEX (`object_id`) ;";
     $this->addQuery($query);
     $this->makeRevision("0.15");
     $query = "ALTER TABLE `compte_rendu` ADD `valide` TINYINT DEFAULT 0;";
     $this->addQuery($query);
     $this->makeRevision("0.16");
     $query = "ALTER TABLE `compte_rendu` ADD `function_id` BIGINT DEFAULT NULL AFTER `chir_id` ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu` ADD INDEX (`function_id`) ;";
     $this->addQuery($query);
     $query = " ALTER TABLE `compte_rendu` CHANGE `chir_id` `chir_id` BIGINT(20) DEFAULT NULL";
     $this->addQuery($query);
     $this->makeRevision("0.17");
     $query = "ALTER TABLE `liste_choix` ADD `function_id` BIGINT DEFAULT NULL AFTER `chir_id` ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `liste_choix` ADD INDEX (`function_id`) ;";
     $this->addQuery($query);
     $query = " ALTER TABLE `liste_choix` CHANGE `chir_id` `chir_id` BIGINT(20) DEFAULT NULL";
     $this->addQuery($query);
     $this->makeRevision("0.18");
     $query = "ALTER TABLE `aide_saisie` DROP `module` ";
     $this->addQuery($query);
     $this->makeRevision("0.19");
     $this->setTimeLimit(1800);
     $query = "ALTER TABLE `compte_rendu`\r\n      CHANGE `type` `type` ENUM('consultation', 'consultAnesth', 'operation', 'hospitalisation', 'autre') DEFAULT 'autre' NOT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.20");
     $this->setTimeLimit(1800);
     $query = "ALTER TABLE `compte_rendu`\r\n      CHANGE `type` `type` ENUM('patient', 'consultation', 'consultAnesth', 'operation', 'hospitalisation', 'autre')\r\n      DEFAULT 'autre' NOT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.21");
     $query = "UPDATE `aide_saisie` SET `class`=CONCAT(\"C\",`class`);";
     $this->addQuery($query);
     $this->makeRevision("0.22");
     $this->setTimeLimit(1800);
     $query = "ALTER TABLE `compte_rendu` CHANGE `type` `type`  VARCHAR(30) NOT NULL DEFAULT 'autre'";
     $this->addQuery($query);
     $this->makeRevision("0.23");
     $this->setTimeLimit(1800);
     $this->addDependency("dPfiles", "0.14");
     $query = "ALTER TABLE `compte_rendu` CHANGE `type` `object_class` VARCHAR(30) DEFAULT NULL;";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu` ADD `file_category_id` INT(11) DEFAULT 0;";
     $this->addQuery($query);
     $aConversion = array("operation" => array("class" => "COperation", "nom" => "Opération"), "hospitalisation" => array("class" => "COperation", "nom" => "Hospitalisation"), "consultation" => array("class" => "CConsultation", "nom" => null), "consultAnesth" => array("class" => "CConsultAnesth", "nom" => null), "patient" => array("class" => "CPatient", "nom" => null));
     foreach ($aConversion as $sKey => $aValue) {
         $sClass = $aValue["class"];
         // Création de nouvelle catégories
         if ($sNom = $aValue["nom"]) {
             $query = "INSERT INTO files_category (`nom`,`class`) VALUES ('{$sNom}','{$sClass}')";
             $this->addQuery($query);
         }
         // Passage des types aux classes
         $query = "UPDATE `compte_rendu` SET `object_class`='{$sClass}' WHERE `object_class`='{$sKey}'";
         $this->addQuery($query);
     }
     $this->makeRevision("0.24");
     $query = "ALTER TABLE `aide_saisie` ADD `function_id` int(10) unsigned NULL AFTER `user_id` ;";
     $this->addQuery($query);
     $this->makeRevision("0.25");
     $this->setTimeLimit(1800);
     $query = "ALTER TABLE `aide_saisie` \r\n                CHANGE `aide_id` `aide_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\r\n                CHANGE `user_id` `user_id` int(11) unsigned NOT NULL DEFAULT '0',\r\n                CHANGE `function_id` `function_id` int(11) unsigned NULL,\r\n                CHANGE `class` `class` varchar(255) NOT NULL,\r\n                CHANGE `field` `field` varchar(255) NOT NULL,\r\n                CHANGE `name` `name` varchar(255) NOT NULL;";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu` \r\n                CHANGE `compte_rendu_id` `compte_rendu_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\r\n                CHANGE `chir_id` `chir_id` int(11) unsigned NULL,\r\n                CHANGE `function_id` `function_id` int(11) unsigned NULL,\r\n                CHANGE `object_id` `object_id` int(11) unsigned NULL,\r\n                CHANGE `nom` `nom` varchar(255) NOT NULL,\r\n                CHANGE `source` `source` mediumtext NULL,\r\n                CHANGE `object_class` `object_class` enum('CPatient','CConsultAnesth','COperation','CConsultation')\r\n                  NOT NULL DEFAULT 'CPatient',\r\n                CHANGE `valide` `valide` tinyint(1) unsigned zerofill NOT NULL DEFAULT '0',\r\n                CHANGE `file_category_id` `file_category_id` int(11) unsigned NOT NULL DEFAULT '0';";
     $this->addQuery($query);
     $query = "ALTER TABLE `liste_choix` \r\n                CHANGE `liste_choix_id` `liste_choix_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\r\n                CHANGE `chir_id` `chir_id` int(11) unsigned NULL,\r\n                CHANGE `function_id` `function_id` int(11) unsigned NULL,\r\n                CHANGE `nom` `nom` varchar(255) NOT NULL,\r\n                CHANGE `compte_rendu_id` `compte_rendu_id` int(11) unsigned NOT NULL DEFAULT '0';";
     $this->addQuery($query);
     $query = "ALTER TABLE `pack` \r\n                CHANGE `pack_id` `pack_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\r\n                CHANGE `chir_id` `chir_id` int(11) unsigned NOT NULL DEFAULT '0',\r\n                CHANGE `nom` `nom` varchar(255) NOT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.26");
     $this->setTimeLimit(1800);
     $query = "ALTER TABLE `compte_rendu` ADD INDEX ( `object_class` );";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu` ADD INDEX ( `file_category_id` );";
     $this->addQuery($query);
     $this->makeRevision("0.27");
     $this->setTimeLimit(1800);
     $query = "UPDATE `liste_choix` SET function_id = NULL WHERE function_id='0';";
     $this->addQuery($query);
     $query = "UPDATE `liste_choix` SET chir_id = NULL WHERE chir_id='0';";
     $this->addQuery($query);
     $this->makeRevision("0.28");
     $this->setTimeLimit(1800);
     $query = "DELETE FROM `pack` WHERE chir_id='0';";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu` CHANGE `file_category_id` `file_category_id` int(11) unsigned NULL DEFAULT NULL;";
     $this->addQuery($query);
     $query = "UPDATE `compte_rendu` SET `file_category_id` = NULL WHERE `file_category_id` = '0';";
     $this->addQuery($query);
     $this->makeRevision("0.29");
     $this->setTimeLimit(1800);
     $query = "UPDATE `compte_rendu` SET `function_id` = NULL WHERE `function_id` = '0';";
     $this->addQuery($query);
     $query = "UPDATE `compte_rendu` SET `chir_id` = NULL WHERE `chir_id` = '0';";
     $this->addQuery($query);
     $query = "ALTER TABLE `liste_choix` CHANGE `compte_rendu_id` `compte_rendu_id` int(11) unsigned NULL DEFAULT NULL;";
     $this->addQuery($query);
     $query = "UPDATE `liste_choix` SET compte_rendu_id = NULL WHERE compte_rendu_id='0';";
     $this->addQuery($query);
     $query = "ALTER TABLE `aide_saisie` CHANGE `user_id` `user_id` int(11) unsigned NULL DEFAULT NULL;";
     $this->addQuery($query);
     $query = "UPDATE `aide_saisie` SET function_id = NULL WHERE function_id='0';";
     $this->addQuery($query);
     $query = "UPDATE `aide_saisie` SET user_id = NULL WHERE user_id='0';";
     $this->addQuery($query);
     $this->makeRevision("0.30");
     $query = "ALTER TABLE `aide_saisie` ADD `depend_value` varchar(255) DEFAULT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.31");
     $this->setTimeLimit(1800);
     $query = "ALTER TABLE `compte_rendu`\r\n      CHANGE `object_class` `object_class` ENUM('CPatient','CConsultAnesth','COperation','CConsultation','CSejour') NOT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.32");
     $query = "ALTER TABLE `pack`\r\n      ADD `object_class` ENUM('CPatient','CConsultAnesth','COperation','CConsultation','CSejour') NOT NULL DEFAULT 'COperation';";
     $this->addQuery($query);
     $this->makeRevision("0.33");
     $query = "UPDATE aide_saisie\r\n      SET `depend_value` = `class`,\r\n          `class` = 'CCompteRendu',\r\n          `field` = 'source'\r\n      WHERE `field` = 'compte_rendu';";
     $this->addQuery($query);
     $this->makeRevision("0.34");
     $query = "ALTER TABLE `compte_rendu` \r\n      ADD `type` ENUM ('header','body','footer'),\r\n      CHANGE `valide` `valide` ENUM ('0','1'),\r\n      ADD `header_id` INT (11) UNSIGNED,\r\n      ADD `footer_id` INT (11) UNSIGNED,\r\n      ADD INDEX (`header_id`),\r\n      ADD INDEX (`footer_id`)";
     $this->addQuery($query);
     $this->makeRevision("0.35");
     $query = "UPDATE `compte_rendu` \r\n      SET `type` = 'body'\r\n      WHERE `object_id` IS NULL";
     $this->addQuery($query);
     $this->makeRevision("0.36");
     $query = "UPDATE `compte_rendu` \r\n      SET `object_class` = 'CSejour'\r\n      WHERE `file_category_id` = 3\r\n      AND `object_class` = 'COperation'\r\n      AND `object_id` IS NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.37");
     $query = "ALTER TABLE `compte_rendu` \r\n      ADD `height` FLOAT;";
     $this->addQuery($query);
     $this->makeRevision("0.38");
     $query = "ALTER TABLE `compte_rendu` \r\n      ADD `group_id` INT (11) UNSIGNED;";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu` \r\n      ADD INDEX (`group_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.39");
     $this->addPrefQuery("saveOnPrint", 1);
     $this->makeRevision("0.40");
     $query = "UPDATE `compte_rendu` \r\n      SET `source` = REPLACE(`source`, '<br style=\"page-break-after: always;\" />', '<hr class=\"pagebreak\" />')";
     // attention: dans le code source de la classe Cpack, on a :
     // <br style='page-break-after:always' />
     // Mais FCKeditor le transforme en :
     // <br style="page-break-after: always;" />
     // Apres verification, c'est toujours comme ça quil a transformé, donc c'est OK.
     $this->addQuery($query);
     if (CModule::getInstalled('dPcabinet') && CModule::getInstalled('dPpatients')) {
         $this->addDependency("dPcabinet", "0.79");
         $this->addDependency("dPpatients", "0.73");
     }
     $this->makeRevision("0.41");
     $query = "ALTER TABLE `aide_saisie` \r\n            CHANGE `depend_value` `depend_value_1` VARCHAR (255),\r\n            ADD `depend_value_2` VARCHAR (255);";
     $this->addQuery($query);
     $this->makeRevision("0.42");
     $query = "ALTER TABLE `compte_rendu` \r\n            ADD `etat_envoi` ENUM ('oui','non','obsolete') NOT NULL default 'non';";
     $this->addQuery($query);
     $this->makeRevision("0.43");
     $this->setTimeLimit(1800);
     $query = "ALTER TABLE `compte_rendu` \r\n    CHANGE `object_class` `object_class` ENUM ('CPatient','CConsultation','CConsultAnesth','COperation','CSejour','CPrescription')\r\n    NOT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.44");
     $this->setTimeLimit(1800);
     $query = "ALTER TABLE `compte_rendu` \r\n            CHANGE `object_class` `object_class` VARCHAR (80) NOT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.45");
     $query = "ALTER TABLE `liste_choix` ADD `group_id` INT (11) UNSIGNED";
     $this->addQuery($query);
     $query = "ALTER TABLE `liste_choix` ADD INDEX (`group_id`)";
     $this->addQuery($query);
     $this->makeRevision("0.46");
     $query = "ALTER TABLE `aide_saisie` ADD `group_id` INT (11) UNSIGNED AFTER `function_id`";
     $this->addQuery($query);
     $query = "ALTER TABLE `aide_saisie` \r\n              ADD INDEX (`user_id`),\r\n              ADD INDEX (`function_id`),\r\n              ADD INDEX (`group_id`)";
     $this->addQuery($query);
     $this->makeRevision("0.47");
     $query = self::renameTemplateFieldQuery("Opération - personnel prévu - Panseuse", "Opération - personnel prévu - Panseur");
     $this->addQuery($query);
     $query = self::renameTemplateFieldQuery("Opération - personnel réel - Panseuse", "Opération - personnel réel - Panseur");
     $this->addQuery($query);
     $this->makeRevision("0.48");
     $query = "ALTER TABLE `pack` \r\n              ADD `function_id` INT (11) UNSIGNED,\r\n              ADD `group_id` INT (11) UNSIGNED,\r\n              ADD INDEX (`function_id`),\r\n              ADD INDEX (`group_id`);";
     $this->addQuery($query);
     $query = "ALTER TABLE `pack` \r\n              CHANGE `chir_id` `chir_id` INT (11) UNSIGNED;";
     $this->addQuery($query);
     $this->makeRevision("0.49");
     $query = "ALTER TABLE `compte_rendu` \r\n              ADD `margin_top`    FLOAT UNSIGNED NOT NULL DEFAULT '2',\r\n              ADD `margin_bottom` FLOAT UNSIGNED NOT NULL DEFAULT '2',\r\n              ADD `margin_left`   FLOAT UNSIGNED NOT NULL DEFAULT '2',\r\n              ADD `margin_right`  FLOAT UNSIGNED NOT NULL DEFAULT '2',\r\n              ADD `page_height`   FLOAT UNSIGNED NOT NULL DEFAULT '29.7',\r\n              ADD `page_width`    FLOAT UNSIGNED NOT NULL DEFAULT '21'";
     $this->addQuery($query);
     $this->makeRevision("0.50");
     $query = "ALTER TABLE `compte_rendu` \r\n              ADD `private` ENUM ('0','1') NOT NULL DEFAULT '0'";
     $this->addQuery($query);
     $this->makeRevision("0.51");
     $this->addPrefQuery("choicepratcab", "prat");
     $this->makeRevision("0.52");
     $query = "INSERT INTO content_html (content, cr_id) SELECT source, compte_rendu_id FROM compte_rendu";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu` DROP `source`";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu` \r\n              ADD `content_id` INT (11) UNSIGNED";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu` \r\n              ADD INDEX (`content_id`);";
     $this->addQuery($query);
     $query = "UPDATE compte_rendu c JOIN content_html ch ON c.compte_rendu_id = ch.cr_id\r\n            SET c.content_id = ch.content_id";
     $this->addQuery($query);
     $query = "ALTER TABLE `content_html` DROP `cr_id`";
     $this->addQuery($query);
     $this->makeRevision("0.53");
     // Déplacement du contenthtml dans system
     $this->makeRevision("0.54");
     $query = "ALTER TABLE `compte_rendu`\r\n            ADD `fast_edit` ENUM ('0','1') NOT NULL DEFAULT '0';";
     $this->addQuery($query);
     $query = "UPDATE `aide_saisie` SET `field` = '_source' WHERE `class` = 'CCompteRendu' AND `field` = 'source'";
     $this->addQuery($query);
     $this->makeRevision("0.55");
     $query = "CREATE TABLE `modele_to_pack` (\r\n              `modele_to_pack_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n              `modele_id` INT (11) UNSIGNED,\r\n              `pack_id` INT (11) UNSIGNED\r\n           ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `modele_to_pack` \r\n              ADD INDEX (`modele_id`),\r\n              ADD INDEX (`pack_id`);\r\n           ";
     $this->addQuery($query);
     $this->addMethod("setupAddmodeles");
     $this->makeRevision("0.56");
     $query = "ALTER TABLE `pack`\r\n              DROP `modeles`";
     $this->addQuery($query);
     $this->makeRevision("0.57");
     // Modification des user logs, seulement pour ceux qui ne font
     // reference qu'au champ "source" des compte rendus. Dans le cas où d'autres
     // champs sont listés, il faudrait splitter le user_log en deux :
     // un pour le CR et un pour le ContentHTML
     // Actions effectuées :
     // - remplacement de source par content
     // - remplacement de CCompteRendu par CContentHTML
     // - mise à jour de l'object_id
     $query = "\r\n    UPDATE user_log \r\n    LEFT JOIN compte_rendu ON compte_rendu.compte_rendu_id = user_log.object_id\r\n    LEFT JOIN content_html ON content_html.content_id = compte_rendu.content_id\r\n    \r\n    SET \r\n      user_log.object_class = 'CContentHTML',\r\n      user_log.object_id = compte_rendu.content_id,\r\n      user_log.fields = 'content'\r\n      \r\n    WHERE user_log.object_class = 'CCompteRendu'\r\n      AND user_log.object_id = compte_rendu.compte_rendu_id\r\n      AND user_log.fields = 'source'";
     $this->addQuery($query);
     $this->makeRevision("0.58");
     $this->addPrefQuery("listDefault", "ulli");
     $this->addPrefQuery("listBrPrefix", "&bull;");
     $this->addPrefQuery("listInlineSeparator", ";");
     $this->makeRevision("0.59");
     $query = "ALTER TABLE `compte_rendu`\r\n            ADD `fast_edit_pdf` ENUM ('0','1') NOT NULL DEFAULT '0'";
     $this->addQuery($query);
     $query = self::replaceTemplateQuery("-- tous]", "- tous]", true);
     $this->addQuery($query);
     $query = self::replaceTemplateQuery("-- tous par appareil]", "- tous par appareil]", true);
     $this->addQuery($query);
     $query = self::replaceTemplateQuery("[Constantes mode", "[Constantes - mode", true);
     $this->addQuery($query);
     $this->makeRevision("0.60");
     $query = self::replaceTemplateQuery("[Patient - médecin correspondants]", "[Patient - médecins correspondants]", true);
     $this->addQuery($query);
     $this->makeRevision("0.61");
     $this->addPrefQuery("aideTimestamp", "1");
     $this->addPrefQuery("aideOwner", "0");
     $this->addPrefQuery("aideFastMode", "1");
     $this->addPrefQuery("aideAutoComplete", "1");
     $this->addPrefQuery("aideShowOver", "1");
     $this->makeRevision("0.62");
     $this->addPrefQuery("mode_play", "0");
     $this->makeRevision("0.63");
     $query = "ALTER TABLE `compte_rendu`\r\n              CHANGE chir_id user_id INT (11) UNSIGNED;";
     $this->addQuery($query);
     $query = "ALTER TABLE `pack`\r\n              CHANGE chir_id user_id INT (11) UNSIGNED;";
     $this->addQuery($query);
     $query = "ALTER TABLE `liste_choix`\r\n              CHANGE chir_id user_id INT (11) UNSIGNED;";
     $this->addQuery($query);
     $this->makeRevision("0.64");
     $query = "ALTER TABLE `pack`\r\n              ADD `fast_edit` ENUM ('0','1') NOT NULL DEFAULT '0',\r\n              ADD `fast_edit_pdf` ENUM ('0','1') NOT NULL DEFAULT '0';";
     $this->addQuery($query);
     $this->makeRevision("0.65");
     $query = self::replaceTemplateQuery("[RPU - Mode", "[Sejour - Mode", true);
     $this->addQuery($query);
     $this->makeRevision("0.66");
     // Table consultation_anesth
     $this->addDependency("dPcabinet", "0.31");
     // Table sejour
     $this->addDependency("dPplanningOp", "0.37");
     $query = "ALTER TABLE `compte_rendu`\r\n      ADD `author_id` INT(11) UNSIGNED AFTER `function_id`;";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu`\r\n      ADD INDEX (`author_id`);";
     $this->addQuery($query);
     // Table temporaire de mappage entre le author_id (user_id du first log) et le compte_rendu_id
     $query = "CREATE TEMPORARY TABLE `owner_doc` (\r\n      `compte_rendu_id` INT(11), `author_id` INT(11)) AS\r\n      SELECT `compte_rendu_id`, `user_log`.`user_id` as `author_id`\r\n      FROM `compte_rendu`, `user_log`\r\n      WHERE `user_log`.`object_class` = 'CCompteRendu'\r\n      AND `user_log`.`object_id` = `compte_rendu`.`compte_rendu_id`\r\n      AND `user_log`.`type` = 'create';";
     $this->addQuery($query);
     $query = "UPDATE `compte_rendu`\r\n      JOIN `owner_doc` ON `compte_rendu`.`compte_rendu_id` = `owner_doc`.`compte_rendu_id`\r\n      SET `compte_rendu`.`author_id` = `owner_doc`.`author_id`;";
     $this->addQuery($query);
     // Mise à jour les compte-rendus de consultation
     $query = "UPDATE `compte_rendu`\r\n      SET `author_id` =\r\n          (\r\n           SELECT `chir_id`\r\n           FROM `plageconsult`\r\n           LEFT JOIN `consultation` ON `consultation`.`plageconsult_id` = `plageconsult`.`plageconsult_id`\r\n           WHERE `consultation`.`consultation_id` = `compte_rendu`.`object_id`\r\n           LIMIT 1\r\n          )\r\n      WHERE `author_id` IS NULL\r\n      AND `compte_rendu`.`object_class` = 'CConsultation'\r\n      AND `compte_rendu`.`object_id` IS NOT NULL;";
     $this->addQuery($query);
     // Pour les consultations d'anesthésie rattachées à une opération
     $query = "UPDATE `compte_rendu`\r\n      SET `author_id` =\r\n        (\r\n          SELECT `operations`.`chir_id`\r\n          FROM `consultation_anesth`\r\n          LEFT JOIN `operations` ON `operations`.`operation_id` = `consultation_anesth`.`operation_id`\r\n          WHERE `consultation_anesth`.`consultation_anesth_id` = `compte_rendu`.`object_id`\r\n          LIMIT 1\r\n        )\r\n      WHERE `author_id` IS NULL\r\n      AND `compte_rendu`.`object_class` = 'CConsultAnesth'\r\n      AND `compte_rendu`.`object_id` IS NOT NULL;";
     $this->addQuery($query);
     // Ou non
     $query = "UPDATE `compte_rendu`\r\n      SET `author_id` =\r\n        (\r\n          SELECT `plageconsult`.`chir_id`\r\n          FROM `consultation_anesth`\r\n          LEFT JOIN `consultation` ON `consultation`.`consultation_id` = `consultation_anesth`.`consultation_id`\r\n          LEFT JOIN `plageconsult` ON `plageconsult`.`plageconsult_id` = `consultation`.`plageconsult_id`\r\n          WHERE `consultation_anesth`.`consultation_anesth_id` = `compte_rendu`.`object_id`\r\n          LIMIT 1\r\n        )\r\n      WHERE `author_id` IS NULL\r\n      AND `compte_rendu`.`object_class` = 'CConsultAnesth'\r\n      AND `compte_rendu`.`object_id` IS NOT NULL;";
     $this->addQuery($query);
     // Pour les opérations
     $query = "UPDATE `compte_rendu`\r\n      SET `author_id` =\r\n        (\r\n          SELECT `chir_id`\r\n          FROM `operations`\r\n          WHERE `operations`.`operation_id` = `compte_rendu`.`object_id`\r\n          LIMIT 1\r\n        )\r\n      WHERE `author_id` IS NULL\r\n      AND `compte_rendu`.`object_class` = 'COperation'\r\n      AND `compte_rendu`.`object_id` IS NOT NULL;";
     $this->addQuery($query);
     // Pour les séjours
     $query = "UPDATE `compte_rendu`\r\n      SET `author_id` =\r\n        (\r\n          SELECT `praticien_id`\r\n          FROM `sejour`\r\n          WHERE `sejour`.`sejour_id` = `compte_rendu`.`object_id`\r\n          LIMIT 1\r\n        )\r\n      WHERE `author_id` IS NULL\r\n      AND `compte_rendu`.`object_class` = 'CSejour'\r\n      AND `compte_rendu`.`object_id` IS NOT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.67");
     $query = "ALTER TABLE `compte_rendu`\r\n      ADD date_print DATETIME DEFAULT NULL";
     $this->addQuery($query);
     $this->makeRevision("0.68");
     $this->addPrefQuery("choice_factory", "CDomPDFConverter");
     $this->makeRevision("0.69");
     $query = "CREATE TABLE `correspondant_courrier` (\r\n              `correspondant_courrier_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n              `compte_rendu_id` INT (11) UNSIGNED NOT NULL,\r\n              `nom` VARCHAR (255),\r\n              `adresse` TEXT,\r\n              `cp_ville` VARCHAR (255),\r\n              `email` VARCHAR (255),\r\n              `active` ENUM ('0','1') DEFAULT '0',\r\n              `tag` VARCHAR (255), \r\n              `object_class` VARCHAR (255)\r\n              ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `correspondant_courrier` \r\n              ADD INDEX (`compte_rendu_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.70");
     $query = "ALTER TABLE `correspondant_courrier`\r\n      DROP `nom`,\r\n      DROP `adresse`,\r\n      DROP `cp_ville`,\r\n      DROP `email`,\r\n      DROP `active`,\r\n      DROP `object_class`,\r\n      ADD `object_guid` VARCHAR (255);";
     $this->addQuery($query);
     $this->makeRevision("0.71");
     $query = "ALTER TABLE `correspondant_courrier`\r\n      ADD `object_class` ENUM ('CMedecin','CPatient','CCorrespondantPatient') NOT NULL,\r\n      ADD `object_id` INT (11) UNSIGNED NOT NULL;";
     $this->addQuery($query);
     $query = "ALTER TABLE `correspondant_courrier` \r\n      ADD INDEX (`object_id`);";
     $this->addQuery($query);
     $query = "UPDATE `correspondant_courrier`\r\n      SET `object_class` = SUBSTRING_INDEX(`object_guid`, '-', 1),\r\n          `object_id` = SUBSTR(`object_guid`, LOCATE('-', `object_guid`, 2)+1);";
     $this->addQuery($query);
     $query = "ALTER TABLE `correspondant_courrier`\r\n      DROP `object_guid`";
     $this->addQuery($query);
     $this->makeRevision("0.72");
     $query = self::replaceTemplateQuery("[Courrier - copie à", "[Courrier - copie à - simple", true);
     $this->addQuery($query);
     $query = self::replaceTemplateQuery("[Courrier - copie à (complet)", "[Courrier - copie à - complet", true);
     $this->addQuery($query);
     $this->makeRevision("0.73");
     $query = "ALTER TABLE `correspondant_courrier` \r\n      ADD `quantite` INT (11) UNSIGNED NOT NULL DEFAULT '1';";
     $this->addQuery($query);
     $this->makeRevision("0.74");
     $this->addPrefQuery("multiple_docs", 0);
     $this->makeRevision("0.75");
     $query = "ALTER TABLE `compte_rendu`\r\n      ADD `purge_field` VARCHAR (255);";
     $this->addQuery($query);
     $this->makeRevision("0.76");
     $query = self::replaceTemplateQuery("[Patient - âge", "[Patient - années", true);
     $this->addQuery($query);
     $this->makeRevision("0.77");
     $query = "ALTER TABLE `pack` \r\n      ADD `merge_docs` ENUM ('0','1') DEFAULT '1';";
     $this->addQuery($query);
     $this->makeRevision("0.78");
     $this->addPrefQuery("auto_capitalize", 0);
     $this->makeRevision("0.79");
     $query = "ALTER TABLE `compte_rendu` \r\n      ADD `modele_id` INT (11) UNSIGNED AFTER `object_id`,\r\n      ADD `purgeable` ENUM ('0','1') DEFAULT '0';";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu`\r\n      ADD INDEX (`modele_id`),\r\n      ADD INDEX (`date_print`);";
     $this->addQuery($query);
     $this->makeRevision("0.80");
     $query = "ALTER TABLE `compte_rendu`\r\n      CHANGE `type` `type` ENUM ('header','preface','body','ending','footer') DEFAULT 'body', \r\n      ADD `preface_id` INT (11) UNSIGNED AFTER `header_id`,\r\n      ADD `ending_id` INT (11) UNSIGNED AFTER `preface_id`;";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu` \r\n      ADD INDEX (`preface_id`),\r\n      ADD INDEX (`ending_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.81");
     $query = "ALTER TABLE `compte_rendu`\r\n      ADD `fields_missing` INT (11) UNSIGNED DEFAULT 0";
     $this->addQuery($query);
     $this->makeRevision("0.82");
     $this->addPrefQuery("default_font", "");
     $this->addPrefQuery("default_size", "");
     $this->makeRevision("0.83");
     $this->delPrefQuery("default_font");
     $this->delPrefQuery("default_size");
     $query = "ALTER TABLE `compte_rendu` \r\n      ADD `font` ENUM ('arial','comic','courier','georgia','lucida','tahoma','times','trebuchet','verdana') AFTER `object_class`,\r\n      ADD `size` ENUM ('xx-small','x-small','small','medium','large','x-large','xx-large',\r\n                       '8pt','9pt','10pt','11pt','12pt','14pt','16pt','18pt','20pt','22pt','24pt','26pt','28pt','36pt','48pt','72pt')\r\n      AFTER `font`";
     $this->addQuery($query);
     $this->makeRevision("0.84");
     $query = self::replaceTemplateQuery("[Patient - Il/Elle", "[Patient - Il/Elle (majuscule)", true);
     $this->addQuery($query);
     $query = self::replaceTemplateQuery("[Patient - Le/La", "[Patient - Le/La (majuscule)", true);
     $this->addQuery($query);
     $this->makeRevision("0.85");
     $query = "ALTER TABLE `compte_rendu`\r\n      CHANGE `font` `font` ENUM ('arial','calibri','comic','courier','georgia','lucida','tahoma','times','trebuchet','verdana')";
     $this->addQuery($query);
     $this->makeRevision("0.86");
     $query = "ALTER TABLE `compte_rendu`\r\n      CHANGE `font` `font` ENUM ('arial','calibri','comic','courier','georgia','lucida','symbol','tahoma',\r\n                                 'times','trebuchet','verdana','zapfdingbats')";
     $this->addQuery($query);
     $this->makeRevision("0.87");
     // Table temporaire de mappage entre le author_id (user_id du first log) et le compte_rendu_id
     // Les compte-rendus affectés sont principalement ceux en édition rapide
     $query = "CREATE TEMPORARY TABLE IF NOT EXISTS `owner_doc` (\r\n      `compte_rendu_id` INT(11), `author_id` INT(11)) AS\r\n      SELECT `compte_rendu_id`, `user_log`.`user_id` as `author_id`\r\n      FROM `compte_rendu`, `user_log`\r\n      WHERE `user_log`.`object_class` = 'CCompteRendu'\r\n      AND `compte_rendu`.`author_id` IS NULL\r\n      AND `user_log`.`object_id` = `compte_rendu`.`compte_rendu_id`\r\n      AND `user_log`.`type` = 'create';";
     $this->addQuery($query);
     $query = "UPDATE `compte_rendu`\r\n      JOIN `owner_doc` ON `compte_rendu`.`compte_rendu_id` = `owner_doc`.`compte_rendu_id`\r\n      SET `compte_rendu`.`author_id` = `owner_doc`.`author_id`;";
     $this->addQuery($query);
     $this->makeRevision("0.88");
     $query = "UPDATE `compte_rendu`\r\n      SET `nom` = '[ENTETE ORDONNANCE]'\r\n      WHERE `object_class` = 'CPrescription'\r\n      AND `type` = 'header'";
     $this->addQuery($query);
     $query = "UPDATE `compte_rendu`\r\n      SET `nom` = '[PIED DE PAGE ORDONNANCE]'\r\n      WHERE `object_class` = 'CPrescription'\r\n      AND `type` = 'footer'";
     $this->addQuery($query);
     $this->makeRevision("0.89");
     $query = self::replaceTemplateQuery("[Patient - Antécédents - Autres", "[Patient - Antécédents - Autres (type)", true);
     $this->addQuery($query);
     $this->makeRevision("0.90");
     $query = "ALTER TABLE `compte_rendu`\r\n                ADD `version` INT (11) DEFAULT '0';";
     $this->addQuery($query);
     $this->makeRevision("0.91");
     $this->addPrefQuery("auto_replacehelper", 0);
     $this->makeRevision("0.92");
     if (CModule::getActive("dPprescription")) {
         $query = "UPDATE aide_saisie\r\n        JOIN category_prescription ON category_prescription.nom = aide_saisie.depend_value_2\r\n        SET aide_saisie.depend_value_2 = category_prescription.category_prescription_id\r\n        WHERE category_prescription_id IS NOT NULL";
         $this->addQuery($query);
     }
     $this->makeRevision("0.93");
     $query = "ALTER TABLE `compte_rendu`\r\n      ADD `language` ENUM ('en-EN','es-ES','fr-CH','fr-FR') DEFAULT 'fr-FR' AFTER modele_id";
     $this->addQuery($query);
     $this->makeRevision("0.94");
     $query = "ALTER TABLE `compte_rendu`\r\n      ADD `locker_id` INT(11) UNSIGNED AFTER `author_id`;";
     $this->addQuery($query);
     $query = "ALTER TABLE `compte_rendu`\r\n      ADD INDEX (`locker_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.95");
     $query = "ALTER TABLE `compte_rendu`\r\n      ADD `type_doc` VARCHAR(128);";
     $this->addQuery($query);
     $this->makeRevision("0.96");
     $this->addPrefQuery("pass_lock", 0);
     $this->makeRevision('0.97');
     $this->addPrefQuery('hprim_med_header', 0);
     $this->makeRevision("0.98");
     if (CModule::getActive("dPprescription")) {
         $query = "UPDATE aide_saisie\r\n        JOIN element_prescription ON element_prescription.libelle = aide_saisie.depend_value_1\r\n        SET aide_saisie.depend_value_1 = element_prescription.element_prescription_id\r\n        WHERE element_prescription_id IS NOT NULL\r\n        AND aide_saisie.class = 'CPrescriptionLineElement'";
         $this->addQuery($query);
     }
     $this->makeRevision("0.99");
     $query = "ALTER TABLE `compte_rendu`\r\n      ADD `factory` ENUM ('none', 'CDomPDFConverter', 'CWkHtmlToPDFConverter', 'CPrinceXMLConverter');";
     $this->addQuery($query);
     $this->makeRevision("1.00");
     $query = "ALTER TABLE `compte_rendu`\r\n                ADD `type_doc_sisra` VARCHAR(10);";
     $this->addQuery($query);
     $this->makeRevision("1.01");
     $this->addPrefQuery("show_old_print", 1);
     $this->makeRevision("1.02");
     $query = "ALTER TABLE `compte_rendu`\r\n                ADD `creation_date` DATETIME;";
     $this->addQuery($query);
     $this->makeRevision("1.03");
     $query = "ALTER TABLE `compte_rendu`\r\n      ADD `annule` ENUM ('0','1') DEFAULT '0' AFTER `modele_id`;";
     $this->addQuery($query);
     $this->makeRevision("1.04");
     $query = "ALTER TABLE `compte_rendu`\r\n      ADD `doc_size` INT (11) UNSIGNED DEFAULT '0';";
     $this->addQuery($query);
     $query = "UPDATE `compte_rendu`\r\n      JOIN `content_html` ON `content_html`.`content_id` = `compte_rendu`.`content_id`\r\n      SET `compte_rendu`.`doc_size` = LENGTH(`content_html`.`content`)";
     $this->addQuery($query);
     $this->mod_version = "1.05";
 }
Exemple #5
0
 /**
  * Standard constructor
  */
 function __construct()
 {
     parent::__construct();
     $this->mod_name = "dPsante400";
     $this->makeRevision("all");
     $query = "CREATE TABLE `id_sante400` (\r\n      `id_sante400_id` INT NOT NULL AUTO_INCREMENT ,\r\n      `object_class` VARCHAR( 25 ) NOT NULL ,\r\n      `object_id` INT NOT NULL ,\r\n       `tag` VARCHAR( 80 ) ,\r\n       `last_update` DATETIME NOT NULL ,\r\n        PRIMARY KEY ( `id_sante400_id` ) ,\r\n        INDEX ( `object_class` , `object_id` , `tag` )) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $this->makeRevision("0.1");
     $query = "ALTER TABLE `id_sante400` ADD `id400` VARCHAR( 8 ) NOT NULL ;";
     $this->addQuery($query);
     $this->makeRevision("0.11");
     $query = "ALTER TABLE `id_sante400` CHANGE `id400` `id400` VARCHAR( 10 ) NOT NULL ;";
     $this->addQuery($query);
     $this->makeRevision("0.12");
     $query = "ALTER TABLE `id_sante400`\r\n      CHANGE `id_sante400_id` `id_sante400_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\r\n      CHANGE `object_id` `object_id` int(11) unsigned NOT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.13");
     $query = "ALTER TABLE `id_sante400` DROP INDEX `object_class` ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `id_sante400` ADD INDEX ( `object_class` ) ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `id_sante400` ADD INDEX ( `object_id` ) ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `id_sante400` ADD INDEX ( `tag` ) ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `id_sante400` ADD INDEX ( `last_update` ) ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `id_sante400` ADD INDEX ( `id400` ) ;";
     $this->addQuery($query);
     $this->makeRevision("0.14");
     $query = "UPDATE `id_sante400` \r\n      SET `tag`='labo code4' \r\n      WHERE `tag`='LABO' \r\n      AND `object_class`='CMediusers' ;";
     $this->addQuery($query);
     $this->makeRevision("0.15");
     $query = "UPDATE `id_sante400`\r\n      SET `tag` = CONCAT('NDOS ', LEFT(`tag`, 8))\r\n      WHERE `object_class` = 'CSejour'\r\n      AND `tag` LIKE 'CIDC:___ DMED:________'";
     $this->addQuery($query);
     $this->makeRevision("0.16");
     $query = "CREATE TABLE `trigger_mark` (\r\n      `mark_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `trigger_class` VARCHAR (255) NOT NULL,\r\n      `trigger_number` VARCHAR (10) NOT NULL,\r\n      `mark` VARCHAR (255) NOT NULL,\r\n      `done` ENUM ('0','1') NOT NULL\r\n    ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $this->makeRevision("0.17");
     $query = "ALTER TABLE `trigger_mark` ADD UNIQUE `trigger_unique` (\r\n      `trigger_class` ,\r\n      `trigger_number`\r\n    );";
     $this->addQuery($query);
     $query = "ALTER TABLE `trigger_mark` ADD INDEX ( `mark` );";
     $this->addQuery($query);
     $this->makeRevision("0.18");
     $query = "ALTER TABLE `trigger_mark` \r\n       CHANGE `trigger_number` `trigger_number` BIGINT (10) UNSIGNED ZEROFILL NOT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.19");
     $query = "ALTER TABLE `id_sante400` \r\n       CHANGE `id400` `id400` VARCHAR  (25) NOT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.20");
     $query = "ALTER TABLE `id_sante400` \r\n       CHANGE `id400` `id400` VARCHAR  (80) NOT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.21");
     $query = "ALTER TABLE `id_sante400` \r\n       CHANGE `object_class` `object_class` VARCHAR (40) NOT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.22");
     $query = "CREATE TABLE `incrementer` (\r\n      `incrementer_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `type` ENUM ('IPP','NDA') NOT NULL,\r\n      `group_id` INT (11) UNSIGNED NOT NULL,\r\n      `last_update` DATETIME NOT NULL,\r\n      `value` VARCHAR (255) NOT NULL DEFAULT '1',\r\n      `pattern` VARCHAR (255) NOT NULL\r\n     ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `incrementer` \r\n      ADD INDEX (`last_update`);";
     $this->addQuery($query);
     $this->makeRevision("0.23");
     $query = "ALTER TABLE `incrementer` \r\n      CHANGE `type` `object_class` ENUM ('CPatient','CSejour') NOT NULL;";
     $this->addQuery($query);
     $query = "ALTER TABLE `incrementer` \r\n      ADD INDEX (`object_class`),\r\n      ADD INDEX (`group_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.24");
     $query = "ALTER TABLE `trigger_mark` \r\n      ADD INDEX ( `trigger_class` ),\r\n      ADD INDEX ( `trigger_number` );";
     $this->addQuery($query);
     $this->makeRevision("0.25");
     $query = "ALTER TABLE `incrementer` \r\n      ADD `range_min` INT (11) UNSIGNED,\r\n      ADD `range_max` INT (11);";
     $this->addQuery($query);
     $this->makeRevision("0.26");
     $query = "ALTER TABLE `trigger_mark`\r\n      ADD `when` DATETIME,\r\n     CHANGE `done` `done` ENUM ('0','1') NOT NULL DEFAULT '0';";
     $this->addQuery($query);
     $this->makeRevision('0.27');
     $query = "CREATE TABLE `hypertext_link` (\r\n                `hypertext_link_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n                `name` VARCHAR (255) NOT NULL,\r\n                `link` VARCHAR (255) NOT NULL,\r\n                `object_id` INT (11) UNSIGNED NOT NULL DEFAULT '0',\r\n                `object_class` VARCHAR (80) NOT NULL\r\n              )/*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = 'ALTER TABLE `hypertext_link`
             ADD INDEX (`object_id`),
             ADD INDEX (`object_class`);';
     $this->addQuery($query);
     $this->makeRevision("0.28");
     if (CModule::getInstalled("hprim21")) {
         $this->addDefaultConfig("dPsante400 CIdSante400 admit_ipp_nda_obligatory", "hprim21 mandatory_num_dos_ipp_adm");
     }
     $this->makeRevision("0.29");
     $query = "ALTER TABLE `id_sante400`\r\n                ADD `datetime_create` DATETIME NOT NULL,\r\n                ADD INDEX ( `datetime_create` ) ;";
     $this->addQuery($query);
     $query = "UPDATE `id_sante400`\r\n      SET `datetime_create` = `last_update`";
     $this->addQuery($query);
     $this->mod_version = '0.30';
 }
Exemple #6
0
$patient_nda = CValue::get("patient_nda");
$useVitale = CValue::get("useVitale", CModule::getActive("fse") && CAppUI::pref('LogicielLectureVitale') != 'none' ? 1 : 0);
$prat_id = CValue::get("prat_id");
$patient_sexe = CValue::get("sexe");
$useCovercard = CValue::get("usecovercard", CModule::getActive("fse") && CModule::getActive("covercard") ? 1 : 0);
$patient_nom_search = null;
$patient_prenom_search = null;
// Save history
$params = array("new" => $new, "patient_id" => $patient_id, "nom" => $patient_nom, "prenom" => $patient_prenom, "ville" => $patient_ville, "cp" => $patient_cp, "Date_Day" => $patient_day, "Date_Month" => $patient_month, "Date_Year" => $patient_year, "patient_ipp" => $patient_ipp, "patient_nda" => $patient_nda, "prat_id" => $prat_id, "sexe" => $patient_sexe);
CViewHistory::save($patient, CViewHistory::TYPE_SEARCH, $params);
$patVitale = new CPatient();
// Liste des praticiens
$prats = $mediuser->loadPraticiens();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("dPsanteInstalled", CModule::getInstalled("dPsante400"));
$smarty->assign("nom", $patient_nom);
$smarty->assign("prenom", $patient_prenom);
$smarty->assign("naissance", $patient_naissance);
$smarty->assign("ville", $patient_ville);
$smarty->assign("cp", $patient_cp);
$smarty->assign("nom_search", $patient_nom_search);
$smarty->assign("prenom_search", $patient_prenom_search);
$smarty->assign("covercard", CValue::get("covercard", ""));
$smarty->assign("sexe", $patient_sexe);
$smarty->assign("prat_id", $prat_id);
$smarty->assign("prats", $prats);
$smarty->assign("patient", $patient);
$smarty->assign("useVitale", $useVitale);
$smarty->assign("useCoverCard", $useCovercard);
$smarty->assign("patVitale", $patVitale);
Exemple #7
0
<?php

/**
 * $Id: index.php 23860 2014-07-04 12:02:15Z alexis_granger $
 *
 * @category Soins
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision: 23860 $
 * @link     http://www.mediboard.org
 */
$module = CModule::getInstalled(basename(__DIR__));
if (CAppUI::pref("vue_sejours") == "standard") {
    $module->registerTab("vw_idx_sejour", TAB_READ);
} else {
    $module->registerTab("vw_sejours", TAB_READ);
}
$current_group = CGroups::loadCurrent();
if (CModule::getActive('dPprescription')) {
    $module->registerTab("vw_pancarte_service", TAB_READ);
    $module->registerTab("vw_bilan_prescription", TAB_READ);
    $module->registerTab("vw_plan_soins_service", TAB_READ);
    if (CAppUI::conf("soins Other show_charge_soins", $current_group)) {
        $module->registerTab("vw_ressources_soins", TAB_READ);
    }
    //$module->registerTab("vw_dossier_sejour"    , TAB_READ);
}
if (CModule::getActive('pharmacie') && CAppUI::conf("pharmacie enable_v2") && CAppUI::conf("pharmacie Display show_dispensation_dossier_soins", $current_group)) {
    $module->registerTab("vw_dispensation", TAB_READ);
}
 /**
  * Merge an array of objects
  *
  * @param self[] $objects An array of CMbObject to merge
  * @param bool   $fast    Tell wether to use SQL (fast) or PHP (slow but checked and logged) algorithm
  *
  * @return string|null
  */
 function merge($objects, $fast = false)
 {
     $alternative_mode = $this->_id != null;
     // Modes and object count check
     if ($alternative_mode && count($objects) > 1) {
         return "mergeAlternativeTooManyObjects";
     }
     if (!$alternative_mode && count($objects) < 2) {
         return "mergeTooFewObjects";
     }
     // Trigger before event
     $this->notify("BeforeMerge");
     if (!$this->_id && ($msg = $this->store())) {
         $this->notify("MergeFailure");
         return $msg;
     }
     foreach ($objects as $object) {
         $this->_merging[$object->_id] = $object;
     }
     foreach ($objects as &$object) {
         $msg = $fast ? $this->fastTransferBackRefsFrom($object) : $this->transferBackRefsFrom($object);
         if ($msg) {
             $this->notify("MergeFailure");
             return $msg;
         }
         $object_id = $object->_id;
         $object->_mergeDeletion = true;
         if ($msg = $object->delete()) {
             return $msg;
         }
         // If external IDs are available, we save old objects' id as external IDs
         if (CModule::getInstalled("dPsante400")) {
             $idex = new CIdSante400();
             $idex->setObject($this);
             $idex->tag = "merged";
             $idex->id400 = $object_id;
             $idex->last_update = CMbDT::dateTime();
             $idex->store();
         }
     }
     // Trigger after event
     $this->notify("AfterMerge");
     return $this->store();
 }
    foreach ($listCategories as $keyCat => $_categorie) {
        foreach ($fiche->_ref_items as $keyItem => $_item) {
            if ($_item->ei_categorie_id == $keyCat) {
                if (!isset($catFiche[$_categorie->nom])) {
                    $catFiche[$_categorie->nom] = array();
                }
                $catFiche[$_categorie->nom][] = $_item;
            }
        }
    }
}
$user = new CMediusers();
/** @var CMediusers[] $listUsersTermine */
$listUsersTermine = $user->loadListFromType();
// Chargement de la liste des Chef de services / utilisateur
$module = CModule::getInstalled("dPqualite");
$perm = new CPermModule();
/** @var CMediusers[] $listUsersEdit */
$listUsersEdit = $user->loadListFromType(null, PERM_READ);
foreach ($listUsersEdit as $keyUser => $_user) {
    if (!$perm->getInfoModule("permission", $module->mod_id, PERM_EDIT, $keyUser)) {
        unset($listUsersEdit[$keyUser]);
    }
}
/** @var CEiItem[] $items */
$items = array();
if ($evenements) {
    $where = array();
    $where["ei_categorie_id"] = " = '{$evenements}'";
    $item = new CEiItem();
    $items = $item->loadList($where);
$dossier_medical = $patient->loadRefDossierMedical();
if ($dossier_medical->_id) {
    $dossier_medical->loadRefsAllergies();
    $dossier_medical->loadRefsAntecedents();
    $dossier_medical->countAntecedents();
    $dossier_medical->countAllergies();
}
$sejour->loadRefPraticien();
$sejour->loadRefsOperations();
$sejour->loadRefsConsultations();
foreach ($sejour->_ref_consultations as $_consult) {
    $_consult->loadRefBrancardage();
}
// personne qui a autorisé la sortie
$sejour->loadRefConfirmeUser()->loadRefFunction();
$prescription_active = CModule::getInstalled("dPprescription");
// Gestion des macro-cible seulement si prescription disponible
$cible_importante = $prescription_active;
$date_transmission = CAppUI::conf("soins synthese transmission_date_limit", $group->_guid) ? CMbDT::dateTime() : null;
$sejour->loadRefsTransmissions($cible_importante, true, false, null, $date_transmission);
$sejour->loadRefsObservations(true);
$sejour->loadRefsTasks();
$sejour->loadRefsNotes();
foreach ($sejour->_ref_tasks as $key => $_task) {
    if ($_task->realise) {
        unset($sejour->_ref_tasks[$key]);
        continue;
    }
    $_task->loadRefPrescriptionLineElement();
    $_task->setDateAndAuthor();
    $_task->loadRefAuthor();
Exemple #11
0
 /**
  * @return CMediusers
  */
 function loadRefMediuser()
 {
     $mediuser = new CMediusers();
     if (CModule::getInstalled("mediusers")) {
         $mediuser->load($this->_id);
         $this->_ref_mediuser = $mediuser;
     }
     return $mediuser;
 }
 */
CCanDo::checkEdit();
global $language;
$module = CValue::getOrSession("module", "system");
$language = CValue::getOrSession("language", "fr");
if ($module != "common") {
    $classes = CModule::getClassesFor($module);
    // Hack to have CModule in system locale file
    if ($module == "system") {
        $classes[] = "CModule";
    }
} else {
    $classes = array();
}
// liste des dossiers modules + common et styles
$modules = array_keys(CModule::getInstalled());
$modules[] = "common";
sort($modules);
// Dossier des traductions
$localesDirs = array();
if ($module != "common") {
    $files = glob("modules/{$module}/locales/*");
    foreach ($files as $file) {
        $name = basename($file, ".php");
        $localesDirs[$name] = $file;
    }
} else {
    $files = glob("locales/*/common.php");
    foreach ($files as $file) {
        $name = basename(dirname($file));
        $localesDirs[$name] = $file;
Exemple #13
0
     $event->title .= "<small>";
     $event->title .= "<br/>{$title}";
     if ($function_id) {
         $event->title .= " - " . $_prat->_shortview . "";
     }
     $event->title .= "<br/> Durée cumulée : ";
     $event->title .= $_plage->_cumulative_minutes ? CMbDT::time("+ {$_plage->_cumulative_minutes} MINUTES", "00:00:00") : "&mdash;";
     $event->title .= "</small>";
     $event->type = $_plage->_class;
     $event->datas = array("id" => $_plage->_id);
     $event->css_class = $_plage->_class;
     $event->setObject($_plage);
     $calendar->days[$_plage->date][$_plage->_guid] = $event;
 }
 // plages op
 if (CModule::getInstalled('dPbloc')) {
     $plage = new CPlageOp();
     $plages_op = $plage->loadForDays($_prat->_id, $calendar->date_min, $calendar->date_max);
     /** @var CPlageOp[] $plages_op */
     foreach ($plages_op as $_plage) {
         $_plage->loadRefsOperations(false);
         $_plage->loadRefSalle();
         $event = new CPlanningEvent($_plage->_guid, $_plage->date);
         $title = CAppUI::tr($_plage->_class);
         if ($_plage->spec_id) {
             $event->title .= "<img src=\"images/icons/user-function.png\" style=\" float:right;\" alt=\"\"/>";
         }
         $event->title .= "\n    <strong>" . CMbDT::format($_plage->debut, "%H:%M") . " - " . CMbDT::format($_plage->fin, "%H:%M") . "</strong>\n     " . count($_plage->_ref_operations) . " " . CAppUI::tr('COperation');
         if (count($_plage->_ref_operations) > 1) {
             $event->title .= "s";
         }
Exemple #14
0
 * $Id: plage_selector.php 22873 2014-04-22 07:51:07Z mytto $
 *
 * @package    Mediboard
 * @subpackage PlanningOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 22873 $
 */
CCanDo::checkRead();
$ds = CSQLDataSource::get("std");
$chir = CValue::get("chir", 0);
$date = CValue::getOrSession("date_plagesel", CMbDT::date());
$group_id = CValue::get("group_id", CGroups::loadCurrent()->_id);
$operation_id = CValue::get("operation_id", null);
$curr_op_time = CValue::get("curr_op_time", "25:00");
$resp_bloc = CModule::getInstalled("dPbloc")->canEdit();
// Liste des mois selectionnables
$date = CMbDT::format($date, "%Y-%m-01");
$listMonthes = array();
for ($i = -6; $i <= 12; $i++) {
    $curr_key = CMbDT::transform("{$i} month", $date, "%Y-%m-%d");
    $curr_month = CMbDT::transform("{$i} month", $date, "%B %Y");
    $listMonthes[$i]["date"] = $curr_key;
    $listMonthes[$i]["month"] = $curr_month;
}
// Chargement du chirurgien
$mediChir = new CMediusers();
$mediChir->load($chir);
$mediChir->loadBackRefs("secondary_functions");
$secondary_functions = array();
foreach ($mediChir->_back["secondary_functions"] as $curr_sec_func) {
 /**
  * @see parent::isInstalled()
  */
 function isInstalled()
 {
     // Prevents zillions of uncachable SQL queries on table existence
     return CModule::getInstalled("mediusers");
 }
Exemple #16
0
        // Need to change
        if ($user->_ref_user->force_change_password) {
            CAppUI::redirect("m=admin&tab=chpwd&forceChange=1");
        }
        if (CMbDT::dateTime("-" . CAppUI::conf("admin CUser password_life_duration")) > $user->_ref_user->user_password_last_change) {
            CAppUI::redirect("m=admin&tab=chpwd&forceChange=1&lifeDuration=1");
        }
    }
}
// Check CSRF protection
CCSRF::checkProtection();
// do some db work if dosql is set
if ($dosql) {
    // dP remover super hack
    if (!CModule::getInstalled($m)) {
        if (!CModule::getInstalled("dP{$m}")) {
            CAppUI::redirect("m=system&a=module_missing&mod={$m}");
        }
        $m = "dP{$m}";
    }
    // controller in controllers/ directory
    if (is_file("./modules/{$m}/controllers/{$dosql}.php")) {
        include "./modules/{$m}/controllers/{$dosql}.php";
    }
}
// Permissions checked on POST $m, but we redirect to GET $m
if ($post_request && $m_get && $m != $m_get && $m != "dP{$m_get}") {
    $m = $m_get;
}
if ($class) {
    $do = new CDoObjectAddEdit($class);
Exemple #17
0
 /**
  * Standard constructor
  */
 function __construct()
 {
     parent::__construct();
     $this->mod_name = "ssr";
     $this->makeRevision("all");
     // Plateau technique
     $this->makeRevision("0.01");
     $query = "CREATE TABLE `plateau_technique` (\r\n      `plateau_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `group_id` INT (11) UNSIGNED,\r\n      `nom` VARCHAR (255) NOT NULL\r\n    ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `plateau_technique` \r\n      ADD INDEX (`group_id`);";
     $this->addQuery($query);
     // Equipement
     $this->makeRevision("0.02");
     $query = "CREATE TABLE `equipement` (\r\n      `equipement_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `plateau_id` INT (11) UNSIGNED NOT NULL,\r\n      `nom` VARCHAR (255) NOT NULL\r\n    ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `equipement` \r\n      ADD INDEX (`plateau_id`);";
     $this->addQuery($query);
     // Technicien
     $this->makeRevision("0.03");
     $this->addDependency("mediusers", "0.1");
     $query = "CREATE TABLE `technicien` (\r\n      `technicien_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `plateau_id` INT (11) UNSIGNED NOT NULL,\r\n      `kine_id` INT (11) UNSIGNED NOT NULL\r\n    ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `technicien` \r\n      ADD INDEX (`plateau_id`),\r\n      ADD INDEX (`kine_id`);";
     $this->addQuery($query);
     // Fiche d'autonomie
     $this->makeRevision("0.04");
     $query = "CREATE TABLE `fiche_autonomie` (\r\n      `fiche_autonomie_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `sejour_id` INT (11) UNSIGNED NOT NULL,\r\n      `alimentation` ENUM ('autonome','partielle','totale'),\r\n      `toilette` ENUM ('autonome','partielle','totale'),\r\n      `habillage_haut` ENUM ('autonome','partielle','totale'),\r\n      `habillage_bas` ENUM ('autonome','partielle','totale'),\r\n      `utilisation_toilette` ENUM ('sonde','couche','bassin','stomie'),\r\n      `transfert_lit` ENUM ('autonome','partielle','totale'),\r\n      `locomotion` ENUM ('autonome','partielle','totale'),\r\n      `locomotion_materiel` ENUM ('canne','cadre','fauteuil'),\r\n      `escalier` ENUM ('autonome','partielle','totale'),\r\n      `pansement` ENUM ('0','1'),\r\n      `escarre` ENUM ('0','1'),\r\n      `comprehension` ENUM ('intacte','alteree'),\r\n      `expression` ENUM ('intacte','alteree'),\r\n      `memoire` ENUM ('intacte','alteree'),\r\n      `resolution_pb` ENUM ('intacte','alteree'),\r\n      `etat_psychique` TEXT,\r\n      `devenir_envisage` TEXT\r\n    ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `fiche_autonomie` \r\n      ADD INDEX (`sejour_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.05");
     $query = "ALTER TABLE `fiche_autonomie` \r\n      ADD `soins_cutanes` TEXT;";
     $this->addQuery($query);
     // Bilan SSR
     $this->makeRevision("0.06");
     $query = "CREATE TABLE `bilan_ssr` (\r\n      `bilan_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `sejour_id` INT (11) UNSIGNED NOT NULL,\r\n      `kine` VARCHAR (255) NOT NULL,\r\n      `ergo` VARCHAR (255) NOT NULL,\r\n      `psy` VARCHAR (255) NOT NULL,\r\n      `ortho` VARCHAR (255) NOT NULL,\r\n      `diet` VARCHAR (255) NOT NULL,\r\n      `social` VARCHAR (255) NOT NULL,\r\n      `apa` VARCHAR (255) NOT NULL,\r\n      `entree` TEXT,\r\n      `sortie` TEXT\r\n    ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `bilan_ssr` \r\n      ADD INDEX (`sejour_id`);";
     $this->addQuery($query);
     // RHS
     $this->makeRevision("0.07");
     $query = "CREATE TABLE `rhs` (\r\n      `rhs_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `sejour_id` INT (11) UNSIGNED NOT NULL,\r\n      `date_monday` DATE NOT NULL\r\n    ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `rhs` \r\n      ADD INDEX (`sejour_id`),\r\n      ADD INDEX (`date_monday`);";
     $this->addQuery($query);
     // D�pendances RHS
     $this->makeRevision("0.08");
     $query = "CREATE TABLE `dependances_rhs` (\r\n      `dependances_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `rhs_id` INT (11) UNSIGNED NOT NULL,\r\n      `habillage`    ENUM ('1','2','3','4'),\r\n      `deplacement`  ENUM ('1','2','3','4'),\r\n      `alimentation` ENUM ('1','2','3','4'),\r\n      `continence`   ENUM ('1','2','3','4'),\r\n      `comportement` ENUM ('1','2','3','4'),\r\n      `relation`     ENUM ('1','2','3','4')\r\n    ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `dependances_rhs` \r\n      ADD INDEX (`rhs_id`);";
     $this->addQuery($query);
     // Ligne d'activit�s RHS
     $this->makeRevision("0.09");
     $query = "CREATE TABLE `ligne_activites_rhs` (\r\n      `ligne_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `rhs_id` INT (11) UNSIGNED NOT NULL,\r\n      `executant_id` INT (11) UNSIGNED NOT NULL,\r\n      `code_activite_cdarr` CHAR (4),\r\n      `code_intervenant_cdarr` CHAR (2),\r\n      `qty_mon` INT (11),\r\n      `qty_tue` INT (11),\r\n      `qty_wed` INT (11),\r\n      `qty_thu` INT (11),\r\n      `qty_fri` INT (11),\r\n      `qty_sat` INT (11),\r\n      `qty_sun` INT (11)\r\n    ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `ligne_activites_rhs` \r\n      ADD INDEX (`rhs_id`),\r\n      ADD INDEX (`executant_id`);";
     $this->addQuery($query);
     // Bilan SSR: suppresion des anciennes prescriptions texte, ajout du kine
     $this->makeRevision("0.10");
     $query = "ALTER TABLE `bilan_ssr` \r\n      ADD `kine_id` INT (11) UNSIGNED,\r\n      DROP COLUMN `kine`,\r\n      DROP COLUMN `ergo`,\r\n      DROP COLUMN `psy`,\r\n      DROP COLUMN `ortho`,\r\n      DROP COLUMN `social`,\r\n      DROP COLUMN `diet`,\r\n      DROP COLUMN `apa`;";
     $this->addQuery($query);
     $query = "ALTER TABLE `bilan_ssr` \r\n      ADD INDEX (`kine_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.11");
     $query = "ALTER TABLE `ligne_activites_rhs` \r\n      CHANGE `code_activite_cdarr` `code_activite_cdarr` CHAR (4) NOT NULL,\r\n      CHANGE `qty_mon` `qty_mon` TINYINT (4) UNSIGNED DEFAULT '0',\r\n      CHANGE `qty_tue` `qty_tue` TINYINT (4) UNSIGNED DEFAULT '0',\r\n      CHANGE `qty_wed` `qty_wed` TINYINT (4) UNSIGNED DEFAULT '0',\r\n      CHANGE `qty_thu` `qty_thu` TINYINT (4) UNSIGNED DEFAULT '0',\r\n      CHANGE `qty_fri` `qty_fri` TINYINT (4) UNSIGNED DEFAULT '0',\r\n      CHANGE `qty_sat` `qty_sat` TINYINT (4) UNSIGNED DEFAULT '0',\r\n      CHANGE `qty_sun` `qty_sun` TINYINT (4) UNSIGNED DEFAULT '0';";
     $this->addQuery($query);
     $this->makeRevision("0.12");
     $query = "CREATE TABLE `element_prescription_to_cdarr` (\r\n      `element_prescription_to_cdarr_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `element_prescription_id` INT (11) UNSIGNED NOT NULL,\r\n      `code` CHAR (4) NOT NULL,\r\n      `commentaire` VARCHAR (255)\r\n    ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `element_prescription_to_cdarr` \r\n      ADD INDEX (`element_prescription_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.13");
     $query = "CREATE TABLE `evenement_ssr` (\r\n      `evenement_ssr_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `element_prescription_id` INT (11) UNSIGNED NOT NULL,\r\n      `code` CHAR (4) NOT NULL,\r\n      `sejour_id` INT (11) UNSIGNED NOT NULL,\r\n      `debut` DATETIME NOT NULL,\r\n      `duree` INT (11) UNSIGNED NOT NULL,\r\n      `therapeute_id` INT (11) UNSIGNED NOT NULL,\r\n      `realise` ENUM ('0','1') DEFAULT '0'\r\n    ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `evenement_ssr` \r\n      ADD INDEX (`element_prescription_id`),\r\n      ADD INDEX (`sejour_id`),\r\n      ADD INDEX (`debut`),\r\n      ADD INDEX (`therapeute_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.14");
     $query = "ALTER TABLE `evenement_ssr` \r\n      ADD `equipement_id` INT (11) UNSIGNED;";
     $this->addQuery($query);
     $query = "ALTER TABLE `evenement_ssr` \r\n      ADD INDEX (`equipement_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.15");
     $query = "ALTER TABLE `bilan_ssr` \r\n      ADD `technicien_id` INT (11) UNSIGNED;";
     $this->addQuery($query);
     $query = "ALTER TABLE `bilan_ssr` \r\n      ADD INDEX (`technicien_id`);";
     $this->addQuery($query);
     $query = "UPDATE `bilan_ssr`\r\n      SET technicien_id = \r\n        (SELECT technicien_id \r\n        FROM technicien\r\n        WHERE kine_id = bilan_ssr.kine_id\r\n        LIMIT 1);";
     $this->addQuery($query);
     $query = "ALTER TABLE `bilan_ssr` \r\n      DROP kine_id";
     $this->addQuery($query);
     $this->makeRevision("0.16");
     $query = "CREATE TABLE `acte_cdarr` (\r\n      `acte_cdarr_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `evenement_ssr_id` INT (11) UNSIGNED NOT NULL,\r\n      `code` CHAR (4) NOT NULL\r\n    ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `acte_cdarr` \r\n      ADD INDEX (`evenement_ssr_id`);";
     $this->addQuery($query);
     $query = "INSERT INTO `acte_cdarr` (`evenement_ssr_id`,`code`)\r\n      SELECT `evenement_ssr_id`,`code`\r\n      FROM evenement_ssr";
     $this->addQuery($query);
     $query = "ALTER TABLE `evenement_ssr` \r\n      DROP `code`;";
     $this->addQuery($query);
     $this->makeRevision("0.17");
     $query = "ALTER TABLE `evenement_ssr` \r\n      ADD `remarque` VARCHAR (255);";
     $this->addQuery($query);
     $this->makeRevision("0.18");
     $query = "ALTER TABLE `bilan_ssr` \r\n      ADD `brancardage` ENUM ('0','1') DEFAULT '0';";
     $this->addQuery($query);
     $this->makeRevision("0.19");
     $query = "CREATE TABLE `replacement` (\r\n      `replacement_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `sejour_id` INT (11) UNSIGNED NOT NULL,\r\n      `conge_id` INT (11) UNSIGNED NOT NULL,\r\n      `replacer_id` INT (11) UNSIGNED NOT NULL\r\n    ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `replacement` \r\n      ADD INDEX (`sejour_id`),\r\n      ADD INDEX (`conge_id`),\r\n      ADD INDEX (`replacer_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.20");
     $query = "ALTER TABLE `fiche_autonomie` \r\n      ADD `toilettes` ENUM ('autonome','partielle','totale') NOT NULL";
     $this->addQuery($query);
     $this->makeRevision("0.21");
     $query = "ALTER TABLE `fiche_autonomie` \r\n      ADD `antecedents` TEXT,\r\n      ADD `traitements` TEXT;";
     $this->addQuery($query);
     $this->makeRevision("0.22");
     $query = "ALTER TABLE `evenement_ssr` \r\n              ADD `prescription_line_element_id` INT (11) UNSIGNED NOT NULL";
     $this->addQuery($query);
     if (CModule::getInstalled("dPprescription")) {
         $query = "UPDATE `evenement_ssr`\r\n        SET `prescription_line_element_id` = (\r\n          SELECT `prescription_line_element_id`\r\n          FROM `prescription_line_element`\r\n          LEFT JOIN `prescription` ON `prescription_line_element`.`prescription_id` = `prescription`.`prescription_id`\r\n          WHERE `prescription`.`type` = 'sejour'\r\n          AND `prescription`.`object_id` = `evenement_ssr`.`sejour_id`\r\n          AND `prescription_line_element`.`element_prescription_id` = `evenement_ssr`.`element_prescription_id`\r\n        );";
         $this->addQuery($query);
     }
     $query = "ALTER TABLE `evenement_ssr` \r\n      DROP `element_prescription_id`";
     $this->addQuery($query);
     $this->makeRevision("0.23");
     $query = "ALTER TABLE `bilan_ssr` \r\n      ADD `planification` ENUM ('0','1') DEFAULT '1';";
     $this->addQuery($query);
     $this->makeRevision("0.24");
     $query = "ALTER TABLE `evenement_ssr` \r\n      CHANGE `sejour_id` `sejour_id` INT (11) UNSIGNED,\r\n      ADD `seance_collective_id` INT (11) UNSIGNED;";
     $this->addQuery($query);
     $query = "ALTER TABLE `evenement_ssr` \r\n      ADD INDEX (`prescription_line_element_id`),\r\n      ADD INDEX (`seance_collective_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.25");
     $query = "ALTER TABLE `evenement_ssr` \r\n      CHANGE `prescription_line_element_id` `prescription_line_element_id` INT (11) UNSIGNED,\r\n      CHANGE `debut` `debut` DATETIME,\r\n      CHANGE `duree` `duree` INT (11) UNSIGNED,\r\n      CHANGE `therapeute_id` `therapeute_id` INT (11) UNSIGNED,\r\n      CHANGE `realise` `realise` ENUM ('0','1') DEFAULT '0';";
     $this->addQuery($query);
     $this->makeRevision("0.26");
     $this->addPrefQuery("ssr_planning_dragndrop", "0");
     $this->addPrefQuery("ssr_planning_resize", "0");
     $this->makeRevision("0.27");
     $query = "ALTER TABLE `equipement` \r\n      ADD `visualisable` ENUM ('0','1') NOT NULL DEFAULT '1';";
     $this->addQuery($query);
     $this->makeRevision("0.28");
     $this->addPrefQuery("ssr_planification_show_equipement", "1");
     $this->addPrefQuery("ssr_planification_duree", "30");
     $this->makeRevision("0.29");
     $query = "ALTER TABLE `rhs` \r\n      ADD `facture` ENUM ('0','1') DEFAULT '0';";
     $this->addQuery($query);
     $this->makeRevision("0.30");
     $query = "ALTER TABLE `evenement_ssr` \r\n      ADD `annule` ENUM ('0','1') DEFAULT '0';";
     $this->addQuery($query);
     $this->makeRevision("0.31");
     $query = "ALTER TABLE `technicien` \r\n      ADD `actif` ENUM ('0','1') DEFAULT '1';";
     $this->addQuery($query);
     $query = "ALTER TABLE `equipement` \r\n      ADD `actif` ENUM ('0','1') DEFAULT '1';";
     $this->addQuery($query);
     $this->makeRevision("0.32");
     $query = "ALTER TABLE `replacement` \r\n      ADD `deb` DATE,\r\n      ADD `fin` DATE;";
     $this->addQuery($query);
     $query = "ALTER TABLE `replacement` \r\n      ADD INDEX (`deb`),\r\n      ADD INDEX (`fin`);";
     $this->addQuery($query);
     $this->makeRevision("0.33");
     $query = "ALTER TABLE `plateau_technique`\r\n      ADD `repartition` ENUM ('0','1') DEFAULT '1';";
     $this->addQuery($query);
     $this->makeRevision("0.34");
     $query = "ALTER TABLE `bilan_ssr`\r\n      ADD `hospit_de_jour` ENUM ('0','1') DEFAULT '0',\r\n      ADD `demi_journee_1` ENUM ('0','1') DEFAULT '0',\r\n      ADD `demi_journee_2` ENUM ('0','1') DEFAULT '0';";
     $this->addQuery($query);
     $this->makeRevision("0.35");
     $query = "ALTER TABLE `replacement`\r\n      ADD UNIQUE INDEX replacement (sejour_id, conge_id)";
     $this->addQuery($query);
     $this->makeRevision("0.36");
     $query = "ALTER TABLE `ligne_activites_rhs` \r\n      ADD `auto` ENUM ('0','1') DEFAULT '0'";
     $this->addQuery($query);
     $this->makeRevision("0.37");
     $query = "ALTER TABLE `ligne_activites_rhs` \r\n      ADD UNIQUE ligne (rhs_id, executant_id, code_activite_cdarr)";
     $this->addQuery($query);
     $this->makeRevision("0.38");
     $query = "ALTER TABLE `acte_cdarr` \r\n      ADD `administration_id` INT (11) UNSIGNED,\r\n      CHANGE `evenement_ssr_id` `evenement_ssr_id` INT (11) UNSIGNED;";
     $this->addQuery($query);
     $this->makeRevision("0.39");
     $query = "ALTER TABLE `acte_cdarr` ADD INDEX (`administration_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.40");
     $query = "ALTER TABLE `acte_cdarr` ADD `sejour_id` INT (11) UNSIGNED;";
     $this->addQuery($query);
     $query = "ALTER TABLE `acte_cdarr` ADD INDEX (`sejour_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.41");
     if (CAppUI::conf("ssr recusation use_recuse") == 0) {
         $query = "UPDATE `sejour`\r\n        SET `sejour`.`recuse` = '0'\r\n        WHERE `sejour`.`type` = 'ssr'";
         $this->addQuery($query);
     }
     $this->makeRevision("0.42");
     $query = "CREATE TABLE `element_prescription_to_csarr` (\r\n      `element_prescription_to_csarr_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `element_prescription_id` INT (11) UNSIGNED NOT NULL DEFAULT '0',\r\n      `code` CHAR (7) NOT NULL,\r\n      `commentaire` VARCHAR (255)\r\n    )/*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `element_prescription_to_csarr` ADD INDEX (`element_prescription_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.43");
     $query = "CREATE TABLE `acte_csarr` (\r\n      `acte_csarr_id` INT (11) UNSIGNED NOT NULL auto_increment PRIMARY KEY,\r\n      `evenement_ssr_id` INT (11) UNSIGNED,\r\n      `administration_id` INT (11) UNSIGNED,\r\n      `sejour_id` INT (11) UNSIGNED,\r\n      `code` CHAR (7) NOT NULL\r\n    )/*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $query = "ALTER TABLE `acte_csarr` \r\n      ADD INDEX (`evenement_ssr_id`),\r\n      ADD INDEX (`administration_id`),\r\n      ADD INDEX (`sejour_id`);";
     $this->addQuery($query);
     $this->makeRevision("0.44");
     if (!CAppUI::conf("ssr recusation use_recuse")) {
         $query = "UPDATE `sejour`\r\n        SET `sejour`.`recuse` = '0'\r\n        WHERE `sejour`.`type` = 'ssr'";
         $this->addQuery($query);
     }
     $this->makeRevision("0.45");
     $query = "ALTER TABLE `ligne_activites_rhs` \r\n      CHANGE `rhs_id` `rhs_id` INT (11) UNSIGNED NOT NULL DEFAULT '0',\r\n      CHANGE `executant_id` `executant_id` INT (11) UNSIGNED NOT NULL DEFAULT '0',\r\n      CHANGE `code_activite_cdarr` `code_activite_cdarr` CHAR (4),\r\n      ADD `code_activite_csarr` CHAR (7);";
     $this->addQuery($query);
     $this->makeRevision("0.46");
     $query = "ALTER TABLE `acte_csarr`\r\n      ADD `modulateurs` VARCHAR (20),\r\n      ADD `phases` VARCHAR (3);";
     $this->addQuery($query);
     $this->makeRevision("0.47");
     $query = "ALTER TABLE `evenement_ssr`\r\n                ADD `type_seance` ENUM ('dediee','non_dediee','collective') DEFAULT 'dediee';";
     $this->addQuery($query);
     $query = "UPDATE `evenement_ssr`\r\n        SET `evenement_ssr`.`type_seance` = 'non_dediee'\r\n        WHERE `evenement_ssr`.`equipement_id` IS NOT NULL";
     $this->addQuery($query);
     $query = "UPDATE `evenement_ssr`\r\n        SET `evenement_ssr`.`type_seance` = 'collective'\r\n        WHERE  `evenement_ssr`.`seance_collective_id` IS NOT NULL";
     $this->addQuery($query);
     $query = "UPDATE `evenement_ssr` e\r\n        INNER JOIN `evenement_ssr` s ON s.`seance_collective_id` = e.`evenement_ssr_id`\r\n        SET e.`type_seance` = 'collective'\r\n        WHERE e.`seance_collective_id` IS NULL\r\n        AND s.`type_seance` = 'collective'";
     $this->addQuery($query);
     $this->makeRevision("0.48");
     $query = "ALTER TABLE `evenement_ssr`\r\n                ADD `nb_patient_seance` INT (11);";
     $this->addQuery($query);
     $this->makeRevision("0.49");
     $query = "ALTER TABLE `ligne_activites_rhs`\r\n                ADD `modulateurs` VARCHAR (20),\r\n                ADD `phases` VARCHAR (3),\r\n                ADD `nb_patient_seance` INT (11);";
     $this->addQuery($query);
     $this->makeRevision("0.50");
     $query = "ALTER TABLE `evenement_ssr`\r\n                CHANGE `type_seance` `type_seance` ENUM ('dediee','non_dediee','collective') DEFAULT 'dediee';";
     $this->addQuery($query);
     $query = "UPDATE `evenement_ssr`\r\n        SET `evenement_ssr`.`type_seance` = 'dediee'\r\n        WHERE  `evenement_ssr`.`type_seance` IS NULL";
     $this->addQuery($query);
     $this->makeRevision("0.51");
     $query = "ALTER TABLE `evenement_ssr`\r\n                ADD `nb_intervenant_seance` INT (11);";
     $this->addQuery($query);
     $query = "ALTER TABLE `ligne_activites_rhs`\r\n                ADD `nb_intervenant_seance` INT (11);";
     $this->addQuery($query);
     $query = "ALTER TABLE `acte_csarr`\r\n                ADD `commentaire` TEXT;";
     $this->addQuery($query);
     $this->mod_version = "0.52";
     // Data source query
     $query = "SHOW TABLES LIKE 'type_activite'";
     $this->addDatasource("cdarr", $query);
     $query = "SELECT * FROM `activite` WHERE `code` = 'AGR+102'";
     $this->addDatasource("csarr", $query);
 }
Exemple #18
0
 * $Id: index.php 28582 2015-06-11 09:58:14Z flaviencrochard $
 *
 * @package    Mediboard
 * @subpackage Hospi
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 28582 $
 */
$module = CModule::getInstalled(basename(dirname(__FILE__)));
$module->registerTab("vw_placements", TAB_READ);
$module->registerTab("edit_sorties", TAB_READ);
$module->registerTab("vw_recherche", TAB_READ);
$module->registerTab("vw_suivi_bloc", TAB_READ);
$module->registerTab("form_print_planning", TAB_READ);
if (CAppUI::conf("dPhospi pathologies") || CAppUI::$user->isAdmin()) {
    $module->registerTab("vw_idx_pathologies", TAB_READ);
}
$module->registerTab("vw_idx_infrastructure", TAB_ADMIN);
$module->registerTab("vw_stats", CAppUI::conf("dPhospi stats_for_all") ? TAB_EDIT : TAB_ADMIN);
if (CAppUI::conf("dPhospi prestations systeme_prestations", CGroups::loadCurrent()) == "standard") {
    $module->registerTab("vw_prestations_standard", TAB_ADMIN);
} else {
    $module->registerTab("vw_prestations", TAB_ADMIN);
}
$module->registerTab("vw_etiquettes", TAB_ADMIN);
if (CModule::getInstalled("printing")) {
    $module->registerTab("vw_printers", TAB_READ);
}
if (CAppUI::conf("dPhospi use_vue_topologique")) {
    $module->registerTab("vw_plan_etage", TAB_READ);
}
        $from = CMbDT::date("-1 DAY", $next);
        break;
    case "month":
        $from = CMbDT::date("-1 MONTH", $next);
        break;
    case "year":
        $from = CMbDT::date("-6 MONTH", $next);
        break;
}
$graphs = array();
if ($groupres == 1) {
    if ($element != "_average_duration" && $element != "_average_request" && $element != "_average_nb_requests") {
        $graphs[] = graphRessourceLog('modules', $date, $element, $interval, $numelem);
    }
    $graphs[] = graphRessourceLog('total', $date, $element, $interval, $numelem);
} else {
    $logs = CAccessLog::loadAggregation($from, $next, $groupres + 1, 0);
    foreach ($logs as $log) {
        $graphs[] = graphRessourceLog($log->_module, $date, $element, $interval, $numelem);
    }
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("graphs", $graphs);
$smarty->assign("date", $date);
$smarty->assign("groupres", $groupres);
$smarty->assign("element", $element);
$smarty->assign("interval", $interval);
$smarty->assign("numelem", $numelem);
$smarty->assign("listModules", CModule::getInstalled());
$smarty->display("view_ressources_logs.tpl");
Exemple #20
0
 function loadRefsPrescriptions($perm = null)
 {
     if (CModule::getInstalled("dPlabo")) {
         $prescription = new CPrescriptionLabo();
         $where = array("patient_id" => "= '{$this->_id}'");
         $order = "date DESC";
         $this->_ref_prescriptions = $prescription->loadListWithPerms($perm, $where, $order);
     }
 }
 /**
  * True if the module is installed
  * Example:  {"dPfiles"|module_installed}
  *
  * @param string $module The module name
  *
  * @return CModule The module object if installed, null otherwise
  */
 function module_installed($module)
 {
     return CModule::getInstalled($module);
 }
$op->loadRefChir4();
if (!$op->_id) {
    $op->_time_op = $op->temp_operation = "00:00:00";
    if ($hour_urgence && $min_urgence) {
        $time = "{$hour_urgence}:{$min_urgence}:00";
    } else {
        $time = str_pad($hours_urgence["deb"], 2, "0", STR_PAD_LEFT) . ":00:00";
    }
    $op->_time_urgence = $op->time_operation = $time;
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("sejours_collision", $patient->getSejoursCollisions());
$smarty->assign("isPrescriptionInstalled", CModule::getActive("dPprescription"));
$smarty->assign("canSante400", CModule::getCanDo("dPsante400"));
$smarty->assign("urgInstalled", CModule::getInstalled("dPurgences"));
$smarty->assign("heure_sortie_ambu", $heure_sortie_ambu);
$smarty->assign("heure_sortie_autre", $heure_sortie_autre);
$smarty->assign("heure_entree_veille", $heure_entree_veille);
$smarty->assign("heure_entree_jour", $heure_entree_jour);
$smarty->assign("op", $op);
$smarty->assign("plage", $op->plageop_id ? $op->_ref_plageop : new CPlageOp());
$smarty->assign("sejour", $sejour);
$smarty->assign("chir", $chir);
$smarty->assign("praticien", $prat);
$smarty->assign("patient", $patient);
$smarty->assign("sejours", $sejours);
$smarty->assign("ufs", CUniteFonctionnelle::getUFs());
$smarty->assign("_functions", $_functions);
$smarty->assign("modurgence", 1);
$smarty->assign("date_min", CMbDT::date());
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage developpement
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$locales = CAppUI::flattenCachedLocales(CAppUI::$lang);
$tabs = array();
foreach ($modules = CModule::getInstalled() as $module) {
    CAppUI::requireModuleFile($module->mod_name, "index");
    if (is_array($module->_tabs)) {
        foreach ($module->_tabs as $tab) {
            $tabs[$tab]["name"] = "mod-{$module->mod_name}-tab-{$tab}";
            $tabs[$tab]["locale"] = CValue::read($locales, $tabs[$tab]["name"]);
        }
    }
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("module", $modules);
$smarty->assign("tabs", $tabs);
$smarty->display("mnt_module_actions.tpl");
Exemple #24
0
<?php

/**
 * $Id: index.php 28574 2015-06-11 08:24:59Z aurelie17 $
 *
 * @package    Mediboard
 * @subpackage dPfacturation
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 * @version    $Revision: 28574 $
 */
$module = CModule::getInstalled(basename(dirname(__FILE__)));
if (CAppUI::conf("dPfacturation CFactureCabinet view_bill")) {
    $module->registerTab("vw_factures_cabinet", TAB_READ);
}
if (CAppUI::conf("dPfacturation CFactureEtablissement view_bill")) {
    $module->registerTab("vw_factures_etab", TAB_READ);
}
$module->registerTab("vw_compta", TAB_READ);
if (CAppUI::conf("dPfacturation Other use_view_chainage")) {
    $module->registerTab("vw_edit_tarifs", TAB_READ);
}
if (CAppUI::conf("dPfacturation CRetrocession use_retrocessions")) {
    $module->registerTab("vw_retrocessions", TAB_READ);
    $module->registerTab("vw_retrocession_regles", TAB_ADMIN);
}
if (CAppUI::conf("dPfacturation CReglement use_debiteur")) {
    $module->registerTab("vw_debiteurs", TAB_READ);
}
if (CAppUI::conf("ref_pays") == "2" && CAppUI::conf("dPfacturation Other see_reject_xml", CGroups::loadCurrent())) {
    $module->registerTab("vw_rejects_xml", TAB_READ);
$patient_ville = CValue::get("ville");
$patient_cp = CValue::get("cp");
$patient_day = CValue::getOrSession("Date_Day");
$patient_month = CValue::getOrSession("Date_Month");
$patient_year = CValue::getOrSession("Date_Year");
$patient_naissance = null;
$patient_ipp = CValue::get("patient_ipp");
$patient_nda = CValue::get("patient_nda");
$useVitale = CValue::get("useVitale", CModule::getActive("fse") && CAppUI::pref('LogicielLectureVitale') != 'none' ? 1 : 0);
$prat_id = CValue::get("prat_id");
$patient_sexe = CValue::get("sexe");
$useCovercard = CValue::get("usecovercard", CModule::getActive("fse") && CModule::getActive("covercard") ? 1 : 0);
$patient_nom_search = null;
$patient_prenom_search = null;
$patVitale = new CPatient();
if ($patient_ipp && CModule::getInstalled("dPsante400")) {
    // Recherche par IPP
    // Initialisation dans le cas d'une recherche par IPP
    $patients = array();
    $patientsLimited = array();
    $patientsSoundex = array();
    $patientsCount = 0;
    $patientsSoundexCount = 0;
    $patient = new CPatient();
    $patient->_IPP = $patient_ipp;
    $patient->loadFromIPP();
    if ($patient->_id) {
        CValue::setSession("patient_id", $patient->_id);
        $patients[$patient->_id] = $patient;
    }
} else {