Skip to content

Connecting to Medical Subject Headings (MeSH)

E. Lynette Rayle edited this page Mar 8, 2019 · 3 revisions

Overview

Provides autocompletion of MeSH terms. This implementation is simple, and only provides descriptors and does not implement qualifiers (in the technical MeSH sense of these terms). The terms are stored in a local database, which is then queried to provide the suggestions.

Prerequisites

To use, run the included rake task to copy over the relevant database migrations into your application:

rake qa:install:migrations

Then, create the tables in your database

rake db:migrate

Now that you've setup your application to use MeSH terms, you'll now need to load the terms into your database so you can query them locally.

To import the mesh terms into the local database, first download the MeSH descriptor dump in ASCII format. You can read about doing this here. Once you have this file, use the following rake task to load the terms into your database:

MESH_FILE=path/to/mesh.txt rake qa:mesh:import

This may take a few minutes to finish.

Note: Updating the tables with new terms is currently not supported.

Accessing via QA

Authority: mesh

Subauthorities:

None supported

NOTE: The linked data module for QA also provides access to this authority. It returns additional data including the URI for terms. See Using-the-Linked-Data-module-to-access-authorities for more information.


Example search queries

Example search:

/qa/search/mesh?q=malignant

Result:

[
  {"id":"C535700","label":"Malignant mesenchymal tumor"},
  {"id":"C562839","label":"Mesothelioma, Malignant"},
  {"id":"C562740","label":"Hemangiopericytoma, Malignant"}
  etc.
]

NOTE: The qa request searches the downloaded data in your local database.


Example term fetch request

Example fetch:

/qa/show/mesh/D000001

Result:

Results for specific terms may vary according to the term. This example request might return something like...

{ "id" : "D000001",
  "label" : "Calcimycin",
  "tree_numbers" : ["D03.438.221.173"],
  "synonyms" : ["A-23187", "A23187", "Antibiotic A23187", "A 23187", "A23187, Antibiotic"]
}

This is due to the varying nature of each authority source. However, results for multiple terms, such as a search, we should always use the above id and label structure to ensure interoperability at the GUI level.

NOTE: The qa request fetches the term from the downloaded data in your local database.


Example list all terms

Not supported


Documentation

MeSH is downloaded to your local database, so API documentation is not applicable. You can get general information about MeSH from this tutorial... https://www.nlm.nih.gov/bsd/disted/meshtutorial/introduction/

Clone this wiki locally