#630 - using mostRecentEncounter since lastEncounter is deprecated.
refactoring - removing voided check from template and using getNonVoidedSortedEncounters on visit details.