Morphine Milligram Equivalent (MME) Calculator: APIs, Containers and Samples
The calculator accepts two parameters:
- the RxNorm RxCUI (the drug identifier), which is used to retrieve the RxNorm normalized drug name
- the sig, free-text instructions from the prescriber or pharmacist indicating how the patient should use the medication
The sig is used to establish a maximum or total daily dose. The normalized drug name is used to identify active opioids and their strengths, so that a total daily dose in milligrams (or the appropriate unit of measure) can be established. Finally, using the appropriate conversion factor, which sometimes requires additional information on the route or form of the drug, a maximum morphine milligram equivalence per day is calculated.
The result is returned along with analysis of the medications and sigs. The analysis breaks down the parsed and calculated information, and includes a confidence rating on the information, along with any explanation of failures. Currently, if there are any failures, the calculator returns a "no-confidence" result.
The calculator makes no recommendations regarding the safety of the maximum MME per day, that is instead left up to calling services (like clinical decision support services), which should analyze the calculated result and the confidence of the calculation before making a recommendation.
Installing the NuGet Package
To use the calculator in your own project, add the package:
dotnet add package PracticeFusion.MmeCalculator.Core
See the sample CLI for more information on how to use the calculator.
- From the
src
directory, run:
$ docker build -f Samples/PracticeFusion.MmeCalculator.WebDemo/Dockerfile . -t mmewebdemo
$ docker run -d -p 80:80 --name mmewebdemo mmewebdemo
- Browse to http://localhost/ to see the demo
- Browse to http://localhost/docs to view the api documentation.
The web demo gives you a quick example of how to pass a sig and an RxNorm ID, and get a calculated MME in response:
The demo also includes a simple example of just parsing a sig:
- From the
src
directory, run:
$ docker build -f Tools/PracticeFusion.MmeCalculator.Cli/Dockerfile . -t mmecli
- Run an instance to see the help:
$ docker run -i --rm mmecli --help
Usage:
mmecalculator [options] [command]
Options:
-i, --input <input> input file (if not present, will use stdin)
-o, --output <output> output file (if not present, will use stdout)
-ow, --overwrite overwrite the output file if it exists [default: False]
-of, --outputFormat <Basic|Debug|DebugFormatted> output format (basic, debug) [default: Basic]
--version Show version information
-?, -h, --help Show help and usage information
Commands:
calculate
parsesig
antlrperf
We want to make contributing to this project as simple as possible, and we are grateful to the community for contributing bug fixes, feature requests and code improvments. Read below to learn how you can take part in improving the MME calculator.
To report a bug click here and fill in the template. We'll look at it as soon as we can.
To request a new feature click here and fill in the template.
Read our Contributing Guide
We have adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text.
- Project homepage: https://github.com/practicefusion/mmecalculator
- Issue tracker: https://github.com/practicefusion/mmecalculator/issues
- In case of sensitive bugs like security vulnerabilities, please contact [email protected] directly instead of using the issue tracker. We value your effort to improve the security and privacy of this project!
- Special thanks to the following:
- Dr. David Hurwitz, Dr. Geoff Caplea, Ken Sheppard, Alex Dove, Jeff Carter
- Dr. Ken Kawamoto (via support from contracts HHS 75P00119F80176 and HHS 75P00120F80182 managed by Security Risk Solutions, Inc.), and the sig parsing for the OpenCDS project.
The Practice Fusion MME Calculator is licensed under the MIT license.