This guide is for contributors developing, testing, and releasing the GP2GP FHIR Request Adaptor. Use it alongside the project overview in README.md, the operating guide in OPERATING.md, and the platform-specific setup guides.
- Project overview and API guidance
- Set up the GP2GP adaptors in INT
- Set up on Windows
- Operate the adaptor
- JDK 21 - the adaptor is developed in Java with Spring Boot
- Docker
- A bash-compatible shell for the project scripts. On Windows, use WSL as described in getting-started-with-windows.md
- A current SNOMED CT UK Edition monolith zip file. See First installation for instructions on how to download one.
- Windows users should complete the prerequisite setup steps
.
├── common # Shared code used by gp2gp-translator, gpc-api-facade and db-connector
├── db-connector # Database migrations and shared DB-related classes
├── docker # Local Docker environment, compose files and helper scripts
├── gp2gp-translator # GP2GP Translator service
├── gpc-api-facade # GPC API Facade service
├── schema # Shared schema module
├── smoke-tests # Smoke-test project
├── snomed-database-loader # Scripts for loading SNOMED CT data into PostgreSQL
└── test-suite # Postman, mock MHS service and local end-to-end test environment
-
Go to the
dockerdirectory. -
Create a copy of
example.vars.shnamedvars.sh. -
Fill in the
SNOMED_CT_TERMINOLOGY_FILEvariable insidedocker/vars.shwith the path to your SNOMED ZIP file. For the description and purpose of other environment variables, refer to the operating guide. -
Run the
start-local-environment.shscript:./start-local-environment.sh
It will execute the following steps, and can take up to 30 minutes:
- create a default PostgreSQL database and
patient_switchingdatabase, - start the MHS Adaptor mock,
- start ActiveMQ,
- run migrations,
- populate SNOMED data into PostgreSQL,
- build and start the GPC API Facade service,
- build and start the GP2GP Translator application. All components run in Docker.
- create a default PostgreSQL database and
-
To run the integration tests, stop the translator and facade containers started by step 4, otherwise they will consume the AMQP messages first. Hit Ctrl-C in the terminal where you ran
./start-local-environment.sh. That stops the foregroundgpc_facadeandgp2gp_translatorcontainers while leaving ActiveMQ, PostgreSQL and the MHS adaptor mock running in the background.From the repository root, run the checks you need:
./gradlew gp2gp-translator:check./gradlew gpc-api-facade:check./gradlew common:check./gradlew db-connector:check
-
To get the adaptor to translate a GP2GP XML file to a GP Connect JSON file, place the XML file you wish to be translated inside
gp2gp-translator/src/transformXmlToJson/resources/input/and then run thetransformXmlToJsongradle task. The task will log out details of what it has transformed.cd gp2gp-translator && ./gradlew transformXmlToJson
First identify the most recent commit within GitHub that contains only changes marked as Done within Jira. You can also review which commits have gone in by using the git log command or your IDE.
Deploy this commit to the AWS Path to Live environment.
- Click through to the successful GitHub Actions build of your commit.
- Navigate to the "Build / Generate Build Id" section of the pipeline, looking for an entry which looks like
Run chmod +x ./create_build_id.sh Generated the build tag: PR-001-000a0a1 - Make a note of the
<TAG_NAME>so it can be deployed in the step below. - Navigate to the Terraform project and specify project=
nia, Environment=ptl, component=pss, action=apply, variables=pss_build_id=<TAG_NAME>and click the Build button waiting for the build to finish successfully
Perform an end-to-end smoke test of the adaptor by transferring the patient 9732596910 from C88046 to P83007 using the
instructions on Confluence by setting the to-ods: C88046 and to-asid: 858000001001.
This patient record has:
- An allergy to penicillin
- A picture of some marbles as a document
Request the patient using the adaptor and check that the allergy is mapped into the Bundle, and that the document has been transferred to S3 and the image is downloadable via a browser.
If you get a 404 response with an OperationOutcome coding of PATIENT_NOT_FOUND you may need to regenerate the patient
and then request that patient instead.
Reject the transfer by sending a FAILED_TO_INTEGRATE response, that way we can reuse the same patient.
Make a note of the most recent Release within GitHub, and identify what the next version number to use will be.
Create a new release within GitHub, specifying the tag as the version to use (e.g. 1.2.7), and the target being the commit you identified. Click on the "Generate release notes" button and this will list all the current changes from the recent commit. Click "Publish Release" which will trigger a GitHub Actions job called "Push Docker Image", which will build and push images to DockerHub.
Update the CHANGELOG.md file, moving the UNRELEASED entries into a line for the new release.
Raise a PR for your changes.
From the docker directory, rebuild the GPC API Facade with:
./rebuild-and-restart-gpc-facade.shFrom the docker directory, rebuild the GP2GP Translator with:
./rebuild-and-restart-gp2gp-translator.shFrom the docker directory, remove the local Docker containers, images and dangling volumes with:
./clear-docker.sh