getStudyId method

String getStudyId(
  1. String? studyId
)

Resolve study ID.

Returns studyId if not null. Otherwise returns the studyId specified in the study, if available. Throws an error if study id cannot be resolved.

Implementation

String getStudyId(String? studyId) {
  if (studyId != null) {
    return studyId;
  } else if (study != null && study?.studyId != null) {
    return study!.studyId!;
  } else {
    throw CarpServiceException(
        message: 'No study ID specified for CAWS endpoint.');
  }
}