apportion: Apportion CDI and MSSA records

apportionR Documentation

Apportion CDI and MSSA records

Description

Apportions records to apportioning algorithm. Includes a clause whereby records created prior to 26th October 2015 are not trust apportioned if patient location is Unknown. This is to ensure consistency with previous reports. See p 47 of Mandatory Surveillance protocol. Prior to the launch of the new DCS, users could create records where the patient location was Null and these cases would not have been apportioned automatically.

Usage

apportion(
  collection,
  patient_location,
  patient_category,
  date_admitted,
  specimen_date,
  date_entered
)

Arguments

collection

The collection (MRSA, MSSA, CDI, E. coli) to which the record belongs.

patient_location

The patient's location at time of sample

patient_category

The patient's category at time of sample

date_admitted

The date the patient was admitted for records from inpatients

specimen_date

The date of the specimen (POSIXct, POSIXt or Date format)

date_entered

Date record created normally 'data collection date' (POSIXct, POSIXt or Date format)

Value

A binary vector giving 1 for Trust-apportioned records and 0 for non-Trust apportioned records

Examples

apportion("mssa", "NHS Acute Trust", "In-patient",
date_admitted = lubridate::dmy("01-01-2015"), specimen_date =
lubridate::dmy("05-01-2015"), date_entered = lubridate::dmy("26-10-2015"))
## Not run: 
apportion("mssa", "NHS Acute Trust", "In-patient",
date_admitted = as.Date(NA_real_, origin = "01-01-1970"),
specimen_date = lubridate::dmy("01-01-2015"), date_entered =
lubridate::dmy("26-10-2015"))
apportion("mssa", "NHS Acute Trust", "In-patient", date_admitted =
lubridate::dmy(""), specimen_date = lubridate::dmy("01-01-2015"),
date_entered = lubridate::dmy("26-10-2015"))

## End(Not run)
apportion("mssa", "NHS Acute Trust", "In-patient", date_admitted =
lubridate::dmy("01-01-2015"),  specimen_date = lubridate::dmy("01-01-2015"),
date_entered = lubridate::dmy("26-10-2015"))
apportion("mssa", "NHS Acute Trust", "Outpatient", date_admitted =
lubridate::dmy("01-01-2015"),  specimen_date = lubridate::dmy("05-01-2015"),
date_entered = lubridate::dmy("26-10-2015"))
apportion("cdi", "NHS Acute Trust", "In-patient", date_admitted =
lubridate::dmy("01-01-2015"),  specimen_date = lubridate::dmy("05-01-2015"),
date_entered = lubridate::dmy("26-10-2015"))

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