execute method

  1. @override
List execute(
  1. List results,
  2. Map<String, dynamic> passed
)
override

The iterable, nested function that evaluates the entire FHIRPath expression one object at a time

Implementation

@override
List execute(List results, Map<String, dynamic> passed) {
  final executedBefore = before.execute(results.toList(), passed);
  final executedAfter = after.execute(results.toList(), passed);

  final beforeBool = SingletonEvaluation.toBool(executedBefore,
      name: "parameter before 'or'", operation: 'or', collection: results);
  final afterBool = SingletonEvaluation.toBool(executedAfter,
      name: "parameter after 'or'", operation: 'or', collection: results);

  if (beforeBool == true || afterBool == true) {
    return [true];
  }

  if (beforeBool == null || afterBool == null) {
    return [];
  }

  return [false];
}