Creating an in-progress Encounter #1058
-
Is it possible to create an Encounter that has an in-progress status, using the Synthea Module Builder? I assumed that if I just don't include an EncounterEnd state, then it would do the job, but that is not the case: the generated Encounter is finished even so. (I even put in a Guard based on date, just before the Encounter, in order to make it more realistic, so that the Encounter would not be in-progress for several years or such, but that doesn't seem to make any difference either.) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Good question. Internally, inside the Synthea engine, such an encounter would be "in progress"... at least for a while (read on). But the FHIR exporter as currently written does not care. As far as it is concerned, the Encounter is always finished: Why? Well, there is no great reason for this. In the past, module authors sometimes unintentionally "forget" to end their encounters. Which left a lot of never-ending encounters in place. This may no longer be an issue -- I haven't checked in a while -- so more sophisticated logic could be written. For example, here is the CSV exporter logic for encounter: synthea/src/main/java/org/mitre/synthea/export/CSVExporter.java Lines 644 to 651 in 4b4dcf9 However, even if that was fixed, the built-in "Encounter Module" written in Java periodically triggers a "Wellness Encounter" (for example, with a Primary Care Provider). When these wellness encounters are triggered, two things happen. First, any open encounters with the type What that means is you are very unlikely to have encounters (of the types terminated by wellness encounters) last more than a year (average time between wellness encounters, but it can vary). Hope that helps. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response. My use case is a bit special, because what I need is a 'current encounter', which is by definition in-progress and since it is supposed to be 'current', it's not older than a couple of days in most cases. (I set up the module to use a Guard which only allows it to progress once it reaches the current month of the current year.) Also, it is in fact an inpatient encounter, therefore the limitations concerning wellness encounter do not apply. Nevertheless, your answer actually helped me to solve the problem by editing the However, based on what you said about how the current solution came to be does not have any great reason, I think it might be a good idea to refactor it in order to use a more sophisticated logic in general. |
Beta Was this translation helpful? Give feedback.
Good question.
Internally, inside the Synthea engine, such an encounter would be "in progress"... at least for a while (read on).
But the FHIR exporter as currently written does not care. As far as it is concerned, the Encounter is always finished:
synthea/src/main/java/org/mitre/synthea/export/FhirR4.java
Line 706 in 4b4dcf9
Why?
Well, there is no great reason for this. In the past, module authors sometimes unintentionally "forget" to end their encounters. Which left a lot of never-ending encounters in place. This may no longer be an issue -- I haven't checked in a while -- so more sophisticated logic could be written.