Skip to content

Commit 9e5befd

Browse files
authored
Merge branch 'master' into VED-887-Slack-alerting-API-errors
2 parents 87967e0 + 6ce912d commit 9e5befd

File tree

2 files changed

+53
-10
lines changed

2 files changed

+53
-10
lines changed

README.specification.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,39 @@ See the APM confluence for more information on how the [\_ping](https://nhsd-con
143143
This folder contains a template for a sandbox API. This example is a NodeJs application running in Docker. The application handles a few simple endpoints such as: /\_ping, /health, /\_status, /hello and some logging logic.
144144
For more information about building sandbox APIs see the [API Producer Zone confluence](https://nhsd-confluence.digital.nhs.uk/display/APM/Setting+up+your+API+sandbox).
145145

146+
### Testing the sandbox
147+
148+
The sandbox can be tested locally by changing to the `/sandbox` folder in a terminal and running `make run`. This will spin up a mock Prism web server at http://0.0.0.0:9000/.
149+
150+
From a separate terminal, test each endpoint as follows:
151+
152+
- Copy the appropriate `curl` command. These can be retrieved by opening the `specification/immunisation-fhir-api.yaml` file in the Swagger editor; expand the required endpoint, select 'Try it out', and then 'Execute'. The `curl` command to use will appear in the Curl window.
153+
154+
- Replace
155+
https://sandbox.api.service.nhs.uk/immunisation-fhir-api/FHIR/R4/ with http://0.0.0.0:9000/
156+
157+
- Add the -i option in order to see the response headers.
158+
159+
Examples:
160+
161+
- GET Search:
162+
163+
curl -i -X 'GET' \
164+
'http://0.0.0.0:9000/Immunization?patient.identifier=https%3A%2F%2Ffhir.nhs.uk%2FId%2Fnhs-number%7C9000000009&-immunization.target=3IN1&-date.from=1900-01-01&-date.to=9999-12-31&_include=Immunization%3Apatient' \
165+
-H 'accept: application/fhir+json' \
166+
-H 'X-Correlation-ID: 60E0B220-8136-4CA5-AE46-1D97EF59D068' \
167+
-H 'X-Request-ID: 60E0B220-8136-4CA5-AE46-1D97EF59D068'
168+
169+
- POST Search:
170+
171+
curl -i -X 'POST' \
172+
'http://0.0.0.0:9000/Immunization/_search' \
173+
-H 'accept: application/fhir+json' \
174+
-H 'X-Correlation-ID: 60E0B220-8136-4CA5-AE46-1D97EF59D068' \
175+
-H 'X-Request-ID: 60E0B220-8136-4CA5-AE46-1D97EF59D068' \
176+
-H 'Content-Type: application/x-www-form-urlencoded' \
177+
-d 'patient.identifier=https%3A%2F%2Ffhir.nhs.uk%2FId%2Fnhs-number%7C9000000009&-immunization.target=3IN1&-date.from=1900-01-01&-date.to=9999-12-31&\_include=Immunization%3Apatient'
178+
146179
#### `utilities/scripts`:
147180

148181
Contains useful scripts that are used throughout the project, for example in Makefile and Github workflows

specification/immunisation-fhir-api.yaml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,8 @@ paths:
510510
resourceType:
511511
type: string
512512
description: FHIR resource type. Always `Practitioner`.
513-
example: Practitioner
513+
enum:
514+
- Practitioner
514515
id:
515516
type: string
516517
description: Logical id of this artifact
@@ -536,7 +537,8 @@ paths:
536537
resourceType:
537538
type: string
538539
description: FHIR resource type. Always `Patient`.
539-
example: Patient
540+
enum:
541+
- Patient
540542
id:
541543
type: string
542544
description: Logical id of this artifact
@@ -1515,7 +1517,8 @@ paths:
15151517
resourceType:
15161518
description: FHIR resource type. Always `Immunization`.
15171519
type: string
1518-
example: Immunization
1520+
enum:
1521+
- Immunization
15191522
id:
15201523
description: Immunization record Id.
15211524
type: string
@@ -1579,7 +1582,8 @@ paths:
15791582
resourceType:
15801583
type: string
15811584
description: FHIR resource type. Always `Practitioner`.
1582-
example: Practitioner
1585+
enum:
1586+
- Practitioner
15831587
id:
15841588
type: string
15851589
description: Logical id of this artifact
@@ -1608,7 +1612,8 @@ paths:
16081612
resourceType:
16091613
type: string
16101614
description: FHIR resource type. Always `Patient`.
1611-
example: Patient
1615+
enum:
1616+
- Patient
16121617
id:
16131618
type: string
16141619
description: Logical id of this artifact
@@ -2278,7 +2283,8 @@ paths:
22782283
resourceType:
22792284
description: FHIR resource type. Always `Immunization`.
22802285
type: string
2281-
example: Immunization
2286+
enum:
2287+
- Immunization
22822288
id:
22832289
description: Immunization record Id.
22842290
type: string
@@ -2345,7 +2351,8 @@ paths:
23452351
resourceType:
23462352
type: string
23472353
description: FHIR resource type. Always `Practitioner`.
2348-
example: Practitioner
2354+
enum:
2355+
- Practitioner
23492356
id:
23502357
type: string
23512358
description: Logical id of this artifact
@@ -2371,7 +2378,8 @@ paths:
23712378
resourceType:
23722379
type: string
23732380
description: FHIR resource type. Always `Patient`.
2374-
example: Patient
2381+
enum:
2382+
- Patient
23752383
id:
23762384
type: string
23772385
description: Logical id of this artifact
@@ -3274,7 +3282,8 @@ components:
32743282
resourceType:
32753283
description: FHIR resource type. Always `Immunization`.
32763284
type: string
3277-
example: Immunization
3285+
enum:
3286+
- Immunization
32783287
id:
32793288
description: Immunization record Id.
32803289
type: string
@@ -3833,7 +3842,8 @@ components:
38333842
resourceType:
38343843
description: FHIR resource type. Always `Patient`.
38353844
type: string
3836-
example: Patient
3845+
enum:
3846+
- Patient
38373847
id:
38383848
description: Patient ID (NHS Number)
38393849
type: string

0 commit comments

Comments
 (0)