test_class.declarator: droolsConceptService
test_class.modifier: private
test_class.original_string: private DroolsConceptService droolsConceptService;
test_class.type: DroolsConceptService
test_class.var_name: droolsConceptService
test_class.file: snomed-drools-rf2-validator/src/test/java/org/ihtsdo/drools/validator/rf2/service/DroolsConceptServiceTest.java
test_class.identifier: DroolsConceptServiceTest
test_class.superclass: extends BaseServiceTest
test_case.body: @Test
      public void testFindStatedAncestorsOfConcept() {
          Concept concept = new DroolsConcept("1263005", true, "900000000000207008", "900000000000073002", true, true);
          Set<String> results = droolsConceptService.findStatedAncestorsOfConcept(concept);
          Assert.assertEquals(7, results.size());
  
          concept = new DroolsConcept("91832008", true, "900000000000207008", "900000000000073002", true, true);
          results = droolsConceptService.findStatedAncestorsOfConcept(concept);
          Assert.assertEquals(2, results.size());
      }
test_case.class_method_signature: DroolsConceptServiceTest.testFindStatedAncestorsOfConcept()
test_case.full_signature: @Test public void testFindStatedAncestorsOfConcept()
test_case.identifier: testFindStatedAncestorsOfConcept
test_case.invocations: findStatedAncestorsOfConcept assertEquals size findStatedAncestorsOfConcept assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFindStatedAncestorsOfConcept()
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.file: snomed-drools-rf2-validator/src/main/java/org/ihtsdo/drools/validator/rf2/service/DroolsConceptService.java
focal_class.identifier: DroolsConceptService
focal_class.interfaces: implements ConceptService
focal_class.class_method_signature: DroolsConceptService.DroolsConceptService(SnomedDroolsComponentRepository repository)
focal_class.full_signature: public  DroolsConceptService(SnomedDroolsComponentRepository repository)
focal_class.identifier: DroolsConceptService
focal_class.modifiers: public
focal_class.parameters: (SnomedDroolsComponentRepository repository)
focal_class.signature:  DroolsConceptService(SnomedDroolsComponentRepository repository)
focal_class.class_method_signature: DroolsConceptService.isActive(String conceptId)
focal_class.full_signature: @Override public boolean isActive(String conceptId)
focal_class.identifier: isActive
focal_class.modifiers: @Override public
focal_class.parameters: (String conceptId)
focal_class.return: boolean
focal_class.signature: boolean isActive(String conceptId)
focal_class.class_method_signature: DroolsConceptService.findById(String conceptId)
focal_class.full_signature: @Override public Concept findById(String conceptId)
focal_class.identifier: findById
focal_class.modifiers: @Override public
focal_class.parameters: (String conceptId)
focal_class.return: Concept
focal_class.signature: Concept findById(String conceptId)
focal_class.class_method_signature: DroolsConceptService.getAllTopLevelHierarchies()
focal_class.full_signature: @Override public Set<String> getAllTopLevelHierarchies()
focal_class.identifier: getAllTopLevelHierarchies
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Set<String>
focal_class.signature: Set<String> getAllTopLevelHierarchies()
focal_class.class_method_signature: DroolsConceptService.findStatedAncestorsOfConcept(Concept concept)
focal_class.full_signature: @Override public Set<String> findStatedAncestorsOfConcept(Concept concept)
focal_class.identifier: findStatedAncestorsOfConcept
focal_class.modifiers: @Override public
focal_class.parameters: (Concept concept)
focal_class.return: Set<String>
focal_class.signature: Set<String> findStatedAncestorsOfConcept(Concept concept)
focal_class.class_method_signature: DroolsConceptService.findTopLevelHierarchiesOfConcept(Concept concept)
focal_class.full_signature: @Override public Set<String> findTopLevelHierarchiesOfConcept(Concept concept)
focal_class.identifier: findTopLevelHierarchiesOfConcept
focal_class.modifiers: @Override public
focal_class.parameters: (Concept concept)
focal_class.return: Set<String>
focal_class.signature: Set<String> findTopLevelHierarchiesOfConcept(Concept concept)
focal_class.class_method_signature: DroolsConceptService.findStatedAncestorsOfConcepts(List<String> conceptIds)
focal_class.full_signature: @Override public Set<String> findStatedAncestorsOfConcepts(List<String> conceptIds)
focal_class.identifier: findStatedAncestorsOfConcepts
focal_class.modifiers: @Override public
focal_class.parameters: (List<String> conceptIds)
focal_class.return: Set<String>
focal_class.signature: Set<String> findStatedAncestorsOfConcepts(List<String> conceptIds)
focal_method.body: @Override
  	public Set<String> findStatedAncestorsOfConcept(Concept concept) {
  		if(concept == null || concept.getId().equals(Constants.ROOT_CONCEPT)) {
  			return Collections.emptySet();
  		}
  		DroolsConcept droolsConcept = repository.getConcept(concept.getId());
  		Set<String> statedParents = new HashSet<>();
  		for (DroolsRelationship relationship : droolsConcept.getRelationships()) {
  			if(relationship.isActive() 
  					&& !relationship.isAxiomGCI() 
  					&& Constants.IS_A.equals(relationship.getTypeId())
  					&& Constants.STATED_RELATIONSHIP.equals(relationship.getCharacteristicTypeId())) {
  				statedParents.add(relationship.getDestinationId());
  			}
  		}
  		Set<String> resultSet = new HashSet<>(statedParents);
  		for (String statedParent : statedParents) {
  			resultSet.addAll(findStatedAncestorsOfConcept(repository.getConcept(statedParent)));
  		}
  		return resultSet;
  	}
focal_method.class_method_signature: DroolsConceptService.findStatedAncestorsOfConcept(Concept concept)
focal_method.full_signature: @Override public Set<String> findStatedAncestorsOfConcept(Concept concept)
focal_method.identifier: findStatedAncestorsOfConcept
focal_method.invocations: equals getId emptySet getConcept getId getRelationships isActive isAxiomGCI equals getTypeId equals getCharacteristicTypeId add getDestinationId addAll findStatedAncestorsOfConcept getConcept
focal_method.modifiers: @Override public
focal_method.parameters: (Concept concept)
focal_method.return: Set<String>
focal_method.signature: Set<String> findStatedAncestorsOfConcept(Concept concept)