Skip to content

Commit

Permalink
Merge pull request #234 from Refhi/ordoTypeFix
Browse files Browse the repository at this point in the history
Correction de la détection du type d'ordonnance numérique
  • Loading branch information
Abeldvlpr authored Sep 3, 2024
2 parents 8def88e + 35229f5 commit 90df5fe
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions prescription.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ addTweak([demandeUrl, prescriptionUrl], '*NumPres', function () {
// Selectionne automatiquement le type de prescription numérique
addTweak(demandeUrl, 'autoSelectTypeOrdoNum', function () {
const typesSoins = [
{ regex: /\bIDE\b|infirmier|pansement|injection/i, type: 1 },
{ regex: /\bkiné\b|\bkine\b|kinésithérapie|kinesitherapie|MKDE|kinesitherapeute|kinesithérapeute|rééducation|reeducation/i, type: 2 },
{ regex: /pédicure|pedicure|podologie|podologique|podologue|semelle|orthoplastie/i, type: 5 },
{ regex: /orthophonie|orthophonique|orthophoniste/i, type: 3 },
{ regex: /orthoptie|orthoptique|orthoptiste/i, type: 4 }
{ regex: /\bIDE\b|infirmier|pansement|injection/i, type: 0 },
{ regex: /\bkiné\b|\bkine\b|kinésithérapie|kinesitherapie|MKDE|kinesitherapeute|kinesithérapeute|rééducation|reeducation/i, type: 1 },
{ regex: /orthophonie|orthophonique|orthophoniste/i, type: 2 },
{ regex: /orthoptie|orthoptique|orthoptiste/i, type: 3 },
{ regex: /pédicure|pedicure|podologie|podologique|podologue|semelle|orthoplastie/i, type: 4 }
];

let contexteSoins = [
Expand Down Expand Up @@ -384,18 +384,11 @@ addTweak(demandeUrl, 'autoSelectTypeOrdoNum', function () {

function clickOnProperDropDownOption(demandeContent, callback) {
let choixPossibles = document.querySelectorAll('.mat-option-text');
let type = null; //non déf
let isLab = isElementSelected('ContentPlaceHolder1_BaseGlossaireUCForm1_LabelILAnalyses');
let isParamedical = isElementSelected('ContentPlaceHolder1_BaseGlossaireUCForm1_LabelILKine');
let isImagerie = isElementSelected('ContentPlaceHolder1_BaseGlossaireUCForm1_LabelILRadio');

if (isImagerie) { reject("Imagerie détectée, je ne peux pas traiter ce cas"); }

if (isLab) { type = 0; }
else if (isParamedical) {
type = determinerTypeSoin(demandeContent);
let type = determinerTypeSoin(demandeContent);
if (type === null) {
console.log("Type de soin non détecté, je laisse l'utilisateur sélectionner le bon");
}
if (type === null) { console.log("Type de soin non détecté, je laisse l'utilisateur sélectionner le bon"); }

else {
console.log('type de soin trouvé', type, 'je clique dessus', choixPossibles[type]);
choixPossibles[type].click();
Expand Down Expand Up @@ -427,7 +420,7 @@ addTweak(demandeUrl, 'autoSelectTypeOrdoNum', function () {
});
});
});
}, 200);
}, 400);
}, document, false, false, 'Création d\'une ordonnance numérique');
});

Expand Down

0 comments on commit 90df5fe

Please sign in to comment.