Search in sources :

Example 1 with StudyDataSourceComment

use of com.odysseusinc.arachne.portal.model.StudyDataSourceComment in project ArachneCentralAPI by OHDSI.

the class BaseStudyServiceImpl method processDataSourceInvitation.

@Override
public void processDataSourceInvitation(IUser user, Long id, Boolean accepted, String comment) {
    StudyDataSourceLink studyDataSourceLink = studyDataSourceLinkRepository.findByIdAndOwnerId(id, user.getId());
    if (studyDataSourceLink != null) {
        DataSourceStatus status = TRUE.equals(accepted) ? APPROVED : DECLINED;
        studyDataSourceLink.setStatus(status);
        if (DECLINED == status) {
            if (!StringUtils.isEmpty(comment)) {
                dataSourceCommentRepository.save(new StudyDataSourceComment(studyDataSourceLink.getId(), user.getId(), comment));
            }
        }
    }
}
Also used : StudyDataSourceComment(com.odysseusinc.arachne.portal.model.StudyDataSourceComment) StudyDataSourceLink(com.odysseusinc.arachne.portal.model.StudyDataSourceLink) DataSourceStatus(com.odysseusinc.arachne.portal.model.DataSourceStatus)

Aggregations

DataSourceStatus (com.odysseusinc.arachne.portal.model.DataSourceStatus)1 StudyDataSourceComment (com.odysseusinc.arachne.portal.model.StudyDataSourceComment)1 StudyDataSourceLink (com.odysseusinc.arachne.portal.model.StudyDataSourceLink)1