get_hospital_admissions: get_hospital_admissions

View source: R/get_hospital_admissions.R

get_hospital_admissionsR Documentation

get_hospital_admissions

Description

get_hospital_admissions

Usage

get_hospital_admissions(
  sus_apc_obj,
  codes_list = NA,
  return_all_codes = FALSE,
  search_strategy = "primary_diagnosis",
  search_strat_adm_method = "all",
  datetime_window = lubridate::interval(NA, NA, tzone = "GMT"),
  id_list = NA,
  ccg_provider_code_list = NA,
  level = "spell",
  verbose = FALSE
)

Arguments

sus_apc_obj

an R6 Database object connected to the APC_SUS database

codes_list

list of ICD-10 diagnosis codes or OPCS procedure codes to search for

return_all_codes

whether to return all the ICD-10 codes associated with the episode/spell, or just those in the 'codes_list'

search_strategy

whether to look in primary diagnosis field, secondary diagnosis field, all diagnosis fields, procedure fields

search_strat_adm_method

the admission method

datetime_window

the beginning and end of the date window (inclusive), must be a lubridate::interval object e.g. lubridate::interval(start, end, tzone = "GMT")

id_list

vector list of character pseudo NHS ids to filter on

ccg_provider_code_list

list of CCG provider codes, default = ALL

level

whether to extract consultant episode or spell level data

verbose

TRUE = print SQL query to console

Value

a data frame


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