Skip to content

A set of tools for extracting formattable data from clinical notes stored in electronic health record systems.

License

Notifications You must be signed in to change notification settings

uclh-criu/miade

Repository files navigation

Build Status License: Elastic License 2.0

A set of tools for extracting formattable data from clinical notes stored in electronic health record systems. Powered by MedCAT models.

Installing

Install MiADE

To install the stable release:

pip install miade

To install the latest development version of MiADE, clone this repository and run:

pip install .

Downloading models

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

Quickstart

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} 

Contributing

See contributing

Maintainers

Name Email
James Brandreth [email protected]
Jennifer Jiang [email protected]

Acknowledgement

This project wouldn't be possible without the work at Cogstack, spaCy, and med7!

Licence

This project is licensed under the Elastic License 2.0. See LICENSE for the full license text.