Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨Add typehints and validation #8

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# OMOP: OMOP Common Data Model

Definition of the models: https://github.com/OHDSI/CommonDataModel
OMOP (Observational Medical Outcomes Partnership) is a common data model (CDM) that standardizes the structure and content of disparate healthcare data for large-scale observational research.
This schema models the OMOP data model accurately allowing for validation of OMOP modeled data.

More about OMOP can be found at the [OHDSI website](https://ohdsi.org) and on the [OMOP GitHub](https://github.com/OHDSI/CommonDataModel).
35 changes: 26 additions & 9 deletions docs/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
},
"outputs": [],
"source": [
"!wget https://physionet.org/static/published-projects/mimic-iv-demo-omop/mimic-iv-demo-data-in-the-omop-common-data-model-0.9.zip\n",
"!unzip mimic-iv-demo-data-in-the-omop-common-data-model-0.9.zip"
"!wget -nc https://physionet.org/static/published-projects/mimic-iv-demo-omop/mimic-iv-demo-data-in-the-omop-common-data-model-0.9.zip\n",
"!unzip -n mimic-iv-demo-data-in-the-omop-common-data-model-0.9.zip"
]
},
{
Expand All @@ -41,7 +41,7 @@
"metadata": {},
"outputs": [],
"source": [
"!lamin init --storage ./test-omop --schema omop"
"!lamin init --storage ./test-omop --name test-omop --schema omop"
]
},
{
Expand All @@ -57,15 +57,16 @@
"metadata": {},
"outputs": [],
"source": [
"import omop as oo\n",
"import lamindb as ln\n",
"import omop as op\n",
"import pandas as pd"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Load the data into a dataframe:"
"Load the data into a Pandas DataFrame:"
]
},
{
Expand Down Expand Up @@ -101,16 +102,32 @@
},
"outputs": [],
"source": [
"concepts = [oo.Concept(**row.to_dict()) for _, row in df.iterrows()]\n",
"concepts = [op.Concept(**row.to_dict()) for _, row in df.iterrows()]\n",
"for concept in concepts:\n",
" concept.save()\n",
"oo.Concept.df()"
"op.Concept.df()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Perform validation of new data."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"op.Concept.validate([\"Stroke Volume Variation\", \"this concept does not exist\"], field=op.Concept.concept_name)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "py310",
"display_name": "lamindb",
"language": "python",
"name": "python3"
},
Expand All @@ -124,7 +141,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion omop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
Vocabulary
"""

__version__ = "0.1.1" # denote a pre-release for 0.1.0 with 0.1rc1
__version__ = "0.1.2" # denote a pre-release for 0.1.0 with 0.1rc1

from lamindb_setup import _check_instance_setup

Expand Down
Loading
Loading