@@ -46,7 +46,7 @@ describe('valueSetUtils', () => {
46
46
47
47
describe ( 'checkCodeInVs' , ( ) => {
48
48
const includesCode = 'C00.0' ;
49
- const expansionCode = 'C00.1' ;
49
+ const expansionCodeWithoutSystem = 'C00.1' ;
50
50
const expansionCodeWithSystem = 'C00.2' ;
51
51
const missingCode = 'C12.34' ;
52
52
const icd10System = 'http://hl7.org/fhir/sid/icd-10-cm' ;
@@ -65,13 +65,25 @@ describe('valueSetUtils', () => {
65
65
expect ( checkCodeInVs ( includesCode , icd10System , vsPath , vsTypes . json ) ) . toBeTruthy ( ) ;
66
66
} ) ;
67
67
test ( 'Should return false if the code is not in the VS includes' , ( ) => {
68
- expect ( checkCodeInVs ( expansionCode , icd10System , vsPath , vsTypes . json ) ) . toBeFalsy ( ) ;
68
+ expect ( checkCodeInVs ( expansionCodeWithSystem , icd10System , vsPath , vsTypes . json ) ) . toBeFalsy ( ) ;
69
69
} ) ;
70
70
test ( 'Should return false if the code is in the VS includes but the systems do not match' , ( ) => {
71
71
expect ( checkCodeInVs ( includesCode , snomedSystem , vsPath , vsTypes . json ) ) . toBeFalsy ( ) ;
72
72
} ) ;
73
- test ( 'Should return true if the code is in the VS expansion' , ( ) => {
74
- expect ( checkCodeInVs ( expansionCode , icd10System , vsWithExpansionPath , vsTypes . json ) ) . toBeTruthy ( ) ;
73
+ test ( 'Should return false if the code is in the VS includes but the coding lacks a system' , ( ) => {
74
+ expect ( checkCodeInVs ( expansionCodeWithoutSystem , snomedSystem , vsPath , vsTypes . json ) ) . toBeFalsy ( ) ;
75
+ } ) ;
76
+ test ( 'Should return false if the code is in the VS includes but a system was not included as an argument' , ( ) => {
77
+ expect ( checkCodeInVs ( expansionCodeWithoutSystem , undefined , vsPath , vsTypes . json ) ) . toBeFalsy ( ) ;
78
+ } ) ;
79
+ test ( 'Should return true if the code is in the VS expansion and systems match' , ( ) => {
80
+ expect ( checkCodeInVs ( expansionCodeWithSystem , icd10System , vsWithExpansionPath , vsTypes . json ) ) . toBeTruthy ( ) ;
81
+ } ) ;
82
+ test ( 'Should return false if the code is in the VS expansion but the coding lacks a system' , ( ) => {
83
+ expect ( checkCodeInVs ( expansionCodeWithoutSystem , icd10System , vsWithExpansionPath , vsTypes . json ) ) . toBeFalsy ( ) ;
84
+ } ) ;
85
+ test ( 'Should return false if the code is in the VS expansion but a system was not included as an argument' , ( ) => {
86
+ expect ( checkCodeInVs ( expansionCodeWithSystem , undefined , vsWithExpansionPath , vsTypes . json ) ) . toBeFalsy ( ) ;
75
87
} ) ;
76
88
test ( 'Should return false if the code is in the VS expansion but the systems do not match' , ( ) => {
77
89
expect ( checkCodeInVs ( expansionCodeWithSystem , snomedSystem , vsWithExpansionPath , vsTypes . json ) ) . toBeFalsy ( ) ;
@@ -83,7 +95,7 @@ describe('valueSetUtils', () => {
83
95
} ) ;
84
96
test ( 'Should check against a json valueSet when no type is provided' , ( ) => {
85
97
expect ( checkCodeInVs ( includesCode , icd10System , vsPath ) ) . toBeTruthy ( ) ;
86
- expect ( checkCodeInVs ( expansionCode , icd10System , vsWithExpansionPath ) ) . toBeTruthy ( ) ;
98
+ expect ( checkCodeInVs ( expansionCodeWithSystem , icd10System , vsWithExpansionPath ) ) . toBeTruthy ( ) ;
87
99
expect ( checkCodeInVs ( missingCode , icd10System , vsPath ) ) . toBeFalsy ( ) ;
88
100
} ) ;
89
101
} ) ;
0 commit comments