Framework for Electronic Medical Records. A python package for building models using EHR data.
Project description
FEMR (EHRSHOT compatible version)
Framework for Electronic Medical Records
Please see here for a discussion of what FEMR is.
This is an EHRSHOT compatible version of FEMR, based on FEMR version 0.0.20.
Installation
pip install ehrshot_femr
pip install --upgrade "jax[cuda11_pip]==0.4.8" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
Building from source
In some scenarios (such as contributing to FEMR), you might want to compile the package from source.
In order to do so, follow the following instructions.
conda create -n FEMR_ENV python=3.10 bazel=6 -c conda-forge -y
conda activate FEMR_ENV
export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
git clone https://github.com/som-shahlab/femr.git
cd femr
pip install -e .
Generating extract
EHRSHOT-2023
# Set up environment variables
# Path to a folder containing your raw STARR-OMOP download, generated via `tools.stanford.download_bigquery.py`
export OMOP_SOURCE=/path/to/omop/folder...
# Path to any arbitrary folder where you want to store your FEMR extract
export EXTRACT_DESTINATION=/path/to/femr/extract/folder...
# Path to any arbitrary folder where you want to store your FEMR extract logs
export EXTRACT_LOGS=/path/to/femr/extract/logs...
# Do some data preprocessing with Stanford-specific helper scripts
# GZIP decompression
gunzip $OMOP_SOURCE/**/*.csv.gz
# Apply zstd compression
zstd -1 --rm $OMOP_SOURCE/**/*.csv
# Extract data from flowsheets
python tools/stanford/flowsheet_cleaner.py --num_threads 5 $OMOP_SOURCE "${EXTRACT_DESTINATION}_flowsheets"
# Normalize visits
python tools/omop/normalize_visit_detail.py --num_threads 5 "${EXTRACT_DESTINATION}_flowsheets" "${EXTRACT_DESTINATION}_flowsheets_detail"
# Run actual FEMR extraction
etl_stanford_omop "${EXTRACT_DESTINATION}_flowsheets_detail" $EXTRACT_DESTINATION $EXTRACT_LOGS --num_threads 10
EHRSHOT-2024
# Set up environment variables
# Path to a folder containing your raw STARR-OMOP download, generated via `tools.stanford.download_bigquery.py`
export OMOP_SOURCE=/path/to/omop/folder...
# Path to any arbitrary folder where you want to store your FEMR extract
export EXTRACT_DESTINATION=/path/to/femr/extract/folder...
# Path to any arbitrary folder where you want to store your FEMR extract logs
export EXTRACT_LOGS=/path/to/femr/extract/logs...
# Do some data preprocessing with Stanford-specific helper scripts
# GZIP decompression
gunzip $OMOP_SOURCE/**/*.csv.gz
# Apply zstd compression
zstd -1 --rm $OMOP_SOURCE/**/*.csv
# Extract data from flowsheets
python tools/stanford/flowsheet_cleaner.py --num_threads 5 $OMOP_SOURCE "${EXTRACT_DESTINATION}_flowsheets"
# Normalize visits
python tools/omop/normalize_visit_detail.py --num_threads 5 "${EXTRACT_DESTINATION}_flowsheets" "${EXTRACT_DESTINATION}_flowsheets_detail"
# Run actual FEMR extraction
etl_stanford_omop "${EXTRACT_DESTINATION}_flowsheets_detail" $EXTRACT_DESTINATION $EXTRACT_LOGS --num_threads 10 --is_join_visits
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
femr-0.0.21.tar.gz
(11.7 MB
view hashes)
Built Distributions
Close
Hashes for femr-0.0.21-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9451bd9d9064a7929f6d12858b171f0dbfafb573922883550c8e937d4f3d1cec |
|
MD5 | bce747c82cdd13d97605ab17535e4781 |
|
BLAKE2b-256 | c6d818e7dba6d80b62ef1ce6e717ffb3c51ee889aa1172dcc8e1490c2ac3f133 |
Close
Hashes for femr-0.0.21-pp39-pypy39_pp73-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2b760f209974784db5c720a78db08bb118e81f34f0cae50676774805d4c7f1a |
|
MD5 | bf676c28f485a35b1fc304dbea64e540 |
|
BLAKE2b-256 | c4f49c41e144ff8f29b7e84e5bede2cc4523db0470c6503f14a092c68b5c3943 |
Close
Hashes for femr-0.0.21-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13db913b3e819749230beab4b3f344b900a9f9986175391de05427a384e963ea |
|
MD5 | fc253698a15ade1f0c5eab055a2948d4 |
|
BLAKE2b-256 | c22d4d8409e4a239c5c84db3a00a4bba33e4aa74177681a60cfde60d64ed4485 |
Close
Hashes for femr-0.0.21-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 717de3b22959f465512c78c474d907086ce04b74c08e42a5632937041c4c5fcd |
|
MD5 | 93f18c04f02fd14522e88d8ecf64a74d |
|
BLAKE2b-256 | bee6ee635f267a2e0c03ad3c48760275ae1c103242351304ce5c5338afb8e147 |
Close
Hashes for femr-0.0.21-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7df1d9accc6867f247288177854deaab7f9c033c9b130624177f792211593ca6 |
|
MD5 | d00c8826d96815e5e8ab614d34afc84f |
|
BLAKE2b-256 | bce1101aab170796aa703e6014207ca27ebbab6df87f3b49b2deee53b2cf5c5a |
Close
Hashes for femr-0.0.21-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cf15169eca28d616353b0d35aad9f2f58876662680bba26cd39187416fcb4c7 |
|
MD5 | d4c7a34fc2eedad7f235bcb0297c720e |
|
BLAKE2b-256 | 06f812c464feb0a19c1af4e1bc49c8d312d8d653e418d1248bedcb9c0ba5f4c4 |
Close
Hashes for femr-0.0.21-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 460f8c3f803c6f88c4ed63c8996527d34c3612cb83610e05b3d7f64fcfaf02ad |
|
MD5 | f50ee4aae954c5daf47741adabae6f48 |
|
BLAKE2b-256 | eefdd4c88814b38baadd12d6341cfcebfbfa43c5fe559c0bebdcc1b5dbb47bae |
Close
Hashes for femr-0.0.21-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52a8665ef5ff1721b25ed3f1cd0eff274626a15820f0826f04a17934a69654c3 |
|
MD5 | d32e4314d418ea53fd1c4de71df1320b |
|
BLAKE2b-256 | 20a8595cce9d8c8968fc197ffdb269379bf77747a4a78d3bde38e21be86b3589 |
Close
Hashes for femr-0.0.21-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d4cf31d4e9305897d7602f86525c0ea8a0522052c7cfaac53b35b47e22355ce |
|
MD5 | d844110153dffd9095b340c51fe2f6f8 |
|
BLAKE2b-256 | 5bf15fecf5eb89c53e39a06c6407cf911b630fa9dd8fbf94743909f54ffa8bc1 |
Close
Hashes for femr-0.0.21-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80e971d6e2e5a8c70b07287b524cf6bd859f21e6b3a8a802b31a90333c068367 |
|
MD5 | 226d8f97143945fcc2dc88b98af242b3 |
|
BLAKE2b-256 | c005ee95331ba805146a6aa79362b2b1e8b69cb488a963fa35af2af9638e4172 |
Close
Hashes for femr-0.0.21-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6f12cc59c7b3c1ab57277167a1a4240e7940309bd74c5a77f913d1691a1f7ff |
|
MD5 | 778a47684669969d38382d7ffc7da703 |
|
BLAKE2b-256 | ff0f68c5ea24585a55c7fa81656c9b4415bb1429c2cc4604eab731b0fc9cb506 |