Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions README.specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,39 @@ See the APM confluence for more information on how the [\_ping](https://nhsd-con
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.
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).

### Testing the sandbox

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/.

From a separate terminal, test each endpoint as follows:

- 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.

- Replace
https://sandbox.api.service.nhs.uk/immunisation-fhir-api/FHIR/R4/ with http://0.0.0.0:9000/

- Add the -i option in order to see the response headers.

Examples:

- GET Search:

curl -i -X 'GET' \
'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' \
-H 'accept: application/fhir+json' \
-H 'X-Correlation-ID: 60E0B220-8136-4CA5-AE46-1D97EF59D068' \
-H 'X-Request-ID: 60E0B220-8136-4CA5-AE46-1D97EF59D068'

- POST Search:

curl -i -X 'POST' \
'http://0.0.0.0:9000/Immunization/_search' \
-H 'accept: application/fhir+json' \
-H 'X-Correlation-ID: 60E0B220-8136-4CA5-AE46-1D97EF59D068' \
-H 'X-Request-ID: 60E0B220-8136-4CA5-AE46-1D97EF59D068' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-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'

#### `utilities/scripts`:

Contains useful scripts that are used throughout the project, for example in Makefile and Github workflows
Expand Down
30 changes: 20 additions & 10 deletions specification/immunisation-fhir-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,8 @@ paths:
resourceType:
type: string
description: FHIR resource type. Always `Practitioner`.
example: Practitioner
enum:
- Practitioner
id:
type: string
description: Logical id of this artifact
Expand All @@ -536,7 +537,8 @@ paths:
resourceType:
type: string
description: FHIR resource type. Always `Patient`.
example: Patient
enum:
- Patient
id:
type: string
description: Logical id of this artifact
Expand Down Expand Up @@ -1515,7 +1517,8 @@ paths:
resourceType:
description: FHIR resource type. Always `Immunization`.
type: string
example: Immunization
enum:
- Immunization
id:
description: Immunization record Id.
type: string
Expand Down Expand Up @@ -1579,7 +1582,8 @@ paths:
resourceType:
type: string
description: FHIR resource type. Always `Practitioner`.
example: Practitioner
enum:
- Practitioner
id:
type: string
description: Logical id of this artifact
Expand Down Expand Up @@ -1608,7 +1612,8 @@ paths:
resourceType:
type: string
description: FHIR resource type. Always `Patient`.
example: Patient
enum:
- Patient
id:
type: string
description: Logical id of this artifact
Expand Down Expand Up @@ -2278,7 +2283,8 @@ paths:
resourceType:
description: FHIR resource type. Always `Immunization`.
type: string
example: Immunization
enum:
- Immunization
id:
description: Immunization record Id.
type: string
Expand Down Expand Up @@ -2345,7 +2351,8 @@ paths:
resourceType:
type: string
description: FHIR resource type. Always `Practitioner`.
example: Practitioner
enum:
- Practitioner
id:
type: string
description: Logical id of this artifact
Expand All @@ -2371,7 +2378,8 @@ paths:
resourceType:
type: string
description: FHIR resource type. Always `Patient`.
example: Patient
enum:
- Patient
id:
type: string
description: Logical id of this artifact
Expand Down Expand Up @@ -3274,7 +3282,8 @@ components:
resourceType:
description: FHIR resource type. Always `Immunization`.
type: string
example: Immunization
enum:
- Immunization
id:
description: Immunization record Id.
type: string
Expand Down Expand Up @@ -3833,7 +3842,8 @@ components:
resourceType:
description: FHIR resource type. Always `Patient`.
type: string
example: Patient
enum:
- Patient
id:
description: Patient ID (NHS Number)
type: string
Expand Down