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
Fixes Number of persons with continuous observation in each year #695
Conversation
inner join | ||
@CDM_schema.observation_period op1 | ||
on p1.person_id = op1.person_id | ||
WITH x AS (SELECT n FROM (VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) v(n)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, the FROM VALUES() syntax does not seem to work on PDW.
Could this be updated to:
select 0 as n UNION ALL select 1 UNION ALL select 2 UNION ALL select 3 UNION ALL select 4 UNION ALL select 5 UNION ALL select 6 UNION ALL select 7 UNION ALL select 8 UNION ALL select 9
We have sqlrender rules that will change this to select 0 as n from dual and select 1 from dual in oracle...
We use this pattern here:
https://github.com/OHDSI/WebAPI/blob/master/src/main/resources/ddl/results/init_heracles_periods.sql#L9
on p1.person_id = c1.subject_id | ||
inner join | ||
@CDM_schema.observation_period op1 | ||
on p1.person_id = op1.person_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot we move repetitive code chunks into temp tables to reduce code duplication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can, but each report could be run separately. so that temp tables has to be present on each report with no profit.
# Conflicts: # src/main/resources/resources/cohortanalysis/sql/runHeraclesAnalyses.sql
closes #318