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

OMOP Oracle Date issues #48

Open
kirchoffkg opened this issue Apr 5, 2022 · 1 comment
Open

OMOP Oracle Date issues #48

kirchoffkg opened this issue Apr 5, 2022 · 1 comment

Comments

@kirchoffkg
Copy link
Collaborator

The date ranges are not formatted right for oracle. ex), cond.condition_start_date BETWEEN '01-01-2021' AND '12-31-2021' for Oracle. Something like TO_DATE('21-12-31', 'RR-MM-DD')

dth.death_date and per.birth_datetime are in date format so don’t need to cast. CAST doesn’t work.
AND (EXTRACT(YEAR FROM CAST(dth.death_date AS DATE)) - EXTRACT(YEAR FROM CAST(per.birth_datetime AS DATE))) > 120
 replace with: and extract(year from dth.death_date) - extract(year from per.birth_datetime) > 120

If you hard code ’12-31-2022’ to extract the year, can you simply subtract from 2022?
WHERE (EXTRACT(YEAR FROM CAST('12-31-2022' AS DATE)) - EXTRACT(YEAR FROM CAST(birth_datetime AS DATE))) > 12
 replace with: where 2022 - extract(year from birth_datetime) > 120
 or if you want to use the date format, then
replace with: where extract(year from to_date('2022-12-31', 'YYYY-MM-DD')) - extract(year from birth_datetime) > 120

rtmill pushed a commit that referenced this issue Apr 5, 2022
Addresses #48 . @kirchoffkg does this resolve your issues?
@rtmill
Copy link
Collaborator

rtmill commented Apr 5, 2022

Pushed a commit above. Please let us know if that resolves the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants