Skip to content

Commit

Permalink
gestion des agendas
Browse files Browse the repository at this point in the history
  • Loading branch information
MedShake committed Aug 11, 2017
1 parent 3e552e3 commit 79a28a0
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 16 deletions.
2 changes: 2 additions & 0 deletions config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ sqlVarPassword: '4fd45sf78s8'
administratifSecteurHonoraires: 1
administratifPeutAvoirFacturesTypes: 'false'
administratifPeutAvoirPrescriptionsTypes: 'false'
administratifPeutAvoirAgenda: 'false'

#######################################
## templates impression
Expand Down Expand Up @@ -122,6 +123,7 @@ dicomDiscoverNewTags: 'true'
agendaDistantLink: 'http://monagenda.agenda.abc'
agendaDistantPatientsOfTheDay: 'http://monagenda.agenda.abc/patientsOfTheDay.json'
agendaLocalPatientsOfTheDay: 'patientsOfTheDay.json'
agendaNumberForPatientsOfTheDay: 0

#######################################
## Rappels RDV par mail
Expand Down
8 changes: 8 additions & 0 deletions config/routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ userLogOutDo: ['GET', '/login/logOutDo/', 'login/logOutDo']
ajaxGetAutocompleteFormValues: ['GET|POST', '/ajax/[a:m]/[:dataset]/[i:type]?/[:setTypes]?/[:linkedTypes]?/', 'actions/ajax']
ajaxGeneral: ['GET|POST', '/ajax/[a:m]/', 'actions/ajax']

#agenda
agendaAjax: ['GET|POST', '/agenda/[i:userID]/ajax/[a:m]/', 'agenda/actions/agendaAjax']
agenda: ['GET', '/agenda/[i:userID]/', 'agenda/agenda']
agendaPatientsOfTheDay: ['GET', '/agenda/[i:userID]/patientsOfTheDay/', 'agenda/agendaPatientsOfTheDay']

#chercher patients / pros
patientsAjax: ['GET|POST', '/[patient|pro:porp]s/ajax/[a:m]/', 'rechercher/actions/patientsAjax']
patients: ['GET', '/[patient|pro:porp]s/', 'rechercher/patients']
Expand Down Expand Up @@ -111,6 +116,9 @@ configActesFsePyx: ['GET', '/configuration/actes-fsepyx/[i:id]/', 'configuration
configDicomTags: ['GET', '/configuration/tags-dicom/', 'configuration/configDicomTags']
configLicence: ['GET', '/licence/', 'configuration/configLicence']

# Configuration Agenda
configAgenda: ['GET', '/configuration/agenda/[i:userID]?/', 'configuration/configAgenda']

# Configuration forms
configForms: ['GET', '/configuration/forms/', 'configuration/configForms']
configFormsCat: ['GET', '/configuration/forms/cat/', 'configuration/configFormsCat']
Expand Down
7 changes: 6 additions & 1 deletion controlers/configuration/actions/configActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
'configFormEdit', // Edition du formulaire
'configUpdatePassword', //Attribuer un password à un user
'configSpecificUserParam', //Attribuer une config spécifique à un utilisateur
'configGiveAdmin' // Toggle droit d'admin
'configGiveAdmin', // Toggle droit d'admin
'configAgendaSave' // sauvegarder config agenda
);

if (!in_array($m, $acceptedModes)) {
Expand All @@ -59,3 +60,7 @@
elseif ($m=='configGiveAdmin') {
include('inc-action-configGiveAdmin.php');
}
// sauvegarder config agenda
elseif ($m=='configAgendaSave') {
include('inc-action-configAgendaSave.php');
}
10 changes: 10 additions & 0 deletions controlers/configuration/configCheckDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,14 @@
$p['page']['check']['cheminFichierC']['is_dir']=false;
$p['page']['check']['cheminFichierC']['is_writable']=false;
}
//repertoire crypte apicrypt
if (is_dir($p['config']['webDirectory'].'agendasConfigurations/')) {
$p['page']['check']['agendasConfigurations']['is_dir']=true;
if (is_writable($p['config']['webDirectory'].'agendasConfigurations/')) {
$p['page']['check']['agendasConfigurations']['is_writable']=true;
}
} else {
$p['page']['check']['agendasConfigurations']['is_dir']=false;
$p['page']['check']['agendasConfigurations']['is_writable']=false;
}
}
10 changes: 0 additions & 10 deletions controlers/configuration/configDataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@
$catRestriction=null;
}

// liste des types par catégorie
// if ($tabTypes=msSQL::sql2tab("select t.*, c.name as catName, c.label as catLabel, count(d.typeID) as enfants
// from data_types as t
// left join data_cat as c on c.id=t.cat
// left join objets_data as d on d.typeID=t.id
// where t.id > 0 and t.groupe='".$p['page']['groupe']."' ".$catRestriction."
// group by t.id
// order by c.label asc, t.label asc")) {



