from pathlib import Path


def get_patient_results_folder(results_folder: Path, patient_id: int) -> Path:
    """
    Gets a folder name that will contain all results for a given patient, like root/017 for patient 17.
    The folder name is constructed such that string sorting gives numeric sorting.
    :param results_folder: The root folder in which the per-patient results should sit.
    :param patient_id: The numeric ID of the patient.
    :return: A path like "root/017"
    """
    return results_folder / f"{int(patient_id):03d}"