Skip to content

Commit e9dedb3

Browse files
committed
NRL-936 add integration test for when invalid category is given for pointer type
1 parent f32b1e7 commit e9dedb3

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/features/producer/createDocumentReference-failure.feature

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,44 @@ Feature: Producer - createDocumentReference - Failure Scenarios
257257
}
258258
"""
259259

260+
Scenario: Invalid category for type
261+
Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API
262+
And the organisation 'X26' is authorised to access pointer types:
263+
| system | value |
264+
| http://snomed.info/sct | 1363501000000100 |
265+
| http://snomed.info/sct | 736253002 |
266+
When producer 'X26' creates a DocumentReference with values:
267+
| property | value |
268+
| subject | 9999999999 |
269+
| status | current |
270+
| type | 1363501000000100 |
271+
| category | 1102421000000108 |
272+
| custodian | X26 |
273+
| author | HAR1 |
274+
| url | https://example.org/my-doc.pdf |
275+
Then the response status code is 400
276+
And the response is an OperationOutcome with 1 issue
277+
And the OperationOutcome contains the issue:
278+
"""
279+
{
280+
"severity": "error",
281+
"code": "invalid",
282+
"details": {
283+
"coding": [
284+
{
285+
"system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1",
286+
"code": "BAD_REQUEST",
287+
"display": "Bad request"
288+
}
289+
]
290+
},
291+
"diagnostics": "The Category code of the provided document 'http://snomed.info/sct|1102421000000108' must match the allowed category for pointer type 'http://snomed.info/sct|736253002' with a category value of 'http://snomed.info/sct|734163000'",
292+
"expression": [
293+
"category.coding[0].code"
294+
]
295+
}
296+
"""
297+
260298
# Invalid document reference - invalid Type
261299
# NRL-769 Known issue: Type display is not validated
262300
# Scenario: Invalid type (valid code but wrong display value)

0 commit comments

Comments
 (0)