OMOP DB Population Simulation

A class for interacting with a test database using OMOP standard. It provides access to person, observation, and measurement data.

 1"""
 2A class for interacting with a test database using OMOP standard. It provides access to person, observation, and measurement data.
 3"""
 4from biomodel.database import OMOP_DB
 5from biomodel.models import Framingham
 6from biomodel.biomodel import OMOPId
 7from pathlib import Path
 8
 9if __name__ == '__main__':
10    data_path = Path("/home/josalhor/Desktop/bioTwin/data/ukbiobank-simulation")
11
12
13    class TestDB(OMOP_DB):
14        """
15        A class for interacting with a test database using OMOP standard. It provides access to person, observation, and measurement data.
16        """
17
18        person_path = data_path / "person.csv"
19        observation_path = data_path / "observation.csv"
20        measurement_path = data_path / "measurement.csv"
21
22
23    coltot = OMOPId(4224820)
24    hdl = OMOPId(4011133)
25    tas = OMOPId(4152194)
26    tad = OMOPId(4154790)
27    smoke = OMOPId(1585856)
28    diab = OMOPId(35817874)
29
30    db = TestDB()
31    model = Framingham()
32
33    prediction = model.predict_population_time(
34        db,
35        {
36            "No smoke": {smoke: 0},
37            "No smoke & CH control": {smoke: 0, coltot: 180, hdl: 50},
38            "Full control": {
39                coltot: 180,
40                hdl: 50,
41                tas: 125,
42                tad: 80,
43                smoke: 0,
44            },
45        },
46    )
47
48    prediction.show_change()
../_images/omop_csv.png