Skip to content

Commit

Permalink
Limit observation_period_end_date to current date
Browse files Browse the repository at this point in the history
Fixes ohdsi-studies#39 
By limiting the end_date to current date, age groups are created without NAs
  • Loading branch information
kzollove authored Mar 17, 2023
1 parent 1202414 commit 1c8922d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion feasibility/sql/stratified_person.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ db_year_range_sql <- render(
'SELECT
MIN("observation_period_1"."observation_period_end_date") AS "first_year",
MAX("observation_period_1"."observation_period_end_date") AS "last_year"
FROM @schema."observation_period" AS "observation_period_1";',
FROM @schema."observation_period" AS "observation_period_1"
WHERE "observation_period_1"."observation_period_end_date" <= GETDATE();',
schema = schema
)
db_year_range_sql <- translate(sql = db_year_range_sql, targetDialect = dbms)
Expand Down

0 comments on commit 1c8922d

Please sign in to comment.