diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..114991db --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @NHSDigital/patient-record-management \ No newline at end of file diff --git a/.github/workflows/automated-sbom-repo-scan.yml b/.github/workflows/automated-sbom-repo-scan.yml index f220c00e..58f9c8a8 100644 --- a/.github/workflows/automated-sbom-repo-scan.yml +++ b/.github/workflows/automated-sbom-repo-scan.yml @@ -15,7 +15,7 @@ jobs: name: SBOM Repo Scan runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis @@ -35,7 +35,7 @@ jobs: output-format: sarif - name: Upload Anchore scan SARIF report - uses: github/codeql-action/upload-sarif@v3 + uses: github/codeql-action/upload-sarif@v4 if: always() with: sarif_file: ${{ steps.sbom-scan.outputs.sarif }} diff --git a/.github/workflows/base-java-service-jobs.yml b/.github/workflows/base-java-service-jobs.yml index 1b86dccf..d19e6570 100644 --- a/.github/workflows/base-java-service-jobs.yml +++ b/.github/workflows/base-java-service-jobs.yml @@ -44,10 +44,10 @@ jobs: working-directory: "./services/${{ inputs.service }}" steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set up JDK ${{ inputs.java_version }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v5 with: distribution: "temurin" java-version: "${{ inputs.java_version }}" @@ -73,17 +73,17 @@ jobs: working-directory: "./services/${{ inputs.service }}" steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set up JDK ${{ inputs.java_version }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v5 with: distribution: "temurin" java-version: "${{ inputs.java_version }}" cache: gradle - name: Configure AWS Credentials (Read/Write) - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v6 with: role-to-assume: ${{ secrets.IAM_ROLE }} aws-region: ${{ vars.AWS_REGION }} @@ -137,7 +137,7 @@ jobs: deploy_infra: name: Deploy Infrastructure needs: [build_and_publish] - uses: nhsconnect/orphaned-record-continuity-infrastructure/.github/workflows/deploy-stack.yml@v3 + uses: NHSDigital/orphaned-record-continuity-infrastructure/.github/workflows/deploy-stack.yml@v3 with: stack: ${{ inputs.service }} diff --git a/.github/workflows/base-node-service-jobs.yml b/.github/workflows/base-node-service-jobs.yml index 225006cb..3cc51264 100644 --- a/.github/workflows/base-node-service-jobs.yml +++ b/.github/workflows/base-node-service-jobs.yml @@ -44,7 +44,7 @@ jobs: id: extract_branch - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set up Node uses: actions/setup-node@v4 @@ -56,7 +56,7 @@ jobs: run: npm install - name: Start LocalStack - uses: LocalStack/setup-localstack@v0.2.4 + uses: LocalStack/setup-localstack@v0.2.5 with: install-awslocal: "true" @@ -106,7 +106,7 @@ jobs: working-directory: "./services/${{ inputs.service }}" steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set up Node uses: actions/setup-node@v4 @@ -115,7 +115,7 @@ jobs: - name: Install dependencies run: npm install - name: Configure AWS Credentials (Read/Write) - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v6 with: role-to-assume: ${{ secrets.IAM_ROLE }} aws-region: ${{ vars.AWS_REGION }} @@ -169,7 +169,7 @@ jobs: deploy_infra: name: Deploy Infrastructure needs: [build_and_publish] - uses: nhsconnect/orphaned-record-continuity-infrastructure/.github/workflows/deploy-stack.yml@v3 + uses: NHSDigital/orphaned-record-continuity-infrastructure/.github/workflows/deploy-stack.yml@v3 with: stack: ${{ inputs.service }} environment: ${{ inputs.environment }} diff --git a/.github/workflows/base-python-service-jobs.yml b/.github/workflows/base-python-service-jobs.yml index 997813d7..5423787e 100644 --- a/.github/workflows/base-python-service-jobs.yml +++ b/.github/workflows/base-python-service-jobs.yml @@ -36,10 +36,10 @@ jobs: working-directory: "./services/${{ inputs.service }}" steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.9 - name: Run Unit tests @@ -54,16 +54,16 @@ jobs: run: working-directory: ./services/${{ inputs.service }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python 3.9 - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.9 - name: Configure AWS credentials id: auth - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v6 with: mask-aws-account-id: true role-to-assume: ${{ secrets.IAM_ROLE }} @@ -120,7 +120,7 @@ jobs: if: ${{ inputs.deploy_infra && inputs.is_deployment }} name: Deploy Infrastructure needs: [build-and-publish-service] - uses: nhsconnect/orphaned-record-continuity-infrastructure/.github/workflows/deploy-stack.yml@v3 + uses: NHSDigital/orphaned-record-continuity-infrastructure/.github/workflows/deploy-stack.yml@v3 with: stack: ${{ inputs.service }} environment: ${{ inputs.environment }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40461ece..6178864d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,12 +10,12 @@ jobs: name: SonarCloud runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Use Node.js 22.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.x @@ -25,7 +25,7 @@ jobs: ./tasks test_coverage-github-action - name: SonarCloud Scan - uses: SonarSource/sonarqube-scan-action@v4 + uses: SonarSource/sonarqube-scan-action@v7 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index be95c020..1034f43b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -18,12 +18,12 @@ jobs: steps: - name: Checkout End to End - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: repository: "nhsconnect/prm-repo-e2e-tests" - name: Setup Java - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: "adopt" java-version: "21" diff --git a/.github/workflows/service-ci.yml b/.github/workflows/service-ci.yml index e5fba3d1..52d7a313 100644 --- a/.github/workflows/service-ci.yml +++ b/.github/workflows/service-ci.yml @@ -40,15 +40,15 @@ jobs: changed: ${{ steps.get_changes.outputs.changed }} steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Get Changes id: get_changes run: | - git fetch origin ${{ github.event.pull_request.base.ref }} - changed=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD | tr '\n' ' ') + git fetch origin main + changed=$(git diff --name-only origin/main... | tr '\n' ' ') echo "changed=$changed" >> $GITHUB_OUTPUT ehr-repo: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..48ca2e2f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,27 @@ +# Welcome to the Orphaned Record Continuity contributors guide + +Thank you for your interest in improving the codebase. + +In this guide you will get an overview of the contribution workflow from creating a PR, reviewing, and merging the PR. + +The codebase covers: + +- The [Orphaned Record Continuity service](https://digital.nhs.uk/services/orphaned-record-continuity). + +To raise an issue, please contact one of the [CODEOWNERS](.github/CODEOWNERS) directly, or raise a PR. + +If you're new to GitHub and/or Markdown, GitHub's own [contributor's guide](https://github.com/github/docs/blob/main/.github/CONTRIBUTING.md) provides good signposting on these topics. + +## Pull requests and merging + +You can't push to the main branch. Therefore, for all changes you will need to create a new branch, and then a pull request to merge said branch into `main`. The [CODEOWNERS](.github/CODEOWNERS) will be nominated as reviewers of your PR by default, but feel free to add other people as well if you think they will have valuable input. + +## Contributing guidelines and etiquette + +- Preview your Markdown code to make sure the format is not broken. +- Check grammar, spelling and punctuation - no-one wants to look pedantic by requesting changes due to typos or inconsistent grammar/syntax, but it's only fair to keep this tidy. +- The codebase is open to the world. This has a few implications: + - Nothing in it should be confidential, private to NHSE or include any personal data. + - All links should be public. + - Consider comments and README.md text: comments in open source repos such as this are not official communications and don't go through the normal approval process for public communication. They can however still be interpreted as official communication, even if not intended as such. +- Use [inclusive language](https://github.com/NHSDigital/software-engineering-quality-framework/blob/main/inclusive-language.md): avoid terms which cause hurt and offence, including if they have historically been considered industry-standard terms. diff --git a/services/ehr-out-service/package.json b/services/ehr-out-service/package.json index 30e111a9..1f246ed9 100644 --- a/services/ehr-out-service/package.json +++ b/services/ehr-out-service/package.json @@ -70,10 +70,6 @@ "superagent": "8.0.8", "semver": ">=7.5.2" }, - "repository": { - "type": "git", - "url": "git+https://github.com/nhsconnect/prm-repo-ehr-out-service.git" - }, "jest": { "resetModules": true, "clearMocks": true, diff --git a/services/ehr-out-service/sonar-project.properties b/services/ehr-out-service/sonar-project.properties index 83b62196..6f59916a 100644 --- a/services/ehr-out-service/sonar-project.properties +++ b/services/ehr-out-service/sonar-project.properties @@ -1,5 +1,5 @@ -sonar.projectKey=prm-orphaned-record-continuity_prm-repo-ehr-out-service -sonar.organization=prm-orphaned-record-continuity +sonar.projectKey=NHSDigital_orphaned-record-continuity +sonar.organization=nhsdigital # This is the name and version displayed in the SonarCloud UI. sonar.projectName=prm-repo-ehr-out-service diff --git a/services/ehr-transfer-service/build.gradle b/services/ehr-transfer-service/build.gradle index ca00bbca..db4e8af3 100644 --- a/services/ehr-transfer-service/build.gradle +++ b/services/ehr-transfer-service/build.gradle @@ -169,8 +169,8 @@ spotbugsIntegration { sonar { properties { - property 'sonar.projectKey', 'prm-orphaned-record-continuity_prm-repo-ehr-transfer-service' - property 'sonar.organization', 'prm-orphaned-record-continuity' + property 'sonar.projectKey', 'NHSDigital_orphaned-record-continuity' + property 'sonar.organization', 'nhsdigital' property 'sonar.host.url', 'https://sonarcloud.io' } } diff --git a/services/gp2gp-messenger/README.md b/services/gp2gp-messenger/README.md index 80a7e7ed..1505eb0c 100644 --- a/services/gp2gp-messenger/README.md +++ b/services/gp2gp-messenger/README.md @@ -3,7 +3,7 @@ This is an implementation of a component to handle the sending of the GP2GP message set used to transfer a patient's Electronic Health Record between GP Practices. It uses the GP2GP message format to transfer orphaned and stranded records out of a secure NHS repository. -This component will communicate with the Message Handler Service (MHS) [GitHub nhsconnect/integration-adaptors](https://github.com/nhsconnect/integration-adaptors) and other components being developed by the Orphaned and Stranded Record programme. +This component will communicate with the Message Handler Service (MHS) using the [NIA MHS Adaptor](https://github.com/NHSDigital/integration-adaptor-mhs) and other components being developed by the Orphaned Record Continuity programme. The initial version will send health records that are encoded in the HL7 format. A subsequent enhancement will be access to the components of the Health Record so that other services can use this component to send and receive Health Records with the need to implement the encoding and fragmentation strategies of the [GP2GP v2.2a](https://data.developer.nhs.uk/dms/mim/6.3.01/Domains/GP2GP/Document%20files/GP2GP%20IM.htm) message specification. @@ -11,7 +11,7 @@ The initial version will send health records that are encoded in the HL7 format. - [Node](https://nodejs.org/en/download/package-manager/#nvm) - version 14.x - [Docker](https://docs.docker.com/install/) - + ### AWS helpers This repository imports shared AWS helpers from [prm-deductions-support-infra](https://github.com/nhsconnect/prm-deductions-support-infra/). @@ -20,22 +20,26 @@ They can be found `utils` directory after running any task from `tasks` file. ## Set up If you would like to run the app locally, you need to: + 1. Run `npm install` to install all node dependencies as per `package.json`. -2. Set up the env variables and/or copy them into your IDE configurations (`Run -> Edit Configurations ->Environment Variables` in IntelliJ): -``` -export E2E_TEST_AUTHORIZATION_KEYS_FOR_GP2GP_MESSENGER=auth-key-2 -export REPOSITORY_URI=$IMAGE_REPO_NAME -export NHS_SERVICE=gp2gp-messenger -export SERVICE_URL=http://${NHS_SERVICE}:3000 -export NHS_ENVIRONMENT=local -export GP2GP_MESSENGER_REPOSITORY_ASID=deduction-asid -export GP2GP_MESSENGER_REPOSITORY_ODS_CODE=deduction-ods -``` -- Locally, the variables `GP2GP_MESSENGER_REPOSITORY_ASID`, `GP2GP_MESSENGER_REPOSITORY_ODS_CODE` can be set - to any value + +1. Set up the env variables and/or copy them into your IDE configurations (`Run -> Edit Configurations ->Environment Variables` in IntelliJ): + + ```bash + export E2E_TEST_AUTHORIZATION_KEYS_FOR_GP2GP_MESSENGER=auth-key-2 + export REPOSITORY_URI=$IMAGE_REPO_NAME + export NHS_SERVICE=gp2gp-messenger + export SERVICE_URL=http://${NHS_SERVICE}:3000 + export NHS_ENVIRONMENT=local + export GP2GP_MESSENGER_REPOSITORY_ASID=deduction-asid + export GP2GP_MESSENGER_REPOSITORY_ODS_CODE=deduction-ods + ``` + + > Locally, the variables `GP2GP_MESSENGER_REPOSITORY_ASID`, `GP2GP_MESSENGER_REPOSITORY_ODS_CODE` can be set + to any value -3. The app will use a fake MHS when `NHS_ENVIRONMENT` is set to `local` or `dev`. - +1. The app will use a fake MHS when `NHS_ENVIRONMENT` is set to `local` or `dev`. + ## Running the tests Run the unit tests by running `./tasks test_unit` @@ -46,14 +50,12 @@ Run the integration tests with: You can also run them with `npm run test:integration` but that will require some additional manual set-up - Run the coverage tests (unit test and integration test) By running `./tasks test_coverage` or run `npm run test:coverage` on your machine - ## Start the app locally 1. Run a development server with `npm run start:local` @@ -65,7 +67,7 @@ The swagger documentation for the app can be found at `http://localhost:3000/swa ### Example request -``` +```bash curl -X POST "http://localhost:3000/ehr-request" -H "accept: application/json" -H "Authorization: auth-key-1" -H "Content-Type: application/json" -d "{ \"nhsNumber\": \"some-nhs-number\", \"odsCode\": \"some-ods-code\"}" ``` @@ -75,8 +77,7 @@ Compile the code with `npm run build`, and then start the server with `npm start ## Config -Ensure you have VPN connection set up to both `dev` and `test` environments: -[CLICK HERE](https://gpitbjss.atlassian.net/wiki/spaces/TW/pages/1832779966/VPN+for+Deductions+Services) +Ensure you have a VPN connection set up to the `dev` environment ([see this Confluence page](https://gpitbjss.atlassian.net/wiki/spaces/TW/pages/1832779966/VPN+for+Deductions+Services)). ## Access to AWS from CLI @@ -89,4 +90,4 @@ As a note, this set-up is based on the README of assume-role [tool](https://gith ## Assume role with elevated permissions -In order to get sufficient access to work with terraform or AWS CLI, please export secrets from the AWS Access Portal for the environment you are using \ No newline at end of file +In order to get sufficient access to work with terraform or AWS CLI, please export secrets from the AWS Access Portal for the environment you are using diff --git a/services/gp2gp-messenger/package.json b/services/gp2gp-messenger/package.json index 719c36b2..5b9fcecc 100644 --- a/services/gp2gp-messenger/package.json +++ b/services/gp2gp-messenger/package.json @@ -22,10 +22,6 @@ "start:local": "babel-node -r dotenv/config src/server.js", "start:nodemon": "nodemon --exec babel-node -r dotenv/config src/server.js" }, - "repository": { - "type": "git", - "url": "git+https://github.com/nhsconnect/prm-deductions-gp2gp-messenger.git" - }, "dependencies": { "@aws-sdk/client-sqs": "^3.470.0", "@babel/runtime": "^7.17.8", diff --git a/services/gp2gp-messenger/sonar-project.properties b/services/gp2gp-messenger/sonar-project.properties index 3296812c..ea20f19b 100644 --- a/services/gp2gp-messenger/sonar-project.properties +++ b/services/gp2gp-messenger/sonar-project.properties @@ -1,5 +1,5 @@ -sonar.projectKey=prm-orphaned-record-continuity_prm-repo-gp2gp-messenger -sonar.organization=prm-orphaned-record-continuity +sonar.projectKey=NHSDigital_orphaned-record-continuity +sonar.organization=nhsdigital # This is the name and version displayed in the SonarCloud UI. sonar.projectName="GP2GP Messenger" diff --git a/services/mesh-forwarder/sonar-project copy.properties b/services/mesh-forwarder/sonar-project copy.properties index 4283a611..11b804a8 100644 --- a/services/mesh-forwarder/sonar-project copy.properties +++ b/services/mesh-forwarder/sonar-project copy.properties @@ -1,5 +1,5 @@ -sonar.projectKey=prm-orphaned-record-continuity_prm-mesh-aws-forwarder -sonar.organization=prm-orphaned-record-continuity +sonar.projectKey=NHSDigital_orphaned-record-continuity +sonar.organization=nhsdigital # This is the name and version displayed in the SonarCloud UI. #sonar.projectName=prm-mesh-aws-forwarder diff --git a/services/mesh-forwarder/sonar-project.properties b/services/mesh-forwarder/sonar-project.properties index dcd9f666..41201bc7 100644 --- a/services/mesh-forwarder/sonar-project.properties +++ b/services/mesh-forwarder/sonar-project.properties @@ -1,5 +1,5 @@ -sonar.projectKey=prm-orphaned-record-continuity_prm-deductions-mesh-forwarder -sonar.organization=prm-orphaned-record-continuity +sonar.projectKey=NHSDigital_orphaned-record-continuity +sonar.organization=nhsdigital # This is the name and version displayed in the SonarCloud UI. #sonar.projectName=prm-deductions-mesh-forwarder diff --git a/services/nems-event-processor/build.gradle b/services/nems-event-processor/build.gradle index f99fccf8..fe4715ed 100644 --- a/services/nems-event-processor/build.gradle +++ b/services/nems-event-processor/build.gradle @@ -9,8 +9,8 @@ plugins { sonar { properties { - property "sonar.projectKey", "prm-orphaned-record-continuity_prm-repo-nems-event-processor" - property "sonar.organization", "prm-orphaned-record-continuity" + property "sonar.projectKey", "NHSDigital_orphaned-record-continuity" + property "sonar.organization", "nhsdigital" property "sonar.host.url", "https://sonarcloud.io" } } diff --git a/services/re-registration-service/build.gradle b/services/re-registration-service/build.gradle index 64f6e264..5ea12bcf 100644 --- a/services/re-registration-service/build.gradle +++ b/services/re-registration-service/build.gradle @@ -168,8 +168,8 @@ spotbugsIntegration { sonar { properties { - property "sonar.projectKey", "prm-orphaned-record-continuity_prm-repo-re-registration-service" - property "sonar.organization", "prm-orphaned-record-continuity" + property "sonar.projectKey", "NHSDigital_orphaned-record-continuity" + property "sonar.organization", "nhsdigital" property "sonar.host.url", "https://sonarcloud.io" } } diff --git a/services/suspension-service/build.gradle b/services/suspension-service/build.gradle index 81844644..d903ae04 100644 --- a/services/suspension-service/build.gradle +++ b/services/suspension-service/build.gradle @@ -167,8 +167,8 @@ spotbugsIntegration { sonar { properties { - property "sonar.projectKey", "prm-orphaned-record-continuity_prm-repo-suspension-service" - property 'sonar.organization', 'prm-orphaned-record-continuity' + property "sonar.projectKey", "NHSDigital_orphaned-record-continuity" + property 'sonar.organization', 'nhsdigital' property 'sonar.host.url', 'https://sonarcloud.io' } } diff --git a/sonar-project.properties b/sonar-project.properties index b6be7570..5cfd6b62 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,5 @@ -sonar.projectKey=prm-orphaned-record-continuity_prm-repo-ehr-repository -sonar.organization=prm-orphaned-record-continuity +sonar.projectKey=NHSDigital_orphaned-record-continuity +sonar.organization=nhsdigital # This is the name and version displayed in the SonarCloud UI. sonar.projectName=prm-repo-ehr-repository