Fixed case ID retrieval, set patient ID to case ID