Skip to content

Add missing OMOP tables to the default config - #1310

Open
kojikojikojikoji wants to merge 1 commit into
sunlabuiuc:masterfrom
kojikojikojikoji:omop-observation-period-visit-detail
Open

kojikojikojikoji wants to merge 1 commit into
sunlabuiuc:masterfrom
kojikojikojikoji:omop-observation-period-visit-detail

Conversation

@kojikojikojikoji

Copy link
Copy Markdown

Part of #1294.

The default OMOP config did not define observation_period, visit_detail, observation or device_exposure, so loading them raised Table ... not found in config, though the docstring lists the last two. I used columns that exist in both CDM v5.3 and v5.4.

Added small CSVs to test-resources/omop and a test in tests/core/test_omop.py that loads all four.

from pyhealth.datasets import OMOPDataset

if __name__ == "__main__":
    tables = ["observation_period", "visit_detail", "observation", "device_exposure"]
    ds = OMOPDataset(root="test-resources/omop", tables=tables)
    patient = ds.get_patient("-4873075614181207858")
    for t in tables:
        print(t, len(patient.get_events(event_type=t)))
before after

observation and device_exposure are listed in the OMOPDataset
docstring but were not in omop.yaml, so loading them failed with
"Table ... not found in config". Also add observation_period and
visit_detail. Columns are the ones shared by CDM v5.3 and v5.4.

Signed-off-by: Koji Miyazawa <24467062+kojikojikojikoji@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant