@Test public void testGetFmbForIcd10HandlesEmptyInput() throws Exception { Response response = controller.getFmbForIcd10(""); assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); }
@GET @Path("/{icd10}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @ApiOperation(value = "Get FMB data for ICD10 codes", httpMethod = "GET", notes = "Fetch the admin user details", produces = MediaType.APPLICATION_JSON) @ApiResponses(value = { @ApiResponse(code = OK, message = "Given FMB data for icd10 code found", response = FmbResponse.class), @ApiResponse(code = BAD_REQUEST, message = "Bad request due to missing icd10 code") }) @PrometheusTimeMethod public Response getFmbForIcd10(@ApiParam(value = "ICD10 code", required = true) @PathParam("icd10") String icd10) { if (icd10 == null || icd10.isEmpty()) { return Response.status(Response.Status.BAD_REQUEST).entity("Missing icd10 code").build(); } return fmbDiagnosInformationService.findFmbDiagnosInformationByIcd10Kod(icd10) .map(Response::ok) .map(Response.ResponseBuilder::build) .orElseGet(() -> Response.noContent().build()); }
FmbApiController extends AbstractApiController { @GET @Path("/{icd10}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @ApiOperation(value = "Get FMB data for ICD10 codes", httpMethod = "GET", notes = "Fetch the admin user details", produces = MediaType.APPLICATION_JSON) @ApiResponses(value = { @ApiResponse(code = OK, message = "Given FMB data for icd10 code found", response = FmbResponse.class), @ApiResponse(code = BAD_REQUEST, message = "Bad request due to missing icd10 code") }) @PrometheusTimeMethod public Response getFmbForIcd10(@ApiParam(value = "ICD10 code", required = true) @PathParam("icd10") String icd10) { if (icd10 == null || icd10.isEmpty()) { return Response.status(Response.Status.BAD_REQUEST).entity("Missing icd10 code").build(); } return fmbDiagnosInformationService.findFmbDiagnosInformationByIcd10Kod(icd10) .map(Response::ok) .map(Response.ResponseBuilder::build) .orElseGet(() -> Response.noContent().build()); } }
FmbApiController extends AbstractApiController { @GET @Path("/{icd10}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @ApiOperation(value = "Get FMB data for ICD10 codes", httpMethod = "GET", notes = "Fetch the admin user details", produces = MediaType.APPLICATION_JSON) @ApiResponses(value = { @ApiResponse(code = OK, message = "Given FMB data for icd10 code found", response = FmbResponse.class), @ApiResponse(code = BAD_REQUEST, message = "Bad request due to missing icd10 code") }) @PrometheusTimeMethod public Response getFmbForIcd10(@ApiParam(value = "ICD10 code", required = true) @PathParam("icd10") String icd10) { if (icd10 == null || icd10.isEmpty()) { return Response.status(Response.Status.BAD_REQUEST).entity("Missing icd10 code").build(); } return fmbDiagnosInformationService.findFmbDiagnosInformationByIcd10Kod(icd10) .map(Response::ok) .map(Response.ResponseBuilder::build) .orElseGet(() -> Response.noContent().build()); }  }
FmbApiController extends AbstractApiController { @GET @Path("/{icd10}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @ApiOperation(value = "Get FMB data for ICD10 codes", httpMethod = "GET", notes = "Fetch the admin user details", produces = MediaType.APPLICATION_JSON) @ApiResponses(value = { @ApiResponse(code = OK, message = "Given FMB data for icd10 code found", response = FmbResponse.class), @ApiResponse(code = BAD_REQUEST, message = "Bad request due to missing icd10 code") }) @PrometheusTimeMethod public Response getFmbForIcd10(@ApiParam(value = "ICD10 code", required = true) @PathParam("icd10") String icd10) { if (icd10 == null || icd10.isEmpty()) { return Response.status(Response.Status.BAD_REQUEST).entity("Missing icd10 code").build(); } return fmbDiagnosInformationService.findFmbDiagnosInformationByIcd10Kod(icd10) .map(Response::ok) .map(Response.ResponseBuilder::build) .orElseGet(() -> Response.noContent().build()); }  @GET @Path("/{icd10}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @ApiOperation(value = "Get FMB data for ICD10 codes", httpMethod = "GET", notes = "Fetch the admin user details", produces = MediaType.APPLICATION_JSON) @ApiResponses(value = { @ApiResponse(code = OK, message = "Given FMB data for icd10 code found", response = FmbResponse.class), @ApiResponse(code = BAD_REQUEST, message = "Bad request due to missing icd10 code") }) @PrometheusTimeMethod Response getFmbForIcd10(@ApiParam(value = "ICD10 code", required = true) @PathParam("icd10") String icd10); @GET @Path("/valideraSjukskrivningstid") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @ApiOperation( value = "validate sjukskrivningstid for patient and ICD10 codes", httpMethod = "GET", produces = MediaType.APPLICATION_JSON) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = "Response Object containing info regardning sjukskrivning for patient", response = FmbResponse.class), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = "Bad request due to missing icd10 codes, or missing foreslagenSjukskrivningstid")}) @PrometheusTimeMethod Response valideraSjukskrivningstid(
        @ApiParam(value = "ICD10 code", required = true) @QueryParam("icd10Kod1") final String icd10Kod1,
        @QueryParam("icd10Kod2") final String icd10Kod2,
        @QueryParam("icd10Kod3") final String icd10Kod3,
        @ApiParam(value = "Personnummer för patient", required = true) @QueryParam("personnummer") final String personnummer,
        @ApiParam(value = "Sjukskrivningsperioder för föreslagen sjukskrivning", required = true) @QueryParam("periods") final List<Period> periods) {; }
FmbApiController extends AbstractApiController { @GET @Path("/{icd10}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @ApiOperation(value = "Get FMB data for ICD10 codes", httpMethod = "GET", notes = "Fetch the admin user details", produces = MediaType.APPLICATION_JSON) @ApiResponses(value = { @ApiResponse(code = OK, message = "Given FMB data for icd10 code found", response = FmbResponse.class), @ApiResponse(code = BAD_REQUEST, message = "Bad request due to missing icd10 code") }) @PrometheusTimeMethod public Response getFmbForIcd10(@ApiParam(value = "ICD10 code", required = true) @PathParam("icd10") String icd10) { if (icd10 == null || icd10.isEmpty()) { return Response.status(Response.Status.BAD_REQUEST).entity("Missing icd10 code").build(); } return fmbDiagnosInformationService.findFmbDiagnosInformationByIcd10Kod(icd10) .map(Response::ok) .map(Response.ResponseBuilder::build) .orElseGet(() -> Response.noContent().build()); }  @GET @Path("/{icd10}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @ApiOperation(value = "Get FMB data for ICD10 codes", httpMethod = "GET", notes = "Fetch the admin user details", produces = MediaType.APPLICATION_JSON) @ApiResponses(value = { @ApiResponse(code = OK, message = "Given FMB data for icd10 code found", response = FmbResponse.class), @ApiResponse(code = BAD_REQUEST, message = "Bad request due to missing icd10 code") }) @PrometheusTimeMethod Response getFmbForIcd10(@ApiParam(value = "ICD10 code", required = true) @PathParam("icd10") String icd10); @GET @Path("/valideraSjukskrivningstid") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @ApiOperation( value = "validate sjukskrivningstid for patient and ICD10 codes", httpMethod = "GET", produces = MediaType.APPLICATION_JSON) @ApiResponses(value = { @ApiResponse(code = HttpStatus.SC_OK, message = "Response Object containing info regardning sjukskrivning for patient", response = FmbResponse.class), @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = "Bad request due to missing icd10 codes, or missing foreslagenSjukskrivningstid")}) @PrometheusTimeMethod Response valideraSjukskrivningstid(
        @ApiParam(value = "ICD10 code", required = true) @QueryParam("icd10Kod1") final String icd10Kod1,
        @QueryParam("icd10Kod2") final String icd10Kod2,
        @QueryParam("icd10Kod3") final String icd10Kod3,
        @ApiParam(value = "Personnummer för patient", required = true) @QueryParam("personnummer") final String personnummer,
        @ApiParam(value = "Sjukskrivningsperioder för föreslagen sjukskrivning", required = true) @QueryParam("periods") final List<Period> periods) {;  }