from typing import List
from typing import Dict
from typing import Set


def check_instances_availability(
    fsh_profiles: List[Dict], fsh_instances: List[Dict], abstract_profiles: Set[str]
) -> List[str]:
    """
    Check if at least one instance exists for each defined profile extracted from FSH file.

    :param fsh_profiles: List of profile defined in FSH file
    :param fsh_instances: List of instances defined in FSH file
    :param abstract_profiles: Set of abstract profiles
    :return: List of profiles without instances
    """
    profiles_without_instance = []

    for p in fsh_profiles:
        if p["id"] in abstract_profiles:
            continue

        if not any(i["instanceof"] == p["id"] for i in fsh_instances):
            profiles_without_instance.append(p["id"])

    return profiles_without_instance