He is kept in custody by the police, so they have to clear him of accusation. After the doctor leaves, they open the letter, which says that they have to clear him by collecting all the evidence found at the apartment from where he has been taken away, Baker Street 221/B.
You are the Baker street free team!
You have to hurry, as justice did not waste its time back then.
Such cases usually ended with hanging.