I think you've to tell more about your background before you can define a project and whenever it makes sense to solve these with a RPi or not. Basically there are two major concepts of drug (whatever we define as a drug) testings.. The immunoassay based ones (e.g. ELISA etc.) and the mass spec based one. The immunoassays are mostly somehow color based (e.g. VIS, IR). There you could probably build some sort of a spectrometer to get a readout of those tests (see if and in which range they're linear etc.). The tests are already available and validated/certified so you don't have to deal with this part. For the mass spec (GC-/LC-MS) based measurements.. this is most likely an overkill for your project.. Firstly, cause initial costs for such a mass spec system starts somewhere around 100k$-500k$ (well, there's not really an end..
). Secondly, there's not much you can use an RPi for it.. Control software is highly vendor specific and proprietary (no wonder, a software license starts at 5k$
). Analyze the data-sets after measurement can mostly be done with the same software, and otherwise the datastructure isn't as funny to work with.. There are a few opensource libs to do so.. but nobody will do this on a RPi..
So the only way I see is if you build something like a colorimeter (https://en.wikipedia.org/wiki/Colorimeter_(chemistry)
) and try to find an already validated immunoassay which is based on a color change for positive and negative. If you want to keep the same concept (colorimeter) but on a lower budget, there are some nice photometric old fashioned tests to determine ions in water solutions (e.g. copper, nitrate, etc.).
For your own sake.. you don't want to work with blood samples trust me..
Saliva and urine are probably the only liquids a body offers which you probably want to work with.. Everything else opens a next rabbit hole.