Accessibility statement

Central Hall, York University

Analysing Patient-Level Data using Hospital Episode Statistics (HES)




I could not do what I do for the GIRFT programme without having done the course; it has proved to be invaluable.

Peter Lanyon,
Consultant Rheumatologist, Nottingham University Hospitals NHS Trust

Hospital episode statistics (HES) contains details of all inpatient admissions, outpatient appointments, and Accident & Emergency attendances to NHS hospitals in England. HES is a main data source for a wide range of healthcare analyses for the NHS, government and many other organisations and individuals. There is also an increasing role for this observational dataset in providing evidence-based parameters, which are not collectable in trials for the economic evaluation of new technologies.

Admitted patient care datasets are available from 1989 onwards and they are organised in episodes of care, known as finished consultant episodes (FCEs). Each FCE relates to a period of care for a patient under a single consultant at a single hospital. Recorded FCEs steadily increased from 12 million in 1999-2000 to 16.8 million in 2009-10, to 20.9 million in 2019-20. In 2020-21, there were 16.2 million FCEs recorded, a decline of 22% from 2019-20 reflecting the impact of the coronavirus pandemic. In 2021-22, there were 21 million FCEs recorded, showing the increasing demand for NHS care. Outpatient datasets are available from 2003. In 2020-21, 101.9 million outpatient appointments were recorded – about 20 million appointments less than in 2019-20. However, in 2021-22, there were 122.3 million outpatient appointments recorded. Accident & Emergency (A&E) data are collected from 2007 onwards, with 25 million A&E attendances recorded in 2019-20, more than double the number of A&E attendances recorded in 2007-08. In 2020-21, the Emergency Care Data Set (ECDS) replaced the A&E HES dataset as the national data set for urgent and emergency care. The number of A&E attendances in 2020-21 fell to 17.4 million due to the coronavirus pandemic. In 2021-22, there were 22.8 million A&E attendances recorded in ECDS.

HES is one of the most challenging datasets to get to grips with: complex coding of data items, data provided at a level which is not immediately amenable to analysis, missing data, duplicates, costing episodes via HRGs and other data issues mean that the analyst has significant upfront investment costs in learning to come to terms with the data.

Taught by academics with extensive experience in using HES for a wide range of outputs, this intensive workshop introduces participants to HES data and teaches them how to handle, manipulate and begin to analyse these very large datasets. The course is organised according to a three-level structure. 

Level 1: Lectures that provide a theoretical background on each topic (click the tentative June 2022 Programme to see the topics covered) and examples of software code (Stata) that can be used to program certain data tasks. Participants will be able to copy and take away the Stata codes.

Level 2: Paper exercises on a limited number of cases to ensure a good understanding of the theory.

Level 3: Illustrative examples of how HES data can be used in practice to address selected research questions.

At the end of the course, the participants should understand the complex nature of the HES datasets, understand the importance of approaching HES with a disciplined structure and have the tools required to manipulate data from the raw form to that required for analysis.

HES data can be linked to other datasets held by NHS Digital, such as the Mental Health Services Dataset (MHSDS) which records all contacts with secondary and specialist mental health services in England. In the same week, the Centre for Health Economics (CHE) will be offering a course about analysing the MHSDS data, for more details please follow: MHSDS short course.

I really liked the fact that the course gave a really good insight into HES (HES is amazingly complicated!)

Previous participant


This course includes instruction on how to:

  • understand, manage and manipulate the data
  • construct and analyse key variables such as waiting times or length of stay
  • analyse individual patient records defined as Finished Consultant Episodes, Provider Spells and Continuous Inpatient Spells
  • monitor emergency readmissions
  • link inpatient data to Outpatient data, urgent and emergency care data (ECDS), and ONS mortality data.
  • aggregate data by Healthcare Resource Group or providers/commissioners
  • cost data by HRG and reference costs
  • use the data for benchmarking and policy evaluation


This course is offered to people working in the public sector, academia and the private sector. It is suitable for analysts who wish to harness the power of non-randomised episode-level patient data to shed further light on such things as patient costs and pathways, re-admissions and outcomes and provider performance. The workshop is suitable for individuals working in NHS hospitals, commissioning organisations and the Department of Health, pharmaceutical companies or consultancy companies and for health care researchers and PhD students. Overseas applicants may also find the tuition can be applied to similar scenarios in their own country, but must be aware that the tuition and exercises relate directly to HES data, which is created for, and used in, England.

The tutors will be presenting examples of software code (Stata) that can be used to program certain data tasks (familiarity with Stata is NOT required).  We will not hold dedicated computer-based sessions as the focus of the course is not on coding but on understanding HES data and learning how to approach and address various research questions drawing information from HES.  


Course dates

Course dates

  • Wednesday 24 May - Friday 26 May 2023


Course programme

Venue: Alcuin East Wing AEW/004, Alcuin College, University of York.

