Closed d0choa closed 1 year ago
There're 3 elements in elastic search but the API is aggregating by warningtype and toxicityclass. If we query the API including the references we'll see that misuse has 2 references:
query:
query q{
drug(chemblId: "CHEMBL418995"){
id
name
drugWarnings{
id
toxicityClass
warningType
description
references {
id
source
url
}
}
}
}
reponse:
{
"data": {
"drug": {
"id": "CHEMBL418995",
"name": "AMINEPTINE",
"drugWarnings": [
{
"id": 3502,
"toxicityClass": "dermatological toxicity",
"warningType": "Withdrawn",
"description": "Abuse; Dependence; Severe Acne",
"references": [
{
"id": "10.1177/009286150103500134",
"source": "DOI",
"url": "https://doi.org/10.1177/009286150103500134"
}
]
},
{
"id": 3383,
"toxicityClass": "misuse",
"warningType": "Withdrawn",
"description": "Potential for abuse and risk of dependence; Follows the decision taken by France to suspend amineptine on the basis of abuse and dependency potential",
"references": [
{
"id": "EDM-QSM-2001.3",
"source": "WHO",
"url": "https://www.who.int/publications/i/item/EDM-QSM-2001.3"
},
{
"id": "EDM-QSM-2001.3",
"source": "WHO",
"url": "https://www.who.int/publications/i/item/EDM-QSM-2001.3"
}
]
}
]
}
}
}
Resolved in dev
@ireneisdoomed identified that for the drug CHEMBL418995 the platform is displaying 2 records when there are 3 records in the data:
ETL output:
API query:
API response:
This is the consequence of an incorrect grouping strategy agreed here: opentargets/platform#1506.
We believe the issue would be fixed in the API code here if we use as unique field the column
id
instead of the combination ofwarningType
andtoxicityClass
.