{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "![Urgences - Image CC0 - pexels.com](img/pexels-pixabay-263402.jpg \"Urgences\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Biology Order Prescription\n", "*Levi-Dan Azoulay* \n", "*Shana Zirah* \n", "*Nathane Berrebi* \n", "*Gaspard André* \n", "*Jona Benhamou* \n", "*Ali Bellamine*" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Plan du document" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Les étapes clés de ce projet sont les suivantes :\n", "\n", "- I. Introduction\n", "- II. Téléchargement des données et transformation\n", "- III. Exploration et visualisation les données\n", "- IV. Sélection des variables d'interêts\n", "- V. Définition et entrainement d'une solution d'apprentissage statistique" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# I. Introduction" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " ## I.1 Contexte" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Chaque jour, environ 50 000 personnes se présentent dans un service d'accueil des urgences (SAU) en France. En moyenne, 75% des patients retournent à domicile, et 20% sont hospitalisés. La durée moyenne de présence au SAU est longue. On estime que seulement 20% attendront moins d'une heure, tandis que ~30% attendront entre 1h et 2H et ~30% attendront en 2 et 4H. Enfin, un peu plus de 10% resteront au SAU entre 4 et 6H. Dans un contexte de pénurie de soignants, le recours à la consultation au SAU est en constante augmentation depuis plusieurs années. L'optimisation du circuit des urgences est une problématique centrale. Le cout humain et financier des dysfonctionnements du circuit et de l'offre de soin est important. \n", "\n", "Le parcours classique du circuit des urgences est le suivant : \n", "1. **Premier contact d'ordre administratif**\n", "2. **Premier contact soignant avec une infirmière d'accueil et d'orientation (IAO) (~M30) avec** :\n", " - Recueil du motif de consultation\n", " - Prise des constantes\n", " - Recueil de quelques antécédents et de l'ordonnance du patient \n", " - Eventuellement ECG \n", "\n", "\n", "Le patient est classé selon un score de gravité (bleu, vert, jaune, orange, rouge, ou 1-2-3-4-5)\n", "\n", "3. **Premier contact médical avec un médecin (~H1)** :\n", " - Interrogatoire\n", " - Examen clinique\n", "\n", " \n", "A la suite de cette consultation, plusieurs cas de figures selon la situation.\n", "Le patient peut sortir avec ou sans ordonnance si le diagnostic est posé par l'examen clinique et ne nécéssite ni examen, ni hospitalisation.\n", "Le patient peut nécéssiter la réalisation d'examens (prise de sang, radiographie, scanner) ou motiver un avis d'un spécialiste. Auquel cas il doit attendre\n", "\n", "4. **Réalisation des examens complémentaire ou d'un avis (prescription, réalisation, récupération)**\n", "5. **Décision finale : Conclusion une fois les examens récupérés. (~H3)**\n", "\n", "Entre chaque étape, le patient attend pendant une durée plus ou moins longue. Le médecin lui « jongle » avec plusieurs patients à la fois à des étapes différentes. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# I.2 Objectifs" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Nous proposons d'aider à **raccourcir le temps entre l'arrivée du patient et sa sortie**, en ne subordonnant pas la décision de réaliser un examen biologique à l'examen clinique du médecin. Nous savons que le temps entre l'arrivée au SAU et la première visite avec le médecin est le temps le plus long et le plus mal vécu par les patients. \n", "\n", "**Nous proposons à l'aide d'un algorithme d'apprentissage statistique de prédire, dès les données fournies par l'IAO, la nécéssité de réaliser un examen de biologie médicale, afin de permettre aux IDE de prélever cet examen juste après l'IAO, de sorte que le médecin dès sa première visite peut conclure avec les résultats de la biologie, qu'il aurait sans cela, demandé et attendu de récuperer avant de conclure et de prendre en charge le patient.**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
Données d'entrée | \n", "Algorithme | \n", "Données de sortie | \n", "
---|---|---|
\n", " | \n", " | Vecteur {0,1}^d d'examens de biologie associée à sa réalisation (1) ou non (0) | \n", "
Age | \n", "MLP NLP (Embeddings, Word2Vec ...) Autres | \n",
" Ionogramme Complet - {0,1} | \n", "
Sexe | \n", "Bilan hépato-biliaire - {0,1} | \n", "|
Motif de consultation | \n", "Numération sanguine (NFS) - {0,1} | \n", "|
Paramètres vitaux (FC, SpO2, PA, T°, FR, EVA) | \n", "Glycémie - {0,1} | \n", "|
Ordonnance d'entrée du patient | \n", "Hémostase - {0,1} | \n", "|
\n", " | ... | \n", "
\n", " | n | \n", "total | \n", "pourcentage | \n", "
---|---|---|---|
temperature | \n", "515 | \n", "414671 | \n", "0.12 | \n", "
heartrate | \n", "30 | \n", "421179 | \n", "0.01 | \n", "
resprate | \n", "78 | \n", "417837 | \n", "0.02 | \n", "
o2sat | \n", "137 | \n", "417552 | \n", "0.03 | \n", "
sbp | \n", "269 | \n", "419888 | \n", "0.06 | \n", "
dbp | \n", "626 | \n", "419060 | \n", "0.15 | \n", "
pain | \n", "11614 | \n", "409525 | \n", "2.84 | \n", "
\n", " | stay_id | \n", "intime | \n", "gender | \n", "age | \n", "temperature | \n", "heartrate | \n", "resprate | \n", "o2sat | \n", "sbp | \n", "dbp | \n", "pain | \n", "chiefcomplaint | \n", "last_7 | \n", "last_30 | \n", "icd9 | \n", "icd10 | \n", "gsn | \n", "time | \n", "temperature_norm | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "30000012 | \n", "2126-02-14 20:22:00 | \n", "F | \n", "65 | \n", "98.8 | \n", "96.0 | \n", "18.0 | \n", "93.0 | \n", "160.0 | \n", "54.0 | \n", "0.0 | \n", "CHANGE IN MENTAL STATUS | \n", "0.0 | \n", "1.0 | \n", "[2761, 4589, 5712, 5990, 7804] | \n", "NaN | \n", "[8209, 21413, 2510, 27462, 66295, 6818, 6818, ... | \n", "73320 | \n", "0.007457 | \n", "
1 | \n", "30000017 | \n", "2185-06-18 11:51:00 | \n", "M | \n", "39 | \n", "NaN | \n", "73.0 | \n", "18.0 | \n", "97.0 | \n", "156.0 | \n", "112.0 | \n", "0.0 | \n", "ETOH, Unable to ambulate | \n", "1.0 | \n", "1.0 | \n", "[07070, 30300, V600] | \n", "NaN | \n", "NaN | \n", "42660 | \n", "NaN | \n", "
2 | \n", "30000038 | \n", "2152-12-07 16:37:00 | \n", "F | \n", "80 | \n", "97.1 | \n", "54.0 | \n", "18.0 | \n", "95.0 | \n", "143.0 | \n", "73.0 | \n", "0.0 | \n", "Cough | \n", "NaN | \n", "NaN | \n", "[9221, 92231, 92232, 95901, E8889] | \n", "NaN | \n", "[16925, 15864, 16278, 17037, 17037, 21413, 289... | \n", "59820 | \n", "-0.008446 | \n", "
3 | \n", "30000039 | \n", "2165-10-06 11:47:00 | \n", "M | \n", "80 | \n", "98.6 | \n", "85.0 | \n", "16.0 | \n", "98.0 | \n", "189.0 | \n", "96.0 | \n", "0.0 | \n", "s/p Fall | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "[8209, 19293] | \n", "42420 | \n", "0.005586 | \n", "
4 | \n", "30000055 | \n", "2155-07-18 17:03:00 | \n", "F | \n", "63 | \n", "99.4 | \n", "85.0 | \n", "16.0 | \n", "100.0 | \n", "NaN | \n", "NaN | \n", "0.0 | \n", "L Ear pain | \n", "NaN | \n", "NaN | \n", "[3804] | \n", "NaN | \n", "[8182] | \n", "61380 | \n", "0.013070 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
448967 | \n", "39999939 | \n", "2155-08-04 11:15:00 | \n", "M | \n", "57 | \n", "98.4 | \n", "84.0 | \n", "16.0 | \n", "97.0 | \n", "152.0 | \n", "90.0 | \n", "2.0 | \n", "Chest pain | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "[8182, 16578, 22159, 22159, 27475, 27475] | \n", "40500 | \n", "0.003715 | \n", "
448968 | \n", "39999953 | \n", "2152-06-22 14:08:00 | \n", "F | \n", "36 | \n", "98.2 | \n", "108.0 | \n", "18.0 | \n", "100.0 | \n", "155.0 | \n", "94.0 | \n", "5.0 | \n", "Palpitations, Dizziness, Headache | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "[6655] | \n", "50880 | \n", "0.001844 | \n", "
448969 | \n", "39999961 | \n", "2145-05-16 17:16:00 | \n", "F | \n", "55 | \n", "99.3 | \n", "119.0 | \n", "22.0 | \n", "NaN | \n", "132.0 | \n", "74.0 | \n", "7.0 | \n", "Chest pain, Cough, Dyspnea | \n", "0.0 | \n", "1.0 | \n", "[4019, 7295, 7820, 78909, E9208] | \n", "[C50919, H6692, I10, L308, L538, R112, R29810,... | \n", "[16927, 16995, 16995, 13109, 2173, 2169, 18368... | \n", "62160 | \n", "0.012134 | \n", "
448970 | \n", "39999964 | \n", "2130-06-05 11:53:00 | \n", "M | \n", "50 | \n", "98.6 | \n", "64.0 | \n", "18.0 | \n", "99.0 | \n", "127.0 | \n", "64.0 | \n", "4.0 | \n", "SI, Depression | \n", "0.0 | \n", "1.0 | \n", "[71946, 7242, 78659, 9221, 92231, 92411, 95901... | \n", "[F329, H5711, M25561, M549, M79662, R45851, R5... | \n", "[44633, 44633, 4561, 4561, 4561, 4540, 4540] | \n", "42780 | \n", "0.005586 | \n", "
448971 | \n", "39999965 | \n", "2125-09-14 00:46:00 | \n", "F | \n", "30 | \n", "97.5 | \n", "65.0 | \n", "16.0 | \n", "100.0 | \n", "132.0 | \n", "77.0 | \n", "0.0 | \n", "Labor | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "2760 | \n", "-0.004704 | \n", "
448972 rows × 19 columns
\n", "\n", " | precision | \n", "recall | \n", "f1_score | \n", "
---|---|---|---|
IonoC | \n", "0.8 | \n", "0.58 | \n", "0.67 | \n", "