TRUNK-4479 Fix provider processing in getEncounters