Calculate the total length of stay between start_date
and
end_date
.
If the end_date
is missing then use the dummy discharge date.
Value
a tibble with additional variable stay
.
If there is no end date use dummy discharge to calculate the total
length of stay.
If there is no end date but sc_qtr is supplied then set this to the end of
the quarter.
If quarter end_date < start_date
and sc_qtr
is supplied then set this
to the end of the next quarter.
See also
Other date functions:
compute_mid_year_age()
,
convert_date_to_numeric()
,
convert_numeric_to_date()
,
end_fy()
,
end_fy_quarter()
,
end_next_fy_quarter()
,
fy_interval()
,
is_date_in_fyyear()
,
last_date_month()
,
midpoint_fy()
,
next_fy()
,
start_fy()
,
start_fy_quarter()
,
start_next_fy_quarter()