A set of tools for extracting formattable data from clinical notes stored in electronic health record systems. Powered by MedCAT models.
To install the stable release:
pip install miade
To install the latest development version of MiADE, clone this repository and run:
pip install .
You may also need to download these additional models to run MiADE:
spaCy - required for MedCAT
python -m spacy download en_core_web_md
med7 - required for medication dosage extraction
pip install https://huggingface.co/kormilitzin/en_core_med7_lg/resolve/main/en_core_med7_lg-any-py3-none-any.whl
Initialise MiADE with the path that you have saved your trained MedCAT models:
miade = NoteProcessor(Path("path/to/model/dir"))
Add annotators:
miade.add_annotator("problems")
miade.add_annotator("meds/allergies")
Create a note:
text = "Patient has penicillin allergy with rash"
note = Note(text)
Extract concepts:
concepts = miade.process(note)
for concept in concepts:
print(concept)
# {name: breaking out - eruption, id: 271807003, category: Category.REACTION, start: 204, end: 208, dosage: None, negex: False, meta: None}
# {name: penicillin, id: 764146007, category: Category.ALLERGY, start: 191, end: 201, dosage: None, negex: False, meta: None}
See contributing
Name | |
---|---|
James Brandreth | [email protected] |
Jennifer Jiang | [email protected] |
This project wouldn't be possible without the work at Cogstack, spaCy, and med7!
This project is licensed under the Elastic License 2.0. See LICENSE for the full license text.