Why display Check-In column in active visits data??

Application Name: OpenMRS Reference Application Version Number: 2.3

Question: The following table gets generated on navigating to active visits page:

As you can see there’s a Check-In column having no data display inside it. I clearly do not understand the reason of having a column with no data populated in it. I guess either something is broken leading to no data being displayed or the column is redundant.

What does Check-In actually signify in OpenMRS context??

The following code is responsible for data population but doesn’t seem to work:

<% if (checkIn) { %>
     <small>
           ${ ui.format(checkIn.location) } @ ${ ui.format(checkIn.encounterDatetime) }
     </small>
<% } %>

Good point @themoonraker13. This page was harvested into the Reference Application from PIH’s Mirebalais implementation, where there is an explicit “Check In” step at the start of a visit.

However the Reference Application doesn’t have a form for this Check-In step. (Though one could add a custom form, and set the emr.checkInEncounterType global property, or else point this property to the Vitals encounter type.)

@mogoodrich, does PIH still use the Active Visits app from the Core Apps module, or does it have its own version?

Possible approaches to this are:

  1. If PIH isn’t using this specific screen, then remove the column.
  2. If this is shared code with PIH’s EMR, then make it configurable whether to show the column or not (e.g. don’t show the column if the emr.checkInEncounterType is not set).
  3. Make configurable which encounter types are shown (e.g. another implementation might prefer Vitals)
  4. Add a Check In form to the Reference Application also.

Yes, we still use the page (though I think it’s got some serious performance issues for large data sets).

So I’m fine with any solution suggested except 1.

2 is probably the simplest/best (and doesn’t preclude implementing 4 as well), though emr-api might be need to be modified to not insist that that global property is set. (I think it will stack trace now if you try to fetch it and it is null).

Mark

I’ve applied a quick fix by considering check-in to be the start of visit. The check-in column in my use case now shows the location and date-time from where & when visit had started.

@themoonraker13 how did you implement this? I’d like to do the same.

Thanks.

@whiscard you need to make the following changes in the activevisits.gsp page in the coreapps module:

   <tbody>
        <% if (visitSummaries == null || (visitSummaries !=null && visitSummaries.size() == 0) ) { %>
            <tr>
                <td colspan="4">${ ui.message("coreapps.none") }</td>
            </tr>
        <% } %>
		<% visitSummaries.each { v ->
			def checkIn = v.visit
			def latest = v.lastEncounter
		%>
			<tr id="visit-${ v.visit.id }">
				<td>${ ui.format(v.visit.patient.patientIdentifier.identifier) }</td>
				<td>

                    <% if (canViewVisits) { %>
                    <!-- only add link to patient dashboard if user has appropriate privilege -->
                        <a href="${ ui.urlBind("/" + contextPath + patientPageUrl, v.visit) }">
                    <% } %>

                    ${ ui.format(v.visit.patient) }

                    <% if (canViewVisits) { %>
                        </a>
                    <% } %>
                </td>
				<td>
                    <% if (checkIn) { %>
                        ${ ui.format(checkIn.location.getName()) } @ ${ ui.format(checkIn.startDatetime) }
                    <% } %>
				</td>
				<td>
                    <% if (latest) { %>
                        ${ ui.format(latest.encounterType) }
                        <br/>
                        <small>
                            ${ ui.format(latest.location) } @ ${ ui.format(latest.encounterDatetime) }
                        </small>

                    <% } %>
				</td>
			</tr>
		<% } %>
	</tbody>

As you can see I’ve defined checkIn as the visit of the patient and extract location and start date-time of the visit to set CheckIn date-time and Last Seen column data.

cool, thanks @themoonraker13