Encounters without Visits - Is this possible?

In the old OpenMRS (pre 1.9) it was possible to add encounters without visits. However in the new platform (reference application) a new visit has to be created for data to be entered.

Is it possible to have the new platform behave like the old one, but still create visits in the background since the initial use case is as a data entry solution done after the patient visit has been completed.

@ssmusoke, it would take some code to make this happen, but yes, it’s possible, and yes, we generally intend to support this.

Behind the scenes OpenMRS has the idea of a configurable encounter-to-visit-assignment-handler. The EMR API module has an implementation of this that it activates by default.

In the currently implementation, if you create a past encounter that can’t be placed in an existing visit, it just leaves it that way. (I don’t think that implementation has been changed at all from what PIH initially wrote for Mirebalais.)

The change you would need to make is to add behavior like ExistingOrNewVAH from openmrs-core to the end of the EMR API version.

I would welcome you to (a) create a ticket in the EMR API module for this, and propose how you think the behavior should be changed, (b) verify that this won’t break the Reference Application UI, and © implement it. There is definitely room for improvement in the current code.

@darius https://issues.openmrs.org/browse/EA-116

@darius, I would like to rebound on this to ask a similar question:

An obs without an encounter (and hence without a visit), why is it possible?

We decided to record a so-called ‘sticky note’ as a floating obs so to say (so that is not attached to any encounter) right through the patient header, and this action is allowed even outside of any visit. Hopefully it is acceptable to do so?

Example below:

Makes sense to me, but this should be configurable in some way, and probably should default to the existing functionality (at least for existing implementations).

That is, whether the EmrApiAssignmentHandler creates a new visit for an encounter that lies outside of an existing visit should be configurable.

I’ll add this to the ticket as well.

Take care, Mark

I made a long ticket comment suggesting how we should solve this. It addresses configurability, and backwards-compatibility for PIH and Bahmni.

This is intentionally allowed. An encounter is supposed to represent an interaction between the patient and one or more providers. It’s possible to capture observations about the patient outside of any specific encounter, so you can have obs.encounter == null. This is a perfectly appropriate choice for your sticky note.

Great, thanks for confirming!