Talking Therapies for Anxiety and Depression 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). The IAPT dataset in the UK LLC TRE comprises nine separate datasets. This dataset was previously known as the Improving Access to Psychological Therapies (IAPT) Data Set.
# define target dataset to document
schema = 'nhsd'
table = 'IAPT'
table1 = 'IAPT_care_activities'
table2 = 'IAPT_care_cluster'
table3 = 'IAPT_coded_scored_assessments'
table4 = 'IAPT_demographics_and_referral'
table5 = 'IAPT_employment_status'
table6 = 'IAPT_internet_enabled_therapies'
table7 = 'IAPT_mental_and_physical_health_conditions'
table8 = 'IAPT_onward_referrals'
table9 = 'IAPT_waiting_time_pauses'
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)
document1 = DocHelper(schema, table1, version, script_fp)
document2 = DocHelper(schema, table2, version, script_fp)
document3 = DocHelper(schema, table3, version, script_fp)
document4 = DocHelper(schema, table4, version, script_fp)
document5 = DocHelper(schema, table5, version, script_fp)
document6 = DocHelper(schema, table6, version, script_fp)
document7 = DocHelper(schema, table7, version, script_fp)
document8 = DocHelper(schema, table8, version, script_fp)
document9 = DocHelper(schema, table9, 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.IAPT*"))
display(Markdown("**Short abstract:** "+dataset['datasetfields']['abstract']))
display(Markdown("***Extended abstract:*** *The IAPT dataset will shortly be renamed the NHS Talking Therapies for Anxiety and Depression dataset. The dataset collects data about adults in England who receive NHS-funded treatment for depression and anxiety disorders under the NHS Talking Therapies programme. Conditions treated include agoraphobia, body dysmorphic disorder, depression, generalised anxiety disorder, health anxiety, obsessive-compulsive disorder, panic disorder, post traumatic stress disorder and a wide range of specific phobias. Submission of data is mandatory for all NHS funded IAPT service providers, including care delivered by independent sector healthcare providers. IAPT is referral based which allows tracking between services and settings. The dataset includes all data relevant to the reporting period, not just finished episodes, and so researchers need to be careful of over-counting. Current and past data models, user guidance and technical output specifications are available here: [https://digital.nhs.uk/data-and-information/data-collections-and-data-sets/data-sets/improving-access-to-psychological-therapies-data-set/implementing-iapt-tools-and-guidance](https://digital.nhs.uk/data-and-information/data-collections-and-data-sets/data-sets/improving-access-to-psychological-therapies-data-set/implementing-iapt-tools-and-guidance)*"))
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/2012 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:*** *TBC*"))
display(Markdown("***Structure of dataset:*** *TBC*"))
display(Markdown("***Update frequency in UK LLC TRE:*** *Quarterly*"))
display(Markdown("***Dataset versions in UK LLC TRE:*** *TBC*"))
display(Markdown("***Data quality issues:*** *See the [IAPT data quality notes](https://digital.nhs.uk/data-and-information/data-collections-and-data-sets/data-sets/improving-access-to-psychological-therapies-data-set/improving-access-to-psychological-therapies-data-set-reports).*"))
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-collections-and-data-sets/data-sets/improving-access-to-psychological-therapies-data-set/improving-access-to-psychological-therapies-data-set-reports](https://digital.nhs.uk/data-and-information/data-collections-and-data-sets/data-sets/improving-access-to-psychological-therapies-data-set/improving-access-to-psychological-therapies-data-set-reports)*"))
NHS England title of dataset: Improving Access to Psychological Therapies Data Set
Dataset name in UK LLC TRE: nhsd.IAPT
Short abstract: Patient-level data set that captures information about people in contact with services commissioned as part of the adult Improving Access to Psychological Services (IAPT) programme.
Extended abstract: The IAPT dataset will shortly be renamed the NHS Talking Therapies for Anxiety and Depression dataset. The dataset collects data about adults in England who receive NHS-funded treatment for depression and anxiety disorders under the NHS Talking Therapies programme. Conditions treated include agoraphobia, body dysmorphic disorder, depression, generalised anxiety disorder, health anxiety, obsessive-compulsive disorder, panic disorder, post traumatic stress disorder and a wide range of specific phobias. Submission of data is mandatory for all NHS funded IAPT service providers, including care delivered by independent sector healthcare providers. IAPT is referral based which allows tracking between services and settings. The dataset includes all data relevant to the reporting period, not just finished episodes, and so researchers need to be careful of over-counting. Current and past data models, user guidance and technical output specifications are available here: https://digital.nhs.uk/data-and-information/data-collections-and-data-sets/data-sets/improving-access-to-psychological-therapies-data-set/implementing-iapt-tools-and-guidance
Geographical coverage: United Kingdom,England
Temporal coverage: 01/04/2012
Data available in UK LLC TRE from: 01/04/2012 onwards
Typical age range: 18-150
Collection situation: COMMUNITY
Purpose: OTHER
Source: EPR
Pathway:
Information collected: TBC
Structure of dataset: TBC
Update frequency in UK LLC TRE: Quarterly
Dataset versions in UK LLC TRE: TBC
Data quality issues: See the IAPT data quality notes.
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
2. Metrics#
The tables below summarise the nine datasets that make up the IAPT dataset in the UK LLC TRE.
2.1 IAPT Care Activities
Table 1 The number of participants from each LPS that are represented in the IAPT_Care_Activities dataset in the UK LLC TRE
(Note: numbers relate to the most recent extract of NHS England data)
gb_cohort = document1.get_cohort_count()
print(gb_cohort.to_markdown(index=False, tablefmt="fancy_grid"))
╒════════════════╤═════════╕
│ cohort │ count │
╞════════════════╪═════════╡
│ ALSPAC │ 951 │
├────────────────┼─────────┤
│ BCS70 │ 418 │
├────────────────┼─────────┤
│ BIB │ 1411 │
├────────────────┼─────────┤
│ ELSA │ 190 │
├────────────────┼─────────┤
│ EPICN │ 334 │
├────────────────┼─────────┤
│ EXCEED │ 524 │
├────────────────┼─────────┤
│ FENLAND │ 500 │
├────────────────┼─────────┤
│ GLAD │ 27065 │
├────────────────┼─────────┤
│ MCS │ 1984 │
├────────────────┼─────────┤
│ NCDS58 │ 249 │
├────────────────┼─────────┤
│ NEXTSTEP │ 824 │
├────────────────┼─────────┤
│ NIHRBIO_COPING │ 1373 │
├────────────────┼─────────┤
│ NSHD46 │ 58 │
├────────────────┼─────────┤
│ TEDS │ 1315 │
├────────────────┼─────────┤
│ TRACKC19 │ 884 │
├────────────────┼─────────┤
│ TWINSUK │ 928 │
├────────────────┼─────────┤
│ UKHLS │ 489 │
├────────────────┼─────────┤
│ total │ 39497 │
╘════════════════╧═════════╛
2.2 IAPT Care Cluster
Table 2 The number of participants from each LPS that are represented in the IAPT_Care_Cluster dataset in the UK LLC TRE
(Note: numbers relate to the most recent extract of NHS England data)
gb_cohort = document2.get_cohort_count()
print(gb_cohort.to_markdown(index=False, tablefmt="fancy_grid"))
╒════════════════╤═════════╕
│ cohort │ count │
╞════════════════╪═════════╡
│ ALSPAC │ 451 │
├────────────────┼─────────┤
│ BCS70 │ 308 │
├────────────────┼─────────┤
│ BIB │ 810 │
├────────────────┼─────────┤
│ ELSA │ 140 │
├────────────────┼─────────┤
│ EPICN │ 101 │
├────────────────┼─────────┤
│ EXCEED │ 470 │
├────────────────┼─────────┤
│ FENLAND │ 347 │
├────────────────┼─────────┤
│ GLAD │ 19573 │
├────────────────┼─────────┤
│ MCS │ 1367 │
├────────────────┼─────────┤
│ NCDS58 │ 178 │
├────────────────┼─────────┤
│ NEXTSTEP │ 559 │
├────────────────┼─────────┤
│ NIHRBIO_COPING │ 918 │
├────────────────┼─────────┤
│ NSHD46 │ 39 │
├────────────────┼─────────┤
│ TEDS │ 893 │
├────────────────┼─────────┤
│ TRACKC19 │ 563 │
├────────────────┼─────────┤
│ TWINSUK │ 638 │
├────────────────┼─────────┤
│ UKHLS │ 328 │
├────────────────┼─────────┤
│ total │ 27683 │
╘════════════════╧═════════╛
2.3 IAPT Coded Scored Assessments
Table 3 The number of participants from each LPS that are represented in the IAPT_Coded_Score_Assessments dataset in the UK LLC TRE
Note: numbers relate to the most recent extract of NHS England data)
gb_cohort = document3.get_cohort_count()
print(gb_cohort.to_markdown(index=False, tablefmt="fancy_grid"))
╒════════════════╤═════════╕
│ cohort │ count │
╞════════════════╪═════════╡
│ ALSPAC │ 913 │
├────────────────┼─────────┤
│ BCS70 │ 395 │
├────────────────┼─────────┤
│ BIB │ 1184 │
├────────────────┼─────────┤
│ ELSA │ 179 │
├────────────────┼─────────┤
│ EPICN │ 264 │
├────────────────┼─────────┤
│ EXCEED │ 514 │
├────────────────┼─────────┤
│ FENLAND │ 465 │
├────────────────┼─────────┤
│ GLAD │ 25855 │
├────────────────┼─────────┤
│ MCS │ 1816 │
├────────────────┼─────────┤
│ NCDS58 │ 235 │
├────────────────┼─────────┤
│ NEXTSTEP │ 761 │
├────────────────┼─────────┤
│ NIHRBIO_COPING │ 1310 │
├────────────────┼─────────┤
│ NSHD46 │ 54 │
├────────────────┼─────────┤
│ TEDS │ 1241 │
├────────────────┼─────────┤
│ TRACKC19 │ 837 │
├────────────────┼─────────┤
│ TWINSUK │ 877 │
├────────────────┼─────────┤
│ UKHLS │ 471 │
├────────────────┼─────────┤
│ total │ 37371 │
╘════════════════╧═════════╛
2.4 IAPT Demographics and Referral
Table 4 The number of participants from each LPS that are represented in the IAPT_demographics_and_referral dataset in the UK LLC TRE
(Note: numbers relate to the most recent extract of NHS England data)
gb_cohort = document4.get_cohort_count()
print(gb_cohort.to_markdown(index=False, tablefmt="fancy_grid"))
╒════════════════╤═════════╕
│ cohort │ count │
╞════════════════╪═════════╡
│ ALSPAC │ 1055 │
├────────────────┼─────────┤
│ BCS70 │ 471 │
├────────────────┼─────────┤
│ BIB │ 1576 │
├────────────────┼─────────┤
│ ELSA │ 216 │
├────────────────┼─────────┤
│ EPICN │ 368 │
├────────────────┼─────────┤
│ EXCEED │ 589 │
├────────────────┼─────────┤
│ FENLAND │ 538 │
├────────────────┼─────────┤
│ GLAD │ 30213 │
├────────────────┼─────────┤
│ MCS │ 2267 │
├────────────────┼─────────┤
│ NCDS58 │ 287 │
├────────────────┼─────────┤
│ NEXTSTEP │ 911 │
├────────────────┼─────────┤
│ NIHRBIO_COPING │ 1482 │
├────────────────┼─────────┤
│ NSHD46 │ 66 │
├────────────────┼─────────┤
│ TEDS │ 1502 │
├────────────────┼─────────┤
│ TRACKC19 │ 944 │
├────────────────┼─────────┤
│ TWINSUK │ 1032 │
├────────────────┼─────────┤
│ UKHLS │ 550 │
├────────────────┼─────────┤
│ total │ 44067 │
╘════════════════╧═════════╛
2.5 IAPT Employment Status
Table 5 The number of participants from each LPS that are represented in the IAPT_employment_status dataset in the UK LLC TRE
(Note: numbers relate to the most recent extract of NHS England data)
gb_cohort = document5.get_cohort_count()
print(gb_cohort.to_markdown(index=False, tablefmt="fancy_grid"))
╒════════════════╤═════════╕
│ cohort │ count │
╞════════════════╪═════════╡
│ ALSPAC │ 886 │
├────────────────┼─────────┤
│ BCS70 │ 376 │
├────────────────┼─────────┤
│ BIB │ 1157 │
├────────────────┼─────────┤
│ ELSA │ 168 │
├────────────────┼─────────┤
│ EPICN │ 267 │
├────────────────┼─────────┤
│ EXCEED │ 517 │
├────────────────┼─────────┤
│ FENLAND │ 465 │
├────────────────┼─────────┤
│ GLAD │ 23630 │
├────────────────┼─────────┤
│ MCS │ 1730 │
├────────────────┼─────────┤
│ NCDS58 │ 228 │
├────────────────┼─────────┤
│ NEXTSTEP │ 684 │
├────────────────┼─────────┤
│ NIHRBIO_COPING │ 1185 │
├────────────────┼─────────┤
│ NSHD46 │ 50 │
├────────────────┼─────────┤
│ TEDS │ 1170 │
├────────────────┼─────────┤
│ TRACKC19 │ 776 │
├────────────────┼─────────┤
│ TWINSUK │ 798 │
├────────────────┼─────────┤
│ UKHLS │ 440 │
├────────────────┼─────────┤
│ total │ 34527 │
╘════════════════╧═════════╛
2.6 IAPT Internet Enabled Therapies
Table 6 The number of participants from each LPS that are represented in the IAPT_internet_enabled_therapies dataset in the UK LLC TRE
(Note: numbers relate to the most recent extract of NHS England data)
gb_cohort = document6.get_cohort_count()
print(gb_cohort.to_markdown(index=False, tablefmt="fancy_grid"))
╒════════════════╤═════════╕
│ cohort │ count │
╞════════════════╪═════════╡
│ ALSPAC │ 85 │
├────────────────┼─────────┤
│ BCS70 │ 18 │
├────────────────┼─────────┤
│ BIB │ 36 │
├────────────────┼─────────┤
│ ELSA │ <10 │
├────────────────┼─────────┤
│ EPICN │ 0 │
├────────────────┼─────────┤
│ EXCEED │ 24 │
├────────────────┼─────────┤
│ FENLAND │ <10 │
├────────────────┼─────────┤
│ GLAD │ 1528 │
├────────────────┼─────────┤
│ MCS │ 120 │
├────────────────┼─────────┤
│ NCDS58 │ 10 │
├────────────────┼─────────┤
│ NEXTSTEP │ 56 │
├────────────────┼─────────┤
│ NIHRBIO_COPING │ 72 │
├────────────────┼─────────┤
│ NSHD46 │ <10 │
├────────────────┼─────────┤
│ TEDS │ 94 │
├────────────────┼─────────┤
│ TRACKC19 │ 83 │
├────────────────┼─────────┤
│ TWINSUK │ 41 │
├────────────────┼─────────┤
│ UKHLS │ 30 │
├────────────────┼─────────┤
│ total │ 2197 │
╘════════════════╧═════════╛
2.7 IAPT Mental and Physical Health Conditions
Table 7 The number of participants from each LPS that are represented in the IAPT_mental_and_physical_health_conditions dataset in the UK LLC TRE
(Note: numbers relate to the most recent extract of NHS England data)
gb_cohort = document7.get_cohort_count()
print(gb_cohort.to_markdown(index=False, tablefmt="fancy_grid"))
╒════════════════╤═════════╕
│ cohort │ count │
╞════════════════╪═════════╡
│ ALSPAC │ 853 │
├────────────────┼─────────┤
│ BCS70 │ 393 │
├────────────────┼─────────┤
│ BIB │ 1447 │
├────────────────┼─────────┤
│ ELSA │ 182 │
├────────────────┼─────────┤
│ EPICN │ 269 │
├────────────────┼─────────┤
│ EXCEED │ 525 │
├────────────────┼─────────┤
│ FENLAND │ 487 │
├────────────────┼─────────┤
│ GLAD │ 25746 │
├────────────────┼─────────┤
│ MCS │ 1830 │
├────────────────┼─────────┤
│ NCDS58 │ 249 │
├────────────────┼─────────┤
│ NEXTSTEP │ 750 │
├────────────────┼─────────┤
│ NIHRBIO_COPING │ 1257 │
├────────────────┼─────────┤
│ NSHD46 │ 55 │
├────────────────┼─────────┤
│ TEDS │ 1230 │
├────────────────┼─────────┤
│ TRACKC19 │ 784 │
├────────────────┼─────────┤
│ TWINSUK │ 853 │
├────────────────┼─────────┤
│ UKHLS │ 476 │
├────────────────┼─────────┤
│ total │ 37386 │
╘════════════════╧═════════╛
2.8 IAPT Onward Referrals
Table 8 The number of participants from each LPS that are represented in the IAPT_onward_referrals datasets in the UK LLC TRE
(Note: numbers relate to the most recent extract of NHS England data)
gb_cohort = document8.get_cohort_count()
print(gb_cohort.to_markdown(index=False, tablefmt="fancy_grid"))
╒════════════════╤═════════╕
│ cohort │ count │
╞════════════════╪═════════╡
│ ALSPAC │ <10 │
├────────────────┼─────────┤
│ BCS70 │ 15 │
├────────────────┼─────────┤
│ BIB │ 164 │
├────────────────┼─────────┤
│ ELSA │ <10 │
├────────────────┼─────────┤
│ EPICN │ <10 │
├────────────────┼─────────┤
│ EXCEED │ 12 │
├────────────────┼─────────┤
│ FENLAND │ 48 │
├────────────────┼─────────┤
│ GLAD │ 1206 │
├────────────────┼─────────┤
│ MCS │ 81 │
├────────────────┼─────────┤
│ NCDS58 │ <10 │
├────────────────┼─────────┤
│ NEXTSTEP │ 25 │
├────────────────┼─────────┤
│ NIHRBIO_COPING │ 56 │
├────────────────┼─────────┤
│ NSHD46 │ <10 │
├────────────────┼─────────┤
│ TEDS │ 47 │
├────────────────┼─────────┤
│ TRACKC19 │ 33 │
├────────────────┼─────────┤
│ TWINSUK │ 24 │
├────────────────┼─────────┤
│ UKHLS │ 18 │
├────────────────┼─────────┤
│ total │ 1729 │
╘════════════════╧═════════╛
2.9 IAPT Waiting Time Pauses
Table 9 The number of participants from each LPS that are represented in the IAPT_waiting_time_pauses dataset in the UK LLC TRE
(Note: numbers relate to the most recent extract of NHS England data)
gb_cohort = document9.get_cohort_count()
print(gb_cohort.to_markdown(index=False, tablefmt="fancy_grid"))
╒════════════════╤═════════╕
│ cohort │ count │
╞════════════════╪═════════╡
│ ALSPAC │ <10 │
├────────────────┼─────────┤
│ BCS70 │ 18 │
├────────────────┼─────────┤
│ BIB │ <10 │
├────────────────┼─────────┤
│ ELSA │ <10 │
├────────────────┼─────────┤
│ EPICN │ <10 │
├────────────────┼─────────┤
│ EXCEED │ <10 │
├────────────────┼─────────┤
│ FENLAND │ 14 │
├────────────────┼─────────┤
│ GLAD │ 1523 │
├────────────────┼─────────┤
│ MCS │ 94 │
├────────────────┼─────────┤
│ NCDS58 │ 13 │
├────────────────┼─────────┤
│ NEXTSTEP │ 43 │
├────────────────┼─────────┤
│ NIHRBIO_COPING │ 59 │
├────────────────┼─────────┤
│ NSHD46 │ <10 │
├────────────────┼─────────┤
│ TEDS │ 61 │
├────────────────┼─────────┤
│ TRACKC19 │ 26 │
├────────────────┼─────────┤
│ TWINSUK │ 58 │
├────────────────┼─────────┤
│ UKHLS │ 21 │
├────────────────┼─────────┤
│ total │ 1930 │
╘════════════════╧═════════╛
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.