from pathlib import Path
import yaml


def get_fhir_version_from_sushi_config(base_path: Path) -> str:
    """
    Get the FHIR version from the SUSHI config file.

    :param base_path: Path to the SUSHI config file
    :return: FHIR version string
    """
    conf_filename = base_path / "sushi-config.yaml"
    if not conf_filename.exists():
        raise FileNotFoundError(f"Could not find {conf_filename}")

    with open(conf_filename, "r") as f:
        conf = yaml.safe_load(f)
        fhir_version = conf["fhirVersion"]

    return fhir_version