Skip to contents

Utility Functions

Functions for reading or writing data from various sources

sql_clean() stable
Clean and Read a SQL query
sql_connect() stable
Connect to a SQL database
sql_read() stable
Read a table from a SQL database
sql_write() stable
Write a table to a SQL database
csv_from_zip() stable
Download a csv from a zip
lookup_recode() stable
Lookup table switch handler

Data Management Functions

Functions for handling, cleaning and processing public health data

valid_nhs() stable
NHS Number Validity Check
uk_patient_id() stable
Patient ID record grouping
proxy_episode_dates() stable
HES/SUS Episode Date Cleaning
cip_spells() stable
Continuous Inpatient (CIP) Spells
group_time() stable
Grouping of intervals or events in time together
respeciate_generic() stable
Respeciate unspecified samples
inpatient_codes() experimental
Inpatient Codes cleanup

Lookup tables

Lookup tables used to reclassify, regroup, or translate data

genus_gram_stain
Bacterial Genus Gram Stain Lookup Table
respeciate_organism
Respeciated organisms
specimen_type_grouping
Specimen type grouping
group_ecds_discharge_destination
A&E attendance discharge destination
group_inpatient_admission_method
Inpatient admission methods
group_inpatient_discharge_destination
Inpatient discharge destination
hospital_in_out_dates()
Hospital IN/OUT dates

Data

Synthetic dataset for testing package functionality

lab_data
Synthetic Lab Data for epidm