synthetichealth / synthea

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

Hospitalization length of stay algorithm #332

Open rbisewski opened 6 years ago

rbisewski commented 6 years ago

The VDEC team, including myself, were examining some of records generated via synthea; specifically the hospitalization data, for which we wondered what algorithm you use.

We defined hospitalization as:

Current Canadian health statistics note that average length of stay of a patient is typically about 7 days:

https://www.statista.com/statistics/497128/canada-average-hospital-stay-length/

I ran synthea and generated 10,000 entries, checked for hospitalizations (514 records), this yields:

  Length of |
Stay (days) |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |         73       14.20       14.20
          1 |        413       80.35       94.55
          2 |         27        5.25       99.81
          5 |          1        0.19      100.00
------------+-----------------------------------
      Total |        514      100.00

Where we define length of stay as stop_date - start_date

So roughly 80% of the data points from synthea show a length of stay of 1 day, and 95% <= 1 day.

The Canadian medical data (and maybe the US as well) seems to point to a different distribution for the length of stay. With this in mind, could you tell us more about the algorithms and assumptions have you have built into the distribution of length of stay in synthea?

jawalonoski commented 6 years ago

How it works

Encounters have a minimum amount of time required:

Type Minimum Time
Emergency 1 hour
Inpatient 1 day
Other 15 minutes

If a module tries to end an encounter early, the system will use the minimum times list above. Otherwise, the system will end the encounter when the module tries to close it.

After that, the system will add additional time to the encounter for each activity (e.g. procedures) that occurred during an encounter so long as the module defined a duration for an activity.

So, for example, if an Encounter for Dialysis (and nothing else) occurs: Start with a minimum of 15 minutes for the Encounter and then add 3 hours for the Dialysis, resulting in 3 hours 15 minutes.

There are few inpatient procedures being modeled now. If a specific disease module doesn't define delays or introduce activities that require time, the system ends the encounter after a day.

Thoughts

Obviously, this can be improved. What are your suggestions?

Perhaps we can get some statistics for common inpatient encounter causes, and lengths of stay for each type, and update the modules to reflect that? We're happy to have help on this.

Righolt commented 6 years ago

The algorithm seems reasonable for emergency and physician visits (adding some random wait times/lengths could be a future idea) as it ends (either send home or admitted to hospital) once all procedures have finished.

Inpatient hospitalization is a bit different (more complex) though, as discharge is based on the condition of the patient as judged by the physician and there can be significant time between procedures (e.g., needing a blood sample every 12 hours). Later procedures can also depend on whether the patient is discharged or not (e.g. daily procedures while in hospital). Not knowing exactly how you program is set up, I cannot say what the best way of action is. One option might be for each day (after the first (or a later) procedure) compute some status score or discharge probability based on morbidity etc. @DrGo any other thoughts?

Righolt commented 6 years ago

How do you handle subjects with more complex health symptoms? Would the hospitalization for one (e.g., stroke) be influenced by other diseases (e.g., diabetes)?

jawalonoski commented 6 years ago

Currently, more complex health comorbidities are handled independently.

tiloc commented 5 years ago

My recently pulled modifications to the congestive_heart_failure module have a crude implementation of a more realistic inpatient encounter that you can look at. I model the encounter as a daily loop with a certain set of daily activities. At the end of the day I branch either into another day of inpatient stay, or into the discharge from the hospital. The likelihood of a discharge is increased sharply as the typical ALOS for heart failure is reached (5 days).

jawalonoski commented 1 year ago

Related to #1168, #1169, #1170, #1171