CARE #26: Added database access for complex conditions