Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[bioontology-support] Help for accessing mappings for MedDRA

S. Grosdidier s.grosdidier at
Mon Apr 1 04:11:12 PDT 2019

Dear Bioontology support team,

I am interested in retrieving all the mappings from MedDRA to SNOMEDCT_US from your bioportal API but I encounter problems.
I am running a first GET /ontologies/MEDDRA/mappings call to the API to get the total number of pages result from MEDDRA and I then iterate over this number to try to retrieve all the MEDDRA mappings (my idea is to filter out mappings other than SNOMEDCT).

Here is my script:


import urllib.request, urllib.error, urllib.parse
import simplejson as json
import requests
API_KEY = "2c84c2c2-3510-46fa-b7af-732659784401"

def get_json(url):
    opener = urllib.request.build_opener()
    opener.addheaders = [('Authorization', 'apikey token=' + API_KEY)]
    return json.loads(

mapping = get_json(REST_URL+"/ontologies/MEDDRA/mappings")
pages = mapping["pageCount"]
for i in range (1,pages):
    print("page: " + str(i))
    mapping2 = get_json(REST_URL+"/ontologies/MEDDRA/mappings?page=" + str(i))
    for element in mapping2["collection"]:
        print(element["source"] + "\t" + element["classes"][0]["@id"]+ "\t" + element["classes"][1]["@id"])

Is that a correct way to retrieve all the mappings you have from MEDDRA?

Then, my script gives me a strange output, while iterating on the different pages, some appear to contain empty "collection" as for example page number 6:

page: 6
    "links": {
        "prevPage": "",
        "nextPage": ""
    "pageCount": 15131,
    "totalCount": 756539,
    "page": 6,
    "prevPage": 5,
    "collection": [],
    "nextPage": 7

At this point, I do think that I am doing something extremely wrong :-/ Can you help me?

I am looking forward to hearing from you!

S. Grosdidier

Solène Grosdidier
Scientific Researcher
Department of Medical Informatics

Email:    s.grosdidier at<mailto:s.grosdidier at>
Phone:    +31 (0) 10 704 4879

Mailing address:   P.O.Box 2040 – 3000 CA
Visiting address:  Wytemaweg 80 – 3015 CN | Room Na-2609
                          Rotterdam, The Netherlands

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the bioontology-support mailing list