HIRID-MEDS 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. hirid_meds-0.0.1/.github/workflows/code-quality-main.yaml +31 -0
  2. hirid_meds-0.0.1/.github/workflows/code-quality-pr.yaml +45 -0
  3. hirid_meds-0.0.1/.github/workflows/python-build.yaml +99 -0
  4. hirid_meds-0.0.1/.github/workflows/tests.yaml +48 -0
  5. hirid_meds-0.0.1/.gitignore +162 -0
  6. hirid_meds-0.0.1/.pre-commit-config.yaml +92 -0
  7. hirid_meds-0.0.1/CITATION.cff +13 -0
  8. hirid_meds-0.0.1/LICENSE +21 -0
  9. hirid_meds-0.0.1/PKG-INFO +86 -0
  10. hirid_meds-0.0.1/README.md +56 -0
  11. hirid_meds-0.0.1/pyproject.toml +37 -0
  12. hirid_meds-0.0.1/setup.cfg +4 -0
  13. hirid_meds-0.0.1/src/HIRID_MEDS/__init__.py +39 -0
  14. hirid_meds-0.0.1/src/HIRID_MEDS/__main__.py +96 -0
  15. hirid_meds-0.0.1/src/HIRID_MEDS/commands.py +80 -0
  16. hirid_meds-0.0.1/src/HIRID_MEDS/configs/ETL.yaml +45 -0
  17. hirid_meds-0.0.1/src/HIRID_MEDS/configs/__init__.py +0 -0
  18. hirid_meds-0.0.1/src/HIRID_MEDS/configs/event_configs.yaml +363 -0
  19. hirid_meds-0.0.1/src/HIRID_MEDS/configs/main.yaml +25 -0
  20. hirid_meds-0.0.1/src/HIRID_MEDS/configs/pre_MEDS.yaml +59 -0
  21. hirid_meds-0.0.1/src/HIRID_MEDS/configs/runner.yaml +7 -0
  22. hirid_meds-0.0.1/src/HIRID_MEDS/dataset.yaml +12 -0
  23. hirid_meds-0.0.1/src/HIRID_MEDS/download.py +308 -0
  24. hirid_meds-0.0.1/src/HIRID_MEDS/pre_MEDS.py +489 -0
  25. hirid_meds-0.0.1/src/HIRID_MEDS.egg-info/PKG-INFO +86 -0
  26. hirid_meds-0.0.1/src/HIRID_MEDS.egg-info/SOURCES.txt +32 -0
  27. hirid_meds-0.0.1/src/HIRID_MEDS.egg-info/dependency_links.txt +1 -0
  28. hirid_meds-0.0.1/src/HIRID_MEDS.egg-info/entry_points.txt +2 -0
  29. hirid_meds-0.0.1/src/HIRID_MEDS.egg-info/requires.txt +19 -0
  30. hirid_meds-0.0.1/src/HIRID_MEDS.egg-info/top_level.txt +1 -0
  31. hirid_meds-0.0.1/static/pypi_trusted_publisher_example.png +0 -0
  32. hirid_meds-0.0.1/tests/d_references.csv +0 -0
  33. hirid_meds-0.0.1/tests/e2e_demo_test.py +67 -0
  34. hirid_meds-0.0.1/tests/operations_synthetic.csv +0 -0
