Search in sources :

Example 1 with Samtyckesstatus

use of se.inera.intyg.clinicalprocess.healthcond.srs.getconsent.v1.Samtyckesstatus in project webcert by sklintyg.

the class SrsApiController method getConsent.

@GET
@Path("/consent/{personnummer}/{hsaId}")
@Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET)
@ApiOperation(value = "Get consent for patient and careunit", httpMethod = "GET", produces = MediaType.APPLICATION_JSON)
public Response getConsent(@ApiParam(value = "Personnummer") @PathParam("personnummer") String personnummer, @ApiParam(value = "HsaId för vårdenhet") @PathParam("hsaId") String hsaId) {
    authoritiesValidator.given(getWebCertUserService().getUser()).features(AuthoritiesConstants.FEATURE_SRS).orThrow();
    try {
        Personnummer p = createPnr(personnummer);
        Samtyckesstatus response = srsService.getConsent(hsaId, p);
        return Response.ok(response).build();
    } catch (InvalidPersonNummerException e) {
        return Response.status(Response.Status.BAD_REQUEST).build();
    }
}
Also used : Personnummer(se.inera.intyg.schemas.contract.Personnummer) InvalidPersonNummerException(se.inera.intyg.schemas.contract.InvalidPersonNummerException) Samtyckesstatus(se.inera.intyg.clinicalprocess.healthcond.srs.getconsent.v1.Samtyckesstatus) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

ApiOperation (io.swagger.annotations.ApiOperation)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 Samtyckesstatus (se.inera.intyg.clinicalprocess.healthcond.srs.getconsent.v1.Samtyckesstatus)1 InvalidPersonNummerException (se.inera.intyg.schemas.contract.InvalidPersonNummerException)1 Personnummer (se.inera.intyg.schemas.contract.Personnummer)1