synthetichealth / synthea

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

How to generate a single patient with a specific module #1466

Closed schowdary55 closed 5 months ago

schowdary55 commented 5 months ago

Requested Feature

I need to generate a single patient say with just Atrial Fibrillation module data. I tried ./run_synthea -g M -a 60-60 -m *fibrillation*

but I still see FHIR json created with over 100 FHIR records.

schowdary55 commented 5 months ago

For example command: ./run_synthea -g M -a 60-60 -m *fibrillation* -p 1

Output:

Running with options: Population: 1 Seed: 1716923914673 Provider Seed:1716923914673 Reference Time: 1716923914673 Location: Massachusetts Min Age: 60 Max Age: 60 Gender: M Modules: Atrial Fibrillation Module

[1 loaded] 1 -- Cyrus914 Herzog843 (60 y/o M) Plymouth, Massachusetts (1299) Records: total=1, alive=1, dead=0 RNG=1 Clinician RNG=5637

FHIR Json: has over 100 records. I did comment out: Lifecycle, Cardiovascular Disease, Quality Of Life, Weight Loss and COVID-19 Immunization Modules in Module.java before running above command.

jawalonoski commented 5 months ago

Respectfully, please see https://github.com/synthetichealth/synthea/wiki/The--M-Feature

jawalonoski commented 5 months ago

Alternatively, I suggest you look into this: https://github.com/synthetichealth/synthea/wiki/Keep-Patients-Module

schowdary55 commented 5 months ago

@jawalonoski Thanks for responding.

I added keep state to atrial_fibrillation.json "Keep": { "type": "Terminal" }

Ran below command:

./run_synthea -m *fibrillation* -k src/main/resources/modules/atrial_fibrillation.json -p 1000

Got this error:

java.lang.RuntimeException: Failed to produce a matching patient after 1000 attempts. Ensure that it is possible for all requested demographics to meet the criteria. (e.g., make sure there is no age restriction that conflicts with a requested condition, such as limiting age to 0-18 and requiring all patients have a condition that only onsets after 55.) If you are confident that the constraints are possible to satisfy but rare, consider increasing the value in config settinggenerate.max_attempts_to_keep_patient``

I did not provide any age or gender restrictions. afaik, atrial_fibrillation.json doesn't have any conditions and is pretty straight forward. atrial_fibrillation.json

Wondering, why i'm not able to generate even one patient.

jawalonoski commented 5 months ago

You are misunderstanding the Keep Patients Module article.