Fixing bug on report generation and treatments show page (now this functions can take the external user role), and refactored this same functions to avoid repeated code.