from apps.accounts.models import User


def get_assignable_users(hospital):
    return (
        User.objects.filter(
            is_active=True,
            hospital=hospital,
            groups__name="PX Employee",
        )
        .select_related("department")
        .distinct()
        .order_by("first_name", "last_name")
    )
