use of com.odysseusinc.arachne.portal.model.IDataSource in project ArachneCentralAPI by OHDSI.
the class BaseStudyController method updateDataSource.
@ApiOperation("Update data source linked to study")
@RequestMapping(value = "/api/v1/study-management/studies/{studyId}/data-sources/{dataSourceId}", method = PUT)
public JsonResult<DataSourceDTO> updateDataSource(Principal principal, @PathVariable("studyId") Long studyId, @PathVariable("dataSourceId") Long dataSourceId, @RequestBody @Valid CreateVirtualDataSourceDTO dataSourceDTO) throws PermissionDeniedException, ValidationException, IOException, NoSuchFieldException, SolrServerException, IllegalAccessException {
final IUser user = getUser(principal);
IDataSource dataSource = studyService.updateVirtualDataSource(user, studyId, dataSourceId, dataSourceDTO.getName(), dataSourceDTO.getDataOwnersIds());
return new JsonResult<>(NO_ERROR, conversionService.convert(dataSource, DataSourceDTO.class));
}
use of com.odysseusinc.arachne.portal.model.IDataSource in project ArachneCentralAPI by OHDSI.
the class BaseStudyController method createVirtualDataSource.
@ApiOperation("Create virtual data source linked to study")
@RequestMapping(value = "/api/v1/study-management/studies/{studyId}/data-sources", method = POST)
public JsonResult<DataSourceDTO> createVirtualDataSource(Principal principal, @PathVariable("studyId") Long studyId, @RequestBody @Valid CreateVirtualDataSourceDTO dataSourceDTO) throws PermissionDeniedException, NotExistException, IllegalAccessException, SolrServerException, IOException, ValidationException, FieldException, AlreadyExistException, NoSuchFieldException {
final IUser createdBy = getUser(principal);
final IDataSource dataSource = studyService.addVirtualDataSource(createdBy, studyId, dataSourceDTO.getName(), dataSourceDTO.getDataOwnersIds());
final DataSourceDTO registeredDataSourceDTO = conversionService.convert(dataSource, DataSourceDTO.class);
return new JsonResult<>(NO_ERROR, registeredDataSourceDTO);
}
use of com.odysseusinc.arachne.portal.model.IDataSource in project ArachneCentralAPI by OHDSI.
the class StudyDataSourceLinkToPaperStudyDataSourceConverter method convert.
@Override
public PaperStudyDataSource convert(StudyDataSourceLink studyDataSourceLink) {
final PaperStudyDataSource studyDataSource = new PaperStudyDataSource();
final IDataSource dataSource = studyDataSourceLink.getDataSource();
studyDataSource.setDataSource(dataSource);
return studyDataSource;
}
use of com.odysseusinc.arachne.portal.model.IDataSource in project ArachneCentralAPI by OHDSI.
the class BaseSubmissionToSubmissionDTOConverter method convert.
@Override
public DTO convert(T source) {
DTO dto = super.convert(source);
dto.setInsight(insightDTO(source.getSubmissionInsight()));
final Status status = statusConverter(source.getStatus());
final Boolean execConfirmed = status.isExecConfirmed();
dto.setIsExecConfirmed(execConfirmed);
final Boolean resultConfirmed = status.isResultConfirmed();
dto.setIsResultConfirmed(resultConfirmed);
dto.setAction(source.getStatus().toString());
IDataSource dataSource = source.getDataSource();
Long loggedUserId = ((ArachneUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getId();
final boolean isOwner = DataNodeUtils.isDataNodeOwner(dataSource.getDataNode(), loggedUserId);
dto.setIsOwner(isOwner);
return dto;
}
Aggregations