Package org.ehrbase.rest.openehr
Class OpenehrEhrController
java.lang.Object
org.ehrbase.rest.BaseController
org.ehrbase.rest.openehr.OpenehrEhrController
- All Implemented Interfaces:
EhrApiSpecification
@ConditionalOnMissingBean(name="primaryopenehrehrcontroller")
@RestController
@RequestMapping(path="${openehr-api.context-path:/rest/openehr}/v1/ehr")
public class OpenehrEhrController
extends BaseController
implements EhrApiSpecification
Controller for /ehr resource of 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<EhrDto> createEhr(String openehrVersion, String openehrAuditDetails, String prefer, EhrStatusDto ehrStatus) org.springframework.http.ResponseEntity<EhrDto> createEhrWithId(String openehrVersion, String openehrAuditDetails, String prefer, String ehrIdString, EhrStatusDto ehrStatus) org.springframework.http.ResponseEntity<EhrDto> getEhrById(String ehrIdString) org.springframework.http.ResponseEntity<EhrDto> getEhrBySubject(String subjectId, String subjectNamespace) Returns EHR by subject (id and namespace)Methods inherited from class org.ehrbase.rest.BaseController
createLocationUri, decodeVersionAtTime, extractCompositionRepresentation, extractVersionedObjectUidFromVersionUid, extractVersionFromVersionUid, getCompositionVersionedObjectUidString, getContextPath, getContributionVersionedObjectUidString, getEhrUuid, parseUUID, resolveContentType, resolveContentType
-
Constructor Details
-
OpenehrEhrController
-
-
Method Details
-
createEhr
@PostMapping(consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) @ResponseStatus(CREATED) public org.springframework.http.ResponseEntity<EhrDto> createEhr(@RequestHeader(value="openEHR-VERSION",required=false) String openehrVersion, @RequestHeader(value="openEHR-AUDIT_DETAILS",required=false) String openehrAuditDetails, @RequestHeader(value="Prefer",required=false,defaultValue="return=minimal") String prefer, @RequestBody(required=false) EhrStatusDto ehrStatus) - Specified by:
createEhrin interfaceEhrApiSpecification
-
createEhrWithId
@PutMapping(path="/{ehr_id}", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) @ResponseStatus(CREATED) public org.springframework.http.ResponseEntity<EhrDto> createEhrWithId(@RequestHeader(value="openEHR-VERSION",required=false) String openehrVersion, @RequestHeader(value="openEHR-AUDIT_DETAILS",required=false) String openehrAuditDetails, @RequestHeader(value="Prefer",required=false) String prefer, @PathVariable("ehr_id") String ehrIdString, @RequestBody(required=false) EhrStatusDto ehrStatus) - Specified by:
createEhrWithIdin interfaceEhrApiSpecification
-
getEhrById
@GetMapping(path="/{ehr_id}", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<EhrDto> getEhrById(@PathVariable("ehr_id") String ehrIdString) - Specified by:
getEhrByIdin interfaceEhrApiSpecification
-
getEhrBySubject
@GetMapping(params={"subject_id","subject_namespace"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<EhrDto> getEhrBySubject(@RequestParam("subject_id") String subjectId, @RequestParam("subject_namespace") String subjectNamespace) Returns EHR by subject (id and namespace)- Specified by:
getEhrBySubjectin interfaceEhrApiSpecification
-