@Test public void testNoMatchingIcfCodes() { doReturn(Optional.empty()) .when(repository) .findFirstByIcd10KodList_kod(anyString()); final IcfResponse response = icfService.findIcfInformationByIcd10Koder(Icd10KoderRequest.of("code", null, null)); assertThat(response.getGemensamma().getIcd10Kod()).isNull(); assertThat(response.getGemensamma().getAktivitetsBegransningsKoder()).isNull(); assertThat(response.getGemensamma().getFunktionsNedsattningsKoder()).isNull(); assertThat(response.getUnika()).isEmpty(); }
@Override @Transactional(readOnly = true) public IcfResponse findIcfInformationByIcd10Koder(final Icd10KoderRequest icd10KoderRequest) { Preconditions.checkArgument(Objects.nonNull(icd10KoderRequest), "Icd10KoderRequest can not be null"); Preconditions.checkArgument(Objects.nonNull(icd10KoderRequest.getIcd10Kod1()), "Icd10KoderRequest must have an icfCode1"); final List<Tuple2<String, Optional<DiagnosInformation>>> collect = List.ofAll(icd10KoderRequest.getIcd10Codes()) .map(this::searchDiagnosInformationByIcd10Kod) .distinctBy(response -> response._1); return convertToResponse(collect); }
IcfServiceImpl extends FmbBaseService implements IcfService { @Override @Transactional(readOnly = true) public IcfResponse findIcfInformationByIcd10Koder(final Icd10KoderRequest icd10KoderRequest) { Preconditions.checkArgument(Objects.nonNull(icd10KoderRequest), "Icd10KoderRequest can not be null"); Preconditions.checkArgument(Objects.nonNull(icd10KoderRequest.getIcd10Kod1()), "Icd10KoderRequest must have an icfCode1"); final List<Tuple2<String, Optional<DiagnosInformation>>> collect = List.ofAll(icd10KoderRequest.getIcd10Codes()) .map(this::searchDiagnosInformationByIcd10Kod) .distinctBy(response -> response._1); return convertToResponse(collect); } }
IcfServiceImpl extends FmbBaseService implements IcfService { @Override @Transactional(readOnly = true) public IcfResponse findIcfInformationByIcd10Koder(final Icd10KoderRequest icd10KoderRequest) { Preconditions.checkArgument(Objects.nonNull(icd10KoderRequest), "Icd10KoderRequest can not be null"); Preconditions.checkArgument(Objects.nonNull(icd10KoderRequest.getIcd10Kod1()), "Icd10KoderRequest must have an icfCode1"); final List<Tuple2<String, Optional<DiagnosInformation>>> collect = List.ofAll(icd10KoderRequest.getIcd10Codes()) .map(this::searchDiagnosInformationByIcd10Kod) .distinctBy(response -> response._1); return convertToResponse(collect); } IcfServiceImpl(
        final IcfTextResource textResource,
        final DiagnosInformationRepository repository); }
IcfServiceImpl extends FmbBaseService implements IcfService { @Override @Transactional(readOnly = true) public IcfResponse findIcfInformationByIcd10Koder(final Icd10KoderRequest icd10KoderRequest) { Preconditions.checkArgument(Objects.nonNull(icd10KoderRequest), "Icd10KoderRequest can not be null"); Preconditions.checkArgument(Objects.nonNull(icd10KoderRequest.getIcd10Kod1()), "Icd10KoderRequest must have an icfCode1"); final List<Tuple2<String, Optional<DiagnosInformation>>> collect = List.ofAll(icd10KoderRequest.getIcd10Codes()) .map(this::searchDiagnosInformationByIcd10Kod) .distinctBy(response -> response._1); return convertToResponse(collect); } IcfServiceImpl(
        final IcfTextResource textResource,
        final DiagnosInformationRepository repository); @Override @Transactional(readOnly = true) IcfResponse findIcfInformationByIcd10Koder(final Icd10KoderRequest icd10KoderRequest); }
IcfServiceImpl extends FmbBaseService implements IcfService { @Override @Transactional(readOnly = true) public IcfResponse findIcfInformationByIcd10Koder(final Icd10KoderRequest icd10KoderRequest) { Preconditions.checkArgument(Objects.nonNull(icd10KoderRequest), "Icd10KoderRequest can not be null"); Preconditions.checkArgument(Objects.nonNull(icd10KoderRequest.getIcd10Kod1()), "Icd10KoderRequest must have an icfCode1"); final List<Tuple2<String, Optional<DiagnosInformation>>> collect = List.ofAll(icd10KoderRequest.getIcd10Codes()) .map(this::searchDiagnosInformationByIcd10Kod) .distinctBy(response -> response._1); return convertToResponse(collect); } IcfServiceImpl(
        final IcfTextResource textResource,
        final DiagnosInformationRepository repository); @Override @Transactional(readOnly = true) IcfResponse findIcfInformationByIcd10Koder(final Icd10KoderRequest icd10KoderRequest);  }