Class EhrController
- java.lang.Object
-
- org.ehrbase.rest.ehrscape.controller.BaseController
-
- org.ehrbase.rest.ehrscape.controller.EhrController
-
@RestController @RequestMapping(path="/rest/ecis/v1/ehr", produces={"application/json","application/xml"}) public class EhrController extends BaseControllerController for /ehr resource of EhrScape REST API
-
-
Constructor Summary
Constructors Constructor Description EhrController(EhrService ehrService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<EhrResponseData>createEhr(String subjectId, String subjectNamespace, String committerId, String committerName, String contentType, String content)org.springframework.http.ResponseEntity<EhrResponseData>getEhr(String subjectId, String subjectNamespace, String contentType)org.springframework.http.ResponseEntity<EhrResponseData>getEhr(UUID ehrId, String contentType)org.springframework.http.ResponseEntity<Map<String,String>>restErrorHandler(DuplicateObjectException e)Specific handler that overwrites inherited handling to comply with EhrScape API specification.org.springframework.http.ResponseEntity<Map<String,String>>restErrorHandler(ObjectNotFoundException e)Specific handler that overwrites inherited handling to comply with EhrScape API specification.org.springframework.http.ResponseEntity<EhrResponseData>updateStatus(UUID ehrId, String ehrStatus, String contentType)-
Methods inherited from class org.ehrbase.rest.ehrscape.controller.BaseController
add2MetaMap, createErrorResponse, getBaseEnvLinkURL, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler
-
-
-
-
Constructor Detail
-
EhrController
@Autowired public EhrController(EhrService ehrService)
-
-
Method Detail
-
createEhr
@PostMapping @ResponseStatus(CREATED) public org.springframework.http.ResponseEntity<EhrResponseData> createEhr(@RequestParam(value="subjectId",required=false) String subjectId, @RequestParam(value="subjectNamespace",required=false) String subjectNamespace, @RequestParam(value="committerId",required=false) String committerId, @RequestParam(value="committerName",required=false) String committerName, @RequestHeader(value="Content-Type",required=false) String contentType, @RequestBody(required=false) String content) throws Exception
- Throws:
Exception
-
getEhr
@GetMapping public org.springframework.http.ResponseEntity<EhrResponseData> getEhr(@RequestParam("subjectId") String subjectId, @RequestParam("subjectNamespace") String subjectNamespace, @RequestHeader(value="Content-Type",required=false) String contentType)
-
getEhr
@GetMapping(path="/{uuid}") public org.springframework.http.ResponseEntity<EhrResponseData> getEhr(@PathVariable("uuid") UUID ehrId, @RequestHeader(value="Content-Type",required=false) String contentType)
-
updateStatus
@PutMapping(path="/{uuid}/status") public org.springframework.http.ResponseEntity<EhrResponseData> updateStatus(@PathVariable("uuid") UUID ehrId, @RequestBody String ehrStatus, @RequestHeader(value="Content-Type",required=false) String contentType)
-
restErrorHandler
@ExceptionHandler(org.ehrbase.api.exception.ObjectNotFoundException.class) public org.springframework.http.ResponseEntity<Map<String,String>> restErrorHandler(ObjectNotFoundException e)
Specific handler that overwrites inherited handling to comply with EhrScape API specification. In the case 'GET /ehr' a not found object shall invoke NO_CONTENT instead of NOT_FOUND.- Overrides:
restErrorHandlerin classBaseController- Returns:
- ResponseEntity
-
restErrorHandler
@ExceptionHandler(org.ehrbase.api.exception.DuplicateObjectException.class) public org.springframework.http.ResponseEntity<Map<String,String>> restErrorHandler(DuplicateObjectException e)
Specific handler that overwrites inherited handling to comply with EhrScape API specification. In the case 'POST /ehr' a duplicate object shall invoke BAD_REQUEST instead of ALREADY_REPORTED.- Overrides:
restErrorHandlerin classBaseController- Returns:
- ResponseEntity
-
-