def aggregate_referral_status(referrals):
        referral_status_output = ""
        if referrals:
            all_successful = all(referral.status == Referral.STATUS_SUCCESSFUL
                                 for referral in referrals)
            if all_successful:
                referral_status_output = (dict(Referral.REFERRAL_STATUSES)
                                          [Referral.STATUS_SUCCESSFUL])
            else:
                # Determine referral status based on the last FQHC referral
                referral_status_output = (dict(Referral.REFERRAL_STATUSES)
                                          [referrals.last().status])
        else:
            referral_status_output = Referral.NO_REFERRALS_CURRENTLY

        return referral_status_output