Thanks @ssmusoke, thanks for the clarification. I think I understand what you’re trying to do now.
I think one of the velocity functions returned all of the encounter details. It was rather cryptic what it returned, if I remember correctly.
Past Encounters: <lookup complexExpression="#foreach($encounter in $fn.allEncounters(null)) $encounter #end"/>
Past Encounter Providers: <lookup complexExpression="#foreach($encounter in $fn.allEncounters(null)) $encounter.encounterProvider #end"/>
If that doesn’t work, it may never have been “fixed” to support the multiple providers.
This is just a shot-in-the-dark. If you can get it to work, please document it on the OpenMRS Wiki.