use of com.odysseusinc.arachne.portal.model.Organization in project ArachneCentralAPI by OHDSI.
the class OrganizationDTOToOrganizationConverter method convert.
@Override
public Organization convert(OrganizationDTO source) {
final Organization organization = new Organization();
organization.setId(source.getId());
organization.setName(source.getName());
return organization;
}
use of com.odysseusinc.arachne.portal.model.Organization in project ArachneCentralAPI by OHDSI.
the class OrganizationServiceImpl method delete.
@Override
@PreAuthorize("hasPermission(#id, 'Organization', " + "T(com.odysseusinc.arachne.portal.security.ArachnePermission).DELETE_ORGANIZATION)")
public void delete(Long id) {
final Organization exist = getById(id);
organizationRepository.deleteById(id);
logger.info("{} deleted", exist);
}
use of com.odysseusinc.arachne.portal.model.Organization in project ArachneCentralAPI by OHDSI.
the class BaseDataNodeController method createManualDataNode.
@ApiOperation("Create new manual data node.")
@RequestMapping(value = "/api/v1/data-nodes/manual", method = RequestMethod.POST)
public CommonDataNodeCreationResponseDTO createManualDataNode(@RequestBody @Valid CommonDataNodeRegisterDTO commonDataNodeRegisterDTO, Principal principal) throws PermissionDeniedException, AlreadyExistException, ValidationException {
commonDataNodeRegisterDTO.setId(null);
final DN dataNode = conversionService.convert(commonDataNodeRegisterDTO, getDataNodeDNClass());
final Organization organization = conversionService.convert(commonDataNodeRegisterDTO.getOrganization(), Organization.class);
dataNode.setOrganization(organizationService.getOrCreate(organization));
return createDataNode(dataNode, principal);
}
use of com.odysseusinc.arachne.portal.model.Organization in project ArachneCentralAPI by OHDSI.
the class OrganizationController method update.
@ApiOperation("Update Organization")
@RequestMapping(value = "/api/v1/user-management/organizations/{id}", produces = APPLICATION_JSON_UTF8_VALUE, consumes = APPLICATION_JSON_UTF8_VALUE, method = PUT)
public OrganizationDTO update(@PathVariable Long id, @RequestBody OrganizationDTO organizationDTO) {
organizationDTO.setId(id);
final Organization organization = conversionService.convert(organizationDTO, Organization.class);
final Organization updated = organizationService.update(organization);
return conversionService.convert(updated, OrganizationDTO.class);
}
use of com.odysseusinc.arachne.portal.model.Organization in project ArachneCentralAPI by OHDSI.
the class OrganizationController method create.
@ApiOperation("Create Organization")
@RequestMapping(value = "/api/v1/user-management/organizations", produces = APPLICATION_JSON_UTF8_VALUE, method = POST)
public OrganizationDTO create(@RequestBody OrganizationDTO organizationDTO) throws ValidationException {
final Organization organization = conversionService.convert(organizationDTO, Organization.class);
final Organization saved = organizationService.create(organization);
return conversionService.convert(saved, OrganizationDTO.class);
}
Aggregations