Skip to content

Commit

Permalink
Cb/VDA-1961-1962 Add Columns to Drug and Measurement Review (#1119)
Browse files Browse the repository at this point in the history
* Adding columns to drug review table in sd

* Adding columns to measurement review table in sd

* Set up configs for local dev (verily configs) (#1120)

* bump 0.0.713

* Adding columns to drug review table in sd

* Adding columns to measurement review table in sd

---------

Co-authored-by: Dexter Amundsen <[email protected]>
Co-authored-by: bumptagbot <[email protected]>
  • Loading branch information
3 people authored Jan 10, 2025
1 parent e83c510 commit 1d3c117
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,25 @@ SELECT
de.drug_source_concept_id,
CAST(FLOOR(TIMESTAMP_DIFF(de.drug_exposure_start_datetime, p.birth_datetime, DAY) / 365.25) AS INT64) AS age_at_occurrence,
de.visit_occurrence_id,
de.drug_type_concept_id,
tc.concept_name AS drug_type_concept_name,
vo.visit_concept_id,
vc.concept_name AS visit_concept_name
vc.concept_name AS visit_concept_name,
de.route_source_value AS route,
x.x_drug_form AS drug_form,
x.x_strength AS drug_strength,
x.x_dose AS dose_amt,
x.x_frequency AS drug_freq,
x.x_doc_type AS source_table

FROM `${omopDataset}.drug_exposure` AS de

JOIN `${omopDataset}.person` AS p
ON p.person_id = de.person_id

JOIN `${omopDataset}.x_drug_exposure` AS x
ON de.drug_exposure_id = x.drug_exposure_id

JOIN `${omopDataset}.concept` AS ic
ON ic.concept_id = de.drug_concept_id

Expand All @@ -29,3 +40,6 @@ LEFT JOIN `${omopDataset}.visit_occurrence` AS vo

LEFT JOIN `${omopDataset}.concept` AS vc
ON vc.concept_id = vo.visit_concept_id

LEFT JOIN `${omopDataset}.concept` AS tc
ON tc.concept_id = de.drug_type_concept_id
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@
{ "name": "source_criteria_id", "dataType": "INT64", "valueFieldName": "drug_source_concept_id" },
{ "name": "age_at_occurrence", "dataType": "INT64", "isComputeDisplayHint": true, "displayHintRangeMin": 0, "displayHintRangeMax": 89 },
{ "name": "visit_occurrence_id", "dataType": "INT64" },
{ "name": "visit_type", "dataType": "INT64", "valueFieldName": "visit_concept_id", "displayFieldName": "visit_concept_name", "isComputeDisplayHint": true }
{ "name": "visit_type", "dataType": "INT64", "valueFieldName": "visit_concept_id", "displayFieldName": "visit_concept_name", "isComputeDisplayHint": true },
{"name": "exposure_type", "dataType": "INT64", "valueFieldName": "drug_type_concept_id", "displayFieldName": "drug_type_concept_name"},
{"name": "form", "dataType": "STRING", "valueFieldName": "drug_form"},
{"name": "strength", "dataType": "STRING", "valueFieldName": "drug_strength"},
{"name": "amount", "dataType": "STRING", "valueFieldName": "dose_amt"},
{"name": "route", "dataType": "STRING", "valueFieldName": "route"},
{"name": "frequency", "dataType": "STRING", "valueFieldName": "drug_freq"},
{"name": "source", "dataType": "STRING", "valueFieldName": "source_table"}
],
"idAttribute": "id",
"optimizeGroupByAttributes": [ "ingredient" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ SELECT DISTINCT
CAST(FLOOR(TIMESTAMP_DIFF(mo.measurement_datetime, p.birth_datetime, DAY) / 365.25) AS INT64) AS age_at_occurrence,
mo.visit_occurrence_id,
vo.visit_concept_id,
vc.concept_name AS visit_concept_name
vc.concept_name AS visit_concept_name,
mo.measurement_type_concept_id,
tc.concept_name AS measurement_type_concept_name


FROM `${omopDataset}.measurement` AS mo

Expand All @@ -36,3 +39,6 @@ ON vo.visit_occurrence_id = mo.visit_occurrence_id

LEFT JOIN `${omopDataset}.concept` AS vc
ON vc.concept_id = vo.visit_concept_id

LEFT JOIN `${omopDataset}.concept` AS tc
ON tc.concept_id = mo.measurement_type_concept_id
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
{ "name": "source_criteria_id", "dataType": "INT64", "valueFieldName": "measurement_source_concept_id" },
{ "name": "age_at_occurrence", "dataType": "INT64", "isComputeDisplayHint": true, "displayHintRangeMin": 0, "displayHintRangeMax": 89 },
{ "name": "visit_occurrence_id", "dataType": "INT64" },
{ "name": "visit_type", "dataType": "INT64", "valueFieldName": "visit_concept_id", "displayFieldName": "visit_concept_name", "isComputeDisplayHint": true }
{ "name": "visit_type", "dataType": "INT64", "valueFieldName": "visit_concept_id", "displayFieldName": "visit_concept_name", "isComputeDisplayHint": true },
{"name": "measurement_type", "dataType": "INT64", "valueFieldName": "measurement_type_concept_id", "displayFieldName": "measurement_type_concept_name"}
],
"idAttribute": "id",
"optimizeGroupByAttributes": [ "measurement" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SELECT
EXISTS
(SELECT 1 FROM `${omopDataset}.genotype_result` gr WHERE p.person_id = gr.person_id
AND gr.assay_name = 'agd whole genome sequencing' ) AS has_agd_genotype_result,
CASE WHEN d.death_date is null THEN true ELSE false END AS is_deceased
CASE WHEN d.death_date is null THEN false ELSE true END AS is_deceased

FROM `${omopDataset}.person` p

Expand Down
78 changes: 72 additions & 6 deletions underlay/src/main/resources/config/underlay/sd/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,63 @@
},
{
"key": "start_date",
"width": 200,
"width": 150,
"title": "Start date",
"sortable": true
},
{
"key": "end_date",
"width": 200,
"width": 150,
"title": "End date",
"sortable": true
},
{
"key": "exposure_type",
"width": 250,
"title": "Exposure type",
"sortable": true
},
{
"key": "form",
"width": 130,
"title": "Form",
"sortable": true
},
{
"key": "strength",
"width": 150,
"title": "Strength",
"sortable": true
},
{
"key": "amount",
"width": 130,
"title": "Amount",
"sortable": true
},
{
"key": "route",
"width": 150,
"title": "Route",
"sortable": true
},
{
"key": "frequency",
"width": 150,
"title": "Frequency",
"sortable": true
},
{
"key": "source",
"width": 150,
"title": "Source",
"sortable": true
},
{
"key": "age_at_occurrence",
"width": 200,
"title": "Age At Event",
"sortable": true
}
]
}
Expand All @@ -181,22 +229,40 @@
"sortable": true,
"filterable": true
},
{ "key": "date", "width": 200, "title": "Date", "sortable": true },
{ "key": "start_date", "width": 200, "title": "Date", "sortable": true },
{
"key": "value_enum",
"width": 160,
"width": 200,
"title": "Categorical value",
"sortable": true,
"filterable": true
},
{
"key": "value_numeric",
"width": 160,
"width": 200,
"title": "Numeric value",
"sortable": true,
"filterable": true
},
{ "key": "unit", "width": 160, "title": "Unit", "sortable": true }
{ "key": "unit", "width": 160, "title": "Unit", "sortable": true },
{
"key": "measurement_type",
"width": 250,
"title": "Measurement type",
"sortable": true
},
{
"key": "source_value",
"width": 200,
"title": "Source value",
"sortable": true
},
{
"key": "age_at_occurrence",
"width": 170,
"title": "Age at event",
"sortable": true
}
]
}
},
Expand Down

0 comments on commit 1d3c117

Please sign in to comment.