Skip to content

ministryofjustice/hmpps-assess-risks-and-needs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assess Risks and Needs Service

API docs

A Spring Boot app to get Risk and Need for offenders across HMPPS.

Swagger API documentation is available

Dependencies

  • Java JDK 21
  • An editor/IDE
  • Gradle
  • Docker
  • Postgres
  • HMPPS Auth

Start the application

make up

Go to http://localhost:8080/health

Start the application in Dev mode

make dev-up

This allows you to run the linter and tests with:

make lint-fix
make test

For a full list of commands run

make

Documentation

The generated documentation for the api can be viewed at http://localhost:8080/swagger-ui.html

Tasks

❗️ This requires kubectl 1.19, as 1.20+ is incompatible with the live-1 cluster as of October 2021

Manually sync prod to pre-prod

To manually trigger the production refresh job:

kubectl --namespace=hmpps-assess-risks-and-needs-prod \
  create job --from=cronjob.batch/db-refresh-job refresh-job

Health

  • /health: provides information about the application health and its dependencies. This should only be used
    by offender assessment service health monitoring (e.g. pager duty) and not other systems who wish to find out the
    state of offender assessment service.
  • /info: provides information about the version of deployed application.

RSR Predictor implementation

The service contains implementations for the OASys and Data Science (ONNX) RSR calculators. Only one implementation can be used at once, selected using the spring profiles

  • oasys-rsr to use the OASys calculator
  • onnx-rsr to use the ONNX implementation

It is not possible to store the ONNX files in this public repository as it has not been approved for release. Sample static and dynamic files which return constant values is provided to facilitate unit tests. A test ONNX file is also used in the application yaml to enable spring boot startup on local machine when using 'onnx-rsr' profile. See onnx-path in the yaml snippet below.

onnx-predictors:
  onnx-path: classpath:/onnx/rsr_v0.0.0_const_brief.onnx
  offence-codes-path: classpath:/onnx/offence_codes_v0.0.0.json

About

API for Risks and OASys integration

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages