Package org.ehrbase.rest.openehr
Class OpenehrCompositionController
java.lang.Object
org.ehrbase.rest.BaseController
org.ehrbase.rest.openehr.OpenehrCompositionController
- All Implemented Interfaces:
CompositionApiSpecification
@ConditionalOnMissingBean(name="primaryopenehrcompositioncontroller")
@RestController
@RequestMapping(path="${openehr-api.context-path:/rest/openehr}/v1/ehr",
produces={"application/json","application/xml","application/openehr.wt.flat.schema+json","application/openehr.wt.structured.schema+json"})
public class OpenehrCompositionController
extends BaseController
implements CompositionApiSpecification
Controller for /composition resource as part of the EHR sub-API of the openEHR REST API
-
Field Summary
Fields inherited from class org.ehrbase.rest.BaseController
ACCEPT, ADMIN_API_CONTEXT_PATH, API_CONTEXT_PATH, API_CONTEXT_PATH_WITH_VERSION, apiContextPathWithVersion, COMPOSITION, CONTENT_TYPE, CONTRIBUTION, DEFINITION, DIRECTORY, EHR, EHR_STATUS, ETAG, IF_MATCH, LAST_MODIFIED, LOCATION, OPENEHR_AUDIT_DETAILS, OPENEHR_VERSION, PREFER, QUERY, REQ_ACCEPT, REQ_CONTENT_TYPE, RESP_CONTENT_TYPE_DESC, RETURN_MINIMAL, RETURN_REPRESENTATION, TEMPLATE, VERSIONED_COMPOSITION, VERSIONED_EHR_STATUS -
Constructor Summary
ConstructorsConstructorDescriptionOpenehrCompositionController(CompositionService compositionService, SystemService systemService) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntitycreateComposition(String openehrVersion, String openehrAuditDetails, String contentType, String accept, String prefer, String ehrIdString, String templateId, String format, String composition) org.springframework.http.ResponseEntitydeleteComposition(String openehrVersion, String openehrAuditDetails, String ehrIdString, String precedingVersionUid) org.springframework.http.ResponseEntitygetComposition(String accept, String ehrIdString, String versionedObjectUid, String format, String versionAtTime) This mapping combines both GETs "/{ehr_id}/composition/{version_uid}" (via overlapping path) and "/{ehr_id}/composition/{versioned_object_uid}{?org.springframework.http.ResponseEntityupdateComposition(String openehrVersion, String openehrAuditDetails, String contentType, String accept, String prefer, String ifMatch, String ehrIdString, String versionedObjectUidString, String templateId, String format, String composition) Methods inherited from class org.ehrbase.rest.BaseController
createLocationUri, decodeVersionAtTime, extractCompositionRepresentation, extractVersionedObjectUidFromVersionUid, extractVersionFromVersionUid, getCompositionVersionedObjectUidString, getContextPath, getContributionVersionedObjectUidString, getEhrUuid, parseUUID, resolveContentType, resolveContentType
-
Constructor Details
-
OpenehrCompositionController
@Autowired public OpenehrCompositionController(CompositionService compositionService, SystemService systemService)
-
-
Method Details
-
createComposition
@PostMapping(value="/{ehr_id}/composition", consumes={"application/json","application/xml","application/openehr.wt.flat.schema+json","application/openehr.wt.structured.schema+json"}) @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, @RequestParam(value="templateId",required=false) String templateId, @RequestParam(value="format",required=false) String format, @RequestBody String composition) - Specified by:
createCompositionin interfaceCompositionApiSpecification
-
updateComposition
@PutMapping(value="/{ehr_id}/composition/{versioned_object_uid}", consumes={"application/json","application/xml","application/openehr.wt.flat.schema+json","application/openehr.wt.structured.schema+json"}) 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, @RequestParam(value="templateId",required=false) String templateId, @RequestParam(value="format",required=false) String format, @RequestBody String composition) - Specified by:
updateCompositionin interfaceCompositionApiSpecification
-
deleteComposition
@DeleteMapping("/{ehr_id}/composition/{preceding_version_uid}") @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) - Specified by:
deleteCompositionin interfaceCompositionApiSpecification
-
getComposition
@GetMapping("/{ehr_id}/composition/{versioned_object_uid}") 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="format",required=false) String format, @RequestParam(value="version_at_time",required=false) String versionAtTime) 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
-