Skip to content

Commit 83864e5

Browse files
committed
System URN support added
1 parent 83543b7 commit 83864e5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/helpers/conditionUtils.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
const path = require('path');
22
const { checkCodeInVs } = require('./valueSetUtils');
33

4+
const systemLookup = {
5+
'urn:oid:2.16.840.1.113883.6.90': 'http://hl7.org/fhir/sid/icd-10-cm',
6+
};
7+
48

59
/**
610
* Checks for ICD-10 code
@@ -24,9 +28,11 @@ function getICD10Code(condition) {
2428
* @param {string} system Code system to which th code belongs
2529
* @return {boolean} if primary cancer condition
2630
*/
31+
/* eslint-disable no-prototype-builtins */
2732
function isConditionCodePrimary(code, system) {
2833
const primaryCancerConditionVSFilepath = path.resolve(__dirname, 'valueSets', 'ValueSet-mcode-primary-or-uncertain-behavior-cancer-disorder-vs.json');
29-
return checkCodeInVs(code, system, primaryCancerConditionVSFilepath);
34+
const searchSystem = systemLookup.hasOwnProperty(system) ? systemLookup[system] : system;
35+
return checkCodeInVs(code, searchSystem, primaryCancerConditionVSFilepath);
3036
}
3137

3238
/**
@@ -35,9 +41,11 @@ function isConditionCodePrimary(code, system) {
3541
* @param {string} system Code system to which th code belongs
3642
* @return {boolean} if secondary cancer condition
3743
*/
44+
/* eslint-disable no-prototype-builtins */
3845
function isConditionCodeSecondary(code, system) {
3946
const secondaryCancerConditionVSFilepath = path.resolve(__dirname, 'valueSets', 'ValueSet-mcode-secondary-cancer-disorder-vs.json');
40-
return checkCodeInVs(code, system, secondaryCancerConditionVSFilepath);
47+
const searchSystem = systemLookup.hasOwnProperty(system) ? systemLookup[system] : system;
48+
return checkCodeInVs(code, searchSystem, secondaryCancerConditionVSFilepath);
4149
}
4250

4351
/**

0 commit comments

Comments
 (0)