Advanced Framingham GUI Simulation

This file contains code to create a model using the Framingham algorithm to assess cardiovascular disease risk. It also includes a user interface to input current health data and potential variations for the model. The model can then be run to calculate the risk based on the input data and variations.

 1"""
 2This file contains code to create a model using the Framingham algorithm to assess cardiovascular disease risk. It also includes a user interface to input current health data and potential variations for the model. The model can then be run to calculate the risk based on the input data and variations.
 3"""
 4from biomodel.models import Framingham
 5from biomodel.gui import InterfaceModel
 6from biomodel.biomodel import OMOPId
 7from biomodel.transformations import After, Set
 8
 9if __name__ == '__main__':
10
11    sex = OMOPId("sex")
12    age = OMOPId("age")
13    coltot = OMOPId(4224820)
14    hdl = OMOPId(4011133)
15    tas = OMOPId(4152194)
16    tad = OMOPId(4154790)
17    smoke = OMOPId(1585856)
18    diab = OMOPId(35817874)
19
20    current = {
21        sex: 1,
22        age: 50,
23        coltot: 250,
24        hdl: 23,
25        tas: 200,
26        tad: 100,
27        smoke: 1,
28        diab: 1,
29    }
30
31    variation = {
32        "No smoke": {smoke: 0},
33        "No smoke Post Y3": [After(year=3, transformation=Set(id=smoke, value=0))],
34        "No smoke & CH control": {smoke: 0, coltot: 180, hdl: 50},
35        "Full control": {
36            coltot: 180,
37            hdl: 50,
38            tas: 125,
39            tad: 80,
40            smoke: 0,
41        },
42    }
43    model = InterfaceModel(Framingham(), current, variation)
44    model.run()
../_images/fr_gui_trans.png