Who is primary when medicare and Medicaid both are involved?

Medicaid is always the payor of last resort.