Search code examples
jsonrubyhl7-fhirpopulationdemographics

How to create Synthea demographic County files?


I am using Synthea to generate synthetic populations using the default county demographics for Massachusetts.

How are these json config files created? Specifically, how could I create them for a different US State?


Solution

  • First, you need to obtain several publicly available data files and place them into your ./resources folder.

    I think you answered some of your own question over in this GitHub issue. But in case someone finds the question here, you need four different files.

    1. “subcounty population estimates for towns and cities” https://www.census.gov/data/datasets/2016/demo/popest/total-cities-and-towns.html

    2. “county population estimates by age, gender, race, ethnicity” https://www.census.gov/data/datasets/2016/demo/popest/counties-detail.html

    3. “income data” https://factfinder.census.gov/faces/tableservices/jsf/pages/productview.xhtml?pid=ACS_15_5YR_S1901&prodType=table

    4. “Education data” https://factfinder.census.gov/faces/tableservices/jsf/pages/productview.xhtml?pid=ACS_15_5YR_S1501&prodType=table

    Once you obtain the files for the US State you are interested in:

    1. Copy the files into your ./resources folder
    2. git checkout other_usa_states The ability to process other states is not currently within the master branch in GitHub.
    3. bundle exec rake synthea:census This will process the files in ./resources (you may need to rename the files) and generate the JSON configuration files into ./config
    4. bundle exec rake synthea:generate[XXX.json] where XXX.json is the name of the county file within the ./config folder that you want to generate.

    Caveats:

    • Geospatial lat/lon information will not be generated without additional data.
    • Zip codes outside of Massachusetts are stubbed to XXXXX
    • Hospital and healthcare facilities will seem odd, since only organizations in Massachusetts are included by default. It will seem like everyone in town travels across the country to go see their doctor in Massachusetts.

    Those issues will be fixed in the future.