Skip to content

Commit 635a288

Browse files
committed
NRL-936 add upsert category test
1 parent 43800f8 commit 635a288

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Feature: Producer - upsertDocumentReference - Failure Scenarios
2+
3+
Scenario: Invalid category for type
4+
Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API
5+
And the organisation 'X26' is authorised to access pointer types:
6+
| system | value |
7+
| http://snomed.info/sct | 1363501000000100 |
8+
| http://snomed.info/sct | 736253002 |
9+
When producer 'X26' upserts a DocumentReference with values:
10+
| property | value |
11+
| subject | 9999999999 |
12+
| status | current |
13+
| type | 736253002 |
14+
| category | 1102421000000108 |
15+
| custodian | X26 |
16+
| author | HAR1 |
17+
| url | https://example.org/my-doc.pdf |
18+
Then the response status code is 400
19+
And the response is an OperationOutcome with 1 issue
20+
And the OperationOutcome contains the issue:
21+
"""
22+
{
23+
"severity": "error",
24+
"code": "invalid",
25+
"details": {
26+
"coding": [
27+
{
28+
"system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1",
29+
"code": "BAD_REQUEST",
30+
"display": "Bad request"
31+
}
32+
]
33+
},
34+
"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'",
35+
"expression": [
36+
"category.coding[0].code"
37+
]
38+
}
39+
"""

0 commit comments

Comments
 (0)