Skip to content

Commit 2350115

Browse files
Merge pull request #1058 from NHSDigital/feature/safo6-NRL-1583-update-location-header
NRL-1583 Update location header
2 parents 33cb256 + 2503e00 commit 2350115

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

api/producer/createDocumentReference/tests/test_create_document_reference.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_create_document_reference_happy_path(repository: DocumentPointerReposit
4545
assert result == {
4646
"statusCode": "201",
4747
"headers": {
48-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
48+
"Location": "/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
4949
**default_response_headers(),
5050
},
5151
"isBase64Encoded": False,
@@ -111,7 +111,7 @@ def test_create_document_reference_happy_path_with_ssp(
111111
assert result == {
112112
"statusCode": "201",
113113
"headers": {
114-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
114+
"Location": "/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
115115
**default_response_headers(),
116116
},
117117
"isBase64Encoded": False,
@@ -1270,7 +1270,7 @@ def test_create_document_reference_supersede_deletes_old_pointers_replace(
12701270
assert result == {
12711271
"statusCode": "201",
12721272
"headers": {
1273-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
1273+
"Location": "/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
12741274
**default_response_headers(),
12751275
},
12761276
"isBase64Encoded": False,
@@ -1329,7 +1329,7 @@ def test_create_document_reference_supersede_succeeds_with_toggle(
13291329
assert result == {
13301330
"statusCode": "201",
13311331
"headers": {
1332-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
1332+
"Location": "/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
13331333
**default_response_headers(),
13341334
},
13351335
"isBase64Encoded": False,
@@ -1444,7 +1444,7 @@ def test_create_document_reference_create_relatesto_not_replaces(
14441444
assert result == {
14451445
"statusCode": "201",
14461446
"headers": {
1447-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
1447+
"Location": "/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
14481448
**default_response_headers(),
14491449
},
14501450
"isBase64Encoded": False,
@@ -1496,7 +1496,7 @@ def test_create_document_reference_with_date_ignored(
14961496
assert result == {
14971497
"statusCode": "201",
14981498
"headers": {
1499-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
1499+
"Location": "/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
15001500
**default_response_headers(),
15011501
},
15021502
"isBase64Encoded": False,
@@ -1562,7 +1562,7 @@ def test_create_document_reference_with_date_and_meta_lastupdated_ignored(
15621562
assert result == {
15631563
"statusCode": "201",
15641564
"headers": {
1565-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
1565+
"Location": "/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
15661566
**default_response_headers(),
15671567
},
15681568
"isBase64Encoded": False,
@@ -1626,7 +1626,7 @@ def test_create_document_reference_with_date_overidden(
16261626
assert result == {
16271627
"statusCode": "201",
16281628
"headers": {
1629-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
1629+
"Location": "/DocumentReference/Y05868-00000000-0000-0000-0000-000000000001",
16301630
**default_response_headers(),
16311631
},
16321632
"isBase64Encoded": False,

api/producer/upsertDocumentReference/tests/test_upsert_document_reference.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_upsert_document_reference_happy_path(repository: DocumentPointerReposit
4343
assert result == {
4444
"statusCode": "201",
4545
"headers": {
46-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-99999-99999-999999",
46+
"Location": "/DocumentReference/Y05868-99999-99999-999999",
4747
**default_response_headers(),
4848
},
4949
"isBase64Encoded": False,
@@ -105,7 +105,7 @@ def test_upsert_document_reference_happy_path_with_ssp(
105105
assert result == {
106106
"statusCode": "201",
107107
"headers": {
108-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-99999-99999-999999",
108+
"Location": "/DocumentReference/Y05868-99999-99999-999999",
109109
**default_response_headers(),
110110
},
111111
"isBase64Encoded": False,
@@ -915,7 +915,7 @@ def test_upsert_document_reference_invalid_relatesto_not_exists_still_creates_wi
915915
assert result == {
916916
"statusCode": "201",
917917
"headers": {
918-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-99999-99999-999999",
918+
"Location": "/DocumentReference/Y05868-99999-99999-999999",
919919
**default_response_headers(),
920920
},
921921
"isBase64Encoded": False,
@@ -1249,7 +1249,7 @@ def test_upsert_document_reference_supersede_deletes_old_pointers_replace(
12491249
assert result == {
12501250
"statusCode": "201",
12511251
"headers": {
1252-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-99999-99999-111111",
1252+
"Location": "/DocumentReference/Y05868-99999-99999-111111",
12531253
**default_response_headers(),
12541254
},
12551255
"isBase64Encoded": False,
@@ -1307,7 +1307,7 @@ def test_upsert_document_reference_supersede_succeeds_with_toggle(
13071307
assert result == {
13081308
"statusCode": "201",
13091309
"headers": {
1310-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-99999-99999-999999",
1310+
"Location": "/DocumentReference/Y05868-99999-99999-999999",
13111311
**default_response_headers(),
13121312
},
13131313
"isBase64Encoded": False,
@@ -1421,7 +1421,7 @@ def test_upsert_document_reference_create_relatesto_not_replaces(
14211421
assert result == {
14221422
"statusCode": "201",
14231423
"headers": {
1424-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-99999-99999-111111",
1424+
"Location": "/DocumentReference/Y05868-99999-99999-111111",
14251425
**default_response_headers(),
14261426
},
14271427
"isBase64Encoded": False,
@@ -1472,7 +1472,7 @@ def test_upsert_document_reference_with_date_ignored(
14721472
assert result == {
14731473
"statusCode": "201",
14741474
"headers": {
1475-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-99999-99999-999999",
1475+
"Location": "/DocumentReference/Y05868-99999-99999-999999",
14761476
**default_response_headers(),
14771477
},
14781478
"isBase64Encoded": False,
@@ -1534,7 +1534,7 @@ def test_upsert_document_reference_with_date_and_meta_lastupdated_ignored(
15341534
assert result == {
15351535
"statusCode": "201",
15361536
"headers": {
1537-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-99999-99999-999999",
1537+
"Location": "/DocumentReference/Y05868-99999-99999-999999",
15381538
**default_response_headers(),
15391539
},
15401540
"isBase64Encoded": False,
@@ -1594,7 +1594,7 @@ def test_upsert_document_reference_with_date_overidden(
15941594
assert result == {
15951595
"statusCode": "201",
15961596
"headers": {
1597-
"Location": "/producer/FHIR/R4/DocumentReference/Y05868-99999-99999-999999",
1597+
"Location": "/DocumentReference/Y05868-99999-99999-999999",
15981598
**default_response_headers(),
15991599
},
16001600
"isBase64Encoded": False,

layer/nrlf/core/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Source(Enum):
4848
X_CORRELATION_ID_HEADER = "X-Correlation-Id"
4949

5050

51-
PRODUCER_URL_PATH = "/producer/FHIR/R4/DocumentReference"
51+
PRODUCER_URL_PATH = "/DocumentReference"
5252

5353

5454
class PointerTypes(Enum):

tests/features/producer/createDocumentReference-success.feature

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Feature: Producer - createDocumentReference - Success Scenarios
3535
}
3636
"""
3737
And the response has a Location header
38-
And the Location header starts with '/producer/FHIR/R4/DocumentReference/ANGY1-'
38+
And the Location header starts with '/DocumentReference/ANGY1-'
3939
And the resource in the Location header exists with values:
4040
| property | value |
4141
| subject | 9278693472 |
@@ -82,7 +82,7 @@ Feature: Producer - createDocumentReference - Success Scenarios
8282
# }
8383
# """
8484
# And the response has a Location header
85-
# And the Location header starts with '/producer/FHIR/R4/DocumentReference/ANGY1'
85+
# And the Location header starts with '/DocumentReference/ANGY1'
8686
# And the resource in the Location header exists with values:
8787
# | property | value |
8888
# | subject | 9278693472 |
@@ -141,7 +141,7 @@ Feature: Producer - createDocumentReference - Success Scenarios
141141
}
142142
"""
143143
And the response has a Location header
144-
And the Location header starts with '/producer/FHIR/R4/DocumentReference/ANGY1-'
144+
And the Location header starts with '/DocumentReference/ANGY1-'
145145
And the resource in the Location header exists with values:
146146
| property | value |
147147
| subject | 9278693472 |
@@ -191,7 +191,7 @@ Feature: Producer - createDocumentReference - Success Scenarios
191191
}
192192
"""
193193
And the response has a Location header
194-
And the Location header starts with '/producer/FHIR/R4/DocumentReference/ANGY1-'
194+
And the Location header starts with '/DocumentReference/ANGY1-'
195195
And the resource in the Location header exists with values:
196196
| property | value |
197197
| subject | 9278693472 |
@@ -270,7 +270,7 @@ Feature: Producer - createDocumentReference - Success Scenarios
270270
}
271271
"""
272272
And the response has a Location header
273-
And the Location header starts with '/producer/FHIR/R4/DocumentReference/ANGY1-'
273+
And the Location header starts with '/DocumentReference/ANGY1-'
274274
And the resource in the Location header exists with values:
275275
| property | value |
276276
| subject | 9278693472 |
@@ -313,7 +313,7 @@ Feature: Producer - createDocumentReference - Success Scenarios
313313
}
314314
"""
315315
And the response has a Location header
316-
And the Location header starts with '/producer/FHIR/R4/DocumentReference/ANGY1-'
316+
And the Location header starts with '/DocumentReference/ANGY1-'
317317
And the resource in the Location header exists with values:
318318
| property | value |
319319
| subject | 9278693472 |
@@ -363,7 +363,7 @@ Feature: Producer - createDocumentReference - Success Scenarios
363363
}
364364
"""
365365
And the response has a Location header
366-
And the Location header starts with '/producer/FHIR/R4/DocumentReference/ANGY1-'
366+
And the Location header starts with '/DocumentReference/ANGY1-'
367367
And the resource in the Location header exists with values:
368368
| property | value |
369369
| subject | 9278693472 |
@@ -482,7 +482,7 @@ Feature: Producer - createDocumentReference - Success Scenarios
482482
}
483483
"""
484484
And the response has a Location header
485-
And the Location header starts with '/producer/FHIR/R4/DocumentReference/TSTCUS-'
485+
And the Location header starts with '/DocumentReference/TSTCUS-'
486486
And the resource in the Location header exists with values:
487487
| property | value |
488488
| content[0].attachment.url | https://example.org/doc1.pdf |
@@ -559,7 +559,7 @@ Feature: Producer - createDocumentReference - Success Scenarios
559559
}
560560
"""
561561
And the response has a Location header
562-
And the Location header starts with '/producer/FHIR/R4/DocumentReference/TSTCUS-'
562+
And the Location header starts with '/DocumentReference/TSTCUS-'
563563
And the resource in the Location header exists with values:
564564
| property | value |
565565
| content[0].attachment.url | https://example.org/incontext-launch.html |

tests/features/steps/3_assert.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,9 @@ def assert_header_starts_with(context: Context, header_name: str, starts_with: s
373373
def assert_resource_in_location_header_exists_with_values(context: Context):
374374
location = context.response.headers.get("Location")
375375

376-
assert location.startswith("/producer/FHIR/R4/DocumentReference/"), format_error(
376+
assert location.startswith("/DocumentReference/"), format_error(
377377
"Unexpected Location header",
378-
"/producer/FHIR/R4/DocumentReference/",
378+
"/DocumentReference/",
379379
location,
380380
context.response.text,
381381
)

0 commit comments

Comments
 (0)