Functionality of creating a linked patient record on save