diff --git a/data_steward/analytics/cdr_ops/controlled_tier_qc/check_controlled_tier_part2.py b/data_steward/analytics/cdr_ops/controlled_tier_qc/check_controlled_tier_part2.py index 628c878e1..a29a16aaa 100644 --- a/data_steward/analytics/cdr_ops/controlled_tier_qc/check_controlled_tier_part2.py +++ b/data_steward/analytics/cdr_ops/controlled_tier_qc/check_controlled_tier_part2.py @@ -1300,7 +1300,6 @@ def query_template(table_era): # **If check fails:**
# * The issue `participant with multiple records` means that those participants have multiple rows in the wear_study table, which should not be possible. Investigate the issue. Start with the CR that creates the wear_study table.
# * The issue `not in person table` means that participants exist in the wear_study table that aren't in the person table, which should not be possible. Investigate the issue. Start with the CR that creates the wear_study table.
-# * The issue `no primary consent` means that participants exist in the wear_study table that do not have proper primary consent. Investigate the issue. It is possible that there is another way to determine primary consent.
# + query = JINJA_ENV.from_string(""" @@ -1329,26 +1328,6 @@ def query_template(table_era): SELECT person_id FROM `{{project_id}}.{{ct_dataset}}.person` o ) - -UNION ALL - -SELECT - 'no primary consent' as issue, - COUNT(person_id) as bad_rows -FROM `{{project_id}}.{{ct_dataset}}.wear_study` ws -WHERE person_id not in ( -- aou consenting participants -- - SELECT cte.person_id - FROM latest_primary_consent_records cte - LEFT JOIN ( -- any positive primary consent -- - SELECT * - FROM `{{project_id}}.{{ct_dataset}}.observation` - WHERE REGEXP_CONTAINS(observation_source_value, '(?i)extraconsent_agreetoconsent') - AND value_as_concept_id = 45877994) o - ON cte.person_id = o.person_id - AND cte.latest_date = o.observation_date - WHERE o.person_id IS NOT NULL - ) - """) q = query.render(project_id=project_id, ct_dataset=ct_dataset) df1 = execute(client, q) @@ -1371,6 +1350,7 @@ def query_template(table_era): ignore_index=True) # - + df1 # + @@ -1530,4 +1510,4 @@ def highlight_cells(val): return f'background-color: {color}' -df.style.applymap(highlight_cells).set_properties(**{'text-align': 'left'}) \ No newline at end of file +df.style.applymap(highlight_cells).set_properties(**{'text-align': 'left'}) diff --git a/data_steward/analytics/cdr_ops/rt_cdr_qc/cdr_deid_qa_report10_extra.py b/data_steward/analytics/cdr_ops/rt_cdr_qc/cdr_deid_qa_report10_extra.py index dc20879d6..ce9accf15 100644 --- a/data_steward/analytics/cdr_ops/rt_cdr_qc/cdr_deid_qa_report10_extra.py +++ b/data_steward/analytics/cdr_ops/rt_cdr_qc/cdr_deid_qa_report10_extra.py @@ -866,26 +866,6 @@ def my_sql(table_name, column_name): SELECT person_id FROM `{{project_id}}.{{rt_cdr_deid}}.person` o ) - -UNION ALL - -SELECT - 'no primary consent' as issue, - COUNT(person_id) as bad_rows -FROM `{{project_id}}.{{rt_cdr_deid}}.wear_study` ws -WHERE person_id not in ( -- aou consenting participants -- - SELECT cte.person_id - FROM latest_primary_consent_records cte - LEFT JOIN ( -- any positive primary consent -- - SELECT * - FROM `{{project_id}}.{{rt_cdr_deid}}.observation` - WHERE REGEXP_CONTAINS(observation_source_value, '(?i)extraconsent_agreetoconsent') - AND value_as_concept_id = 45877994) o - ON cte.person_id = o.person_id - AND cte.latest_date = o.observation_date - WHERE o.person_id IS NOT NULL - ) - """) q = query.render(project_id=project_id, rt_cdr_deid=rt_cdr_deid)