Bugs fixes for Trello 174/184. We cannot rely on the 'PATIENT' mapping in the usermapping table. Therefore we check for the existance of a usermapping by join it to patient and user which forces the DISTINCT on the query.