query_opcs_codes: Title query_opcs_codes

View source: R/query_opcs_codes.R

query_opcs_codesR Documentation

Title query_opcs_codes

Description

Title query_opcs_codes

Usage

query_opcs_codes(
  hospital_events_tbl,
  codes,
  search_strat_date,
  search_strat_adm_method = "all",
  time_window,
  return_vals
)

Arguments

hospital_events_tbl

table of hospital episodes and associated data

codes

A vector OPCS codes to search for e.g. c("K72")

search_strat_date

The date search strategy; return the most recent date with "max", or the most historical date with "min"

search_strat_adm_method

the admission method to filter on, on of c(...) "exists" returns a boolean as to whether a code was found within the time window

time_window

The time window to search within - must be a lubridate::interval() object

return_vals

A switch on what is being returned. If nothing found then NA is returned. Can be a vector, in which case multiple colums returned "code" returns the OPCS code "spell_interval" returns the spell interval in which the OPCS code was found

Value

Depends on the return_val parameter


nicksunderland/acsprojectns documentation built on July 20, 2023, 7:23 p.m.