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 descendants = DescendantsParser().execute(results, passed);
  final answerMaps = descendants.where((element) =>
      (element is Map<String, dynamic>) && element.containsKey('answer'));
  final answers = <dynamic>[];
  answerMaps.forEach((element) {
    answers.addAll((element as Map<String, dynamic>)['answer'] as Iterable);
  });
  return answers;
}