The drug, which contains a tiny ingestible sensor, is designed for patients with mental illness.