HES Admitted Patient Care (HESAPC) Dataset#
# 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
1. Summary#
display(document.style_table(document.get_dataset_info()))
Dataset descriptor | Dataset-specific information |
---|---|
Name of dataset in TRE | HESAPC |
Other name | None |
Keywords | Inpatients, NHS hospitals |
Short description | Dataset of patients admitted for treatment at NHS hospitals in England, either as day cases or overnight and either as emergency or planned admissions. A record represents one episode. The dataset includes delivery and birth data, but note maternity data are also collected in the Maternity Services Data Set (MSDS). Some measures are available in both datasets (e.g. ethnicity of the mother) and some are unique to one dataset (e.g. MSDS collects the mother’s smoking status and HESAPC collects the length of hospital stay). In reports, HESAPC data are used for the national totals, because they have historically been more complete. |
Owner | NHS England |
Geographical coverage | England |
Temporal coverage | 01/04/1989 onwards |
TRE temporal coverage | 01/04/1998 onwards |
Frequency of update | Quarterly |
Date of last extract | None |
DOI | None |
Data resolution | Inpatient episode |
Number of variables | None |
Number of participants | None |
Number of observations | None |
Version | None |
Key link | https://digital.nhs.uk/data-and-information/data-tools-and-services/data-services/hospital-episode-statistics |
Specific restrictions to data use | None |
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.
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).
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)
display(document.style_table(document.get_cohort_count()))
LPS | Participant count |
---|---|
ALSPAC | 4644 |
BCS70 | 5082 |
BIB | 27111 |
ELSA | 6528 |
EPICN | 14161 |
EXCEED | 8411 |
FENLAND | 8690 |
GLAD | 57687 |
MCS | 16009 |
NCDS58 | 5536 |
NEXTSTEP | 4111 |
NIHRBIO_COPING | 14278 |
NSHD46 | 2820 |
TEDS | 5553 |
TRACKC19 | 11317 |
TWINSUK | 11762 |
UKHLS | 5924 |
TOTAL | 209624 |
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.