Skip to content

Commit 71fed8a

Browse files
Add counts in ncit loader
1 parent 9597953 commit 71fed8a

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/ncit/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ const { logger } = require('../logging');
66

77
const { ncit: SOURCE_DEFN } = require('../sources');
88

9+
let sourceIdAsNameCount = 0;
10+
let noExplicitNameCount = 0;
11+
912
const diseaseConcepts = [
1013
'Anatomical Abnormality',
1114
'Congenital Abnormality',
@@ -147,6 +150,10 @@ const cleanRawRow = (rawRow) => {
147150
parentConcepts,
148151
} = rawRow;
149152

153+
if (!rawName) {
154+
noExplicitNameCount += 1;
155+
}
156+
150157
const row = {
151158
deprecated: (
152159
rawParents.split('|').some(p => DEPRECATED.includes(p))
@@ -216,9 +223,11 @@ const cleanRawRow = (rawRow) => {
216223
// if no name, use 1st synonym as prefered name, with fallback to sourceId
217224
if (!name) {
218225
name = sourceId;
226+
sourceIdAsNameCount += 1;
219227

220228
if (row.synonyms && row.synonyms[0]) {
221229
name = row.synonyms[0];
230+
sourceIdAsNameCount -= 1;
222231
}
223232
}
224233

@@ -526,14 +535,16 @@ const uploadFile = async ({
526535
}
527536
}
528537

538+
logger.info(`Count of records without an explicitly given name: ${noExplicitNameCount}`);
539+
logger.info(`Count of sourceId used as record's name: ${sourceIdAsNameCount}`);
529540
logger.info(JSON.stringify(counts));
530541
};
531542

532543

533544
module.exports = {
534545
SOURCE_DEFN,
535546
cleanRawRow,
536-
pickEndpoint,
537547
filterSynonyms,
548+
pickEndpoint,
538549
uploadFile,
539550
};

0 commit comments

Comments
 (0)