@Test public void testGetKSH97PDiagnosisByCode() { assertEquals("Null should return invalid", DiagnosResponseType.INVALID_CODE, service.getDiagnosisByCode(null, KSH97P).getResultat()); assertEquals("Empty should return invalid", DiagnosResponseType.INVALID_CODE, service.getDiagnosisByCode("", KSH97P).getResultat()); assertEquals("Spaces should return invalid", DiagnosResponseType.INVALID_CODE, service.getDiagnosisByCode(" ", KSH97P).getResultat()); assertEquals(DiagnosResponseType.NOT_FOUND, service.getDiagnosisByCode("A11", KSH97P).getResultat()); DiagnosResponse res = service.getDiagnosisByCode("A00-", KSH97P); assertEquals(DiagnosResponseType.OK, res.getResultat()); assertFalse(res.getDiagnoser().isEmpty()); }
@Override public DiagnosResponse getDiagnosisByCode(String code, String codeSystemStr) { if (!validateDiagnosisCode(code, codeSystemStr)) { return DiagnosResponse.invalidCode(); } Diagnoskodverk codeSystem = getDiagnoskodverk(codeSystemStr); return findDiagnosisesByCode(code, codeSystem); }
DiagnosServiceImpl implements DiagnosService { @Override public DiagnosResponse getDiagnosisByCode(String code, String codeSystemStr) { if (!validateDiagnosisCode(code, codeSystemStr)) { return DiagnosResponse.invalidCode(); } Diagnoskodverk codeSystem = getDiagnoskodverk(codeSystemStr); return findDiagnosisesByCode(code, codeSystem); } }
DiagnosServiceImpl implements DiagnosService { @Override public DiagnosResponse getDiagnosisByCode(String code, String codeSystemStr) { if (!validateDiagnosisCode(code, codeSystemStr)) { return DiagnosResponse.invalidCode(); } Diagnoskodverk codeSystem = getDiagnoskodverk(codeSystemStr); return findDiagnosisesByCode(code, codeSystem); }  }
DiagnosServiceImpl implements DiagnosService { @Override public DiagnosResponse getDiagnosisByCode(String code, String codeSystemStr) { if (!validateDiagnosisCode(code, codeSystemStr)) { return DiagnosResponse.invalidCode(); } Diagnoskodverk codeSystem = getDiagnoskodverk(codeSystemStr); return findDiagnosisesByCode(code, codeSystem); }  @PostConstruct void initDiagnosRepository(); @Override DiagnosResponse getDiagnosisByCode(String code, String codeSystemStr); @Override DiagnosResponse getDiagnosisByCode(String code, Diagnoskodverk codeSystem); @Override DiagnosResponse searchDiagnosisByCode(String codeFragment, String codeSystemStr, int nbrOfResults); @Override DiagnosResponse searchDiagnosisByDescription(String searchString, String codeSystemStr, int nbrOfResults); @Override boolean validateDiagnosisCode(String diagnosisCode, String codeSystemStr); }
DiagnosServiceImpl implements DiagnosService { @Override public DiagnosResponse getDiagnosisByCode(String code, String codeSystemStr) { if (!validateDiagnosisCode(code, codeSystemStr)) { return DiagnosResponse.invalidCode(); } Diagnoskodverk codeSystem = getDiagnoskodverk(codeSystemStr); return findDiagnosisesByCode(code, codeSystem); }  @PostConstruct void initDiagnosRepository(); @Override DiagnosResponse getDiagnosisByCode(String code, String codeSystemStr); @Override DiagnosResponse getDiagnosisByCode(String code, Diagnoskodverk codeSystem); @Override DiagnosResponse searchDiagnosisByCode(String codeFragment, String codeSystemStr, int nbrOfResults); @Override DiagnosResponse searchDiagnosisByDescription(String searchString, String codeSystemStr, int nbrOfResults); @Override boolean validateDiagnosisCode(String diagnosisCode, String codeSystemStr);  }