Skip to content

Commit

Permalink
Fixes #215 and adds further granularity for parent/child by vocabulary
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonysena authored and chrisknoll committed Dec 21, 2016
1 parent 53c021f commit 8f84d9c
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,16 @@ define(['jquery', 'knockout', 'jnj_chart', 'd3', 'ohdsi.util', 'appConfig', 'fac
}]
};
self.metatrix = {
'ATC.ATC 4th': {
childRelationships: [{
name: 'Has descendant of',
range: [0, 1]
}],
parentRelationships: [{
name: 'Has ancestor of',
range: [0, 5]
}]
},
'ICD9CM.5-dig billing code': {
childRelationships: [{
name: 'Subsumes',
Expand Down Expand Up @@ -604,8 +614,9 @@ define(['jquery', 'knockout', 'jnj_chart', 'd3', 'ohdsi.util', 'appConfig', 'fac
range: [0, 999]
}],
parentRelationships: [{
name: 'Has inferred drug class (OMOP)',
range: [0, 999]
name: 'Has ancestor of',
vocabulary: ['ATC', 'ETC'],
range: [0, 1]
}]
},
'RxNorm.Brand Name': {
Expand Down Expand Up @@ -750,7 +761,15 @@ define(['jquery', 'knockout', 'jnj_chart', 'd3', 'ohdsi.util', 'appConfig', 'fac
for (var i = 0; i < relationships.length; i++) {
if (concept.RELATIONSHIPS[r].RELATIONSHIP_NAME == relationships[i].name) {
if (concept.RELATIONSHIPS[r].RELATIONSHIP_DISTANCE >= relationships[i].range[0] && concept.RELATIONSHIPS[r].RELATIONSHIP_DISTANCE <= relationships[i].range[1]) {
return true;
if (relationships[i].vocabulary) {
for(var v = 0; v < relationships[i].vocabulary.length; v++) {
if (relationships[i].vocabulary[v] == concept.VOCABULARY_ID) {
return true;
}
}
} else {
return true;
}
}
}
}
Expand Down

0 comments on commit 8f84d9c

Please sign in to comment.