Closed TheCedarPrince closed 1 year ago
Here's a very loose description of the function's docstring:
"""
GetVisitDate(visit_occurrence_id; interval::Symbol = :start, tab = visit_occurrence)
This function queries a database for the start or end date of the visit occurrence associated with the given `visit_occurrence_id` or list of `visit_occurrence_id`'s.
# Arguments:
- `visit_occurrence_id`: A single `visit_occurrence_id` or a vector of `visit_occurrence_id`'s to query for.
- `interval`: A keyword argument that determines whether to query for the visit start date (`interval=:start`) or the visit end date (`interval=:end`). Default value is `interval=:start`.
# Returns:
A dataframe with two columns: `visit_occurrence_id` and either `visit_start_date` or `visit_end_date`, depending on the value of the `interval` argument.
Thanks @VarshC for adding this feature!
I was tinkering with the Mental Health Equity study code today, and realized in creating one of our cohorts, we need a function called
GetVisitDate
that does the following:visit_occurrence_id
or a list ofvisit_occurrence_id
'svisit_start_date
orvisit_end_date
(I would do something like:interval = :start
forvisit_start_date
andinterval=:end
forvisit_end_date
)visit_occurrence_id
given to the function and finds its associated interval in the visit occurrence.visit_occurrence_id
and the requested date for the second columnnamed either
visit_start_dateor
visit_end_date`Could you get to this asap @VarshC ? Thanks! :smile: