Using a swab inside the cheek and a sophisticated computer algorithm, a DNA test recently approved by federal regulators promises to assess genetic risk of opioid addiction. The test’s maker says results give doctors and patients a crucial tool when considering use of the very pain pills that ignited the nation’s opioid crisis.