Search in sources :

Example 6 with ProfessionalType

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

the class ProfessionalTypeController method list.

@ApiOperation("List professional types.")
@RequestMapping(value = "/api/v1/user-management/professional-types", method = RequestMethod.GET)
public JsonResult<List<CommonProfessionalTypeDTO>> list() {
    JsonResult result = null;
    Iterable<ProfessionalType> professionalTypes = professionalTypeService.list();
    result = new JsonResult<>(JsonResult.ErrorCode.NO_ERROR);
    result.setResult(professionalTypes);
    return result;
}
Also used : ProfessionalType(com.odysseusinc.arachne.portal.model.ProfessionalType) JsonResult(com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 7 with ProfessionalType

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

the class UserDTOToUserConverter method convert.

@Override
public User convert(CommonUserRegistrationDTO dto) {
    User user = new User();
    user.setEmail(dto.getEmail());
    user.setPassword(dto.getPassword());
    user.setMiddlename(dto.getMiddlename());
    user.setFirstname(dto.getFirstname());
    user.setLastname(dto.getLastname());
    ProfessionalType professionalType = new ProfessionalType();
    professionalType.setId(dto.getProfessionalTypeId());
    user.setProfessionalType(professionalType);
    return user;
}
Also used : User(com.odysseusinc.arachne.portal.model.User) ProfessionalType(com.odysseusinc.arachne.portal.model.ProfessionalType)

Aggregations

ProfessionalType (com.odysseusinc.arachne.portal.model.ProfessionalType)7 JsonResult (com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult)4 ApiOperation (io.swagger.annotations.ApiOperation)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 FieldError (org.springframework.validation.FieldError)2 Country (com.odysseusinc.arachne.portal.model.Country)1 StateProvince (com.odysseusinc.arachne.portal.model.StateProvince)1 User (com.odysseusinc.arachne.portal.model.User)1 Date (java.util.Date)1