HES Admitted Patient Care (HESAPC) Dataset#

1. Summary#

The information below is retrieved from the Health Data Gateway API developed by NHS England, with additional fields added by UK LLC (indicated by italics).

# define target dataset to document
schema = 'nhsd'
table = 'HESAPC'
version = 'v0003'
# import functions from script helper
import sys
script_fp = "../../../../scripts/"
sys.path.insert(0, script_fp)
from data_doc_helper import DocHelper
# create instance
document = DocHelper(schema, table, version, script_fp)
# markdown/code hybrid cell module requirement
from IPython.display import display, Markdown
# get api data
dataset = document.get_api_data()
display(Markdown("**NHS England title of dataset:** "+dataset['datasetfields']['datautility']['title']))
display(Markdown("***Dataset name in UK LLC TRE***: *nhsd.HESAPC*"))  
display(Markdown("***Nested datasets***: *HESAPC encompasses the following three datasets: Maternity dataset (HESAPC_MAT), Critical Care minimum dataset (HESCC) and the retired Augmented Care Periods dataset (HESAPC_ACP)*"))  
display(Markdown("**Short abstract:** "+dataset['datasetfields']['abstract']))
display(Markdown("***Extended abstract***: [*https://web.www.healthdatagateway.org/dataset/6599230a-df54-4615-937c-d724d239491f*](https://web.www.healthdatagateway.org/dataset/6599230a-df54-4615-937c-d724d239491f)"))
display(Markdown("**Geographical coverage:** "+dataset['datasetfields']['geographicCoverage'][0]))
display(Markdown("**Temporal coverage:** "+dataset['datasetfields']['datasetStartDate']))
display(Markdown("***Data available in UK LLC TRE from***: *01/04/1997 onwards*"))
display(Markdown("**Typical age range:** "+dataset['datasetfields']['ageBand']))
display(Markdown("**Collection situation:** "+dataset['datasetv2']['provenance']['origin']['collectionSituation'][0]))
display(Markdown("**Purpose:** "+dataset['datasetv2']['provenance']['origin']['purpose'][0]))
display(Markdown("**Source:** "+dataset['datasetv2']['provenance']['origin']['source'][0]))
display(Markdown("**Pathway:** "+dataset['datasetv2']['coverage']['pathway']))
display(Markdown("***Information collected***: *Patient demographics, date and source of admission, waiting time, reason for admission, clinical diagnosis and procedures performed, and date and destination of discharge.*"))  
display(Markdown("***Structure of dataset***: *Data are organised into episodes and spells - see section 2 for further details.*"))  
display(Markdown("***Update frequency in UK LLC TRE***: *Quarterly*"))  
display(Markdown("***Dataset versions in UK LLC TRE***: *TBC*"))
display(Markdown("***Data quality issues***: *Data quality notes that highlight specific known issues are published alongside the finalised HES datasets: [https://digital.nhs.uk/data-and-information/data-tools-and-services/data-services/hospital-episode-statistics/the-processing-cycle-and-hes-data-quality](https://digital.nhs.uk/data-and-information/data-tools-and-services/data-services/hospital-episode-statistics/the-processing-cycle-and-hes-data-quality)*"))  
display(Markdown("***Restrictions to data usage***: *Medical purposes only (medical research) as defined in the NHS Act 2006: [https://www.legislation.gov.uk/ukpga/2006/41/part/13/crossheading/patient-information](https://www.legislation.gov.uk/ukpga/2006/41/part/13/crossheading/patient-information)*"))    
display(Markdown("***Further information***: [*https://digital.nhs.uk/data-and-information/data-tools-and-services/data-services/hospital-episode-statistics*](https://digital.nhs.uk/data-and-information/data-tools-and-services/data-services/hospital-episode-statistics)"))

NHS England title of dataset: Hospital Episode Statistics Admitted Patient Care

Dataset name in UK LLC TRE: nhsd.HESAPC

Nested datasets: HESAPC encompasses the following three datasets: Maternity dataset (HESAPC_MAT), Critical Care minimum dataset (HESCC) and the retired Augmented Care Periods dataset (HESAPC_ACP)

Short abstract: Record-level patient data set of patients admitted for treatment at NHS hospitals in England, including delivery and birth data. A record represents one episode.

Extended abstract: https://web.www.healthdatagateway.org/dataset/6599230a-df54-4615-937c-d724d239491f

Geographical coverage: United Kingdom,England

Temporal coverage: 01/04/1989

Data available in UK LLC TRE from: 01/04/1997 onwards

Typical age range: 0-120

Collection situation: IN-PATIENTS

Purpose: CARE

Source: EPR

Pathway: Secondary Care pathway. This dataset covers inpatient admissions to hospitals in England. It includes information on the treatment and outcome of the hospital admission and can be linked to the HES A&E dataset to further the pathway if an A&E attendance took place prior to an admissions to hospital.

