Fixed the bug about linking a medicament to a medical record.