@@ -14,6 +14,7 @@ describe('JavaScript render Staging template', () => {
14
14
effectiveDateTime : '2020-01-01' ,
15
15
stageGroup : '3C' ,
16
16
type : 'Clinical' ,
17
+ stagingSystem : null ,
17
18
categoryIds : null ,
18
19
} ;
19
20
@@ -23,17 +24,18 @@ describe('JavaScript render Staging template', () => {
23
24
} ) ;
24
25
25
26
test ( 'minimal pathologic required data passed into template should generate FHIR resource' , ( ) => {
26
- const STAGING_CLINICAL_MINIMAL_DATA = {
27
+ const STAGING_PATHOLOGIC_MINIMAL_DATA = {
27
28
id : 'example-id' ,
28
29
subjectId : 'example-mrn' ,
29
30
conditionId : 'example-condition-id' ,
30
31
effectiveDateTime : '2020-01-01' ,
31
32
stageGroup : '3C' ,
32
33
type : 'Pathologic' ,
34
+ stagingSystem : null ,
33
35
categoryIds : null ,
34
36
} ;
35
37
36
- const generatedStaging = stagingTemplate ( STAGING_CLINICAL_MINIMAL_DATA ) ;
38
+ const generatedStaging = stagingTemplate ( STAGING_PATHOLOGIC_MINIMAL_DATA ) ;
37
39
expect ( generatedStaging ) . toEqual ( minimalStagingPathologicResource ) ;
38
40
expect ( isValidFHIR ( generatedStaging ) ) . toBeTruthy ( ) ;
39
41
} ) ;
@@ -46,6 +48,7 @@ describe('JavaScript render Staging template', () => {
46
48
effectiveDateTime : '2020-01-01' ,
47
49
type : 'Clinical' ,
48
50
stageGroup : '3C' ,
51
+ stagingSystem : '443830009' ,
49
52
categoryIds : [ 't-category-id' , 'n-category-id' , 'm-category-id' ] ,
50
53
} ;
51
54
@@ -65,6 +68,7 @@ describe('JavaScript render Staging template', () => {
65
68
} ;
66
69
67
70
const OPTIONAL_DATA = {
71
+ stagingSystem : '443830009' ,
68
72
categoryIds : [ 't-category-id' , 'n-category-id' , 'm-category-id' ] ,
69
73
} ;
70
74
@@ -74,11 +78,14 @@ describe('JavaScript render Staging template', () => {
74
78
test ( 'missing required data should throw an error' , ( ) => {
75
79
const INVALID_DATA = {
76
80
// Omitting 'effectiveDateTime' field which is a required property
81
+ effectiveDateTime : null ,
77
82
id : 'example-id' ,
78
83
subjectId : 'example-mrn' ,
79
84
conditionId : 'example-condition-id' ,
80
85
type : 'Clinical' ,
81
- effectiveDateTime : null ,
86
+ stageGroup : '3C' ,
87
+ stagingSystem : '443830009' ,
88
+ categoryIds : [ 't-category-id' , 'n-category-id' , 'm-category-id' ] ,
82
89
} ;
83
90
84
91
expect ( ( ) => stagingTemplate ( INVALID_DATA ) ) . toThrow ( Error ) ;
0 commit comments