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

Fixes Number of persons with continuous observation in each year #695

Merged
merged 5 commits into from Nov 29, 2018

Conversation

wivern
Copy link
Contributor

@wivern wivern commented Nov 15, 2018

closes #318

@wivern wivern requested a review from pavgra November 15, 2018 10:45
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)),
Copy link
Collaborator

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

@anthonysena anthonysena added this to the V2.7.0. "Bug free" milestone Nov 21, 2018
on p1.person_id = c1.subject_id
inner join
@CDM_schema.observation_period op1
on p1.person_id = op1.person_id)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@pavgra pavgra merged commit 7085997 into master Nov 29, 2018
@chrisknoll chrisknoll deleted the issue-318-heracles-continuous-observation branch November 29, 2018 20:10
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

Successfully merging this pull request may close these issues.

Heracles 109 Number of persons with continuous observation in each year
4 participants