synthetichealth / synthea

Synthetic Patient Population Simulator
https://synthetichealth.github.io/synthea
Apache License 2.0
2.19k stars 657 forks source link

Updating records over time #716

Open charliejllewellyn opened 4 years ago

charliejllewellyn commented 4 years ago

Hi,

Apologies if this is the wrong place to log this. I am looking to understand if it is possible to replicate a use case I see in many health institutions. The challenge is showing data changing over time. For example patient 1 lives at address A then moves to address B. In many systems this is represented as:

ID,BIRTHDATE,DEATHDATE,SSN,DRIVERS,PASSPORT,PREFIX,FIRST,LAST,SUFFIX,MAIDEN,MARITAL,RACE,ETHNICITY,GENDER,BIRTHPLACE,ADDRESS
a216e053-3ff2-4af6-96f8-c3f12a25384a,1956-01-18,1956-02-22,999-27-5187,,,,Mohammad3,Stiedemann935,,,,white,german,F,Blackstone MA US,9984 Werner Summit Eastham MA 02642 US

When the patient moves a delta is created with the same ID but with different details, e.g.

a216e053-3ff2-4af6-96f8-c3f12a25384a,1956-01-18,1956-02-22,999-27-5187,,,,Mohammad3,Stiedemann935,,,,white,german,F,Norwood MA US,4320 Dexter Mills Eastham MA 02642 US

Is is possible to simulate this behaviour with Synthea. For example creating an inital dataset for years 0-50 and then a set of delta with updates made for some of the records over time, e.g. years 50-51, 51-52, 52-53 etc.

Any help much appreciated :)

hadleynet commented 4 years ago

Synthea has an experimental feature that will do some of what you are looking, see:

https://github.com/synthetichealth/synthea/wiki/Evolving-a-Population

Synthea won't produce the entire delta for you, but you could get part way there using the exporter.years_of_history setting with a 1 year value provided you moved the population forward a year at a time using the experimental feature.

You should also be aware of issue 682 if you need to do any manual diff between records over time. IDs will change making it hard to track things over time.

AndriesSmartmed commented 4 years ago

Currently I'm trying to generate evolving vital sign data through the Evolving Population feature at: [https://github.com/synthetichealth/synthea/wiki/Evolving-a-Population]

However I run into an error, how to proceed? (normal Synthea cmd run just fine) My setup:

Windows .bat file: java -jar synthea-with-dependencies.jar ./run_synthea -p 5 -u output/1/snap --exporter.baseDirectory output/1 java -jar synthea-with-dependencies.jar ./run_synthea -i output/1/snap -u output/2/snap -t 100 --exporter.baseDirectory output/2 java -jar synthea-with-dependencies.jar ./run_synthea -i output/2/snap -u output/3/snap -t 100 --exporter.baseDirectory output/3 pause

Folder structure: output/1, output/2, output/3

Error: Unable to load demographics java.lang.Exception: The city output/1/snap was not found in the demographics file. at org.mitre.synthea.world.geography.Location.<init>(Location.java:59) at org.mitre.synthea.engine.Generator.init(Generator.java:188) at org.mitre.synthea.engine.Generator.<init>(Generator.java:143) at App.main(App.java:144) Exception in thread "main" java.lang.ExceptionInInitializerError at org.mitre.synthea.world.geography.Location.<init>(Location.java:81) at org.mitre.synthea.engine.Generator.init(Generator.java:188) at org.mitre.synthea.engine.Generator.<init>(Generator.java:143) at App.main(App.java:144) Caused by: java.lang.Exception: The city output/1/snap was not found in the demographics file. at org.mitre.synthea.world.geography.Location.<init>(Location.java:59) ... 3 more

jawalonoski commented 4 years ago

Try that command with = symbol added in a few places.

For example, --exporter.baseDirectory output/3 pause should be --exporter.baseDirectory="output/3 pause"

Right now, it thinks you are trying to run Synthea inside a state or city named "output/1/snap" which is why it says that city does not exist in the demographics file.

AndriesSmartmed commented 4 years ago

Thanks, much appreciated! I figured it had something to do with the syntax, now it got past --exporter.baseDirectory="output/1"! But not past the -u path: -u="output/1/snap",maybe i need some different syntactic here?

Exception: java.lang.Exception: The city -u=output/1/snap was not found in the demographics file.

jawalonoski commented 4 years ago

Oh sorry, you only need the = on the double-dash arguments --exporter.blahblah because those are properties, and not on the single-dash arguments -u or whatever.

It is weird now that I explain it, but that is how it works.

AndriesSmartmed commented 4 years ago

I have tried with and without, both get stuck at -u, somehow not parsing the arguments correctly.

Synthax cmd line: java -jar synthea-with-dependencies.jar -p 5 -u output/1/snap --exporter.baseDirectory="output/1"

Exception: java.lang.Exception: The city output/1/snap was not found in the demographics file.

dehall commented 4 years ago

@AndriesSmartmed you may need to re-download the synthea-with-dependencies.jar. There was an issue until just a few days ago where it wasn't being updated correctly and it was several months out of date, so it's possible the version you have predates the support for the -u flag.

AndriesSmartmed commented 4 years ago

Will do! My old version: v2.5.0-32-g5503ea1

AndriesSmartmed commented 4 years ago

@jawalonoski & @dehall thanks! I have downloaded and build the latest version, and have it up and running!