Skip to content

Commit 8f6fb9f

Browse files
committed
testing sandbox
1 parent 122410b commit 8f6fb9f

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
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 with `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 using 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

0 commit comments

Comments
 (0)