def get_cui_if_exists(field_ids: list, remapped_cuis: dict):
    """
    Given a list of IDs present in a SemMedDB SUBJECT_CUI or OBJECT_CUI field, this function returns the CUI, if one
    exists (sometimes only NCBIGene IDs are present).
    """
    first_id = field_ids[0]
    if first_id.upper().startswith('C'):
        cui = remapped_cuis.get(first_id, first_id)  # Use remapped CUI if one exists
        return cui
    else:
        return None