-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5eba55
commit 91b4823
Showing
25 changed files
with
492 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
notebooks/ | ||
data/* | ||
|
||
.ruff_cache | ||
.old | ||
.vscode | ||
|
||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Changelog | ||
|
||
## [0.2.0](https://github.com/OHDSI/Hestia/compare/v0.1.0...v0.2.0) (2024-03-05) | ||
|
||
|
||
### Features | ||
|
||
* added dev container ([3ddcc41](https://github.com/OHDSI/Hestia/commit/3ddcc4104b618c622a9f8e13f0b98d4810bb89f0)) | ||
* added dev container ([3934c53](https://github.com/OHDSI/Hestia/commit/3934c5373e806430402851f067537a45f535590c)) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* release-please set to push for main ([5682581](https://github.com/OHDSI/Hestia/commit/568258197dd56a08b451f267a46e83a100e7657e)) | ||
|
||
|
||
### Documentation | ||
|
||
* added CONTRIBUTING.md ([54d393c](https://github.com/OHDSI/Hestia/commit/54d393c5131504d95391de3b0e2087d61b10a06a)) | ||
* organization ([9efe22f](https://github.com/OHDSI/Hestia/commit/9efe22f9c83e70e5b1caed9e20c58dc810296d81)) | ||
* typo ([e32f838](https://github.com/OHDSI/Hestia/commit/e32f83821de303ad17f96b1aba0bce7d6ba4d1c6)) | ||
* update readme ([fc8f48a](https://github.com/OHDSI/Hestia/commit/fc8f48a17319725e2bcd06067b30b459f48c6297)) | ||
* updated contrib ([2f2ead3](https://github.com/OHDSI/Hestia/commit/2f2ead3f73cd487022b13e1337f8c92770a0353f)) | ||
* updated readme ([aaae4da](https://github.com/OHDSI/Hestia/commit/aaae4dae9e26113186b08920032dce200994201c)) | ||
* updated README ([2919cec](https://github.com/OHDSI/Hestia/commit/2919cec4cafdc67b572405900620fd50f449b2bf)) | ||
* updated security.md ([6272ebc](https://github.com/OHDSI/Hestia/commit/6272ebcb57ce65d7b600e8d8253f35430e3a3dd0)) | ||
* updates ([b6c6be3](https://github.com/OHDSI/Hestia/commit/b6c6be3502c44e79892eb3872b97ed1b055cad2d)) | ||
|
||
## 0.1.0 (2024-02-16) | ||
|
||
|
||
### Features | ||
|
||
* added setup.cfg ([7aff036](https://github.com/OHDSI/Hestia/commit/7aff036b5b1e437220c725532d063eccddb97a8c)) | ||
|
||
|
||
### Documentation | ||
|
||
* added code owner ([887b7df](https://github.com/OHDSI/Hestia/commit/887b7dfa3e494c21e84d548df19e1ddc5e09eaf0)) | ||
* added templates and file structure ([3d33b3d](https://github.com/OHDSI/Hestia/commit/3d33b3d399144224116690ef1ddc215f229f3413)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Python | ||
__pycache__ | ||
app.egg-info | ||
*.pyc | ||
.mypy_cache | ||
.coverage | ||
htmlcov | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
__pycache__ | ||
app.egg-info | ||
*.pyc | ||
.mypy_cache | ||
.coverage | ||
htmlcov | ||
.cache | ||
.venv |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# app/api/endpoints/endpoint_concept.py | ||
|
||
from fastapi import APIRouter, Depends, HTTPException | ||
from sqlalchemy.orm import Session | ||
from app.crud import crud_concept | ||
from app.db.session import get_db # Assuming you have a function to get the DB session | ||
|
||
router = APIRouter() | ||
|
||
@router.get("/concept/{concept_id}") | ||
def read_concept(concept_id: int, db: Session = Depends(get_db)): | ||
db_concept = crud_concept.get_concept(db, concept_id=concept_id) | ||
if db_concept is None: | ||
raise HTTPException(status_code=404, detail="Concept not found") | ||
return db_concept |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
|
||
### CARE SITE ### | ||
|
||
|
||
|
||
### CONDITION ### | ||
|
||
### CONDITION ERA ### | ||
|
||
### CONDITION OCCURRENCE COMBINATIONS ### | ||
|
||
|
||
|
||
|
||
### DRUG ### | ||
|
||
### DRUG COST ### | ||
|
||
### DRUG ERA ### | ||
|
||
### DRUG EXPOSURE ### | ||
|
||
### OBSERVATION PERIOD ### | ||
|
||
### OBSERVATION ### | ||
|
||
### PAYER PLAN ### | ||
|
||
### PROCEDURE ### | ||
|
||
### PERSON ### | ||
|
||
|
||
|
||
|
||
### GENERAL ### | ||
|
||
|
||
|
||
# G01: Find concept by concept ID | ||
def find_concept_by_concept_id(concept_id, connection): | ||
""" | ||
This is the most generic look-up for obtaining concept details associated with a concept identifier. The query is intended as a tool for quick reference for the name, class, level and source vocabulary details associated with a concept identifier. | ||
Parameters: | ||
concept_id (int): The ID of the concept to retrieve. | ||
connection: An ibis backend connection object to the OMOP CDM database using the ibis framework. | ||
Returns: | ||
DataFrame: The result of the query is an Ibis DataFrame. | ||
""" | ||
|
||
query = ( | ||
connection.table('concept').sql(f""" | ||
SELECT | ||
c.concept_id, | ||
c.concept_name, | ||
c.concept_code, | ||
c.concept_class_id, | ||
c.standard_concept, | ||
c.vocabulary_id | ||
FROM concept AS c | ||
WHERE concept_id = {concept_id} | ||
; | ||
""") | ||
) | ||
|
||
return query | ||
|
||
|
||
# G02: Find a concept by code from a source vocabulary | ||
def find_concept_by_code_form_a_source_vocabulary(concept_id, vocabulary_id, connection): | ||
""" | ||
This query obtains the concept details associated with a concept code, such as name, class, level and source vocabulary. | ||
Only concepts from the Standard Vocabularies can be searched using this query. If you want to translate codes from other Source Vocabularies to Standard Vocabularies use G06 query. | ||
Parameters: | ||
concept_id (int): The ID of the concept to retrieve. | ||
vocabulary_id (str): The source vocabulary ID of the concept to retrieve. | ||
connection: An ibis backend connection object to the OMOP CDM database using the ibis framework. | ||
Returns: | ||
DataFrame: The result of the query is an Ibis DataFrame. | ||
""" | ||
|
||
query = ( | ||
connection.table('concept').sql(f""" | ||
SELECT | ||
c.concept_id, | ||
c.concept_name, | ||
c.concept_code, | ||
c.concept_class_id, | ||
c.vocabulary_id | ||
FROM concept AS c | ||
WHERE | ||
c.concept_code = {concept_id} AND | ||
c.vocabulary_id = {vocabulary_id} AND | ||
c.invalid_reason IS NULL | ||
; | ||
""") | ||
) | ||
|
||
return query | ||
|
||
|
||
# G04: Find synonyms for a given concept | ||
def find_synonyms_for_a_given_concept(): | ||
|
||
|
||
# G05: Translate a code from a source to a standard vocabulary. | ||
def translate_a_code_from_a_source_to_a_standard_vocabulary(): | ||
|
||
|
||
# G06: Find concepts and their descendants that are covered by a given source code | ||
def find_concepts_and_their_descendants_that_are_covered_by_a_given_source_code(): | ||
|
||
|
||
# G07: Find concepts that have a relationship with a given concept | ||
def find_concepts_that_have_a_relationship_with_a_given_concept(): | ||
|
||
|
||
# G08: Find ancestors for a given concept | ||
def find_ancestors_for_a_given_concept(): | ||
|
||
|
||
# G09: Find descendants for a given concept | ||
def find_descendants_for_a_given_concept(): | ||
|
||
|
||
# G10: Find parents for a given concept | ||
def find_parents_for_a_given_concept(): | ||
|
||
|
||
# G11: Find children for a given concept | ||
def find_children_for_a_given_concept(): | ||
|
||
|
||
# G12: List current vocabulary release number | ||
def list_current_vocabulary_release_number(): | ||
|
||
|
||
# G13: List available vocabularies | ||
def list_available_vocabularies(): | ||
|
||
|
||
# G14: Statistics about relationships between concepts | ||
def statistics_about_relationships_between_concepts(): | ||
|
||
|
||
# G15: Statistic about Concepts, Vocabularies, Classes and Levels | ||
def statistic_about_concepts_vocabularies_classes_and_levels(): | ||
|
||
|
||
# G16: Statistics about Condition Mapping of Source Vocabularies | ||
def statistics_about_condition_mapping_of_source_vocabularies(): | ||
|
||
|
||
# G17: Statistics about Drugs Mapping of Source Vocabularies | ||
def statistics_about_drugs_mapping_of_source_vocabularies(): | ||
|
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Oops, something went wrong.