Class OpenehrEhrController

  • All Implemented Interfaces:
    EhrApiSpecification

    @RestController
    @RequestMapping(path="${openehr-api.context-path:/rest/openehr}/v1/ehr",
                    produces={"application/json","application/xml"})
    public class OpenehrEhrController
    extends BaseController
    implements EhrApiSpecification
    Controller for /ehr resource of openEHR REST API
    • Constructor Detail

      • OpenehrEhrController

        @Autowired
        public OpenehrEhrController​(EhrService ehrService)
    • Method Detail

      • createEhr

        @PostMapping
        @ResponseStatus(CREATED)
        public org.springframework.http.ResponseEntity createEhr​(@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,defaultValue="return=minimal")
                                                                 String prefer,
                                                                 @RequestBody(required=false)
                                                                 com.nedap.archie.rm.ehr.EhrStatus ehrStatus,
                                                                 javax.servlet.http.HttpServletRequest request)
        Specified by:
        createEhr in interface EhrApiSpecification
      • createEhrWithId

        @PutMapping(path="/{ehr_id}")
        @ResponseStatus(CREATED)
        public org.springframework.http.ResponseEntity<org.ehrbase.response.openehr.EhrResponseData> createEhrWithId​(@RequestHeader(value="openEHR-VERSION",required=false)
                                                                                                                     String openehrVersion,
                                                                                                                     @RequestHeader(value="openEHR-AUDIT_DETAILS",required=false)
                                                                                                                     String openehrAuditDetails,
                                                                                                                     @RequestHeader(value="Accept",required=false)
                                                                                                                     String accept,
                                                                                                                     @RequestHeader(value="Prefer",required=false)
                                                                                                                     String prefer,
                                                                                                                     @PathVariable("ehr_id")
                                                                                                                     String ehrIdString,
                                                                                                                     @RequestBody(required=false)
                                                                                                                     com.nedap.archie.rm.ehr.EhrStatus ehrStatus,
                                                                                                                     javax.servlet.http.HttpServletRequest request)
        Specified by:
        createEhrWithId in interface EhrApiSpecification
      • retrieveEhrById

        @GetMapping(path="/{ehr_id}")
        @PreAuthorize("checkAbacPre(@openehrEhrController.EHR, @ehrService.getSubjectExtRef(#ehrIdString))")
        public org.springframework.http.ResponseEntity<org.ehrbase.response.openehr.EhrResponseData> retrieveEhrById​(@RequestHeader(value="Accept",required=false)
                                                                                                                     String accept,
                                                                                                                     @PathVariable("ehr_id")
                                                                                                                     String ehrIdString,
                                                                                                                     javax.servlet.http.HttpServletRequest request)
        Returns EHR by ID
        Specified by:
        retrieveEhrById in interface EhrApiSpecification
      • retrieveEhrBySubject

        @GetMapping(params={"subject_id","subject_namespace"})
        @PreAuthorize("checkAbacPre(@openehrEhrController.EHR, #subjectId)")
        public org.springframework.http.ResponseEntity<org.ehrbase.response.openehr.EhrResponseData> retrieveEhrBySubject​(@RequestHeader(value="Accept",required=false)
                                                                                                                          String accept,
                                                                                                                          @RequestParam("subject_id")
                                                                                                                          String subjectId,
                                                                                                                          @RequestParam("subject_namespace")
                                                                                                                          String subjectNamespace,
                                                                                                                          javax.servlet.http.HttpServletRequest request)
        Returns EHR by subject (id and namespace)
        Specified by:
        retrieveEhrBySubject in interface EhrApiSpecification