Skip to content

Morphine Milligram Equivalent (MME) Calculator: APIs, Containers and Samples

License

Notifications You must be signed in to change notification settings

practicefusion/mmecalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI

Practice Fusion MME Calculator

Morphine Milligram Equivalent (MME) Calculator: APIs, Containers and Samples

The calculator accepts two parameters:

  1. the RxNorm RxCUI (the drug identifier), which is used to retrieve the RxNorm normalized drug name
  2. 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 / Getting started

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.

Running the web demo in a docker image

  1. From the src directory, run:
$ docker build -f Samples/PracticeFusion.MmeCalculator.WebDemo/Dockerfile . -t mmewebdemo
$ docker run -d -p 80:80 --name mmewebdemo mmewebdemo
  1. Browse to http://localhost/ to see the demo
  2. Browse to http://localhost/docs to view the api documentation.

Web demo examples

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:

A screenshot of the MME Calculator Demo web page, showing an MME calculation

The demo also includes a simple example of just parsing a sig:

A screenshot of the MME Calculator Demo web page, showing a parsed sig

Running the sample CLI in a docker image

  1. From the src directory, run:
$ docker build -f Tools/PracticeFusion.MmeCalculator.Cli/Dockerfile . -t mmecli
  1. 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

How to Contribute

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.

Bug reports

To report a bug click here and fill in the template. We'll look at it as soon as we can.

Feature Requests

To request a new feature click here and fill in the template.

Contributing Guide

Read our Contributing Guide

We have adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text.

Links

Maintainers

@JonathanMalek

License

The Practice Fusion MME Calculator is licensed under the MIT license.