@Test(expected = CodeSystemNotFoundException.class) public void testCreateCodeSystemFromDto_throw_CodeSystemNotFoundException() throws ValueSetNotFoundException, CodeSystemNotFoundException, DuplicateConceptCodeException { ConceptCodeDto created = mock(ConceptCodeDto.class); when(created.getDescription()).thenReturn("description"); when(created.getCodeSystemVersionId()).thenReturn((long) 1); when(codeSystemVersionRepository.findOne(anyLong())).thenReturn(null); conceptCodeServiceImpl.create(created); }
@Override public ConceptCodeVSCSDto create() throws ValueSetNotFoundException, CodeSystemVersionNotFoundException, CodeSystemNotFoundException { ConceptCodeVSCSDto conceptCodeVSCSDto = new ConceptCodeVSCSDto(); conceptCodeVSCSDto.setValueSetsMap(getAllValueSetsInMap()); List<CodeSystem> codeSystems = codeSystemRepository.findAll(); if (codeSystems == null || codeSystems.size() == 0) { logger.debug("No codeSystems found in the system"); throw new CodeSystemNotFoundException(); } conceptCodeVSCSDto.setCsVersions(valueSetMgmtHelper .createCSVersionsDTOFormEntity(codeSystems)); return conceptCodeVSCSDto; }
ConceptCodeServiceImpl implements ConceptCodeService { @Override public ConceptCodeVSCSDto create() throws ValueSetNotFoundException, CodeSystemVersionNotFoundException, CodeSystemNotFoundException { ConceptCodeVSCSDto conceptCodeVSCSDto = new ConceptCodeVSCSDto(); conceptCodeVSCSDto.setValueSetsMap(getAllValueSetsInMap()); List<CodeSystem> codeSystems = codeSystemRepository.findAll(); if (codeSystems == null || codeSystems.size() == 0) { logger.debug("No codeSystems found in the system"); throw new CodeSystemNotFoundException(); } conceptCodeVSCSDto.setCsVersions(valueSetMgmtHelper .createCSVersionsDTOFormEntity(codeSystems)); return conceptCodeVSCSDto; } }
ConceptCodeServiceImpl implements ConceptCodeService { @Override public ConceptCodeVSCSDto create() throws ValueSetNotFoundException, CodeSystemVersionNotFoundException, CodeSystemNotFoundException { ConceptCodeVSCSDto conceptCodeVSCSDto = new ConceptCodeVSCSDto(); conceptCodeVSCSDto.setValueSetsMap(getAllValueSetsInMap()); List<CodeSystem> codeSystems = codeSystemRepository.findAll(); if (codeSystems == null || codeSystems.size() == 0) { logger.debug("No codeSystems found in the system"); throw new CodeSystemNotFoundException(); } conceptCodeVSCSDto.setCsVersions(valueSetMgmtHelper .createCSVersionsDTOFormEntity(codeSystems)); return conceptCodeVSCSDto; } ConceptCodeServiceImpl(int conceptCodePageSize,
			ConceptCodeRepository conceptCodeRepository,
			ValueSetRepository valueSetRepository,
			CodeSystemRepository codeSystemRepository,
			CodeSystemVersionRepository codeSystemVersionRepository,
			ConceptCodeValueSetRepository conceptCodeValueSetRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); }
