javascript for splitting patients begun