@@ -0,0 +1,31 @@
1
+ # Same as `code-quality-pr.yaml` but triggered on commit to main branch
2
+ # and runs on all files (instead of only the changed ones)
3
+
4
+ name: Code Quality Main
5
+
6
+ on:
7
+ push:
8
+ branches: [main]
9
+
10
+ jobs:
11
+ code-quality:
12
+ runs-on: ubuntu-latest
13
+
14
+ strategy:
15
+ matrix:
16
+ python-version: ["3.12"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install packages
27
+ run: |
28
+ pip install .[dev]
29
+
30
+ - name: Run pre-commits
31
+ uses: pre-commit/action@v3.0.1
@@ -0,0 +1,45 @@
1
+ # This workflow finds which files were changed, prints them,
2
+ # and runs `pre-commit` on those files.
3
+
4
+ # Inspired by the sktime library:
5
+ # https://github.com/alan-turing-institute/sktime/blob/main/.github/workflows/test.yml
6
+
7
+ name: Code Quality PR
8
+
9
+ on:
10
+ pull_request:
11
+ branches: [main, "release/*", "dev"]
12
+
13
+ jobs:
14
+ code-quality:
15
+ runs-on: ubuntu-latest
16
+
17
+ strategy:
18
+ matrix:
19
+ python-version: ["3.12"]
20
+
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+
24
+ - name: Set up Python ${{ matrix.python-version }}
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: ${{ matrix.python-version }}
28
+
29
+ - name: Install packages
30
+ run: |
31
+ pip install .[dev]
32
+
33
+ - name: Find modified files
34
+ id: file_changes
35
+ uses: trilom/file-changes-action@v1.2.4
36
+ with:
37
+ output: " "
38
+
39
+ - name: List modified files
40
+ run: echo '${{ steps.file_changes.outputs.files}}'
41
+
42
+ - name: Run pre-commits
43
+ uses: pre-commit/action@v3.0.1
44
+ with:
45
+ extra_args: --files ${{ steps.file_changes.outputs.files}}
@@ -0,0 +1,99 @@
1
+ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2
+
3
+ on: push
4
+
5
+ jobs:
6
+ build:
7
+ name: Build distribution 📦
8
+ runs-on: ubuntu-latest
9
+
10
+ strategy:
11
+ matrix:
12
+ python-version: ["3.12"]
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - name: Set up Python ${{ matrix.python-version }}
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: ${{ matrix.python-version }}
20
+ - name: Install pypa/build
21
+ run: >-
22
+ python3 -m
23
+ pip install
24
+ build
25
+ --user
26
+ - name: Build a binary wheel and a source tarball
27
+ run: python3 -m build
28
+ - name: Store the distribution packages
29
+ uses: actions/upload-artifact@v4
30
+ with:
31
+ name: python-package-distributions
32
+ path: dist/
33
+
34
+ publish-to-pypi:
35
+ name: >-
36
+ Publish Python 🐍 distribution 📦 to PyPI
37
+ if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
38
+ needs:
39
+ - build
40
+ runs-on: ubuntu-latest
41
+ environment:
42
+ name: pypi
43
+ url: https://pypi.org/p/MEDS-transforms # Replace <package-name> with your PyPI project name
44
+ permissions:
45
+ id-token: write # IMPORTANT: mandatory for trusted publishing
46
+
47
+ steps:
48
+ - name: Download all the dists
49
+ uses: actions/download-artifact@v4
50
+ with:
51
+ name: python-package-distributions
52
+ path: dist/
53
+
54
+ - name: Publish distribution 📦 to PyPI
55
+ uses: pypa/gh-action-pypi-publish@release/v1
56
+
57
+ github-release:
58
+ name: >-
59
+ Sign the Python 🐍 distribution 📦 with Sigstore
60
+ and upload them to GitHub Release
61
+ needs:
62
+ - publish-to-pypi
63
+ runs-on: ubuntu-latest
64
+
65
+ permissions:
66
+ contents: write # IMPORTANT: mandatory for making GitHub Releases
67
+ id-token: write # IMPORTANT: mandatory for sigstore
68
+
69
+ steps:
70
+ - name: Download all the dists
71
+ uses: actions/download-artifact@v4
72
+ with:
73
+ name: python-package-distributions
74
+ path: dist/
75
+
76
+ - name: Sign the dists with Sigstore
77
+ uses: sigstore/gh-action-sigstore-python@v3.0.0
78
+ with:
79
+ inputs: >-
80
+ ./dist/*.tar.gz
81
+ ./dist/*.whl
82
+ - name: Create GitHub Release
83
+ env:
84
+ GITHUB_TOKEN: ${{ github.token }}
85
+ run: >-
86
+ gh release create
87
+ '${{ github.ref_name }}'
88
+ --repo '${{ github.repository }}'
89
+ --notes ""
90
+ - name: Upload artifact signatures to GitHub Release
91
+ env:
92
+ GITHUB_TOKEN: ${{ github.token }}
93
+ # Upload to GitHub Release using the `gh` CLI.
94
+ # `dist/` contains the built packages, and the
95
+ # sigstore-produced signatures and certificates.
96
+ run: >-
97
+ gh release upload
98
+ '${{ github.ref_name }}' dist/**
99
+ --repo '${{ github.repository }}'
@@ -0,0 +1,48 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main, "release/*", "dev"]
8
+
9
+ jobs:
10
+ run_tests_ubuntu:
11
+ runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ python-version: ["3.11", "3.12"]
16
+ fail-fast: false
17
+
18
+ timeout-minutes: 30
19
+
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Set up Python ${{ matrix.python-version }}
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: ${{ matrix.python-version }}
28
+
29
+ - name: Install packages
30
+ run: |
31
+ pip install -e .[tests]
32
+
33
+ #----------------------------------------------
34
+ # run test suite
35
+ #----------------------------------------------
36
+ - name: Run tests
37
+ run: |
38
+ pytest src/ tests/ -v --cov=src --junitxml=junit.xml -s
39
+
40
+ - name: Upload coverage to Codecov
41
+ uses: codecov/codecov-action@v4.0.1
42
+ with:
43
+ token: ${{ secrets.CODECOV_TOKEN }}
44
+ - name: Upload test results to Codecov
45
+ if: ${{ !cancelled() }}
46
+ uses: codecov/test-results-action@v1
47
+ with:
48
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,162 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110
+ .pdm.toml
111
+ .pdm-python
112
+ .pdm-build/
113
+
114
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115
+ __pypackages__/
116
+
117
+ # Celery stuff
118
+ celerybeat-schedule
119
+ celerybeat.pid
120
+
121
+ # SageMath parsed files
122
+ *.sage.py
123
+
124
+ # Environments
125
+ .env
126
+ .venv
127
+ env/
128
+ venv/
129
+ ENV/
130
+ env.bak/
131
+ venv.bak/
132
+
133
+ # Spyder project settings
134
+ .spyderproject
135
+ .spyproject
136
+
137
+ # Rope project settings
138
+ .ropeproject
139
+
140
+ # mkdocs documentation
141
+ /site
142
+
143
+ # mypy
144
+ .mypy_cache/
145
+ .dmypy.json
146
+ dmypy.json
147
+
148
+ # Pyre type checker
149
+ .pyre/
150
+
151
+ # pytype static type analyzer
152
+ .pytype/
153
+
154
+ # Cython debug symbols
155
+ cython_debug/
156
+
157
+ # PyCharm
158
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
161
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
162
+ #.idea/
@@ -0,0 +1,92 @@
1
+ default_language_version:
2
+ python: python3.12
3
+
4
+ exclude: "docs/index.md|MIMIC-IV_Example/README.md|eICU_Example/README.md|AUMCdb_Example/README.md|test/demo_resources/.*"
5
+
6
+ repos:
7
+ - repo: https://github.com/pre-commit/pre-commit-hooks
8
+ rev: v5.0.0
9
+ hooks:
10
+ # list of supported hooks: https://pre-commit.com/hooks.html
11
+ - id: trailing-whitespace
12
+ - id: end-of-file-fixer
13
+ - id: check-docstring-first
14
+ - id: check-yaml
15
+ - id: debug-statements
16
+ - id: detect-private-key
17
+ - id: check-executables-have-shebangs
18
+ - id: check-toml
19
+ - id: check-case-conflict
20
+ - id: check-added-large-files
21
+ args: [--maxkb, "800"]
22
+
23
+ # python code formatting, linting, and import sorting using ruff
24
+ - repo: https://github.com/astral-sh/ruff-pre-commit
25
+ rev: v0.11.7
26
+ hooks:
27
+ # Run the formatter
28
+ - id: ruff-format
29
+ # Run the linter
30
+ - id: ruff
31
+ args: ["--fix", "--exit-non-zero-on-fix"]
32
+
33
+ # # python docstring formatting
34
+ # - repo: https://github.com/myint/docformatter
35
+ # rev: v1.7.5
36
+ # hooks:
37
+ # - id: docformatter
38
+ # args: [--in-place, --wrap-summaries=110, --wrap-descriptions=110]
39
+
40
+ # yaml formatting
41
+ - repo: https://github.com/pre-commit/mirrors-prettier
42
+ rev: v4.0.0-alpha.8
43
+ hooks:
44
+ - id: prettier
45
+ types: [yaml]
46
+ exclude: "environment.yaml"
47
+
48
+ # shell scripts linter
49
+ - repo: https://github.com/shellcheck-py/shellcheck-py
50
+ rev: v0.10.0.1
51
+ hooks:
52
+ - id: shellcheck
53
+
54
+ # md formatting
55
+ - repo: https://github.com/executablebooks/mdformat
56
+ rev: 0.7.22
57
+ hooks:
58
+ - id: mdformat
59
+ args: ["--number"]
60
+ additional_dependencies:
61
+ - mdformat-ruff
62
+ - mdformat-gfm
63
+ - mdformat-gfm-alerts
64
+ - mdformat-tables
65
+ - mdformat_frontmatter
66
+ - mdformat-config
67
+ - mdformat-mkdocs
68
+ - mdformat-toc
69
+
70
+ # word spelling linter
71
+ - repo: https://github.com/codespell-project/codespell
72
+ rev: v2.4.1
73
+ hooks:
74
+ - id: codespell
75
+ args:
76
+ - --skip=*.ipynb,*.bib,*.svg,pyproject.toml,*.csv
77
+ - --ignore-words-list=ehr,crate
78
+
79
+ # jupyter notebook cell output clearing
80
+ - repo: https://github.com/kynan/nbstripout
81
+ rev: 0.8.1
82
+ hooks:
83
+ - id: nbstripout
84
+
85
+ # jupyter notebook linting with ruff
86
+ - repo: https://github.com/nbQA-dev/nbQA
87
+ rev: 1.9.1
88
+ hooks:
89
+ - id: nbqa-ruff
90
+ args: ["--fix"]
91
+ - id: nbqa-ruff-format
92
+ args: ["--line-length=110"]
@@ -0,0 +1,13 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it as below."
3
+ title: "SICdb_MEDS ETL"
4
+ version: "0.0.1"
5
+ doi: "10.5281/zenodo.14893939"
6
+ authors:
7
+ - family-names: "van de Water"
8
+ given-names: "Robin Philippus"
9
+ orcid: "https://orcid.org/0000-0002-2895-4872"
10
+ date-released: "2025-02-19"
11
+ url: "https://github.com/rvandewater/SICdb_MEDS"
12
+ repository-code: "https://github.com/rvandewater/SICdb_MEDS"
13
+ license: "MIT"
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Matthew McDermott
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.4
2
+ Name: HIRID-MEDS
3
+ Version: 0.0.1
4
+ Summary: An ETL pipeline to extract HIRID data into the MEDS format.
5
+ Author-email: Robin van de Water <robin.vandewater@hpi.de>
6
+ Project-URL: Homepage, https://github.com/mmcdermott/ETL_MEDS_Template
7
+ Project-URL: Issues, https://github.com/mmcdermott/ETL_MEDS_Template/issues
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.11
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: meds-transforms~=0.2.4
15
+ Requires-Dist: requests
16
+ Requires-Dist: beautifulsoup4
17
+ Requires-Dist: hydra-core
18
+ Requires-Dist: loguru
19
+ Requires-Dist: polars<1.30.0
20
+ Provides-Extra: dev
21
+ Requires-Dist: pre-commit<4; extra == "dev"
22
+ Provides-Extra: tests
23
+ Requires-Dist: pytest; extra == "tests"
24
+ Requires-Dist: pytest-cov; extra == "tests"
25
+ Provides-Extra: local-parallelism
26
+ Requires-Dist: hydra-joblib-launcher; extra == "local-parallelism"
27
+ Provides-Extra: slurm-parallelism
28
+ Requires-Dist: hydra-submitit-launcher; extra == "slurm-parallelism"
29
+ Dynamic: license-file
30
+
31
+ # Extract your custom dataset via MEDS-Transforms
32
+
33
+ [![codecov](https://codecov.io/gh/mmcdermott/ETL_MEDS_Template/graph/badge.svg?token=RW6JXHNT0W)](https://codecov.io/gh/mmcdermott/ETL_MEDS_Template)
34
+ [![tests](https://github.com/mmcdermott/ETL_MEDS_Template/actions/workflows/tests.yaml/badge.svg)](https://github.com/mmcdermott/ETL_MEDS_Template/actions/workflows/tests.yml)
35
+ [![code-quality](https://github.com/mmcdermott/ETL_MEDS_Template/actions/workflows/code-quality-main.yaml/badge.svg)](https://github.com/mmcdermott/ETL_MEDS_Template/actions/workflows/code-quality-main.yaml)
36
+ ![python](https://img.shields.io/badge/-Python_3.11-blue?logo=python&logoColor=white)
37
+ [![license](https://img.shields.io/badge/License-MIT-green.svg?labelColor=gray)](https://github.com/mmcdermott/ETL_MEDS_Template#license)
38
+ [![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/mmcdermott/ETL_MEDS_Template/pulls)
39
+ [![contributors](https://img.shields.io/github/contributors/mmcdermott/ETL_MEDS_Template.svg)](https://github.com/mmcdermott/ETL_MEDS_Template/graphs/contributors)
40
+ ![Static Badge](https://img.shields.io/badge/MEDS-0.3.3-blue)
41
+
42
+ Warning: This ETL currently needs a lot of resources to run.
43
+
44
+ A template repository for a MEDS-Transforms powered extraction pipeline for a custom dataset. Once you have
45
+ customized the repository to your dataset (see instructions below), you will be able to run your extraction
46
+ pipeline with a few simple command-line commands, such as:
47
+
48
+ ```bash
49
+ pip install HIRID_MEDS # you can do this locally or via PyPI
50
+ # Download your data or set download credentials
51
+ MEDS_extract-HIRID root_output_dir=$ROOT_OUTPUT_DIR do_download=true raw_input_dir=$RAW_INPUT_DIR
52
+ ```
53
+
54
+ ## MEDS-transforms settings
55
+
56
+ If you want to convert a large dataset, you can use parallelization with MEDS-transforms
57
+ (the MEDS-transformation step that takes the longest).
58
+
59
+ Using local parallelization with the `hydra-joblib-launcher` package, you can set the number of workers:
60
+
61
+ ```
62
+ pip install hydra-joblib-launcher --upgrade
63
+ ```
64
+
65
+ Then, you can set the number of workers as environment variable:
66
+
67
+ ```bash
68
+ export N_WORKERS=8
69
+ ```
70
+
71
+ Moreover, you can set the number of subjects per shard to balance the parallelization overhead based on how many
72
+ subjects you have in your dataset:
73
+
74
+ ```bash
75
+ export N_SUBJECTS_PER_SHARD=100000
76
+ ```
77
+
78
+ ## Citation
79
+
80
+ If you use this dataset, please cite the original publication below and the ETL (see cite this repository):
81
+
82
+ ```
83
+ Faltys, M., Zimmermann, M., Lyu, X., Hüser, M., Hyland, S., Rätsch, G., & Merz, T. (2021). HiRID, a high time-resolution ICU dataset (version 1.1.1). PhysioNet. https://doi.org/10.13026/nkwc-js72.
84
+
85
+ Hyland, S.L., Faltys, M., Hüser, M. et al. Early prediction of circulatory failure in the intensive care unit using machine learning. Nat Med 26, 364–373 (2020). https://doi.org/10.1038/s41591-020-0789-4
86
+ ```
@@ -0,0 +1,56 @@
1
+ # Extract your custom dataset via MEDS-Transforms
2
+
3
+ [![codecov](https://codecov.io/gh/mmcdermott/ETL_MEDS_Template/graph/badge.svg?token=RW6JXHNT0W)](https://codecov.io/gh/mmcdermott/ETL_MEDS_Template)
4
+ [![tests](https://github.com/mmcdermott/ETL_MEDS_Template/actions/workflows/tests.yaml/badge.svg)](https://github.com/mmcdermott/ETL_MEDS_Template/actions/workflows/tests.yml)
5
+ [![code-quality](https://github.com/mmcdermott/ETL_MEDS_Template/actions/workflows/code-quality-main.yaml/badge.svg)](https://github.com/mmcdermott/ETL_MEDS_Template/actions/workflows/code-quality-main.yaml)
6
+ ![python](https://img.shields.io/badge/-Python_3.11-blue?logo=python&logoColor=white)
7
+ [![license](https://img.shields.io/badge/License-MIT-green.svg?labelColor=gray)](https://github.com/mmcdermott/ETL_MEDS_Template#license)
8
+ [![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/mmcdermott/ETL_MEDS_Template/pulls)
9
+ [![contributors](https://img.shields.io/github/contributors/mmcdermott/ETL_MEDS_Template.svg)](https://github.com/mmcdermott/ETL_MEDS_Template/graphs/contributors)
10
+ ![Static Badge](https://img.shields.io/badge/MEDS-0.3.3-blue)
11
+
12
+ Warning: This ETL currently needs a lot of resources to run.
13
+
14
+ A template repository for a MEDS-Transforms powered extraction pipeline for a custom dataset. Once you have
15
+ customized the repository to your dataset (see instructions below), you will be able to run your extraction
16
+ pipeline with a few simple command-line commands, such as:
17
+
18
+ ```bash
19
+ pip install HIRID_MEDS # you can do this locally or via PyPI
20
+ # Download your data or set download credentials
21
+ MEDS_extract-HIRID root_output_dir=$ROOT_OUTPUT_DIR do_download=true raw_input_dir=$RAW_INPUT_DIR
22
+ ```
23
+
24
+ ## MEDS-transforms settings
25
+
26
+ If you want to convert a large dataset, you can use parallelization with MEDS-transforms
27
+ (the MEDS-transformation step that takes the longest).
28
+
29
+ Using local parallelization with the `hydra-joblib-launcher` package, you can set the number of workers:
30
+
31
+ ```
32
+ pip install hydra-joblib-launcher --upgrade
33
+ ```
34
+
35
+ Then, you can set the number of workers as environment variable:
36
+
37
+ ```bash
38
+ export N_WORKERS=8
39
+ ```
40
+
41
+ Moreover, you can set the number of subjects per shard to balance the parallelization overhead based on how many
42
+ subjects you have in your dataset:
43
+
44
+ ```bash
45
+ export N_SUBJECTS_PER_SHARD=100000
46
+ ```
47
+
48
+ ## Citation
49
+
50
+ If you use this dataset, please cite the original publication below and the ETL (see cite this repository):
51
+
52
+ ```
53
+ Faltys, M., Zimmermann, M., Lyu, X., Hüser, M., Hyland, S., Rätsch, G., & Merz, T. (2021). HiRID, a high time-resolution ICU dataset (version 1.1.1). PhysioNet. https://doi.org/10.13026/nkwc-js72.
54
+
55
+ Hyland, S.L., Faltys, M., Hüser, M. et al. Early prediction of circulatory failure in the intensive care unit using machine learning. Nat Med 26, 364–373 (2020). https://doi.org/10.1038/s41591-020-0789-4
56
+ ```
@@ -0,0 +1,37 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64", "setuptools-scm>=8.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "HIRID-MEDS"
7
+ dynamic = ["version"]
8
+ authors = [
9
+ {name= "Robin van de Water", email="robin.vandewater@hpi.de"},
10
+ ]
11
+ description = "An ETL pipeline to extract HIRID data into the MEDS format."
12
+ readme = "README.md"
13
+ requires-python = ">=3.11"
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ ]
19
+ dependencies = [
20
+ "meds-transforms~=0.2.4", "requests", "beautifulsoup4", "hydra-core", "loguru", "polars<1.30.0"
21
+
22
+ ]
23
+
24
+ [tool.setuptools_scm]
25
+
26
+ [project.optional-dependencies]
27
+ dev = ["pre-commit<4"]
28
+ tests = ["pytest", "pytest-cov"]
29
+ local_parallelism = ["hydra-joblib-launcher"]
30
+ slurm_parallelism = ["hydra-submitit-launcher"]
31
+
32
+ [project.scripts]
33
+ MEDS_extract-HIRID = "HIRID_MEDS.__main__:main"
34
+
35
+ [project.urls]
36
+ Homepage = "https://github.com/mmcdermott/ETL_MEDS_Template"
37
+ Issues = "https://github.com/mmcdermott/ETL_MEDS_Template/issues"