def get_index_by_header(
    render_table, header_value, obj_cls=None, item_type=None
):
    """
    Return the column index based on field header value.

    :param render_table: Study/assay render table
    :param header_value: Header value
    :param obj_cls: Class of Dango model object for searched header (optional)
    :param item_type: Type of searched item in GenericMaterial (optional)
    :return: Int or None if not found
    """
    header_value = header_value.lower()
    obj_cls = obj_cls.__name__ if obj_cls else None
    for i, h in enumerate(render_table['field_header']):
        if (
            h['value'].lower() == header_value
            and (not obj_cls or h['obj_cls'] == obj_cls)
            and (not item_type or h['item_type'] == item_type)
        ):
            return i
    return None