Antidepressants for pain indication - dm+d

PH3277 / 8269

OpenSAFELY

Jan 26, 2026

REGISTERING DOI...

OpenCodelists Phenotype
  1. Overview

    Codelist ID
    opensafely/antidepressants-for-pain-indication-dmd
    Version ID
    1e769556
    Coding System
    dm+d codes
    Collections
    OpenCodelistPhenotype Library
    Tags
    No data
  2. Definition

    This codelist was taken from OpenCodelists, created by OpenSAFELY. We recommend viewing this Phenotype on the OpenCodelist website to view the most recent version.

    This codelist will be used to identify prescribing of antidepressants with an indication for pain to people waiting on procedure waiting lists.

    © University of Oxford for the Bennett Institute for Applied Data Science 2025. This work may be copied freely for non-commercial research and study.

  3. Methodology

    Converted from pseudo-BNF system codelist

    Search Terms

    Amitriptyline

    Duloxetine

    Inclusion criteria

    Antidepressant agents that are most likely to have been prescribed for pain. According to NICE guidelines amitriptyline and duloxetine are the antidepressant agents that are recommended.

    Exclusion criteria

    Combination products with antipsychotics (amitriptyline/perphenazine)

    Duloxetine 20 and 40mg capsules which are indicated for stress incontinence.

    Borderline cases

    Liquid formulation duloxetine included even though within Chapter 07: Obstetrics, Gynaecology and Urinary-Tract Disorders as only liquid formulation available. Very limited prescribing.

    Topical amitriptyline/ketamine, excluded not prescribed at all in last 5 years in Primary care (OpenPrescribing). NICE/BNF recommendations are for oral preparations.

    Nortriptyline not included, as not recommended by NICE for the management of neuropathic pain.

  4. References

  5. Clinical Codelist

  6. API

    To Export Phenotype Details:

    FormatAPI
    JSON site_root/api/v1/phenotypes/PH3277/version/8269/detail/?format=json
    R Package

    # Download here

    library(ConceptLibraryClient)


    # Connect to API

    client = ConceptLibraryClient::Connection$new(public=TRUE)


    # Get details of Phenotype

    phenotype_details = client$phenotypes$get_detail(
     'PH3277',
     version_id=8269
    )

    Py Package

    # Download here

    from pyconceptlibraryclient import Client


    # Connect to API

    client = Client(public=True)


    # Get details of Phenotype

    phenotype_detail = client.phenotypes.get_detail(
     'PH3277',
     version_id=8269
    )

    To Export Phenotype Code List:

    FormatAPI
    JSON site_root/api/v1/phenotypes/PH3277/version/8269/export/codes/?format=json
    R Package

    # Download here

    library(ConceptLibraryClient)


    # Connect to API

    client = ConceptLibraryClient::Connection$new(public=TRUE)


    # Get codelist of Phenotype

    phenotype_codelist = client$phenotypes$get_codelist(
     'PH3277',
     version_id=8269
    )

    Py Package

    # Download here

    from pyconceptlibraryclient import Client


    # Connect to API

    client = Client(public=True)


    # Get codelist of Phenotype

    phenotype_codelist = client.phenotypes.get_codelist(
     'PH3277',
     version_id=8269
    )

  7. Version History

    Version IDNameOwnerPublish date
    Antidepressants for pain indication - dm+d ieuan.scanlon2026-01-26 23:09