Package org.ehrbase.rest.openehr
Class OpenehrCompositionController
java.lang.Object
org.ehrbase.rest.BaseController
org.ehrbase.rest.openehr.OpenehrCompositionController
- All Implemented Interfaces:
CompositionApiSpecification
@RestController
@RequestMapping(path="${openehr-api.context-path:/rest/openehr}/v1/ehr",
produces={"application/json","application/xml"})
public class OpenehrCompositionController
extends BaseController
implements CompositionApiSpecification
Controller for /composition resource as part of the EHR sub-API of the openEHR REST API
- Since:
- 1.0.0
- Author:
- Stefan Spiska, Jake Smolka
-
Field Summary
Fields inherited from class org.ehrbase.rest.BaseController
ACCEPT, API_CONTEXT_PATH_WITH_VERSION, apiContextPathWithVersion, COMPOSITION, CONTENT_TYPE, CONTRIBUTION, DEFINITION, DIRECTORY, EHR, EHR_STATUS, ETAG, IF_MATCH, IF_NONE_MATCH, LAST_MODIFIED, LOCATION, OPENEHR_AUDIT_DETAILS, OPENEHR_VERSION, PREFER, QUERY, REQ_ACCEPT, REQ_CONTENT_TYPE, REQ_CONTENT_TYPE_BODY, REQ_OPENEHR_AUDIT, REQ_OPENEHR_VERSION, REQ_PREFER, RESP_CONTENT_TYPE_DESC, RESP_ETAG_DESC, RESP_LAST_MODIFIED_DESC, RESP_LOCATION_DESC, RESP_NOT_ACCEPTABLE_DESC, RESP_UNSUPPORTED_MEDIA_DESC, REST_OPERATION, RETURN_MINIMAL, RETURN_REPRESENTATION, TEMPLATE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntitycreateComposition(String openehrVersion, String openehrAuditDetails, String contentType, String accept, String prefer, String ehrIdString, String composition, javax.servlet.http.HttpServletRequest request) org.springframework.http.ResponseEntitydeleteComposition(String openehrVersion, String openehrAuditDetails, String ehrIdString, String precedingVersionUid, javax.servlet.http.HttpServletRequest request) org.springframework.http.ResponseEntitygetComposition(String accept, String ehrIdString, String versionedObjectUid, String versionAtTime, javax.servlet.http.HttpServletRequest request) This mapping combines both GETs "/{ehr_id}/composition/{version_uid}" (via overlapping path) and "/{ehr_id}/composition/{versioned_object_uid}{?version_at_time}" (here).org.springframework.http.ResponseEntityupdateComposition(String openehrVersion, String openehrAuditDetails, String contentType, String accept, String prefer, String ifMatch, String ehrIdString, String versionedObjectUidString, String composition, javax.servlet.http.HttpServletRequest request) Methods inherited from class org.ehrbase.rest.BaseController
add2MetaMap, createLocationUri, decodeVersionAtTime, encodePath, enrichRequestAttribute, extractCompositionFormat, extractVersionedObjectUidFromVersionUid, extractVersionFromVersionUid, getCompositionVersionedObjectUidString, getContextPath, getContributionVersionedObjectUidString, getEhrUuid, resolveContentType, resolveContentType
-
Constructor Details
-
OpenehrCompositionController
-
-
Method Details
-
createComposition
@PostMapping(value="/{ehr_id}/composition", consumes={"application/xml","application/json"}) @PreAuthorize("checkAbacPre(@openehrCompositionController.COMPOSITION, @ehrService.getSubjectExtRef(#ehrIdString), #composition, #contentType)") @ResponseStatus(CREATED) public org.springframework.http.ResponseEntity createComposition(@RequestHeader(value="openEHR-VERSION",required=false) String openehrVersion, @RequestHeader(value="openEHR-AUDIT_DETAILS",required=false) String openehrAuditDetails, @RequestHeader("Content-Type") String contentType, @RequestHeader(value="Accept",required=false) String accept, @RequestHeader(value="Prefer",required=false) String prefer, @PathVariable("ehr_id") String ehrIdString, @RequestBody String composition, javax.servlet.http.HttpServletRequest request) - Specified by:
createCompositionin interfaceCompositionApiSpecification
-
updateComposition
@PutMapping("/{ehr_id}/composition/{versioned_object_uid}") @PreAuthorize("checkAbacPre(@openehrCompositionController.COMPOSITION, @ehrService.getSubjectExtRef(#ehrIdString), #composition, #contentType)") public org.springframework.http.ResponseEntity updateComposition(String openehrVersion, @RequestHeader(value="openEHR-AUDIT_DETAILS",required=false) String openehrAuditDetails, @RequestHeader(value="Content-Type",required=false) String contentType, @RequestHeader(value="Accept",required=false) String accept, @RequestHeader(value="Prefer",required=false) String prefer, @RequestHeader("If-Match") String ifMatch, @PathVariable("ehr_id") String ehrIdString, @PathVariable("versioned_object_uid") String versionedObjectUidString, @RequestBody String composition, javax.servlet.http.HttpServletRequest request) - Specified by:
updateCompositionin interfaceCompositionApiSpecification
-
deleteComposition
@DeleteMapping("/{ehr_id}/composition/{preceding_version_uid}") @PreAuthorize("checkAbacPre(@openehrCompositionController.COMPOSITION, @ehrService.getSubjectExtRef(#ehrIdString), #precedingVersionUid, null)") @ResponseStatus(NO_CONTENT) public org.springframework.http.ResponseEntity deleteComposition(@RequestHeader(value="openEHR-VERSION",required=false) String openehrVersion, @RequestHeader(value="openEHR-AUDIT_DETAILS",required=false) String openehrAuditDetails, @PathVariable("ehr_id") String ehrIdString, @PathVariable("preceding_version_uid") String precedingVersionUid, javax.servlet.http.HttpServletRequest request) - Specified by:
deleteCompositionin interfaceCompositionApiSpecification
-
getComposition
@GetMapping("/{ehr_id}/composition/{versioned_object_uid}") @PostAuthorize("checkAbacPost(@openehrCompositionController.COMPOSITION, @ehrService.getSubjectExtRef(#ehrIdString), returnObject, #accept)") public org.springframework.http.ResponseEntity getComposition(@RequestHeader(value="Accept",required=false) String accept, @PathVariable("ehr_id") String ehrIdString, @PathVariable("versioned_object_uid") String versionedObjectUid, @RequestParam(value="version_at_time",required=false) String versionAtTime, javax.servlet.http.HttpServletRequest request) This mapping combines both GETs "/{ehr_id}/composition/{version_uid}" (via overlapping path) and "/{ehr_id}/composition/{versioned_object_uid}{?version_at_time}" (here). This is necessary because of the overlapping paths. Both mappings are specified to behave almost the same, so this solution works in this case.- Specified by:
getCompositionin interfaceCompositionApiSpecification
-