Skip to content

dmarrazzo/dmn-framingham-cvd-risk-score

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An implementation of the Framingham CVD risk score with DMN

Disclaimer

Not medical advice. Always seek professional medical advice. The content on this repository is provided for informational purposes only and is not intended as a medical advice, or a substitute for the medical advice of a doctor/physician.

The content on this repository is intended only as a methodological exercise to translate a scientific paper publication into a standardised executable DMN model.

Model features and labels are modeled as expressed with consideration from the original paper; that is for inputs:

age, sex, high blood pressure, smoking, dyslipidemia, and diabetes

and for outputs:

Framingham score, CVD Risk [%], Heart age/vascular age [y]

References

Benchmark edition

DMN execution

In development mode:

mvn quarkus:dev -DskipTests

Package and run locally

mvn package
java -Dquarkus.http.host=0.0.0.0 -jar target/quarkus-app/quarkus-run.jar 

Probe the decision:

curl -i -X POST http://localhost:8080/framingham \
-H "Content-Type: application/json" \
-d \
"  {
    \"age\": 61,
    \"Sex\": \"Women\",
    \"Smoker?\": true,
    \"Systolic blood pressure\": 124,
    \"On SBP treatment?\": false,
    \"Total Cholesterol\": 180,
    \"HDL Cholesterol\": 47,
    \"Diabetic?\": false
  }"

Deploy in OpenShift

Build the image:

mvn clean package -Dquarkus.container-image.build=true -DskipTests

Create the app:

oc new-app --name=dmn-framingham-cvd-risk-score kogito-decision/dmn-framingham-cvd-risk-score:1.0-SNAPSHOT

Expose the service:

oc expose service/dmn-framingham-cvd-risk-score

K6 load test

If you run K6 in a container make sure that the decision service hostname is visible from the container: in script.js, change thehost accordingly.

Launch the test in a container:

podman run -i --user root -v ./k6:/home/k6:Z loadimpact/k6 run script.js

Deploy in OpenShift

Change the script to match the URL available in the target environment.

E.g. const url = 'http://dmn-framingham-cvd-risk-score.kogito-decision.svc.cluster.local:8080/framingham';

Deploy the script and lauch the job:

oc create configmap script --from-file=k6/script.js
oc create -f k6/test-job.yaml

Follow the script execution log:

oc logs -f --selector=job-name=k6-test

To change the script in the configmap:

oc edit configmap/script

Repeat the load test:

oc delete job/k6-test; oc create -f k6/test-job.yaml

Further information:

About

An implementation of the Framingham CVD risk score with DMN

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 46.2%
  • JavaScript 31.7%
  • HTML 22.1%