Takes a family tree structure and a concept ID and generates an ancestor table showing descendant relationships and path information.

.familyTreeToAncestorTable(familyTree, conceptId)

Arguments

familyTree

A tibble containing parent-child concept relationships

conceptId

The concept ID to generate the ancestor table for

Value

A tibble containing:

  • descendant_concept_id - The descendant concept IDs

  • levels - String showing min and max levels of the relationship

  • paths - Number of paths to reach the descendant