Skip to main content

Provenience of discharge summaries Pythonic access

PyPI Python 3.9 Python 3.10 Build Status

This library provides integrated MIMIC-III with discharge summary provenance of data annotations and Pythonic classes.

Documentation

See the full documentation. The API reference is also available.

Obtaining

The easiest way to install the command line program is via the pip installer:

pip3 install --use-deprecated=legacy-resolver zensols.dsprov

Binaries are also available on pypi.

Usage

The package includes a command line interface, which is probably most useful by dumping selected admission annotations.

Command line

# help
$ dsprov -h

# get two admission IDs (hadm_id)
$ dsprov ids -l 2

# print out two admissions
$ dsprov show -l 2

# print out admissions 139676
$ dsprov show -d 139676

# output the JSON of two admissions with indent 4
$ dsprov show -i 4 -f json -d $(dsprov ids -l 2 | awk '{print $1}' | paste -s -d, -)

API

The package can be used directly in your research to provide Python object oriented access to the annotations:

>>> from zensols.nlp import FeatureDocument
>>> from zensols.dsprov import ApplicationFactory, AdmissionMatch
>>> stash = ApplicationFactory.get_stash()
>>> am: AdmissionMatch = next(iter(stash.values()))
>>> doc: FeatureDocument = am.note_matches[0].discharge_summary.note.doc
>>> print(f'hadm: {am.hadm_id}')
>>> print(f'sentences: {len(doc.sents)}')
>>> print(f'tokens: {doc.token_len}')
>>> print(f'entities: {doc.entities}')
hadm: 120334
sentences: 46
tokens: 1039
entities: (<Admission>, <Date>, <Discharge>, <Date>, <Date of Birth>, <Sex>, ...)

Changelog

An extensive changelog is available here.

License

MIT License

Copyright (c) 2023 Paul Landes

Release files for zensols.dsprov 0.0.1

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

Built distribution (wheel)

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

Release files / zensols.dsprov-0.0.1-py3-none-any.whl

Download URL zensols.dsprov-0.0.1-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
787754d006b1367d09162ca8c6db92fc41fa60533cbe66d18ae40cc3175d76bd
BLAKE2b-256 checksum
How to use checksums
9ca82f0a1004a88b59e8e81142a3edb1f24b525ca80812a86a159da6ef512eac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.2

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

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