Skip to content
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

[DC-3635] Remove portion of query checking primary consent #1834

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -866,26 +866,6 @@ def my_sql(table_name, column_name):
SELECT person_id
FROM `{{project_id}}.{{rt_cdr_deid}}.person` o
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaelSchmidt82 you would also need to update the comment for this check to remove primary_consent related info.

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)
Expand Down