Reduce a service_type data frame to the row effective for each service_type_code as of a given date
Source:R/get_effective_service_type.R
get_effective_service_type.Rd`service_type` may contain multiple rows per `service_type_code`, distinguished by `start_date`, so that rate changes can be scheduled by adding a row rather than editing code. This collapses the table to the single row per `service_type_code` that is in effect as of `as_of_date`: the row with the latest `start_date` that is not after `as_of_date`. A row with `start_date = NA` is treated as effective since the beginning of time and is only used as a fallback when no dated row applies yet.
Examples
if (FALSE) { # \dontrun{
get_effective_service_type(service_type, redcapcustodian::get_script_run_time())
} # }