Documents shed light on why Rhode Island doctor was detained