Source:
<code>protected String getDetails(Patient p, Encounter initialEncounter) { EncounterType followupEncounterType = null; if (StringUtils.isNotBlank(getFollowupEncounterTypeName())) { followupEncounterType = Context.getEncounterService().getEncounterType(getFollowupEncounterTypeName()); } if (followupEncounterType == null) { followupEncounterType = Context.getEncounterService().getEncounterType(getFollowupEncounterTypeId()); } List<Encounter> followups = Context.getEncounterService().getEncounters(p, null, null, null, null, Arrays.asList(followupEncounterType), null, false); String created = "Created: " + Helper.formatDate(initialEncounter.getEncounterDatetime()); <START> String visited = "Visited: no"; <END> String rvd = "Appointment: none"; if (!followups.isEmpty()) { Encounter lastFollowup = followups.get(followups.size() - 1); visited = "Visited: " + Helper.formatDate(lastFollowup.getEncounterDatetime()) + " at " + lastFollowup.getLocation().getName(); Concept appt = Context.getConceptService().getConcept(APPOINTMENT_DATE); Date startOfDay = DateUtil.getStartOfDay(lastFollowup.getEncounterDatetime()); Date endOfDay = DateUtil.getEndOfDay(lastFollowup.getEncounterDatetime()); List<Obs> os = Context.getObsService().getObservations(Arrays.asList((Person) p), null, Arrays.asList(appt), null, null, null, Arrays.asList("dateCreated"), 1, null, startOfDay, endOfDay, false); if (!os.isEmpty()) { rvd = "Appointment: " + Helper.formatDate(os.get(0).getValueDatetime()); } } String details = created + ", " + visited + ", " + rvd; return details; }</code><technical_language>This verbage is wrong, this re-worded "Last Tracking Date"</technical_language>

Target:
protected String getDetails(Patient p, Encounter initialEncounter) { EncounterType followupEncounterType = null; if (StringUtils.isNotBlank(getFollowupEncounterTypeName())) { followupEncounterType = Context.getEncounterService().getEncounterType(getFollowupEncounterTypeName()); } if (followupEncounterType == null) { followupEncounterType = Context.getEncounterService().getEncounterType(getFollowupEncounterTypeId()); } List<Encounter> followups = Context.getEncounterService().getEncounters(p, null, null, null, null, Arrays.asList(followupEncounterType), null, false); String created = "Created: " + Helper.formatDate(initialEncounter.getEncounterDatetime()); String visited = "Last Tracking Date: no"; String rvd = "Next Tracking Attempt: none"; if (!followups.isEmpty()) { Encounter lastFollowup = followups.get(followups.size() - 1); visited = "Last Tracking Date: " + Helper.formatDate(lastFollowup.getEncounterDatetime()) + " at " + lastFollowup.getLocation().getName(); Concept nextTrackingDate = Context.getConceptService().getConcept(DATE_OF_NEXT_TRACKING_ATTEMPT); Date startOfDay = DateUtil.getStartOfDay(lastFollowup.getEncounterDatetime()); Date endOfDay = DateUtil.getEndOfDay(lastFollowup.getEncounterDatetime()); List<Obs> os = Context.getObsService().getObservations(Arrays.asList((Person) p), null, Arrays.asList(nextTrackingDate), null, null, null, Arrays.asList("dateCreated"), 1, null, startOfDay, endOfDay, false); if (!os.isEmpty()) { rvd = "Next Tracking Attempt: " + Helper.formatDate(os.get(0).getValueDatetime()); } } String details = created + ", " + visited + ", " + rvd; return details; }