handleTaggedEntities = taggedEntities => {
const suggestions = [];
taggedEntities.genes.forEach(gene => {
suggestions.push({
question: `Tell me about ${gene.toUpperCase()}`,
url: `/search/gene/${gene}`,
});
});
taggedEntities.diseases.forEach(disease => {
suggestions.push({
question: `Tell me about ${disease}`,
url: `/search/disease/${disease}`,
});
});
taggedEntities.tissueOrCellTypes.forEach(tissueOrCellType => {
suggestions.push({
question: `Tell me about ${tissueOrCellType}`,
url: `/search/tissueOrCellType/${tissueOrCellType}`,
});
});
taggedEntities.genes.forEach(gene => {
taggedEntities.diseases.forEach(disease => {
suggestions.push({
question: `Show me the evidence associating ${gene.toUpperCase()} and ${disease}`,
url: `/search/evidence/${gene}/${disease}`,
});
});
});
taggedEntities.genes.forEach(gene => {
if (taggedEntities.entityDisease.length > 0) {
suggestions.push({
question: `Show me diseases associated with ${gene.toUpperCase()}`,
url: `/search/association/gene/${gene}`,
});
}
});
taggedEntities.diseases.forEach(disease => {
if (taggedEntities.entityGene.length > 0) {
suggestions.push({
question: `Show me genes associated with ${disease}`,
url: `/search/association/disease/${disease}`,
});
}
});
taggedEntities.genes.forEach(gene => {
if (taggedEntities.entityTissueOrCellType.length > 0) {
suggestions.push({
question: `Show me where ${gene.toUpperCase()} is expressed in the body`,
url: `/search/expression/${gene}`,
});
}
});
return suggestions;
}