"Urine, hair, and meconium samples are sensitive biological markers of substance use. Urine drug screening can detect only recent substance exposure, while neonatal hair and meconium testing can document intrauterine use because meconium and hair form in the second and third trimester, respectively.38–41 By itself, a single positive test result cannot be used to diagnose substance dependence. Although child protection agencies sometimes request hair analyses, neither hair nor meconium is appropriate for routine clinical use because of the high costs and propensity for false positive results."

Source

Wong, Suzanne; Ordean, Alice; Kahan, Meldon, "Substance Use in Pregnancy," Society of Obstetricians and Gynaecologists of Canada: Ottawa, Ontario: April 2011.