Day 1: Wednesday 24 May 2023 

  • 10.45-11.15 Registration and refreshments  
  • 11.15-12.00 Introduction to HES datasets: Data-generating process and clinical coding; Inpatient data structure
  • 12.00-12.30 Introduction to HES datasets: Applying for HES data
  • 12.30-13.00 Paper exercise: examining an example HES inpatient extract
  • 13.00-14.00 Lunch
  • 14.00-15.45 HES data manipulation: Dictionaries; key variables; Missing values; Dates
  • 15.45-16.15 Refreshments break
  • 16.15-17.00 Illustrative example: Measuring resource use before and during the Covid-19 pandemic across types of care and          patient groups
  • 17.00-18.30 Drinks Reception


Day 2:  Thursday 25 May 2023

  • 09.30-10.30 HES data manipulation - duplicate records, linking patient episodes
  • 10.30-11.00 Illustrative example: Measuring socioeconomic inequalities in waiting times
  • 11.00-11.30 Paper exercise: Linking patient episodes
  • 11.30-12.00 Refreshments break
  • 12.00-13.00 Measuring health improvements using Patient Reported Outcome Measures (PROMS)
  • 13.00-14.00 Lunch
  • 14.00-14.30 Linking inpatient data to other data (ONS mortality, ECDS, Outpatient)
  • 14.30-15.00 Refreshments break
  • 15.30-16.30 Paper exercise: Outpatient and ECDS data
  • 19.00-22.00 Dinner


Day 3:  Friday 26 May 2023

  • 09.45-11.00 Introduction to Healthcare Resource Groups (HRGs) and grouping process.
  • 11.00-11.15 Refreshments break
  • 11.15-11.45 The HRG Grouper: how to assign patients to HRGs and use of HRGs for costing purposes
  • 11.45-12.00 Q&A
  • 12.15-13.15 Lunch



The tutors for this course are researchers in the Centre for Health Economics, University of York



Registrations are now closed.

Before you register on this course, please ensure you have secured the appropriate funding from your Organisation.

Registration is done online by for instant payment by credit and debit card and a guaranteed secured place on this course (please note the University of York does not accept American Express cards).

If you or your Organisation cannot pay by credit/debit card, please email the Course Administrators.  
We regret that we cannot reserve or hold places on this course in advance of booking or payment.  


Fees are fully inclusive of tuition, lunches, drinks reception, course dinner and course materials, but do not include accommodation. VAT is not payable. 

Public/academic sector  Private/commercial sector 
Course fee 




* Promotional Codes for Public Sector discounted rate: We offer a public sector discounted rate which only applies to not-for-profit organisations (e.g. universities, charities, hospitals), government agencies and other public bodies worldwide. If you are eligible for this rate, please enter the promotional code letters that are shown beneath the public sector discounted fees the table above, into the 'Promo Code' box when you complete your online registration, otherwise the discounted rate will not be applied.

Full-time PhD students can apply for a subsidised place at £300 (VAT not payable). Please complete this PhD application form. Places are allocated at the discretion of the organisers.  Once you have completed and submitted the form, you will be contacted at the end of April with the outcome of your application.

Registration fees are payable in advance of the workshop dates.

We regret that we cannot reserve or hold workshop places in advance of booking or payment.

Our short training courses do not carry any formal CPD (continuing professional development) accreditation.

Places on the Analysing Patient Data Course are available to book until 5pm on Wednesday 10th May 2023.

Cancellations and Alterations

For bookings of between 1 and 5 people from the same organisation:
A full refund of course registration fees (less a 10% administrative charge) will be made for cancellations received in writing at least one month prior to the course.
Cancellations made less than one month prior to the course are not refundable. 

For larger bookings of 6 or more people from the same organisation:
A full refund of course registration fees (less a 10% administrative charge) will be made for cancellations received in writing at least two months prior to the course.
Cancellations made less than two months prior to the course are not refundable. 

Substitutes can be made but please email the substitute delegate details as soon as these are known, to the Course Administrators

Transfers between CHE's short courses/workshops is not possible.

Deferrals may be given under extenuating circumstances but will only be valid until the end of the following year - after that there can be no further deferral or refund. 

In the unlikely event that, due to unforeseen circumstances, the course has to be cancelled by the University of York, our liability is limited to a refund of paid course fees only.


You are responsible for arranging your own accommodation.  Unfortunately, campus accommodation is not available - the University STEM Centre can provide updated information.  There are many hotels and guest houses locally (Fulford and Heslington are the closest areas).  Some of these hotels can be viewed on the following websites:  

Visit York

Expedia Fulford Hotels

Getting Here

Our main campus is in the south east of York within walking and cycling distance of, or a short bus ride from, the city centre.  Our address is: University of York, York, YO10 5DD.

By Bus, rail and taxi

Parking is limited, so we suggest alternative transport where possible. Once you’re here, it's easy to get around campus by bus, bike and foot.

Cars and Parking - Pay and display and short stay parking

Use our interactive Campus Map.  
The area you will require is Zone 3 in red.
For registration you will need the ARC Foyer which is Alcuin B Block. 
For the workshop you will require Alcuin East Wing.

Campus Map - MHSDS APD 2022




Who to contact

  • Tim Glover & Sarah Crust
    Course Administrators
    Tel:  +44 (0)1904 321436
            +44 (0)1904 321469

Course dates

  • 24 May - 26 May 2023