# Example 1: 30mg PO Oxycodone to PO Morphine (No reduction)
# 30 * 1.5 = 45 MME
opioid_conversion_calculator("oxycodone", "po", 30, "morphine", "po")
# Example 2: 2mg IV Hydromorphone to PO Oxycodone with 25% reduction
# 2 * 20 = 40 MME. Reduce 25% = 30 MME. 30 / 1.5 = 20 mg Oxycodone.
opioid_conversion_calculator("hydromorphone", "iv", 2, "oxycodone", "po", 25)
Run the code above in your browser using DataLab