Skip to content

Commit 5f3f8d3

Browse files
committed
NRL-1472 add happy path scenarios with new valueset entries
1 parent c0fac58 commit 5f3f8d3

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

layer/nrlf/core/tests/test_validators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,7 @@ def test_validate_content_invalid_content_type():
13971397
[
13981398
("urn:nhs-ic:record-contact", "Contact details (HTTP Unsecured)"),
13991399
("urn:nhs-ic:unstructured", "Unstructured Document"),
1400+
("urn:nhs-ic:structured", "Structured Document"),
14001401
],
14011402
)
14021403
def test_validate_nrl_format_code_valid_match(format_code, format_display):

tests/features/producer/createDocumentReference-success.feature

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ Feature: Producer - createDocumentReference - Success Scenarios
223223
| pointer-type | pointer-category | type-name |
224224
| 824321000000109 | 823651000000106 | SUMMARY_RECORD |
225225

226+
Examples: Record Artifacts
227+
| pointer-type | pointer-category | type-name |
228+
| 749001000000101 | 419891008 | APPOINTMENT |
229+
226230
# Create with content and contact details
227231
# Create with contact details only
228232
# Create with multiple attachments
@@ -319,3 +323,56 @@ Feature: Producer - createDocumentReference - Success Scenarios
319323
| custodian | ANGY1 |
320324
| author | HAR1 |
321325
| url | https://example.org/my-doc.pdf |
326+
327+
Scenario Outline: Successfully create a BaRS Appointment pointer
328+
Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API
329+
And the organisation 'BARS1' is authorised to access pointer types:
330+
| system | value |
331+
| http://snomed.info/sct | 749001000000101 |
332+
When producer 'BARS1' creates a DocumentReference with values:
333+
| property | value |
334+
| subject | 9278693472 |
335+
| status | current |
336+
| type | 749001000000101 |
337+
| category | 419891008 |
338+
| custodian | BARS1 |
339+
| author | HAR0 |
340+
| url | https://example.org/appt-link |
341+
| practiceSetting | 394802001 |
342+
| contentType | application/json+fhir |
343+
| formatCode | urn:nhs-ic:structured |
344+
| formatDisplay | Structured Document |
345+
Then the response status code is 201
346+
And the response is an OperationOutcome with 1 issue
347+
And the OperationOutcome contains the issue:
348+
"""
349+
{
350+
"severity": "information",
351+
"code": "informational",
352+
"details": {
353+
"coding": [
354+
{
355+
"system": "https://fhir.nhs.uk/ValueSet/NRL-ResponseCode",
356+
"code": "RESOURCE_CREATED",
357+
"display": "Resource created"
358+
}
359+
]
360+
},
361+
"diagnostics": "The document has been created"
362+
}
363+
"""
364+
And the response has a Location header
365+
And the Location header starts with '/producer/FHIR/R4/DocumentReference/ANGY1-'
366+
And the resource in the Location header exists with values:
367+
| property | value |
368+
| subject | 9278693472 |
369+
| status | current |
370+
| type | 749001000000101 |
371+
| category | 419891008 |
372+
| custodian | BARS1 |
373+
| author | HAR0 |
374+
| url | https://example.org/appt-link |
375+
| practiceSetting | 394802001 |
376+
| contentType | application/json+fhir |
377+
| formatCode | urn:nhs-ic:structured |
378+
| formatDisplay | Structured Document |

0 commit comments

Comments
 (0)