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

Age char does not de-dupe subjects #28

Open
katy-sadowski opened this issue Oct 17, 2024 · 0 comments
Open

Age char does not de-dupe subjects #28

katy-sadowski opened this issue Oct 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@katy-sadowski
Copy link
Collaborator

setMethod("as_sql", "ageChar", function(x){
domain <- x@domain
sql <- glue::glue(
"-- Make {domain} query
INSERT INTO {{dataTable}} (cohort_id, subject_id, category_id, time_id, value_id, value)
SELECT t.cohort_definition_id AS cohort_id, t.subject_id,
{x@orderId} AS category_id,
-999 AS time_id,
-999 AS value_id,
YEAR(t.cohort_start_date) - d.year_of_birth AS value
FROM {{targetTable}} t
JOIN {{cdmDatabaseSchema}}.person d
ON t.subject_id = d.person_id;"
)
return(sql)
})

@katy-sadowski katy-sadowski added the bug Something isn't working label Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant