@Test public void testGetDescriptionFromDiagnosKod() { final String code = "code"; final String codeSystemStr = "codesystem"; final String description = "description"; Diagnos diagnos = new Diagnos(); diagnos.setBeskrivning(description); when(diagnosService.getDiagnosisByCode(code, codeSystemStr)).thenReturn(DiagnosResponse.ok(Arrays.asList(diagnos), false)); String res = service.getDescriptionFromDiagnosKod(code, codeSystemStr); assertEquals(description, res); }
@Override public String getDescriptionFromDiagnosKod(String code, String codeSystemStr) { DiagnosResponse response = diagnosService.getDiagnosisByCode(code, codeSystemStr); List<Diagnos> diagnoser = response.getDiagnoser(); return diagnoser == null || diagnoser.size() != 1 ? "" : diagnoser.get(0).getBeskrivning(); }
WebcertModuleServiceImpl implements WebcertModuleService { @Override public String getDescriptionFromDiagnosKod(String code, String codeSystemStr) { DiagnosResponse response = diagnosService.getDiagnosisByCode(code, codeSystemStr); List<Diagnos> diagnoser = response.getDiagnoser(); return diagnoser == null || diagnoser.size() != 1 ? "" : diagnoser.get(0).getBeskrivning(); } }
WebcertModuleServiceImpl implements WebcertModuleService { @Override public String getDescriptionFromDiagnosKod(String code, String codeSystemStr) { DiagnosResponse response = diagnosService.getDiagnosisByCode(code, codeSystemStr); List<Diagnos> diagnoser = response.getDiagnoser(); return diagnoser == null || diagnoser.size() != 1 ? "" : diagnoser.get(0).getBeskrivning(); }  }
WebcertModuleServiceImpl implements WebcertModuleService { @Override public String getDescriptionFromDiagnosKod(String code, String codeSystemStr) { DiagnosResponse response = diagnosService.getDiagnosisByCode(code, codeSystemStr); List<Diagnos> diagnoser = response.getDiagnoser(); return diagnoser == null || diagnoser.size() != 1 ? "" : diagnoser.get(0).getBeskrivning(); }  @Override boolean validateDiagnosisCode(String codeFragment, String codeSystemStr); @Override boolean validateDiagnosisCode(String codeFragment, Diagnoskodverk codeSystem); @Override String getDescriptionFromDiagnosKod(String code, String codeSystemStr); }
WebcertModuleServiceImpl implements WebcertModuleService { @Override public String getDescriptionFromDiagnosKod(String code, String codeSystemStr) { DiagnosResponse response = diagnosService.getDiagnosisByCode(code, codeSystemStr); List<Diagnos> diagnoser = response.getDiagnoser(); return diagnoser == null || diagnoser.size() != 1 ? "" : diagnoser.get(0).getBeskrivning(); }  @Override boolean validateDiagnosisCode(String codeFragment, String codeSystemStr); @Override boolean validateDiagnosisCode(String codeFragment, Diagnoskodverk codeSystem); @Override String getDescriptionFromDiagnosKod(String code, String codeSystemStr);  }