-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
hi @nmercadeb @edward-burn I think this needs more testing, will need to add it during the week :) |
R/trimDemographics.R
Outdated
sex = NULL, | ||
minPriorObservation = NULL, | ||
minFutureObservation = NULL, | ||
order = c("sex", "age", "prior_observation", "future_observation"), |
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.
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)
R/observationPeriodCohort.R
Outdated
name <- validateName(name) | ||
cohortName <- assertCharacter(cohortName, length = 1) | ||
|
||
cdm[[name]] <- cdm$observation_period |> |
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.
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
R/observationPeriodCohort.R
Outdated
# TO BE EXPORTED WHEN TESTS ARE ADDED | ||
#' @noRd | ||
#' | ||
observationPeriodCohort <- function(cdm, |
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 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 .....
this should be ready for a second review @edward-burn @nmercadeb |
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.
I added an issue to create tests for demographicsCohort since there aren't, but everything else seems fine to me!
No description provided.