from typing import List
from typing import Set


def get_missing_internal_subtypes(st_vals: List[str],
                                  pos_subtypes_set: Set[str]) -> Set[str]:
    """Compare nested subtypes from the final subtype call to positive subtypes found

    Args:
        st_vals: Hierarchical subtype values
        pos_subtypes_set: Set of positive subtypes

    Returns:
        Set of missing nested hierarchical subtypes
    """
    out = set()
    for i in range(len(st_vals)):
        sub_subtype = '.'.join(st_vals[0: i + 1])
        if sub_subtype not in pos_subtypes_set:
            out.add(sub_subtype)
    return out