The public API is RiskScoreCalculator
, RiskScoreCalculatorConfiguration
and ScanInstance
.
There is an example configuration at RiskScoreCalculatorConfiguration.exampleConfiguration
taken from the GAEN repo.
The risk score is computed from the list of ScanInstance
s associated with a single exposure window.
For a sample, data is available at https://github.com/nhsx/gaen_data-public. This data can be tested by running
./gradlew run
Include the following to the repositories
block in your module's build.gradle
file
maven {
url = 'https://maven.pkg.github.com/nhsx/riskscore-kt-public'
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("PACKAGES_ACCESS_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("PACKAGES_ACCESS_TOKEN")
}
}
Then you can use the riskscore-kt dependency as follows
implementation "uk.nhs.covid19:riskscore-kt:$riskscore_version"
NB: Consumers of this library should bundle a Kotlin stdlib with API version 1.3.
This module uses semantic versioning.
To publish the package, simply create a release on GitHub and this will trigger a workflow to publish the package.
Be sure to update the version number in build.gradle to match the tag of the release.
The module depends on Apache commons-math v3 for the Gamma distribution calculations.
This module uses kotest for unit and property based testing. To use this in Intellij / Android studio install the kotest plugin.