"""
Template filters for hospital-related functionality
"""
from django import template

register = template.Library()


@register.simple_tag
def get_all_hospitals():
    """
    Get all hospitals for the hospital switcher dropdown.

    This is used by PX Admins to quickly switch between hospitals
    directly from the header without navigating to the selector page.
    """
    from apps.organizations.models import Hospital

    return Hospital.objects.all().order_by('name', 'city')
