Having to address this situation again. Plan is to print a QR code on the examination sheet. When it gets scanned in again, the code will be read and the examination sheet attached to the correct patient. Some initial tests show that I can generate the code, and also read it. The rest is easy.