An algorithm to use publicly available health statistics in order to generate a synthetic health population of an area.
File config.ini
contains setting for the application. Currently, a country to be used can be specified as well as population size to be produced
[generate]
# default country
country = NZ
# default size of population to produce
population_size = 5
Input for the application consists of a number of files referring to the country/area.
In order to add a new area, two new sections need to be added to file config.ini
, for example:
New Zealand requires section [NZ] with locations for demographics and deprivation input files as well as [NZ_modules] section with location of lifestyle and disease modules input files
[NZ]
# input filed for NZ
demographics = input/nz/demographic/nz_demographics.csv
deprivation = input/nz/demographic/nz_deprivation.csv
[NZ_modules]
# lifestyle modules for NZ
smoking = input/nz/lifestyle/smoking.csv
physical_activity = input/nz/lifestyle/physical_activity.csv
body_size = input/nz/lifestyle/body_size.csv
# disease modules for NZ
diabetes_1 = input/nz/disease/diabetes_1.csv
diabetes_2 = input/nz/disease/diabetes_2.csv
CVD = input/nz/disease/CVD.csv
The applications saves the results to two csv files named patients.csv
and timelines.csv
located in the outputs
folder.
git clone https://github.com/maciejtarsa/synthetic-health-population
cd synthetic-health-population
python3 -m venv env
source env/bin/activate
python3 -m pip install --editable .
Move to the folder and run
cd synthetic-health-population
source env/bin/activate
generate_patients
generate_patients -p 2
or
generate_patients --population 2
generate_patients --prob
generate_patients --display