Skip to content

Commit

Permalink
Merge branch 'master' into indelog-fix-link-external-patient
Browse files Browse the repository at this point in the history
  • Loading branch information
MedShake committed Aug 27, 2022
2 parents 2945540 + 893962b commit 5e26162
Show file tree
Hide file tree
Showing 41 changed files with 259 additions and 321 deletions.
4 changes: 4 additions & 0 deletions Makefile
@@ -1,5 +1,9 @@
default:
rm -f MedShakeEHR-base.zip SHA256SUMS
zip -r MedShakeEHR-base.zip . -x .git\* -x Makefile -x installer\*
sha256sum -b MedShakeEHR-base.zip > preSHA256SUMS
head -c 64 preSHA256SUMS > SHA256SUMS
rm -f preSHA256SUMS

clean:
rm -f MedShakeEHR-base.zip
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -4,6 +4,11 @@ Consultez [www.logiciel-cabinet-medical.fr](http://www.logiciel-cabinet-medical.
Un [groupe de discussion](https://groups.google.com/forum/#!forum/medshakeehr) est disponible pour les questions techniques.

# MedShakeEHR-base
[![latest medshakeehr-osteo tag][latest-tag]][latest-link]

[latest-tag]: https://img.shields.io/github/v/release/MedShake/MedshakeEHR-base?display_name=tag&label=version
[latest-link]: https://github.com/MedShake/MedShakeEHR-base/releases/latest

Base pour MedShakeEHR, logiciel modulaire, universel, open source pour les praticiens santé.

## Avertissements
Expand Down
1 change: 1 addition & 0 deletions SHA256SUMS
@@ -0,0 +1 @@
b6e8699a99338e00d0bbaaf4410b530d81c6688e04a333b819fceada128f40ce
2 changes: 1 addition & 1 deletion Vagrantfile
Expand Up @@ -20,7 +20,7 @@
# @author Michaël Val

Vagrant.configure("2") do |config|
config.vm.box = "debian/buster64"
config.vm.box = "debian/bullseye64"

# Pour personnaliser sa clef ssh
#config.ssh.insert_key = false
Expand Down
13 changes: 5 additions & 8 deletions class/msClicRDV.php
Expand Up @@ -91,10 +91,7 @@ public function getInterventions($group='',$cal='') {
}

private function _getUserParams() {
return msSQL::sql2tabKey("SELECT dt.name,od.value
FROM data_types AS dt left join objets_data AS od
ON od.typeID=dt.id AND od.toID='".$this->_userID."' AND od.outdated='' AND od.deleted=''
WHERE dt.groupe='user'", 'name', 'value');
return msConfiguration::getCatParametersForUser('clicRDV', array('id'=>$this->_userID,'module'=>''));
}

//liste des patients qui ont un id clic connu
Expand Down Expand Up @@ -134,7 +131,7 @@ private function _getRelatedPatients() {
*/
public function sendEvent($event) {
try {
$params=$this->_getUserParams();
$params = msConfiguration::getCatParametersForUser('clicRDV', array('id'=>$this->_userID,'module'=>''));
if (!array_key_exists('clicRdvUserId', $params)) {
return false;
}
Expand Down Expand Up @@ -229,7 +226,7 @@ public function sendEvent($event) {
*/
public function modEvent($event) {
try {
$params=$this->_getUserParams();
$params = msConfiguration::getCatParametersForUser('clicRDV', array('id'=>$this->_userID,'module'=>''));
if (!array_key_exists('clicRdvUserId', $params)) {
return false;
}
Expand Down Expand Up @@ -268,7 +265,7 @@ public function modEvent($event) {
*/
public function delEvent($event) {
try {
$params=$this->_getUserParams();
$params = msConfiguration::getCatParametersForUser('clicRDV', array('id'=>$this->_userID,'module'=>''));
if (!array_key_exists('clicRdvUserId', $params)) {
return false;
}
Expand Down Expand Up @@ -301,7 +298,7 @@ public function delEvent($event) {

public function syncEvents() {
try {
$params=$this->_getUserParams();
$params = msConfiguration::getCatParametersForUser('clicRDV', array('id'=>$this->_userID,'module'=>''));
if (!array_key_exists('clicRdvUserId', $params) or !$params['clicRdvUserId']) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion class/msModBaseSqlGenerate.php
Expand Up @@ -140,7 +140,7 @@ class msModBaseSqlGenerate extends msSqlGenerate
'formFormulaireNouveauGroupe'=>'baseNewGroupe',
'droitDossierPeutVoirUniquementPatientsGroupes'=>'false',
'droitDossierPeutVoirUniquementPraticiensGroupes'=>'false',
'designTopMenuSections'=>"- agenda\n- patients\n- praticiens\n- groupes\n- registres\n- compta\n- inbox\n- dropbox\n- transmissions\n- outils",
'designTopMenuSections'=>"- agenda\n- podt\n- patients\n- praticiens\n- groupes\n- registres\n- compta\n- inbox\n- dropbox\n- transmissions\n- outils",
'optionGeActiverAgenda'=>'true',
'optionGeActiverCompta'=>'true',
'optionGeActiverInboxApicrypt'=>'true',
Expand Down
7 changes: 6 additions & 1 deletion class/msTools.php
Expand Up @@ -557,7 +557,12 @@ public static function genBareCodeFile($type, $code) {
return 0;
} else {
$generator = new Picqer\Barcode\BarcodeGeneratorSVG();
if (file_put_contents($barcodedir.'barecode-'.$type.'-'.$code.'.svg', $generator->getBarcode($code, $generator::TYPE_CODE_128))) {
$codebarre_svg = $generator->getBarcode($code, $generator::TYPE_CODE_128);
// Nétoie de deux première ligne du svg généré. Elles contiennent
// la version xml et le DOCTYPE ce qui gène quant on veut
// réinjecter le svg directement dans le html.
$codebarre_svg = implode(PHP_EOL, array_slice(explode(PHP_EOL, $codebarre_svg),2));
if (file_put_contents($barcodedir.'barecode-'.$type.'-'.$code.'.svg', $codebarre_svg)) {
return true;
} else {
throw new Exception('Echec de la création du fichier '.$barcodedir.'barecode-'.$type.'-'.$code.'.svg');
Expand Down
20 changes: 10 additions & 10 deletions class/msUser.php
Expand Up @@ -295,16 +295,16 @@ public function doLogin()
* Effectuer un logout
* @return void
*/
public static function doLogout()
{
global $p;
setcookie("userName", '', (time()-$p['config']['cookieDuree']), "/", $p['config']['cookieDomain']);
setcookie("apacheLogUserID", '', (time()-$p['config']['cookieDuree']), "/", $p['config']['cookieDomain']);
setcookie("userPass", '', (time()-$p['config']['cookieDuree']), "/", $p['config']['cookieDomain']);
setcookie("userIdPc", '', (time()-$p['config']['cookieDuree']), "/", $p['config']['cookieDomain']);
setcookie("userPassPc", '', (time()-$p['config']['cookieDuree']), "/", $p['config']['cookieDomain']);
unset($_SESSION);
}
public static function doLogout()
{
global $p;
setcookie("userName", '', (time()-5), "/", $p['config']['cookieDomain']);
setcookie("apacheLogUserID", '', (time()-5), "/", $p['config']['cookieDomain']);
setcookie("userPass", '', (time()-5), "/", $p['config']['cookieDomain']);
setcookie("userIdPc", '', (time()-5), "/", $p['config']['cookieDomain']);
setcookie("userPassPc", '', (time()-5), "/", $p['config']['cookieDomain']);
unset($_SESSION);
}

/**
* Mettre à jour la password d'un utilisateur
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Expand Up @@ -3,9 +3,9 @@
"twig/twig": "^3.0.3",
"altorouter/altorouter": "2.0.1",
"mustangostang/spyc": "0.6.3",
"wixel/gump": "1.5.7",
"dompdf/dompdf": "0.8.5",
"phpmailer/phpmailer": "6.1.6",
"wixel/gump": "1.12.2",
"dompdf/dompdf": "2.0.0",
"phpmailer/phpmailer": "6.5.1",
"atrapalo/urlcrypt": "1.0.1",
"webit/eval-math": "1.0.1",
"ovh/ovh": "v2.0.1",
Expand Down
111 changes: 0 additions & 111 deletions controlers/actions/inc-ajax-getBareCodeGenerator.php

This file was deleted.

30 changes: 24 additions & 6 deletions controlers/agenda/actions/inc-ajax-searchPatient.php
Expand Up @@ -30,12 +30,30 @@
$term = msSQL::cleanVar($_GET['term']);
$a_json = array();

$mss=new msPeopleSearch;
$mss->setNameSearchMode('BnFnOrLnFn');
$mss->setPeopleType(['pro','patient']);
$criteres = array(
'birthname'=>$term,
);
// Permet d'affiner les résultat sur des nom qui peuvent resembler à des
// prénoms très commun :
// (ex : MARIE Françoise (nom + prenom) <> Marie Françoise (prénom seul))
// en donnant le prossiblité de préciser la recherche en spéparant les nom et
// prénom par un ":". Dans le cas le nom est le premier terme et le prénom le
// second.
$split_term = explode(':', $term);
if (count($split_term) > 1) {
$mss=new msPeopleSearch;
$mss->setPeopleType(['pro','patient']);
$criteres = array(
'birthname'=>trim($split_term[0]),
'lastname'=>trim($split_term[0]),
'firstname'=>trim($split_term[1]),
);
} else {
$mss=new msPeopleSearch;
$mss->setNameSearchMode('BnFnOrLnFn');
$mss->setPeopleType(['pro','patient']);
$criteres = array(
'birthname'=>$term,
);
}

$mss->setCriteresRecherche($criteres);
$mss->setColonnesRetour(['deathdate', 'identite', 'birthdate']);
$mss->setLimitNumber(20);
Expand Down
2 changes: 2 additions & 0 deletions controlers/compta/compta.php
Expand Up @@ -73,6 +73,8 @@
"lastweek"=>"Semaine dernière",
"thismonth"=>"Ce mois",
"lastmonth"=>"Mois dernier",
"thisyear"=>"Cette année",
"lastyear"=>"Année dernière",
"bilanmois"=>"Bilan mois dernier",
"bilanannee"=>"Bilan année dernière",
"impayesmois"=>"Impayés mois",
Expand Down
2 changes: 1 addition & 1 deletion controlers/index.php
Expand Up @@ -34,7 +34,7 @@
$agenda->set_userID($p['user']['id']);
}
$todays=$agenda->getPatientsOfTheDay();
if (count($todays)) {
if (is_countable($todays) ? count($todays) : 0) {
msTools::redirection('/todays/');
}
}
Expand Down
5 changes: 5 additions & 0 deletions controlers/people/actions/inc-action-peopleRegister.php
Expand Up @@ -111,6 +111,11 @@
if (isset($in)) {
if (!empty(trim($v)) and !empty(trim($in))) {
$objet->createNewObjetByTypeName($in, $v);
// Génération automatique d'un SVG pour le code barre rpps et adeli si activé
if ($p['config']['activGenBarreCode'] == 'true' && ($in === 'rpps' || $in === 'adeli')) {
$res = msTools::genBareCodeFile('rpps', $v);
$res = msTools::genBareCodeFile('adeli', $v);
}
} elseif (isset($_POST['patientID']) and empty(trim($v)) and !empty(trim($in))) {
if(isset($patient->getSimpleAdminDatasByName([$in])[$in])) {
$objet->createNewObjetByTypeName($in, $v);
Expand Down
15 changes: 15 additions & 0 deletions controlers/people/proView.php
Expand Up @@ -104,3 +104,18 @@
if($p['config']['droitDossierPeutTransformerPraticienEnUtilisateur'] == 'true') {
$p['page']['loginUsername'] = msUser::makeRandomUniqLoginUsername(@$p['page']['proData']['firstname'], @$p['page']['proData']['lastname'], @$p['page']['proData']['birthname']);
}

// Retrouve le svg pour le code bare svg et adeli si il existe
if ($p['config']['activGenBarreCode'] == 'true') {
$barcodedir = $p['config']['stockageLocation'].'barecode/';
// Retrouve le svg pour le RPPS
if (file_exists($barcodedir.'barecode-rpps-'.$p['page']['proData']['rpps'].'.svg'))
$p['page']['svgRPPS'] = file_get_contents($barcodedir.'barecode-rpps-'.$p['page']['proData']['rpps'].'.svg');
else
$p['page']['svgRPPS'] = '';
// Retrouve le svg pour le ADELI
if (file_exists($barcodedir.'barecode-adeli-'.$p['page']['proData']['adeli'].'.svg'))
$p['page']['svgADELI'] = file_get_contents($barcodedir.'barecode-adeli-'.$p['page']['proData']['adeli'].'.svg');
else
$p['page']['svgADELI'] = '';
}
4 changes: 2 additions & 2 deletions controlers/rechercher/actions/inc-ajax-patientsListByCrit.php
Expand Up @@ -121,9 +121,9 @@
ON od.typeID=dt.id AND od.outdated='' AND od.deleted=''
WHERE dt.name='relationExternePatient' and od.toID in ('".implode("', '", array_column($todays, 'id'))."')", 'toID', 'value');
} elseif (array_key_exists('PraticienPeutEtrePatient', $p['config']) and $p['config']['PraticienPeutEtrePatient'] == 'true'){
$mss->setPeopleType(['pro','patient']);
$mss->setPeopleType(['pro','patient','externe']);
} else {
$mss->setPeopleType(['patient']);
$mss->setPeopleType(['patient','externe']);
}

//restrictions sur retours
Expand Down
4 changes: 2 additions & 2 deletions controlers/rechercher/peopleSearch.php
Expand Up @@ -45,12 +45,12 @@
return;
}

// Template et liste des types par catégorie avec retriction aux types employés dans le form de création
// Template et liste des types par catégorie avec restriction aux types employés dans le form de création
$form = new msForm;
if($p['page']['porp'] == 'pro') {
$template="searchPeoplePatientsAndPros";
$form->setFormIDbyName($p['config']['formFormulaireNouveauPraticien']);
} elseif($p['page']['porp'] == 'patient' || $p['page']['porp'] == 'externe') {
} elseif($p['page']['porp'] == 'patient' || $p['page']['porp'] == 'externe' || $p['page']['porp'] == 'today') {
$template="searchPeoplePatientsAndPros";
$form->setFormIDbyName($p['config']['formFormulaireNouveauPatient']);
} elseif($p['page']['porp'] == 'groupe') {
Expand Down
3 changes: 2 additions & 1 deletion cron/agendaChiffreParMail.php
Expand Up @@ -39,7 +39,8 @@
setlocale(LC_ALL, "fr_FR.UTF-8");
session_start();

$homepath=getcwd().'/';
if (!empty($homepath=getenv("MEDSHAKEEHRPATH"))) $homepath=getenv("MEDSHAKEEHRPATH");
else $homepath=preg_replace("#cron$#", '', __DIR__);

/////////// Composer class auto-upload
require $homepath.'vendor/autoload.php';
Expand Down
3 changes: 2 additions & 1 deletion cron/baseBackup.php
Expand Up @@ -39,7 +39,8 @@
setlocale(LC_ALL, "fr_FR.UTF-8");
session_start();

$homepath=getcwd().'/';
if (!empty($homepath=getenv("MEDSHAKEEHRPATH"))) $homepath=getenv("MEDSHAKEEHRPATH");
else $homepath=preg_replace("#cron$#", '', __DIR__);

/////////// Composer class auto-upload
require $homepath.'vendor/autoload.php';
Expand Down
3 changes: 2 additions & 1 deletion cron/baseGzipBackup.php
Expand Up @@ -39,7 +39,8 @@
setlocale(LC_ALL, "fr_FR.UTF-8");
session_start();

$homepath=getcwd().'/';
if (!empty($homepath=getenv("MEDSHAKEEHRPATH"))) $homepath=getenv("MEDSHAKEEHRPATH");
else $homepath=preg_replace("#cron$#", '', __DIR__);

/////////// Composer class auto-upload
require $homepath.'vendor/autoload.php';
Expand Down

0 comments on commit 5e26162

Please sign in to comment.