aec_inpatient: Determine whether record is from an acute trust inpatient for...

View source: R/aec_inpatient.R

aec_inpatientR Documentation

Determine whether record is from an acute trust inpatient for AEC

Description

Inpatients have a patient location of 'NHS Acute Trust' and are one of: inpatient, day patient or emergency assessment. Assumes that where the date of admission is greater than the date of specimen, the patient was not actually an inpatient.

Usage

aec_inpatient(patient_location, patient_category, specimen_date, date_admitted)

Arguments

patient_location

Location of patient at time of specimen.

patient_category

Category of patient at time of specimen. One of: "In-patient", "Day patient" or "Emergency Assessment"

specimen_date

Date specimen taken

date_admitted

Date of admission to NHS Acute Trust

Value

A numeric value

Examples

patient_cat <- "In-patient"
patient_loc <- "NHS Acute Trust"
date_admitted <- lubridate::dmy("01/01/2016")
specimen_date <- lubridate::dmy("02/01/2016")
aec_inpatient(patient_loc, patient_cat, specimen_date, date_admitted)
## Not run: 
date_admitted <- NA
aec_inpatient(patient_loc, patient_cat, specimen_date, date_admitted)
date_admitted <- lubridate::dmy("03/01/2016")
aec_inpatient(patient_loc, patient_cat, specimen_date, date_admitted)
specimen_date <- NA
aec_inpatient(patient_loc, patient_cat, specimen_date, date_admitted)

## End(Not run)

PublicHealthEngland/hcaidcs documentation built on Jan. 19, 2024, 8:38 a.m.