HES Outpatients (HESOP) 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 = 'HESOP'
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
dataset_info = document.get_dataset_info()
print(dataset_info.transpose().to_markdown(index=True, headers=['Dataset descriptor', 'Dataset specific information'], tablefmt="fancy_grid"))
╒═══════════════════════════════════╤═══════════════════════════════════════════════════════════════════════════════════════════════════════════════╕
│ Dataset descriptor                │ Dataset specific information                                                                                  │
╞═══════════════════════════════════╪═══════════════════════════════════════════════════════════════════════════════════════════════════════════════╡
│ index                             │ 0                                                                                                             │
├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Name of dataset in TRE            │ HESOP                                                                                                         │
├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Other name                        │                                                                                                               │
├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Owner                             │ NHS England                                                                                                   │
├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Keywords                          │ Outpatients, NHS hospitals                                                                                    │
├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Geographical coverage             │ England                                                                                                       │
├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Temporal coverage                 │ 01/04/2003 onwards                                                                                            │
├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ TRE temporal coverage             │ 01/04/2003 onwards                                                                                            │
├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Number of variables               │                                                                                                               │
├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Number of participants            │                                                                                                               │
├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Number of observations            │                                                                                                               │
├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ DOI                               │                                                                                                               │
├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Key link                          │ https://digital.nhs.uk/data-and-information/data-tools-and-services/data-services/hospital-episode-statistics │
├───────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Specific restrictions to data use │                                                                                                               │
╘═══════════════════════════════════╧═══════════════════════════════════════════════════════════════════════════════════════════════════════════════╛

2. Metrics#

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

Table 1 The number of participants from each LPS that are represented in the HESOP 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, headers=['LPS', 'Number of participants'], tablefmt="fancy_grid"))
╒════════════════╤══════════════════════════╕
│ LPS            │   Number of participants │
╞════════════════╪══════════════════════════╡
│ ALSPAC         │                     5692 │
├────────────────┼──────────────────────────┤
│ BCS70          │                     5698 │
├────────────────┼──────────────────────────┤
│ BIB            │                    26135 │
├────────────────┼──────────────────────────┤
│ ELSA           │                     6962 │
├────────────────┼──────────────────────────┤
│ EPICN          │                    14697 │
├────────────────┼──────────────────────────┤
│ EXCEED         │                     9161 │
├────────────────┼──────────────────────────┤
│ FENLAND        │                    10058 │
├────────────────┼──────────────────────────┤
│ GLAD           │                    50869 │
├────────────────┼──────────────────────────┤
│ MCS            │                    17141 │
├────────────────┼──────────────────────────┤
│ NCDS58         │                     6163 │
├────────────────┼──────────────────────────┤
│ NEXTSTEP       │                     4596 │
├────────────────┼──────────────────────────┤
│ NIHRBIO_COPING │                    16081 │
├────────────────┼──────────────────────────┤
│ NSHD46         │                     2870 │
├────────────────┼──────────────────────────┤
│ TEDS           │                     2276 │
├────────────────┼──────────────────────────┤
│ TRACKC19       │                    13284 │
├────────────────┼──────────────────────────┤
│ TWINSUK        │                    12607 │
├────────────────┼──────────────────────────┤
│ UKHLS          │                     6624 │
├────────────────┼──────────────────────────┤
│ total          │                   210914 │
╘════════════════╧══════════════════════════╛

3. 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.