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

Events within visit #7

Merged
merged 3 commits into from
Sep 20, 2017
Merged

Events within visit #7

merged 3 commits into from
Sep 20, 2017

Conversation

gowthamrao
Copy link
Member

This pull-request addresses the following:

  1. New major functionality in creating Qualified_events. Option to restrict events within same visit
  2. visit_occurrence is maybe used to generate statistics about cohort-creation
  3. changed row_number() to dense_rank() to allow to restrict to earliest-event, latest-event or all-event in qualified-event queries.
    Atlas Cohort issue - cohort with certain procedure in the same visit with a certain diagnosis Atlas#454

@gowthamrao
Copy link
Member Author

@chrisknoll - please let us know if you find any issues with this PR

@chrisknoll
Copy link
Collaborator

Will do. I'm sorry I haven't been able to turn this around sooner, there's been other priorities I've had to manage. I'll let you know if there's any issues by 9/20.

Copy link
Collaborator

@chrisknoll chrisknoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in local branch passing in a JSON object with restrictVisit = true and false, and saw the correct changes. Query executed against PDW.

@chrisknoll
Copy link
Collaborator

@gowthamrao , as an aside, and I don't want to hold this PR up, but the change you made regarding dense_rank() wasn't made in all places. You did it when the primary events were selected, but you didn't put it in to the individual criteria queries such as here:
https://github.com/OHDSI/circe-be/blob/master/src/main/resources/resources/cohortdefinition/sql/conditionOccurrence.sql#L5

Pretty much anywhere you see 'as ordinal' in the select, you should use dense_rank(). The reason for this is that when you make a correlated query, you want to be able to find events that occur on the same day when they choose 'first event'. But this is a minor change and shouldn't hold up this PR here, so I'm merging in this to get the 'same visit' criteria implemented.

Next step will be to modify the Atlas circe ui editor to provide the checkbox to let people restrict to same visit.

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.

None yet

2 participants