if ($tabTypes=msSQL::sql2tab("select t.*, c.name as catName, c.label as catLabel,
(select count(id) from objets_data as d where d.typeID=t.id ) as enfants
Expand Down
11 changes: 10 additions & 1 deletion controlers/configuration/configLicence.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,16 @@
'description'=>'A popular general-purpose scripting language',
'url'=>'http://php.net/'
);

$p['page']['thanks'][
'FullCalendar']=array(
'description'=>'A JavaScript event calendar. Customizable and open source',
'url'=>'https://fullcalendar.io/'
);
$p['page']['thanks'][
'jQuery contextMenu']=array(
'description'=>'jQuery contextMenu plugin & polyfill',
'url'=>'https://github.com/swisnl/jQuery-contextMenu'
);


uksort($p['page']['thanks'], 'strcasecmp');
9 changes: 8 additions & 1 deletion controlers/configuration/configSpecificUserParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@

$p['page']['userData']=$data->getSimpleAdminDatas();

$p['page']['userParams']=$data->getPeopleDataFromDataTypeGroupe('user', ['dt.*', 'od.value as userVal']);
if($data=$data->getPeopleDataFromDataTypeGroupe('user', ['dt.*', 'od.value as userVal'])) {
foreach($data as $v) {
$p['page']['userParams'][$v['cat']][]=$v;
}
}

$p['page']['configDefaut']=Spyc::YAMLLoad('../config/config.yml');

// liste des catégories
if ($p['page']['catList']=msSQL::sql2tabKey("select id, label from data_cat where groupe='user' order by label", 'id', 'label'));
}
17 changes: 17 additions & 0 deletions medshakeEHR-base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ CREATE TABLE `actes_cat` (
`displayOrder` smallint(3) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `agenda` (
`id` int(12) UNSIGNED NOT NULL,
`userid` smallint(5) UNSIGNED NOT NULL DEFAULT '3',
`start` datetime DEFAULT NULL,
`end` datetime DEFAULT NULL,
`type` varchar(10) DEFAULT NULL,
`dateAdd` datetime DEFAULT NULL,
`patientid` mediumint(6) UNSIGNED DEFAULT NULL,
`statut` enum('actif','deleted') DEFAULT 'actif',
`absente` enum('non','oui') DEFAULT 'non',
`motif` text
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `data_cat` (
`id` smallint(5) NOT NULL,
`groupe` enum('admin','medical','typecs','mail','doc','courrier','ordo','reglement','dicom','user','relation') NOT NULL DEFAULT 'admin',
Expand Down Expand Up @@ -237,6 +250,10 @@ ALTER TABLE `data_cat`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `name` (`name`);

ALTER TABLE `agenda`
ADD PRIMARY KEY (`id`,`userid`) USING BTREE,
ADD KEY `patientid` (`patientid`);

ALTER TABLE `data_types`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `name` (`name`),
Expand Down
6 changes: 4 additions & 2 deletions public_html/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"Bertrand Boutillier"
],
"license": "GNU GPL",
"homepage": "https://www.medshake.net",
"homepage": "http://www.medshake.net",
"private": true,
"ignore": [
"**/.*",
Expand All @@ -24,6 +24,8 @@
"tinymce": "^4.5.7",
"jquery": "^3.2.1",
"uploader": "https://github.com/danielm/uploader.git",
"jSignature": "^2.1.1"
"jSignature": "^2.1.1",
"fullcalendar": "^3.4.0",
"jQuery-contextMenu": "^2.5.0"
}
}
15 changes: 14 additions & 1 deletion public_html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,27 @@
$p['page']['inbox']['numberOfMsg']=msSQL::sqlUniqueChamp("select count(txtFileName) from inbox where archived='n' and mailForUserID = '".$p['config']['apicryptInboxMailForUserID']."' ");

// patients of the day
$p['page']['patientsOfTheDay']=msExternalData::jsonFileToPhpArray($p['config']['workingDirectory'].$p['config']['agendaLocalPatientsOfTheDay']);
if(isset($p['config']['agendaNumberForPatientsOfTheDay'])) {
if($p['config']['agendaNumberForPatientsOfTheDay'] > 0) {
$events = new msAgenda();
$events->set_userID($p['config']['agendaNumberForPatientsOfTheDay']);
$p['page']['patientsOfTheDay']=$events->getPatientsOfTheDay();
}
}
if(!isset($p['page']['patientsOfTheDay']) and isset($p['config']['agendaLocalPatientsOfTheDay'])) {
$p['page']['patientsOfTheDay']=msExternalData::jsonFileToPhpArray($p['config']['workingDirectory'].$p['config']['agendaLocalPatientsOfTheDay']);
}
}

// crédits SMS
if(is_file($p['config']['workingDirectory'].$p['config']['smsCreditsFile'])) {
$p['page']['creditsSMS']=file_get_contents($p['config']['workingDirectory'].$p['config']['smsCreditsFile']);
}

//utilisateurs pouvant avoir un agenda
$agendaUsers= new msPeople();
$p['page']['agendaUsers']=$agendaUsers->getUsersListForService('administratifPeutAvoirAgenda');

header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

Expand Down
19 changes: 19 additions & 0 deletions sqlUpgrade.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
-- Modifications de structure de la bdd d'une version à la suivante

-- 1.1.0 to

CREATE TABLE `agenda` (
`id` int(12) UNSIGNED NOT NULL,
`userid` smallint(5) UNSIGNED NOT NULL DEFAULT '3',
`start` datetime DEFAULT NULL,
`end` datetime DEFAULT NULL,
`type` varchar(10) DEFAULT NULL,
`dateAdd` datetime DEFAULT NULL,
`patientid` mediumint(6) UNSIGNED DEFAULT NULL,
`statut` enum('actif','deleted') DEFAULT 'actif',
`absente` enum('non','oui') DEFAULT 'non',
`motif` text
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

ALTER TABLE `agenda`
ADD PRIMARY KEY (`id`,`userid`) USING BTREE,
ADD KEY `patientid` (`patientid`);

-- 1.0.1 to 1.1.0
ALTER TABLE inbox ADD COLUMN mailHeaderInfos blob AFTER txtFileName;

0 comments on commit 79a28a0

Please sign in to comment.