ConceptCodeServiceImpl implements ConceptCodeService { @Override public ConceptCodeVSCSDto create() throws ValueSetNotFoundException, CodeSystemVersionNotFoundException, CodeSystemNotFoundException { ConceptCodeVSCSDto conceptCodeVSCSDto = new ConceptCodeVSCSDto(); conceptCodeVSCSDto.setValueSetsMap(getAllValueSetsInMap()); List<CodeSystem> codeSystems = codeSystemRepository.findAll(); if (codeSystems == null || codeSystems.size() == 0) { logger.debug("No codeSystems found in the system"); throw new CodeSystemNotFoundException(); } conceptCodeVSCSDto.setCsVersions(valueSetMgmtHelper .createCSVersionsDTOFormEntity(codeSystems)); return conceptCodeVSCSDto; } ConceptCodeServiceImpl(int conceptCodePageSize,
			ConceptCodeRepository conceptCodeRepository,
			ValueSetRepository valueSetRepository,
			CodeSystemRepository codeSystemRepository,
			CodeSystemVersionRepository codeSystemVersionRepository,
			ConceptCodeValueSetRepository conceptCodeValueSetRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); @Override @Transactional(rollbackFor = ConceptCodeNotFoundException.class) ConceptCodeDto delete(Long conceptCodeId); @Override ConceptCodeDto findById(Long id); @Override @Transactional(rollbackFor = ConceptCodeNotFoundException.class) ConceptCodeDto update(ConceptCodeDto updated); @Override List<ConceptCodeDto> findAll(); @Override Map<String, Object> findAll(int pageNumber); @Override Map<String, Object> findAllByCode(String searchTerm,
			String codeSystem, String codeSystemVersion, String valueSetName,
			int pageNumber); @Override Map<String, Object> findAllByName(String searchTerm,
			String codeSystem, String codeSystemVersion, String valueSetName,
			int pageNumber); @Override ConceptCodeVSCSDto create(); @Override @Transactional ConceptCodeDto create(ConceptCodeDto created); @Override @Transactional(rollbackFor = DataIntegrityViolationException.class) ConceptCodeDto conceptCodeBatchUpload(ConceptCodeDto conceptCodeDto,
			MultipartFile file, String codeSystemId, Long codeSystemVersionId,
			List<Long> valueSetIds); @Override List<ValueSet> findValueSetsByCodeSystem(String codeSystem,
			String codeSystemVersion); }
ConceptCodeServiceImpl implements ConceptCodeService { @Override public ConceptCodeVSCSDto create() throws ValueSetNotFoundException, CodeSystemVersionNotFoundException, CodeSystemNotFoundException { ConceptCodeVSCSDto conceptCodeVSCSDto = new ConceptCodeVSCSDto(); conceptCodeVSCSDto.setValueSetsMap(getAllValueSetsInMap()); List<CodeSystem> codeSystems = codeSystemRepository.findAll(); if (codeSystems == null || codeSystems.size() == 0) { logger.debug("No codeSystems found in the system"); throw new CodeSystemNotFoundException(); } conceptCodeVSCSDto.setCsVersions(valueSetMgmtHelper .createCSVersionsDTOFormEntity(codeSystems)); return conceptCodeVSCSDto; } ConceptCodeServiceImpl(int conceptCodePageSize,
			ConceptCodeRepository conceptCodeRepository,
			ValueSetRepository valueSetRepository,
			CodeSystemRepository codeSystemRepository,
			CodeSystemVersionRepository codeSystemVersionRepository,
			ConceptCodeValueSetRepository conceptCodeValueSetRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); @Override @Transactional(rollbackFor = ConceptCodeNotFoundException.class) ConceptCodeDto delete(Long conceptCodeId); @Override ConceptCodeDto findById(Long id); @Override @Transactional(rollbackFor = ConceptCodeNotFoundException.class) ConceptCodeDto update(ConceptCodeDto updated); @Override List<ConceptCodeDto> findAll(); @Override Map<String, Object> findAll(int pageNumber); @Override Map<String, Object> findAllByCode(String searchTerm,
			String codeSystem, String codeSystemVersion, String valueSetName,
			int pageNumber); @Override Map<String, Object> findAllByName(String searchTerm,
			String codeSystem, String codeSystemVersion, String valueSetName,
			int pageNumber); @Override ConceptCodeVSCSDto create(); @Override @Transactional ConceptCodeDto create(ConceptCodeDto created); @Override @Transactional(rollbackFor = DataIntegrityViolationException.class) ConceptCodeDto conceptCodeBatchUpload(ConceptCodeDto conceptCodeDto,
			MultipartFile file, String codeSystemId, Long codeSystemVersionId,
			List<Long> valueSetIds); @Override List<ValueSet> findValueSetsByCodeSystem(String codeSystem,
			String codeSystemVersion); final int CONCEPT_CODE_PAGE_SIZE; }