This repository should be considered deprecated and will receive no further updates. It is not tied to any live systems or service and so will not receive updates of any kind. It is for information purposes only.
If you wish to discuss this repository please contact the Patient Record Migration (PRM) team in GPITFutures.
- node v8.10.0 (or above)
- an IDE / text editor
- Postman (optional, but useful to have)
This solution is a walking skeleton to explore the problem of a patient record being migrated from one practice to another.
- It starts with an EHR extract being uploaded to the solution
- We store the extract as JSON payload in a database (DynamoDB)
- The database is shared across the lambdas for simplicity
- The payload is validated with data retrieved from PDS
- In this instance, it's just a very basic check to prove the concept of calling PDS via OpenTest
- At any point after the extract is uploaded and stored as the payload, its translation status can be checked by calling the
status
endpoint - Once the stored payload has been fully translated, its status will be updated to reflect that, and it can be retrieved by calling the
retrieve
endpoint
For further information on the solution, please see the Core Infrastructure section in Confluence.
Each of the lambdas are independent of one another, so they can be packaged / deployed independently. As such, they each have their own node_modules
and packages.json
.
From a command prompt, cd
into the root directory of the lambda you want to build, then install its node packages with:
npm i
Run the tests with:
npm t
Please note: The end to end tests are for testing the deployed code, hosted in AWS, rather than any local changes you may want to test.
The end to end tests are Postman tests, and so we use Newman to run them from command line.
From a command prompt, cd
into the e2e directory, then install its node packages with:
npm i
Run the tests by passing the postman collection to newman, along with the relevant environment variables collection:
i.e.
newman run postman-collections/PRM.postman_collection.json --environment postman-collections/PRM-dev-327778747031.postman_environment.json --delay-request 200
You can also run the tests from Postman directly, by importing them. You'll find the tests and their environment variable collection in the postman-collections directory.
The build pipelines for the lambdas are defined in the pipelines directory, however they are deployed by the PRM-Infra solution. All of the AWS dependencies, such as the API gateway and DynamoDB are deployed and configured by the the prm-infra solution as well.