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

Trim demographics #94

Merged
merged 12 commits into from
Apr 16, 2024
Merged

Trim demographics #94

merged 12 commits into from
Apr 16, 2024

Conversation

catalamarti
Copy link
Collaborator

No description provided.

@catalamarti
Copy link
Collaborator Author

hi @nmercadeb @edward-burn I think this needs more testing, will need to add it during the week :)

sex = NULL,
minPriorObservation = NULL,
minFutureObservation = NULL,
order = c("sex", "age", "prior_observation", "future_observation"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

would be good to discuss this pattern (on the face of it I don't really like it as it doesn't quite fit the rest of the package, but would need to understand better why it is here)

name <- validateName(name)
cohortName <- assertCharacter(cohortName, length = 1)

cdm[[name]] <- cdm$observation_period |>
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be good I think to inner_join with the person table. Normally people in person would also be in observation period (and vice versa) but i have seen cases where this is not true

# TO BE EXPORTED WHEN TESTS ARE ADDED
#' @noRd
#'
observationPeriodCohort <- function(cdm,
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could make the name a little more general to indicate this is person + observation period tables (see comment below)

In a way I would be tempted to broaden and make a demographicCohort() function .....

@catalamarti catalamarti requested review from edward-burn and nmercadeb and removed request for edward-burn April 15, 2024 18:01
@catalamarti
Copy link
Collaborator Author

this should be ready for a second review @edward-burn @nmercadeb

Copy link
Collaborator

@nmercadeb nmercadeb left a comment

Choose a reason for hiding this comment

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

I added an issue to create tests for demographicsCohort since there aren't, but everything else seems fine to me!

@edward-burn edward-burn merged commit 61478c4 into main Apr 16, 2024
1 check passed
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.

3 participants