From 48a4e873728996bd9dbfa1f71004c5e90f9a804c Mon Sep 17 00:00:00 2001 From: mathieulemieux Date: Tue, 28 May 2024 10:47:48 -0700 Subject: [PATCH] getTherapy() on lowercases --- src/civic/therapy.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/civic/therapy.js b/src/civic/therapy.js index f9346d8..dded526 100644 --- a/src/civic/therapy.js +++ b/src/civic/therapy.js @@ -59,21 +59,22 @@ const resolveTherapies = (evidenceItem) => { */ const getTherapy = async (conn, therapyRecord) => { const name = therapyRecord.name.toLowerCase().trim(); + const ncitId = therapyRecord.ncitId.toLowerCase().trim(); // Trying with the ncitId - if (therapyRecord.ncitId) { + if (ncitId) { try { return await conn.getUniqueRecordBy({ filters: [ { source: { filters: { name: NCIT_SOURCE_DEFN.name }, target: 'Source' } }, - { sourceId: therapyRecord.ncitId }, + { sourceId: ncitId }, { name }, ], sort: orderPreferredOntologyTerms, target: 'Therapy', }); } catch (err) { - logger.error(`had NCIt therapy mapping (${therapyRecord.ncitId}) named (${therapyRecord.name}) but failed to fetch from graphkb: ${err}`); + logger.error(`had NCIt therapy mapping (${ncitId}) named (${therapyRecord.name}) but failed to fetch from graphkb`); throw err; } }