Skip to content

Commit 5f7ec4c

Browse files
committed
NRL-478 fix integration tests
1 parent dabd68b commit 5f7ec4c

File tree

4 files changed

+53
-73
lines changed

4 files changed

+53
-73
lines changed

tests/features/consumer/readDocumentReference-success.feature

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,18 @@ Feature: Consumer - readDocumentReference - Success Scenarios
7070
"url": "https://example.org/my-doc.pdf"
7171
}
7272
}
73-
]
73+
],
74+
"context": {
75+
"practiceSetting": {
76+
"coding": [
77+
{
78+
"system": "http://snomed.info/sct",
79+
"code": "390826005",
80+
"display": "Mental health caregiver support"
81+
}
82+
]
83+
}
84+
}
7485
}
7586
"""
7687

@@ -144,7 +155,18 @@ Feature: Consumer - readDocumentReference - Success Scenarios
144155
"url": "https://example.org/my-doc.pdf"
145156
}
146157
}
147-
]
158+
],
159+
"context": {
160+
"practiceSetting": {
161+
"coding": [
162+
{
163+
"system": "http://snomed.info/sct",
164+
"code": "390826005",
165+
"display": "Mental health caregiver support"
166+
}
167+
]
168+
}
169+
}
148170
}
149171
"""
150172

tests/features/producer/readDocumentReference-success.feature

Lines changed: 8 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -72,81 +72,18 @@ Feature: Producer - readDocumentReference - Success Scenarios
7272
"url": "https://example.org/my-doc.pdf"
7373
}
7474
}
75-
]
76-
}
77-
"""
78-
79-
Scenario: Read document reference by ID
80-
Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API
81-
And the organisation 'RX898' is authorised to access pointer types:
82-
| system | value |
83-
| http://snomed.info/sct | 736253002 |
84-
And a DocumentReference resource exists with values:
85-
| property | value |
86-
| id | RX898-9999999999-ReadDocRefSameCust |
87-
| subject | 9999999999 |
88-
| status | current |
89-
| type | 736253002 |
90-
| category | 734163000 |
91-
| contentType | application/pdf |
92-
| url | https://example.org/my-doc.pdf |
93-
| custodian | RX898 |
94-
| author | HAR1 |
95-
When producer 'RX898' reads a DocumentReference with ID 'RX898-9999999999-ReadDocRefSameCust'
96-
Then the response status code is 200
97-
And the response is a DocumentReference with JSON value:
98-
"""
99-
{
100-
"resourceType": "DocumentReference",
101-
"id": "RX898-9999999999-ReadDocRefSameCust",
102-
"status": "current",
103-
"type": {
104-
"coding": [
105-
{
106-
"system": "http://snomed.info/sct",
107-
"code": "736253002"
108-
}
109-
]
110-
},
111-
"category": [
112-
{
75+
],
76+
"context": {
77+
"practiceSetting": {
11378
"coding": [
114-
{
115-
"system": "http://snomed.info/sct",
116-
"code": "734163000",
117-
"display": "Care plan"
79+
{
80+
"system": "http://snomed.info/sct",
81+
"code": "390826005",
82+
"display": "Mental health caregiver support"
11883
}
11984
]
12085
}
121-
],
122-
"subject": {
123-
"identifier": {
124-
"system": "https://fhir.nhs.uk/Id/nhs-number",
125-
"value": "9999999999"
126-
}
127-
},
128-
"custodian": {
129-
"identifier": {
130-
"system": "https://fhir.nhs.uk/Id/ods-organization-code",
131-
"value": "RX898"
132-
}
133-
},
134-
"author": [
135-
{
136-
"identifier": {
137-
"system": "https://fhir.nhs.uk/Id/ods-organization-code",
138-
"value": "HAR1"
139-
}
140-
}
141-
],
142-
"content": [
143-
{
144-
"attachment": {
145-
"contentType": "application/pdf",
146-
"url": "https://example.org/my-doc.pdf"
147-
}
148-
}
149-
]
86+
}
15087
}
15188
"""
15289

tests/features/utils/constants.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@
6060

6161
DEFAULT_TEST_CONTEXT = """
6262
"context": {
63+
"practiceSetting": {
64+
"coding": [
65+
{
66+
"system": "http://snomed.info/sct",
67+
"code": "390826005",
68+
"display": "Mental health caregiver support"
69+
}
70+
]
71+
},
6372
"related": [
6473
{
6574
"identifier": {

tests/features/utils/data.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Coding,
66
DocumentReference,
77
DocumentReferenceContent,
8+
DocumentReferenceContext,
89
DocumentReferenceRelatesTo,
910
Identifier,
1011
Reference,
@@ -35,6 +36,17 @@ def create_test_document_reference(items: dict) -> DocumentReference:
3536
)
3637
)
3738
],
39+
context=DocumentReferenceContext(
40+
practiceSetting=CodeableConcept(
41+
coding=[
42+
Coding(
43+
system="http://snomed.info/sct",
44+
code="390826005",
45+
display="Mental health caregiver support",
46+
)
47+
]
48+
)
49+
),
3850
)
3951

4052
if items.get("id"):

0 commit comments

Comments
 (0)