forked from navikt/fhir-validator-junit-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-specification.schema.json
More file actions
200 lines (200 loc) · 7.1 KB
/
test-specification.schema.json
File metadata and controls
200 lines (200 loc) · 7.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "FHIR Validator test specification",
"description": "Specification for tests which uses the FHIR Validator to validate FHIR resources against FHIR conformance resources.",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": true,
"title": {
"description": "[Optional] Human readable name of the Test Suite, the default is to use the filename.",
"type": "string"
},
"validator": {
"type": "object",
"description": "[Optional] The arguments to use in the FHIR Validator, see: https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator#UsingtheFHIRValidator-Runningthevalidator and https://raw.githubusercontent.com/hapifhir/org.hl7.fhir.core/master/org.hl7.fhir.validation/src/main/resources/help.txt",
"additionalProperties": false,
"properties": {
"version": {
"type": "string",
"description": "[Optional] The FHIR version to use, the default is to use 'current' which is R5.",
"default": "current",
"examples": [
"4.0",
"4.0.1"
]
},
"tx": {
"type": "string",
"description": "[Optional] The (base) URL of a FHIR terminology service. The default is to not use a terminology service.",
"default": "n/a",
"examples": [
"http://tx.fhir.org"
]
},
"txLog": {
"type": "string",
"description": "[Optional] Produce a log of the terminology server operations in file. Default value is not to produce a log.",
"examples": [
"txLog.txt",
"logs/tx.txt"
]
},
"sct": {
"type": "string",
"description": "[Optional] Edition of SNOMED CT to use.",
"examples": [
"intl",
"us",
"uk",
"au",
"nl",
"ca",
"se",
"dk",
"es"
]
},
"ig": {
"type": [
"array",
"string"
],
"description": "[Optional] IGs or profile definitions to load. Can be file, folder, URL or package ([id]#[ver]) of an implementation guide. The core profiles will always be loaded.",
"uniqueItems": true,
"items": {
"type": "string",
"examples": [
"../fsh-generated/resources",
"hl7.fhir.us.core#1.0.1"
]
}
}
}
},
"tests": {
"type": "array",
"description": "List of test cases describing a FHIR resource to validate against a profile and the expected outcome.",
"additionalProperties": false,
"uniqueItems": true,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"fileMatch"
],
"properties": {
"fileMatch": {
"type": [
"array",
"string"
],
"description": "[Required] gitignore-glob-patterns for FHIR resources (xml or json) to validate, see: https://git-scm.com/docs/gitignore#_pattern_format",
"additionalProperties": false,
"uniqueItems": true,
"items": {
"type": "string",
"minItems": 1,
"examples": [
"fsh-generated/resources/**/*.json",
"!**/*.png"
]
}
},
"title": {
"description": "[Optional] Human readable name of the Test Case, the default is the validated resource's filename.",
"type": "string"
},
"profile": {
"description": "[Optional] Canonical URL of the Profile the resources should conform to. If this is left empty the value of Resource.meta.profile will be used, if this also is empty the core profile is used.",
"type": "string",
"format": "uri"
},
"tags": {
"description": "[Optional] Tags can be used to mark and filter tests, must conform to the specified syntax rules: https://junit.org/junit5/docs/current/user-guide/#running-tests-tags",
"type": [
"array",
"string"
],
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^[^,()&|! ]+$",
"examples": [
"sut"
]
}
},
"expectedIssues": {
"type": "array",
"description": "[Optional] List of issues expected in the validation outcome. An issue with ERROR severity will result in a failed test unless specified here.",
"additionalProperties": false,
"uniqueItems": true,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"severity"
],
"properties": {
"severity": {
"description": "[Required] The expected severity of the issue, see: https://www.hl7.org/fhir/valueset-issue-severity.html",
"enum": [
"FATAL",
"ERROR",
"WARNING",
"INFORMATION"
]
},
"type": {
"description": "[Optional] The expected type of issue, see: https://www.hl7.org/fhir/valueset-issue-type.html",
"enum": [
"INVALID",
"STRUCTURE",
"REQUIRED",
"VALUE",
"INVARIANT",
"SECURITY",
"LOGIN",
"UNKNOWN",
"EXPIRED",
"FORBIDDEN",
"SUPPRESSED",
"PROCESSING",
"NOTSUPPORTED",
"DUPLICATE",
"MULTIPLEMATCHES",
"NOTFOUND",
"DELETED",
"TOOLONG",
"CODEINVALID",
"EXTENSION",
"TOOCOSTLY",
"BUSINESSRULE",
"CONFLICT",
"TRANSIENT",
"LOCKERROR",
"NOSTORE",
"EXCEPTION",
"TIMEOUT",
"INCOMPLETE",
"THROTTLED",
"INFORMATIONAL"
]
},
"expression": {
"description": "[Optional] FHIRPath to the element within the FHIR resource expected to containing the error, see: https://www.hl7.org/fhir/operationoutcome.html#loc.",
"type": "string"
},
"message": {
"description": "[Optional] The expected validation error message. Match is partial and case insensitive.",
"type": "string"
}
}
}
}
}
}
}
}
}