Update Encounter on Ended/Closed Visit

Tags: #<Tag:0x00007f01c2e19978> #<Tag:0x00007f01c2e19680>

Continuing the discussion from How do I add new encounters to a visit?:

Is it possible to add an encounter to an already ended visit on the new UI? My use-case is the user would like to be able to go back in time and add a visit note to a visit that has already been closed.

Dear @whiscard, I’m glad you’re making progress with your OpenMRS Implementation.

I don’t think it’s currently possible to add a visit note to a closed Reference Application visit at this time. There are tickets to add support for retrospective data entry, but I don’t think any work has been done on this yet. As a work-around, you could remove the visit end date (AKA open the visit again), add the visit note, and then set the visit end date (AKA close the visit). FYI: you can’t have more than one active visit at a time, so you would need to ensure the current visit (if they had one) was closed before opening the previous one.

Another option (in theory) would be to copy the Visit Note form into a new HTML form, and add it to the UI. When adding it, you could remove the requirement for it to have an active visit when setting it up in the UI. This method may get confusing as you would then see multiple Visit Note type forms, including when a visit was not active and the note may not be tied to a visit.

1 Like

I think you should be able to do what @arbaughj is suggesting here without it being confusing to the end user. (I haven’t tested this, but I think it will work as you want…)

  1. Create a new HTML Form, whose contents you copy from simpleVisitNote.xml in the reference application
  2. Configure Metadata -> Manage Form -> Add a form (for the form you just created)
  3. for the “UI” bit you want to add it as a visit action (not an overall/general action), and set: label: “referenceapplication.visitNote.title” icon: “icon-stethoscope”, order: 30, requiredPrivilege: “Task: referenceapplication.simpleVisitNote”, require: “!visit.active”

I think you’ll only be able to see this link from the visit dashboard after clicking on a visit. The overall patient dashboard only shows you overall actions, and actions for the currently active visit.

Let us know how this works!

3 Likes

@arbaughj and @darius Many thanks for the suggestions both work very well.

For purpose of Documentation, Here’s what I did: Platform Version 1.11.4 1. On the suggestion to delete End Date: On the New UI Edit date option only gives me the option to Choose a date from when the Visit was ended upto the current date e.g from the below I only choose a date from 14 Oct 2015 to 04 Jan 2016:
Solution I either had to Delete the Visit and Recreate it, edit the date to the 14 Oct 2015 and then add a visit note with the date as 14 Oct 2015 or I choose Edit Visit from the Dash Board and then search for the patient, select the visit to be edited and then Delete Stop Date and Time: So after saving the change above and going back to the New UI the Visit becomes active and one can add a visit note, and then close the visit. 2. Create a New HTML Form: This is the most optimal solution. With the HTML Form Entry Module installed, go to: System Administration -> Advanced Administration -> HTML Form Entry -> Manage Forms -> New HTML Form: After Clicking save you’ll see the below, copy simpleVisitNote.xml contents into the HTML part e.g:

After saving, go to: DashBoard -> Configure Metadata -> Manage Forms and from UI, click Add: Then Enter as explained above and click on save: Now when you want to add a visit note on a closed visit, you’ll see the option as per the below, click on Visit Note and Enter Diagnosis as required:

1 Like

@whiscard I’m glad this worked out for you!

Would you mind documenting the “most optimal” solution in Q&A format here: https://wiki.openmrs.org/x/fAEzAw ? Thanks!

1 Like

@darius sure, no problem. This has been done. Thanks as well :smiley:

2 Likes

Just to add if you want to show the visit note for both past and current visits you can use the check:

(visit.active || !visit.active) which shows the form in the current actions for both current and past visits without having to add a new form

1 Like

@ssmusoke nice, I’ll try it out.

Thanks.