Write a function to validate a medical code against a given set of criteria.
Implement validate_medical_code(code, criteria), where code is a string and criteria contains pattern, min_length, max_length, and allowed_prefixes. Return True only when the code matches the regular expression, satisfies the length bounds, and starts with an allowed prefix; otherwise return False.
The pattern must match the entire code, and an empty allowed_prefixes list means no prefix is accepted.
def validate_medical_code(code, criteria):