1
1
const path = require ( 'path' ) ;
2
2
const { checkCodeInVs } = require ( './valueSetUtils' ) ;
3
3
4
+ const systemLookup = {
5
+ 'urn:oid:2.16.840.1.113883.6.90' : 'http://hl7.org/fhir/sid/icd-10-cm' ,
6
+ } ;
7
+
4
8
5
9
/**
6
10
* Checks for ICD-10 code
@@ -24,9 +28,11 @@ function getICD10Code(condition) {
24
28
* @param {string } system Code system to which th code belongs
25
29
* @return {boolean } if primary cancer condition
26
30
*/
31
+ /* eslint-disable no-prototype-builtins */
27
32
function isConditionCodePrimary ( code , system ) {
28
33
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 ) ;
30
36
}
31
37
32
38
/**
@@ -35,9 +41,11 @@ function isConditionCodePrimary(code, system) {
35
41
* @param {string } system Code system to which th code belongs
36
42
* @return {boolean } if secondary cancer condition
37
43
*/
44
+ /* eslint-disable no-prototype-builtins */
38
45
function isConditionCodeSecondary ( code , system ) {
39
46
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 ) ;
41
49
}
42
50
43
51
/**
0 commit comments