The mentioned modulo should work:
class PatientDataset(Dataset):
    def __init__(self):
        self.data = torch.arange(10).float().view(10, 1)

    def __len__(self):
        return 5*len(self.data)

    def __getitem__(self, idx):
        idx = idx % len(self.data)
        x = self.data[idx]
        return x

dataset = PatientDataset()
loader = DataLoader(dataset, batch_size=2)

for x in loader:
    print(x)