Skip to main content

Version Documentation Maintenance License:MIT

RBMCE (Rule-Based Microbiology Concept Extractor):

This code was developed to provide an open-source python package to extract clinical concepts from free-text semi-structured microbiology reports. The two primary outputs for this package are (1) an binary estimation of patient bacterial infection status and (2) a list of all clinically relevant microorganisms found in the report. These outputs were validated on two independent datasets and achieved f-1 scores over 0.95 on both outputs when compared to expert review. Full details on background, algorithm, and validation results can be seen at our paper here: (currently being written, will update once submitted to archive).

🏠 Homepage

✨ package

Requirements

* python >=3.6.8
* pandas >=0.25.0

Install

pip install rbmce

Usage

Recommended datastructure:

the rbcme.run() function expects a pandas dataframe with the following elements (associated column names can be specified as kwargs):

  • parsed_note:
    • microbiology report txt in either a raw or (**perferable) chopped up into components (eg gram stain/growth report/ab susceptability)
  • culture_id:
    • a primary key tied to a given sample/specimen + microbiological exam order.
    • Often a microbiology order can be tied to numerous components (eg gram stain/growth report/ ab susceptability). additionally these can be appended to same report or added as a new report tied to same sample + order. all of these tied to a sample+order should share same culture_id
  • visit_id:
    • primary key for patient's visit/encounter
    • can be 1-many:1 to culture_id or 1:1 (in which case can specify as culture_id)
    • in some datasets a patient may have multiple cultures performed in a visit/encounter.

Inline:

import rbmce
import pandas as pd
d={'parsed_note': 'No Salmonella, Shigella, Campylobacter, Aeromonas or Plesiomonas isolated.', 'culture_id': 1, 'visit_id': 1}
df=pd.DataFrame(data=d, index=[1])
rbmce.run(df)

Command Line:

see rbcme_run_example.py for example of an executable python file to import, format, process w/ rbmce, and save outputs (annotated dataframe, markdown_summary file)

Run tests

Inline

from rbmce import debug
test_str='No Salmonella, Shigella, Campylobacter, Aeromonas or Plesiomonas isolated.'
debug.rbmce_str_in(test_str)

Command Line:

python -m rbmce.debug 'No Salmonella, Shigella, Campylobacter, Aeromonas or Plesiomonas isolated.'

Author

👤 Garrett Eickelberg

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide

Show your support

Give a ⭐️ if this project helped you!

Credits

Markdown Readme Generator

📝 License

This project is MIT licensed.


This README was created with the markdown-readme-generator

Metadata

Release files for rbmce 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rbmce 0.0.2
File Size Uploaded
rbmce-0.0.2.tar.gz 40.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rbmce 0.0.2
File Interpreter ABI Platform
rbmce-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 85.4 kB

Release files / rbmce-0.0.2.tar.gz

Download URL rbmce-0.0.2.tar.gz
Size 40.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bf6b6bc76eec814298209ea25a762950ba82e74340fc87b7967abb720b3acf52
BLAKE2b-256 checksum
How to use checksums
798f789c4e704f33240007259ff4187476946520bbfcb6ae2656045f27f2b7a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.7

Release files / rbmce-0.0.2-py3-none-any.whl

Download URL rbmce-0.0.2-py3-none-any.whl
Size 44.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae37186511a4b2139344c99792bb0ddeb7cf0c60914236d6bb8c8af810d03ebd
BLAKE2b-256 checksum
How to use checksums
16f1e226fb05b9ce37ea807a9842e287e75334bcc2bb13c26c95a42b16910a5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.7

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page