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();
}
}
Aggregations