How to deal with encounters of discontinuation orders in emr-api?

I am currently trying to use emr-api to handle encounters in the radiology module. The following case is a little difficult to deal with, so I am looking for a best practise approach.

  1. Create a radiology order
  2. EMR-API automatically creates a visit and assigns the encounter of the active radiology order to it
  3. The user ends the visit here Now the interesting part:
  4. The user wants to discontinue the radiology order, the original visit has ended

My question: How to deal with the visit now? These are the two cases I tried to evaluate:

  1. Create a new visit for the “discontinuation encounter”
  2. Assign the “discontinuation encounter” to the original visit of the radiology order (by giving the original visit uuid to emr-api), to keep everything in a similar context? This fails because the visit has already stopped!

Any suggestions?

Offhand I would suggest that you create an encounter that doesn’t belong to any visit, to hold the discontinuation order.

Presuming that the patient has already left the facility, and that’s why the visit is closed, this would in fact be the correct modeling.

Thank you for your answer!

I also thought about that, but isn’t emr-api set to create a visit for each encounter to be saved?

Presuming that the patient has already left the facility, and that’s why the visit is closed, this would in fact be the correct modeling.

According to the Visit design page:

In many cases, the patient is physically present; however, this might not always be the case

So it should also be ok to create a visit?

Peeking at the EMR API code in these two places:

… it looks like we intended to eventually require certain (configurable) encounter types to require visits, but the current code does not require it at all.

If you’re seeing visits automatically created, that must be happening somewhere else…