Class OpenehrCompositionController
- java.lang.Object
-
- org.ehrbase.rest.openehr.controller.BaseController
-
- org.ehrbase.rest.openehr.controller.OpenehrCompositionController
-
@RestController @RequestMapping(path="/rest/openehr/v1/ehr", produces={"application/json","application/xml"}) public class OpenehrCompositionController extends BaseControllerController for /composition resource as part of the EHR sub-API of the openEHR REST APITODO WIP state only implements endpoints from outer server side, everything else is a stub. Also with a lot of duplication at the moment, which should be reduced when implementing functionality.
-
-
Constructor Summary
Constructors Constructor Description OpenehrCompositionController(CompositionService compositionService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntitycreateComposition(String openehrVersion, String openehrAuditDetails, String contentType, String accept, String prefer, String ehrIdString, String composition)org.springframework.http.ResponseEntitydeleteComposition(String openehrVersion, String openehrAuditDetails, String ehrIdString, String precedingVersionUid)org.springframework.http.ResponseEntity<CompositionResponseData>getCompositionByRevisionHistory(String ehrIdString, String versionedObjectUidString, String versionUid)org.springframework.http.ResponseEntitygetCompositionByTime(String accept, String ehrIdString, String versionedObjectUid, LocalDateTime 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).org.springframework.http.ResponseEntity<CompositionResponseData>getCompositionByVersionId(String accept, String ehrIdString, String versionUid, LocalDateTime versionAtTime)Acts as overloaded function and calls the overlapping and more specific method getCompositionByTime.org.springframework.http.ResponseEntity<VersionedCompositionResponseData>getRevisionHistoryVersionedCompositionById(String ehrIdString, String versionedObjectUidString)org.springframework.http.ResponseEntity<CompositionResponseData>getVersionedCompositionAtTime(String ehrIdString, String versionedObjectUidString, String versionAtTime)org.springframework.http.ResponseEntity<VersionedCompositionResponseData>getVersionedCompositionById(String ehrIdString, String versionedObjectUidString)org.springframework.http.ResponseEntityupdateComposition(String openehrVersion, String openehrAuditDetails, String contentType, String accept, String prefer, String ifMatch, String ehrIdString, String versionedObjectUidString, String composition)-
Methods inherited from class org.ehrbase.rest.openehr.controller.BaseController
add2MetaMap, createErrorResponse, encodePath, extractCompositionFormat, extractMediaType, extractVersionedObjectUidFromVersionUid, extractVersionFromVersionUid, getBaseEnvLinkURL, getCompositionVersionedObjectUidString, getContributionVersionedObjectUidString, getEhrUuid, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler, restErrorHandler
-
-
-
-
Constructor Detail
-
OpenehrCompositionController
@Autowired public OpenehrCompositionController(CompositionService compositionService)
-
-
Method Detail
-
createComposition
@PostMapping(value="/{ehr_id}/composition", consumes={"application/xml","application/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, @RequestBody String composition)
-
updateComposition
@PutMapping("/{ehr_id}/composition/{versioned_object_uid}") public org.springframework.http.ResponseEntity updateComposition(@RequestHeader(value="openEHR-VERSION",required=false) 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)
-
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)
-
getCompositionByVersionId
@GetMapping("/{ehr_id}/composition/{version_uid}") public org.springframework.http.ResponseEntity<CompositionResponseData> getCompositionByVersionId(@RequestHeader(value="Accept",required=false) String accept, @PathVariable("ehr_id") String ehrIdString, @PathVariable("version_uid") String versionUid, @RequestParam(value="version_at_time",required=false) @DateTimeFormat(iso=DATE_TIME) LocalDateTime versionAtTime)Acts as overloaded function and calls the overlapping and more specific method getCompositionByTime. Catches both "/{ehr_id}/composition/{version_uid}" and "/{ehr_id}/composition/{versioned_object_uid}" which works because their processing is the same. "{?version_at_time}" is hidden in swagger-ui, it only is here to be piped through.
-
getCompositionByTime
@GetMapping("/{ehr_id}/composition/{versioned_object_uid}{?version_at_time}") public org.springframework.http.ResponseEntity getCompositionByTime(@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) LocalDateTime 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.
-
getVersionedCompositionById
@GetMapping("/{ehr_id}/versioned_composition/{versioned_object_uid}") public org.springframework.http.ResponseEntity<VersionedCompositionResponseData> getVersionedCompositionById(@PathVariable("ehr_id") String ehrIdString, @PathVariable("versioned_object_uid") String versionedObjectUidString)
-
getRevisionHistoryVersionedCompositionById
@GetMapping("/{ehr_id}/versioned_composition/{versioned_object_uid}/revision_history") public org.springframework.http.ResponseEntity<VersionedCompositionResponseData> getRevisionHistoryVersionedCompositionById(@PathVariable("ehr_id") String ehrIdString, @PathVariable("versioned_object_uid") String versionedObjectUidString)
-
getCompositionByRevisionHistory
@GetMapping("/{ehr_id}/versioned_composition/{versioned_object_uid}/version/{version_uid}") public org.springframework.http.ResponseEntity<CompositionResponseData> getCompositionByRevisionHistory(@PathVariable("ehr_id") String ehrIdString, @PathVariable("versioned_object_uid") String versionedObjectUidString, @PathVariable("version_uid") String versionUid)
-
getVersionedCompositionAtTime
@GetMapping("/{ehr_id}/versioned_composition/{versioned_object_uid}/version{?version_at_time}") public org.springframework.http.ResponseEntity<CompositionResponseData> getVersionedCompositionAtTime(@PathVariable("ehr_id") String ehrIdString, @PathVariable("versioned_object_uid") String versionedObjectUidString, @RequestParam(value="version_at_time",required=false) String versionAtTime)
-
-