test_class.declarator: droolsDescriptionService
test_class.modifier: private
test_class.original_string: private DroolsDescriptionService droolsDescriptionService;
test_class.type: DroolsDescriptionService
test_class.var_name: droolsDescriptionService
test_class.file: snomed-drools-rf2-validator/src/test/java/org/ihtsdo/drools/validator/rf2/service/DroolsDescriptionServiceTest.java
test_class.identifier: DroolsDescriptionServiceTest
test_class.superclass: extends BaseServiceTest
test_case.body: @Test
      public void testFindMatchingDescriptionsInHierachy() throws FileNotFoundException {
          //load a dummy concept which has duplicated description term with its parent
          repository.addConcept(FileLoaderTestUtils.fileToObject("data/1234567890.json", DroolsConcept.class));
          DroolsConcept testConcept = repository.getConcept("1234567890");
          DroolsDescription testDescription = null;
          for (DroolsDescription droolsDescription : testConcept.getDescriptions()) {
              testDescription = droolsDescription;
          }
          Set<Description> results = droolsDescriptionService.findMatchingDescriptionInHierarchy(testConcept, testDescription);
          Assert.assertEquals(1, results.size());
          for (Description result : results) {
              Assert.assertEquals("1204236014", result.getId());
          }
      }
test_case.class_method_signature: DroolsDescriptionServiceTest.testFindMatchingDescriptionsInHierachy()
test_case.full_signature: @Test public void testFindMatchingDescriptionsInHierachy()
test_case.identifier: testFindMatchingDescriptionsInHierachy
test_case.invocations: addConcept fileToObject getConcept getDescriptions findMatchingDescriptionInHierarchy assertEquals size assertEquals getId
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFindMatchingDescriptionsInHierachy()
focal_class.declarator: FULLY_SPECIFIED_NAME = "900000000000003001"
focal_class.modifier: private static final
focal_class.original_string: private static final String FULLY_SPECIFIED_NAME = "900000000000003001";
focal_class.type: String
focal_class.var_name: FULLY_SPECIFIED_NAME
focal_class.declarator: PREFERRED_ACCEPTABILITY = "900000000000548007"
focal_class.modifier: private static final
focal_class.original_string: private static final String PREFERRED_ACCEPTABILITY = "900000000000548007";
focal_class.type: String
focal_class.var_name: PREFERRED_ACCEPTABILITY
focal_class.declarator: repository
focal_class.modifier: private final
focal_class.original_string: private final SnomedDroolsComponentRepository repository;
focal_class.type: SnomedDroolsComponentRepository
focal_class.var_name: repository
focal_class.declarator: droolsDescriptionIndex
focal_class.modifier: private final
focal_class.original_string: private final DroolsDescriptionIndex droolsDescriptionIndex;
focal_class.type: DroolsDescriptionIndex
focal_class.var_name: droolsDescriptionIndex
focal_class.declarator: testResourceProvider
focal_class.modifier: private final
focal_class.original_string: private final TestResourceProvider testResourceProvider;
focal_class.type: TestResourceProvider
focal_class.var_name: testResourceProvider
focal_class.file: snomed-drools-rf2-validator/src/main/java/org/ihtsdo/drools/validator/rf2/service/DroolsDescriptionService.java
focal_class.identifier: DroolsDescriptionService
focal_class.interfaces: implements DescriptionService
focal_class.class_method_signature: DroolsDescriptionService.DroolsDescriptionService(SnomedDroolsComponentRepository repository, TestResourceProvider testResourceProvider)
focal_class.full_signature: public  DroolsDescriptionService(SnomedDroolsComponentRepository repository, TestResourceProvider testResourceProvider)
focal_class.identifier: DroolsDescriptionService
focal_class.modifiers: public
focal_class.parameters: (SnomedDroolsComponentRepository repository, TestResourceProvider testResourceProvider)
focal_class.signature:  DroolsDescriptionService(SnomedDroolsComponentRepository repository, TestResourceProvider testResourceProvider)
focal_class.class_method_signature: DroolsDescriptionService.getFSNs(Set<String> conceptIds, String... languageRefsetIds)
focal_class.full_signature: @Override public Set<String> getFSNs(Set<String> conceptIds, String... languageRefsetIds)
focal_class.identifier: getFSNs
focal_class.modifiers: @Override public
focal_class.parameters: (Set<String> conceptIds, String... languageRefsetIds)
focal_class.return: Set<String>
focal_class.signature: Set<String> getFSNs(Set<String> conceptIds, String... languageRefsetIds)
focal_class.class_method_signature: DroolsDescriptionService.findActiveDescriptionByExactTerm(String exactTerm)
focal_class.full_signature: @Override public Set<Description> findActiveDescriptionByExactTerm(String exactTerm)
focal_class.identifier: findActiveDescriptionByExactTerm
focal_class.modifiers: @Override public
focal_class.parameters: (String exactTerm)
focal_class.return: Set<Description>
focal_class.signature: Set<Description> findActiveDescriptionByExactTerm(String exactTerm)
focal_class.class_method_signature: DroolsDescriptionService.findInactiveDescriptionByExactTerm(String exactTerm)
focal_class.full_signature: @Override public Set<Description> findInactiveDescriptionByExactTerm(String exactTerm)
focal_class.identifier: findInactiveDescriptionByExactTerm
focal_class.modifiers: @Override public
focal_class.parameters: (String exactTerm)
focal_class.return: Set<Description>
focal_class.signature: Set<Description> findInactiveDescriptionByExactTerm(String exactTerm)
focal_class.class_method_signature: DroolsDescriptionService.findMatchingDescriptionInHierarchy(Concept concept, Description description)
focal_class.full_signature: @Override // FIXME: Currently only finds matching description in ancestors. // Should search all descendants of the second highest ancestor (the ancestor which is a direct child of root). public Set<Description> findMatchingDescriptionInHierarchy(Concept concept, Description description)
focal_class.identifier: findMatchingDescriptionInHierarchy
focal_class.modifiers: @Override // FIXME: Currently only finds matching description in ancestors. // Should search all descendants of the second highest ancestor (the ancestor which is a direct child of root). public
focal_class.parameters: (Concept concept, Description description)
focal_class.return: Set<Description>
focal_class.signature: Set<Description> findMatchingDescriptionInHierarchy(Concept concept, Description description)
focal_class.class_method_signature: DroolsDescriptionService.getCaseSensitiveWordsErrorMessage(Description description)
focal_class.full_signature: @Override public String getCaseSensitiveWordsErrorMessage(Description description)
focal_class.identifier: getCaseSensitiveWordsErrorMessage
focal_class.modifiers: @Override public
focal_class.parameters: (Description description)
focal_class.return: String
focal_class.signature: String getCaseSensitiveWordsErrorMessage(Description description)
focal_class.class_method_signature: DroolsDescriptionService.getLanguageSpecificErrorMessage(Description description)
focal_class.full_signature: @Override public String getLanguageSpecificErrorMessage(Description description)
focal_class.identifier: getLanguageSpecificErrorMessage
focal_class.modifiers: @Override public
focal_class.parameters: (Description description)
focal_class.return: String
focal_class.signature: String getLanguageSpecificErrorMessage(Description description)
focal_class.class_method_signature: DroolsDescriptionService.findParentsNotContainingSemanticTag(Concept concept, String termSematicTag, String... languageRefsetIds)
focal_class.full_signature: @Override public Set<String> findParentsNotContainingSemanticTag(Concept concept, String termSematicTag, String... languageRefsetIds)
focal_class.identifier: findParentsNotContainingSemanticTag
focal_class.modifiers: @Override public
focal_class.parameters: (Concept concept, String termSematicTag, String... languageRefsetIds)
focal_class.return: Set<String>
focal_class.signature: Set<String> findParentsNotContainingSemanticTag(Concept concept, String termSematicTag, String... languageRefsetIds)
focal_class.class_method_signature: DroolsDescriptionService.isRecognisedSemanticTag(String termSemanticTag)
focal_class.full_signature: @Override public boolean isRecognisedSemanticTag(String termSemanticTag)
focal_class.identifier: isRecognisedSemanticTag
focal_class.modifiers: @Override public
focal_class.parameters: (String termSemanticTag)
focal_class.return: boolean
focal_class.signature: boolean isRecognisedSemanticTag(String termSemanticTag)
focal_class.class_method_signature: DroolsDescriptionService.getDroolsDescriptionIndex()
focal_class.full_signature: public DroolsDescriptionIndex getDroolsDescriptionIndex()
focal_class.identifier: getDroolsDescriptionIndex
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: DroolsDescriptionIndex
focal_class.signature: DroolsDescriptionIndex getDroolsDescriptionIndex()
focal_method.body: @Override
  	// FIXME: Currently only finds matching description in ancestors.
  	// Should search all descendants of the second highest ancestor (the ancestor which is a direct child of root).
  	public Set<Description> findMatchingDescriptionInHierarchy(Concept concept, Description description) {
  		if(concept == null || concept.getId().equals(Constants.ROOT_CONCEPT)) {
  			return Collections.emptySet();
  		}
  		Set<Description> resultSet = new HashSet<>();
  
  		String languageCode = description.getLanguageCode();
  		String term = description.getTerm();
  		if(term == null || term.trim().isEmpty()) return Collections.emptySet();
  		
  		ConceptService conceptService = new DroolsConceptService(repository);
  		Set<String> conceptAncestorIds = conceptService.findStatedAncestorsOfConcept(concept);
  		for (String conceptAncestorId : conceptAncestorIds) {
  			Concept conceptAncestor = repository.getConcept(conceptAncestorId);
  			for (Description ancestorsDescription : conceptAncestor.getDescriptions()) {
  				if(ancestorsDescription.isActive() && ancestorsDescription.getLanguageCode().equals(languageCode)
  						&& ancestorsDescription.getTerm().equals(term)) {
  					resultSet.add(ancestorsDescription);
  				}
  			}
  		}
  		return resultSet;
  	}
focal_method.class_method_signature: DroolsDescriptionService.findMatchingDescriptionInHierarchy(Concept concept, Description description)
focal_method.full_signature: @Override // FIXME: Currently only finds matching description in ancestors. // Should search all descendants of the second highest ancestor (the ancestor which is a direct child of root). public Set<Description> findMatchingDescriptionInHierarchy(Concept concept, Description description)
focal_method.identifier: findMatchingDescriptionInHierarchy
focal_method.invocations: equals getId emptySet getLanguageCode getTerm isEmpty trim emptySet findStatedAncestorsOfConcept getConcept getDescriptions isActive equals getLanguageCode equals getTerm add
focal_method.modifiers: @Override // FIXME: Currently only finds matching description in ancestors. // Should search all descendants of the second highest ancestor (the ancestor which is a direct child of root). public
focal_method.parameters: (Concept concept, Description description)
focal_method.return: Set<Description>
focal_method.signature: Set<Description> findMatchingDescriptionInHierarchy(Concept concept, Description description)