def build_interlock_status(device):
    """
    Builds an integer representation of the interlock bit-field.
    :param device: the lewis device
    :return: int representation of the bit field
    """
    interlocks = device.get_interlocks()

    bit = 1
    result = 0
    for ilk in interlocks.values():
        result += bit if ilk else 0
        bit *= 2

    return result