getParticipantDataList method

  1. @override
Future<List<ParticipantData>> getParticipantDataList(
  1. List<String> studyDeploymentIds
)
override

Get currently set data for all expected participant data for a set of study deployments with studyDeploymentIds. Data which is not set equals null.

Implementation

@override
Future<List<ParticipantData>> getParticipantDataList(
    List<String> studyDeploymentIds) async {
  // early out if empty list
  if (studyDeploymentIds.isEmpty) return [];

  Map<String, dynamic> responseJson =
      await _rpc(GetParticipantDataList(studyDeploymentIds));

  // we expect a list of 'items'
  List<Map<String, dynamic>> items =
      responseJson['items'] as List<Map<String, dynamic>>;
  List<ParticipantData> data = [];
  for (var item in items) {
    data.add(ParticipantData.fromJson(item));
  }

  return data;
}