-
Notifications
You must be signed in to change notification settings - Fork 38
Initial beta build for OMOP Waveform Extension ETL #65
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
Open
briangow
wants to merge
27
commits into
dev
Choose a base branch
from
bg_waveform_extension_1
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
6882109
add waveform extension ddl
briangow 69f4ca9
waveform extension table build
briangow 4c580ef
update readme for waveform extension
briangow 36e08cc
update waveform extension build
briangow 18832aa
update readme for waveform extension build
briangow 2f2e20f
update variable name and use 64 bit for waveform_channel_metadata_id
briangow bec3f9e
Create SQL validation queries for waveform extension
p-talapova 0c0ddb4
etl(wf-occurrence): deterministic person/visit/time; validate group_i…
briangow e1cf63a
etl(wf-registry): 1 row per trg_file; IDs from trg_file; no URI recon…
briangow 609e657
etl(wf-lineage): inherit person/visit from occurrence; channels join …
briangow bcb7ac7
remove _all from waveform source files
briangow 26e8bb5
fix typo
briangow 33ca3a2
etl(wf-channel-id): use registry_id + channel_index + metadata_type f…
briangow c92579d
etl(wf-channel-required): fail on unresolved required concepts; skip …
briangow 5f58004
etl(wf-mapping-channel): apply tiered channel mapping and fail on amb…
briangow c3ec93c
etl(wf-units): map only to valid standard Unit-domain concepts; prese…
briangow b7dcba8
test(wf-qa): add blocking waveform integrity checks and QA workflow c…
briangow 81d03a2
ddl(wf-ddl): centralize waveform table definitions and truncate/reloa…
briangow c9f7871
wf-cleanup: clean up formatting
briangow f5a1a25
remove old waveform script from workflow
briangow e77ef67
note old waveform etl in readme
briangow fca5992
support sql_script workflows for waveforms
briangow 99502e5
waveform etl - move declare statement to top
briangow 70d90e2
keep unit concept id matching case sensitive
briangow a9b9901
Resolve README merge conflict
briangow 1a325d3
add source waveform channel_index to readme schema
briangow 30748b4
waveforms - remove metadata fallback to zero
briangow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,12 @@ | ||
| { | ||
| "workflow": "waveforms", | ||
| "type": "sql_script", | ||
|
|
||
| "scripts": | ||
| [ | ||
| {"script": "etl/etl/cdm_waveform_occurrence.sql", "comment": ""}, | ||
| {"script": "etl/etl/cdm_waveform_registry.sql", "comment": ""}, | ||
| {"script": "etl/etl/cdm_waveform_update_num_of_files.sql", "comment": ""}, | ||
| {"script": "etl/etl/cdm_waveform_channel_metadata.sql", "comment": ""} | ||
| ] | ||
| } |
This file contains hidden or 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,10 @@ | ||
| { | ||
| "workflow": "waveforms_qa", | ||
| "type": "sql_script", | ||
| "scripts": [ | ||
| { | ||
| "script": "test/qa/qa_wf_extension.sql", | ||
| "comment": "Blocking waveform QA checks" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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,76 @@ | ||
|
|
||
|
|
||
| CREATE OR REPLACE TABLE @etl_project.@etl_dataset.cdm_waveform_occurrence | ||
| ( | ||
| waveform_occurrence_id INT64 not null, | ||
| waveform_occurrence_concept_id INT64 not null, | ||
| person_id INT64 not null, | ||
| waveform_occurrence_start_datetime DATETIME not null, | ||
| waveform_occurrence_end_datetime DATETIME not null, | ||
| visit_occurrence_id INT64 not null, | ||
| visit_detail_id INT64 , | ||
| preceding_waveform_occurrence_id INT64 , | ||
| waveform_format_concept_id INT64 , | ||
| waveform_occurrence_source_value STRING , | ||
| num_of_files INT64 , | ||
| waveform_format_source_value STRING | ||
| ) | ||
| ; | ||
|
|
||
|
|
||
| CREATE OR REPLACE TABLE @etl_project.@etl_dataset.cdm_waveform_registry | ||
| ( | ||
| waveform_registry_id INT64 not null, | ||
| waveform_occurrence_id INT64 not null, | ||
| waveform_feature_id INT64 , | ||
| person_id INT64 not null, | ||
| waveform_file_start_datetime DATETIME not null, | ||
| waveform_file_end_datetime DATETIME not null, | ||
| visit_occurrence_id INT64 not null, | ||
| visit_detail_id INT64 , | ||
| file_extension_concept_id INT64 , | ||
| file_extension_source_value STRING not null, | ||
| waveform_source_file_uri STRING , | ||
| waveform_target_file_uri STRING not null | ||
| ); | ||
|
|
||
|
|
||
| CREATE OR REPLACE TABLE @etl_project.@etl_dataset.cdm_waveform_channel_metadata | ||
| ( | ||
| waveform_channel_metadata_id INT64 not null, | ||
| waveform_registry_id INT64 not null, | ||
| procedure_occurrence_id INT64 , | ||
| device_exposure_id INT64 , | ||
| waveform_channel_source_value STRING , | ||
| channel_concept_id INT64 not null, | ||
| metadata_source_value STRING not null, | ||
| metadata_concept_id INT64 not null, | ||
| value_as_number FLOAT64 , | ||
| value_as_concept_id INT64 , | ||
| value_as_string STRING , | ||
| unit_concept_id INT64 , | ||
| unit_source_value STRING | ||
| ); | ||
|
|
||
|
|
||
| CREATE OR REPLACE TABLE @etl_project.@etl_dataset.cdm_waveform_feature | ||
| ( | ||
| waveform_feature_id INT64 not null, | ||
| waveform_occurrence_id INT64 not null, | ||
| waveform_registry_id INT64 not null, | ||
| waveform_channel_metadata_id INT64 not null, | ||
| measurement_id INT64 , | ||
| observation_id INT64 , | ||
| algorithm_concept_id INT64 not null, | ||
| algorithm_source_value STRING , | ||
| anatomic_site_concept_id INT64 , | ||
| waveform_feature_start_timestamp TIME , | ||
| waveform_feature_end_timestamp TIME , | ||
| is_feature_overflow BOOLEAN , | ||
| value_as_number FLOAT64 , | ||
| value_as_concept_id INT64 , | ||
| value_as_string STRING , | ||
| value_is_a_registry_file BOOLEAN , | ||
| unit_concept_id INT64 , | ||
| unit_source_value STRING | ||
| ); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding ddl_cdm_waveform_extension.sql to the DDL workflow is appropriate. However, because the individual ETL scripts recreate the same tables, the schema currently has two separate definitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The waveform extension tables are now defined only in the central DDL workflow, and the waveform ETL scripts populate those existing tables via full-refresh loads.