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
  • Constructor Details

    • OpenehrEhrController

      @Autowired public OpenehrEhrController(EhrService ehrService, SystemService systemService)
  • 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:
      createEhr in interface EhrApiSpecification
    • 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:
      createEhrWithId in interface EhrApiSpecification
    • getEhrById

      @GetMapping(path="/{ehr_id}", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<EhrDto> getEhrById(@PathVariable("ehr_id") String ehrIdString)
      Specified by:
      getEhrById in interface EhrApiSpecification
    • 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:
      getEhrBySubject in interface EhrApiSpecification