Skip to content

Commit

Permalink
Bug Fix: GDC Values Data Mapping Report
Browse files Browse the repository at this point in the history
  • Loading branch information
fmanuelos committed Nov 3, 2022
1 parent ad703f4 commit 1994255
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/service/search/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,7 @@ const generateGDCValuesReport = async function(req, res) {
let uid = entry.category + "." + node + "." + prop;
let prop_enum = prop_dict[prop] !== undefined && prop_dict[prop].enum !== undefined && prop_dict[prop].enum.length > 0 ? prop_dict[prop].enum : [];
let mappings = gdc_values[uid] !== undefined ? gdc_values[uid] : [];
let deprecated_enum = prop_dict[prop] !== undefined && prop_dict[prop].deprecated_enum !== undefined && prop_dict[prop].deprecated_enum.length > 0 ? prop_dict[prop].deprecated_enum : [];

for(let value of prop_enum){
let tmp = {};
Expand All @@ -1413,6 +1414,10 @@ const generateGDCValuesReport = async function(req, res) {
tmp.icdoS = [];
tmp.ncitPV = [];

if (deprecated_enum.includes(value)) {
continue;
}

let map = mappings.find(({ nm }) => nm === value);
if(map !== undefined){
tmp.ncit = Array.isArray(map.n_c) ? map.n_c.join('|') : '';
Expand All @@ -1427,7 +1432,7 @@ const generateGDCValuesReport = async function(req, res) {
dataset.push(tmp);
}
}
}
}
}

// You can define styles as json object
Expand Down

0 comments on commit 1994255

Please sign in to comment.