care.emr.reports.authorizers package

class BaseReportAuthorizer

Bases: ABC

abstractmethod authorize_read(user, associating_id: str) bool
abstractmethod authorize_write(user, associating_id: str) bool
class DischargeSummaryReportAuthorizer

Bases: EncounterReportAuthorizer

class EncounterReportAuthorizer

Bases: BaseReportAuthorizer

authorize_read(user, associating_id: str) bool
authorize_write(user, associating_id: str) bool
report_authorizer(user, report_type: str, associating_id: str, permission: str)

Authorize user access to a report based on report type and permission.

Parameters:
  • user – User requesting access

  • report_type – Type of report (from ReportTypeRegistry)

  • associating_id – UUID of the associated resource

  • permission – Either “read” or “write”

Raises:

PermissionDenied – If user doesn’t have permission

Submodules