use of com.odysseusinc.arachne.portal.model.DataSource in project ArachneCentralAPI by OHDSI.
the class DataNodeController method convertCommonDataSourceDtoToDataSource.
@Override
protected DataSource convertCommonDataSourceDtoToDataSource(CommonDataSourceDTO commonDataSourceDTO) {
DataSource ds = conversionService.convert(commonDataSourceDTO, DataSource.class);
ds.setModelType(null);
ds.setHealthStatus(CommonHealthStatus.GREEN);
return ds;
}
use of com.odysseusinc.arachne.portal.model.DataSource in project ArachneCentralAPI by OHDSI.
the class ParticipantLinkToParticipantDTOConverter method convert.
@Override
public ParticipantDTO convert(ParticipantLink participantLink) {
ParticipantDTO participantDTO = new ParticipantDTO();
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());
if (participantLink instanceof UserStudyExtended) {
if (DECLINED == participantLink.getStatus() && !isEmpty(((UserStudyExtended) participantLink).getComment())) {
participantDTO.setComment(((UserStudyExtended) participantLink).getComment());
}
if (role.equals(ParticipantRole.DATA_SET_OWNER)) {
DataSource ownedDataSource = ((UserStudyExtended) participantLink).getDataSource();
participantDTO = new DataOwnerParticipantDTO(participantDTO, ownedDataSource.getId());
}
}
return participantDTO;
}
use of com.odysseusinc.arachne.portal.model.DataSource in project ArachneCentralAPI by OHDSI.
the class AnalysisHelperTest method prepareDataSource.
private DataSource prepareDataSource() {
DataSource dataSource = new DataSource();
dataSource.setId(1L);
dataSource.setName("test");
return dataSource;
}
use of com.odysseusinc.arachne.portal.model.DataSource in project ArachneCentralAPI by OHDSI.
the class AnalysisHelperTest method createSubmission.
@Test
@WithUserDetails("admin@odysseusinc.com")
public void createSubmission() throws Exception {
DataSource dataSource = prepareDataSource();
when(dataSourceService.getByIdUnsecured(1L)).thenReturn(dataSource);
IUser user = prepareUser();
Study study = prepareStudy(user);
Analysis analysis = prepareAnalysis(user, study);
List<Submission> submissions = AnalysisHelper.createSubmission(submissionService, Collections.<Long>singletonList(1L), user, analysis);
try {
assertThat(submissions, is(not(empty())));
assertThat(submissions, contains(hasProperty("status", notNullValue())));
assertThat(submissions, contains(hasProperty("submissionGroup", notNullValue())));
} finally {
cleanup(submissions, analysis, study);
}
}
Aggregations