use of com.odysseusinc.arachne.portal.model.ParticipantRole in project ArachneCentralAPI by OHDSI.
the class BaseStudyController method updateParticipantRole.
@ApiOperation("Update participant.")
@RequestMapping(value = "/api/v1/study-management/studies/{studyId}/participants/{userUuid}", method = PUT)
public JsonResult<Boolean> updateParticipantRole(@PathVariable("studyId") Long studyId, @PathVariable("userUuid") String userUuid, @RequestBody @Valid UpdateParticipantDTO participantDTO) throws NotExistException, AlreadyExistException, ValidationException {
if (participantDTO.getRole() != null) {
ParticipantRole newRole = ParticipantRole.valueOf(participantDTO.getRole());
studyService.updateParticipantRole(studyId, UserIdUtils.uuidToId(userUuid), newRole);
}
return new JsonResult<>(NO_ERROR, Boolean.TRUE);
}
use of com.odysseusinc.arachne.portal.model.ParticipantRole in project ArachneCentralAPI by OHDSI.
the class ParticipantLinkToParticipantExtendedDTOConverter method convert.
@Override
public ParticipantExtendedDTO convert(ParticipantLink participantLink) {
final ParticipantExtendedDTO participantDTO = new ParticipantExtendedDTO();
ParticipantRole role = participantLink.getRole();
final IUser user = participantLink.getUser();
participantDTO.setId(user.getUuid());
participantDTO.setFullName(user.getFullName());
participantDTO.setRole(new OptionDTO(role.name(), role.toString()));
participantDTO.setStatus(participantLink.getStatus().toString());
participantDTO.setAffilation(user.getAffiliation());
participantDTO.setProfessionalType(user.getProfessionalType());
return participantDTO;
}
Aggregations