Whether or not EMR API currently supports it, Visits can definitely overlap. For example, a stable hospitalized patient may be taken to an outpatient clinic during their hospitalization to avoid missing an outpatient appointment, resulting in an outpatient visit coincident with an inpatient visit. Also, visit boundaries can be fuzzy (e.g., steps to close the visit may be deferred until the end of the day). Patients traveling a long way to a clinic may very likely arrange multiple visits on the same day for convenience and we cannot guarantee each preceding visit will be closed before the next begins. I think it would be fair to say two visits for the same type of visit in the same care setting would not overlap.
As far as automatically assigning encounter to visits, our intent was to support this auto-assignment in a manner that could be adapted to meet local needs, since the logic for automatically assigning encounters to a visit is not universal. Ideally, this algorithm would be isolated (not spread throughout multiple parts of the codebase) and would respond with an array of possible visits – i.e., in the happy path, you’d get back one visit, but if the algorithm lacked the information to decide between 2 or more open visits, it could handle the ambiguity by passing the list of candidates and forcing the client to pick amongst them.
OpenMRS Visit-Encounter Model
For OpenMRS, we came up with this model:
Encounter is an interaction between patient and healthcare system at a point in time.
Visit represents an event that can include one or more encounters and occurs over a span of time. Typically, an outpatient clinic visit or an inpatient hospitalization.
Episode of Care is a collection of encounters and/or visits that belong to a logical grouping and may span across visits. This could be all visits/encounters relating to a pregnancy or a course of TB treatment.
Program was created to represent a care program (like HIV Treatment Program or TB Treatment Program) or a study protocol. It might seem similar to an Episode of Care; however, there are distinct differences: patient are enrolled in a Program, may have a program-specific identifiers, go through states of a program, etc. Episode of Care is just a logical grouping that does not involve enrollments or states. If we had implemented Episodes of Care, they would have likely linked either to a condition or program as the “topic” for the episode of care. As it stands, if/when we want to implements Episodes of Care, we’ll be better off aligning with FHIR’s EpisodeOfCare
resource.
OpenMRS | FHIR |
---|---|
Encounter | Encounter |
Visit | Encounter |
Episode of Care | EpisodeOfCare |
Program | PlanDefinition |
PatientProgram | CarePlan |