Information collected: Patient demographics, date and source of admission, waiting time, reason for admission, clinical diagnosis and procedures performed, and date and destination of discharge.

Structure of dataset: Data are organised into episodes and spells - see section 2 for further details.

Update frequency in UK LLC TRE: Quarterly

Dataset versions in UK LLC TRE: TBC

Data quality issues: Data quality notes that highlight specific known issues are published alongside the finalised HES datasets: https://digital.nhs.uk/data-and-information/data-tools-and-services/data-services/hospital-episode-statistics/the-processing-cycle-and-hes-data-quality

Restrictions to data usage: Medical purposes only (medical research) as defined in the NHS Act 2006: https://www.legislation.gov.uk/ukpga/2006/41/part/13/crossheading/patient-information

Further information: https://digital.nhs.uk/data-and-information/data-tools-and-services/data-services/hospital-episode-statistics

2. Structure of the HESAPC dataset#

Episodes and spells#

Data in the HESAPC dataset are organised into episodes and spells. Each row indicates a Finished Consultant Episode (FCE), which is a continuous period of care under one consultant at a single hospital. A spell is a continuous period of care within a single hospital from admission to discharge or death. Most patients in the HESAPC datasets are represented by one row of data (i.e. a spell comprising one episode), but others may be represented by multiple rows if they move between consultants within or between hospitals (see the scenario below). Furthermore, in the HESAPC_MAT dataset, each birth generates at least two episodes, one recording details of the delivery (relating to the mother) and one episode per child delivered (relating to the child).

If the patient was seen by multiple consultants during the same stay at the same hospital, a spell may contain one or more FCEs, i.e. one or more rows of data per patient (see figure 1). The first (or only) FCE can also be called a Finished Admission Episode (FAE) and the final (or only) FCE can also be called a Discharge Episode. This is why there are more FCEs than FAEs in the APC dataset: https://digital.nhs.uk/data-and-information/publications/statistical/hospital-admitted-patient-care-activity.

../../../../../_images/Episodes_spells_diagram_APC.jpg

Figure 1 Episodes and spells in the HESAPC dataset - each row of data in the dataset corresponds to a single FCE

Continuous Inpatient (CIP) spells#

A more complex scenario again is if a patient is transferred to a different hospital. In this instance, a new spell begins. To identify and measure continuous hospital stays, which include transfers to other hospitals, Continuous Inpatient (CIP) spells need to be derived (see figure 2).

../../../../../_images/CIP_spell_diagram_APC.jpg

Figure 2 Spells and CIP spells in the HESAPC dataset

Episodes/spells that span financial years#

FCEs are entered into the HESAPC dataset according to the financial year in which they end. Consequently, episodes/spells that start in one financial year and end in another will be classified as unfinished in the starting financial year and finished in the ending financial year. Unfinished episodes/spells need to be removed before analysis to prevent double counting.

3. Metrics#

The tables below summarise the HESAPC dataset in the UK LLC TRE.

Table 1 The number of participants from each LPS that are represented in the HESAPC dataset in the UK LLC TRE
(Note: numbers relate to the most recent extract of NHS England data)

gb_cohort = document.get_cohort_count()
print(gb_cohort.to_markdown(index=False, tablefmt="fancy_grid"))
╒════════════════╤═════════╕
│ cohort         │   count │
╞════════════════╪═════════╡
│ ALSPAC         │    4644 │
├────────────────┼─────────┤
│ BCS70          │    5071 │
├────────────────┼─────────┤
│ BIB            │   27111 │
├────────────────┼─────────┤
│ ELSA           │    6528 │
├────────────────┼─────────┤
│ EPICN          │   14161 │
├────────────────┼─────────┤
│ EXCEED         │    8411 │
├────────────────┼─────────┤
│ FENLAND        │    8690 │
├────────────────┼─────────┤
│ GLAD           │   57756 │
├────────────────┼─────────┤
│ MCS            │   16041 │
├────────────────┼─────────┤
│ NCDS58         │    5515 │
├────────────────┼─────────┤
│ NEXTSTEP       │    4099 │
├────────────────┼─────────┤
│ NIHRBIO_COPING │   14278 │
├────────────────┼─────────┤
│ NSHD46         │    2820 │
├────────────────┼─────────┤
│ TEDS           │    5553 │
├────────────────┼─────────┤
│ TRACKC19       │   11317 │
├────────────────┼─────────┤
│ TWINSUK        │   11762 │
├────────────────┼─────────┤
│ UKHLS          │    5924 │
├────────────────┼─────────┤
│ total          │  209681 │
╘════════════════╧═════════╛

4. Helpful syntax#

Below we will include syntax that may be helpful to other researchers in the UK LLC TRE. For longer scripts, we will include a snippet of the code plus a link to Git where you can find the full script.