group_source_bacteraemia: group_source_bacteraemia

View source: R/group_source_bacteraemia.R

group_source_bacteraemiaR Documentation

group_source_bacteraemia

Description

Group the sources of bacteraemia for reporting in QEC or elsewhere. In 2017 the column which gave the primary focus for Gram-negative collections changed with the introducion new risk factor collection on the DCS.

Usage

group_source_bacteraemia(collection, source_col)

Arguments

collection

A string giving the data collection, one of "MRSA", "MSSA", "E. coli", "Klebsiella spp", "Pseudomonas aeruginosa"

source_col

The string giving the source of bacteraemia to be grouped

Details

Previously, the field name was risk_factors_most_likely_primary_focus the new field name is source_primary_focus_of_bacteraemia

The general approach when analysing the data is to combine the information from both fields into one. This may cause problems where there is contradictory information. New information is copied into old, but only when new information is not unknown or otherwise missing.

Value

A vector of grouped sources

Examples

group_source_bacteraemia(collection = "E. coli", source_col = "Urinary tract")
## Not run: 
dat <- data.frame(stringsAsFactors=FALSE,
  org = c("E. coli", "MRSA"),
  source = c("Unassessed", "Skin/Soft tissue infection")
)
dat$grouped_source <- group_source_bacteraemia(collection = dat$org, source_col = dat$source)

## End(Not run)

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