Pharmaceuticals are meant to help patients become healthier. This requires consistent, high quality active pharmaceutical ingredients (APIs), responsible for the therapeutic benefits and which are formulated in the final medicinal products. Hence, potential impurities in the APIs are to be kept as low as possible, as they are most often toxic compounds.
For the related impurities, 3 thresholds are given in the European Pharmacopoeia monograph 2034 (substances for pharmaceutical use), based on the ICH guidelines: impurities above any of these thresholds require an action, which can be (1) to report, (2) to identify or (3) to toxicologically qualify them. The table below gives these thresholds, which are based on the maximum daily dose, and which are expressed in percentage and/or in quantity for the identification and qualification thresholds.
Compute the reporting, identification and qualification thresholds of organic impurities in active substances. You should do this in the following way:
Write a function mg2g that takes a quantity (float) expressed in milligrams, and returns that quantity expressed in grams (float).
Write a function threshold that takes three floating point arguments: i) a maximal daily dose $$mdd$$ (float, expressed in grams), ii) a maximal quantity of impurity $$q_i$$ (float, expressed in grams) and iii) a maximal percentage of impurity $$p_i$$ (float). The function should return the threshold $$t$$ (float) that is computed as \[ t = \min(100 \times \frac{q_i}{mdd}, p_i) \]
Write a function reportingThreshold that takes a maximal daily dose (float) expressed in grams. The function should return the reporting threshold of organic impurities in active substances (float).
Write a function identificationThreshold that takes a maximal daily dose (float) expressed in grams. The function should return the identification threshold of organic impurities in active substances (float).
Write a function qualificationThreshold that takes a maximal daily dose (float) expressed in grams. The function should return the qualification threshold of organic impurities in active substances (float).
>>> mg2g(0.5) 0.0005 >>> mg2g(1.0) 0.001 >>> mg2g(123.45) 0.12345 >>> threshold(0.5, 0.001, 0.10) 0.1 >>> threshold(2.0, 0.001, 0.10) 0.05 >>> threshold(3.0, 0.001, 0.10) 0.03333333333333333 >>> reportingThreshold(0.5) 0.05 >>> reportingThreshold(2.0) 0.05 >>> reportingThreshold(3.0) 0.03 >>> identificationThreshold(0.5) 0.1 >>> identificationThreshold(2.0) 0.05 >>> identificationThreshold(3.0) 0.05 >>> qualificationThreshold(0.5) 0.15 >>> qualificationThreshold(2.0) 0.05 >>> qualificationThreshold(3.0) 0.05