The sandbox environment uses:
- OpenAPI Generator CLI to validate the specification and convert it from .yaml to .json for use in the sandbox.
- Prism as a mock server.
- A flask proxy to allow us to inject specific examples based on request attributes.
Run the following command to start the sandbox environment:
make spec
make upThis will start the sandbox environment on localhost port 9000.
make downThis will stop the sandbox environment.
There are a number of examples of responses which can be returned by passing specific NHS Numbers in the patient query parameter:
curl -X GET "http://0.0.0.0:9000/patient-check/<NHS_NUMBER>| Patient ID | Response |
|---|---|
| 50000000001 | RSV - Actionable due to membership of an Age Cohort including suggested actions (with booking) |
| 50000000002 | RSV - Actionable due to membership of an Age Cohort including suggested action (not booking) |
| 50000000003 | RSV - Actionable due to membership of an alternative Age Cohort including suggested action (not booking) |
| 50000000004 | RSV - Actionable due to membership of an Age Cohort including suggested action (existing national booking) |
| 50000000005 | RSV - Actionable due to membership of an Age Cohort including suggested actions (not booking) |
| 50000000006 | RSV - Not Actionable despite to membership of an Age Cohort with reasoning of already vaccinated |
| 50000000007 | RSV - Not Actionable despite to membership of an Age Cohort with reasoning of no available vaccinations (not available type 1) |
| 50000000008 | RSV - No RSV response as no active campaign (not available type 2) |
| 50000000009 | RSV - Not Actionable despite to membership of an Age Cohort with reasoning of dose not yet due |
| 50000000010 | RSV - Not Actionable despite to membership of an Age Cohort with reasoning of dose not far enough apart |
| 50000000011 | RSV - Not Actionable despite to membership of an Age Cohort with reasoning of vaccination given in current setting (e.g. care home) |
| 50000000012 | RSV - Not Actionable despite no cohort membership with reasoning of already vaccinated (type 1 includes unknown cohort) |
| 50000000013 | RSV - Not Actionable despite no cohort membership with reasoning of already vaccinated (type 2 includes no cohorts) |
| 50000000014 | RSV - Not Actionable despite no cohort membership with reasoning of already vaccinated (type 2 includes no cohorts) |
| 90000000400 | Invalid input data |
| 90000000404 | Person not found |
| 90000000422 | Unrecognised input data. (Unprocessable Content) |
| 90000000500 | Internal server error |
See app.py for current examples.
In order for our sandbox to be deployed correctly, both the specification for the sandbox and the accompanying backend need to be deployed.
Instructions for creation and deployment of the sandbox specification can be found in the specification README
To deploy the sandbox Docker image to AWS ECR, we use Proxygen CLI as follows:
- Follow the instructions in the specification README to set up Proxygen authentication.
- Run
proxygen docker get-loginand copy the command provided in the response. - Run the command to authenticate with our ECR repository.
- Build the sandbox container -
make buildin this directory. - Tag the image created using
docker image tag <image id> 958002497996.dkr.ecr.eu-west-2.amazonaws.com/eligibility-signposting-api:latest. You can see what the image id is by runningdocker imagesto find what was just built. - Push the docker image to our ECR repository using
docker push 958002497996.dkr.ecr.eu-west-2.amazonaws.com/eligibility-signposting-api:latest