[OE-2535] fixed bug in patient_episodes feature