SELECT EXISTS (
	SELECT 1 FROM clin.patient WHERE
		fk_identity = ID_ACTIVE_PATIENT
			AND
		coalesce((
			-- longer than 3 months ago
			edc < now() - '3 months'::interval
				OR
			-- 2 years in the future
			edc > now() + '2 years'::interval
		), FALSE)
);