@@ -50,19 +50,19 @@ describe('getConditionsFromContext', () => {
50
50
} ,
51
51
] ,
52
52
} ;
53
- test ( 'Should return Patient resource in context' , ( ) => {
54
- const conditions = getConditionsFromContext ( MOCK_PATIENT_MRN , conditionContext ) ;
53
+ test ( 'Should return Condition resource in context' , ( ) => {
54
+ const conditions = getConditionsFromContext ( conditionContext ) ;
55
55
expect ( conditions ) . toContain ( conditionResource ) ;
56
56
expect ( conditions ) . toContain ( conditionResource2 ) ;
57
57
} ) ;
58
58
59
59
test ( 'Should throw an error if there is no patient in context' , ( ) => {
60
- expect ( ( ) => getConditionsFromContext ( MOCK_PATIENT_MRN , { } ) )
61
- . toThrow ( 'Could not find conditions in context; ensure that a ConditionExtractor is used earlier in your extraction configuration' ) ;
60
+ expect ( ( ) => getConditionsFromContext ( { } ) )
61
+ . toThrow ( 'Could not find any conditions in context; ensure that a ConditionExtractor is used earlier in your extraction configuration' ) ;
62
62
} ) ;
63
63
} ) ;
64
64
65
- describe ( 'getConditionFromContext ' , ( ) => {
65
+ describe ( 'getConditionEntriesFromContext ' , ( ) => {
66
66
const conditionResource = {
67
67
resourceType : 'Condition' ,
68
68
id : 'mCODEConditionExample01' ,
@@ -82,8 +82,8 @@ describe('getConditionFromContext', () => {
82
82
] ,
83
83
} ;
84
84
85
- test ( 'Should return all Condition resources in context' , ( ) => {
86
- const conditions = getConditionEntriesFromContext ( MOCK_PATIENT_MRN , conditionContext ) ;
85
+ test ( 'Should return all Condition entries in context' , ( ) => {
86
+ const conditions = getConditionEntriesFromContext ( conditionContext ) ;
87
87
expect ( conditions ) . toHaveLength ( 2 ) ;
88
88
expect ( conditions [ 0 ] ) . toEqual ( {
89
89
fullUrl : 'context-url-1' ,
@@ -92,7 +92,7 @@ describe('getConditionFromContext', () => {
92
92
} ) ;
93
93
94
94
test ( 'Should throw an error if there are no conditions in context' , ( ) => {
95
- expect ( ( ) => getConditionEntriesFromContext ( MOCK_PATIENT_MRN , { } ) )
95
+ expect ( ( ) => getConditionEntriesFromContext ( { } ) )
96
96
. toThrow ( 'Could not find any conditions in context; ensure that a ConditionExtractor is used earlier in your extraction configuration' ) ;
97
97
} ) ;
98
98
} ) ;
0 commit comments