synthetichealth / synthea

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

Generating a Single Table with Patients and Conditions #763

Open abdulzeedo opened 4 years ago

abdulzeedo commented 4 years ago

Hi guys,

I would like to generate a single table with only the patient details i.e. DoB, gender, zip, etc and the description field of the Conditions table. I have read through the wiki but I couldn't find a suitable configuration for it.

Is this possible?

Another thing is that I would like to get only disorders rather than things like Body mass index 30+ - obesity (finding) in the description field of the Conditions table.

The application is relevant to data anonymisation.

jawalonoski commented 4 years ago

@abdulzeedo there is no out of the box configuration to produce that. Your best choice is to post-process the data at this point.

You could join the patients.csv with the conditions.csv if you loaded them into a relational database (for example).

Joining patient.id with conditions.patient should do the trick. Theoretically you could add a where-clause for disorders. Something like conditions.description ilike %disorder% -- although my SQL is rusty so that probably doesn't work exactly, but you get the idea.

abdulzeedo commented 4 years ago

@jawalonoski thanks for the reply. Yes, seems like it's the only option. Another question, the relationship between patients and conditions is a 1-to-many, right?

jawalonoski commented 4 years ago

Another question, the relationship between patients and conditions is a 1-to-many, right?

Yes, although a patient might not have any conditions (if they are healthy).