Skip to content

Commit 5bd73d7

Browse files
Merge pull request #89 from practicefusion/v1.2.2
V1.2.2
2 parents 3551984 + 6f1eb7b commit 5bd73d7

File tree

222 files changed

+7817
-5711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+7817
-5711
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,9 @@ console/mme.csv
364364
dataconsole/mme.csv
365365

366366
.DS_Store
367+
368+
src/.idea/
369+
370+
src/generate-test-file.sh
371+
372+
src/Grammar/antlr-4.9.3-complete.jar

CODE-OF-CONDUCT.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Contributor Covenant Code of Conduct
32

43
## Our Pledge
@@ -107,7 +106,7 @@ Violating these terms may lead to a permanent ban.
107106
### 4. Permanent Ban
108107

109108
**Community Impact**: Demonstrating a pattern of violation of community
110-
standards, including sustained inappropriate behavior, harassment of an
109+
standards, including sustained inappropriate behavior, harassment of an
111110
individual, or aggression toward or disparagement of classes of individuals.
112111

113112
**Consequence**: A permanent ban from any sort of public interaction within
@@ -119,15 +118,19 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119118
version 2.0, available at
120119
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
121120

122-
Community Impact Guidelines were inspired by
121+
Community Impact Guidelines were inspired by
123122
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124123

125124
For answers to common questions about this code of conduct, see the FAQ at
126-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
125+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
127126
at [https://www.contributor-covenant.org/translations][translations].
128127

129128
[homepage]: https://www.contributor-covenant.org
129+
130130
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
131+
131132
[Mozilla CoC]: https://github.com/mozilla/diversity
133+
132134
[FAQ]: https://www.contributor-covenant.org/faq
135+
133136
[translations]: https://www.contributor-covenant.org/translations

CONTRIBUTING.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# Contributing to the Practice Fusion MME Calculator
22

3-
Thank you for your interest in contributing to this project. From commenting on issues, to reviewing and sending Pull Requests, all contributions are welcome.
3+
Thank you for your interest in contributing to this project. From commenting on issues, to reviewing and sending Pull
4+
Requests, all contributions are welcome.
45

5-
The [Open Source Guides](https://opensource.guide/) website has a collection of resources for anyone who wants to learn how to [contribute to open source projects](https://opensource.guide/how-to-contribute/), along with a lot of other valuable information on open source.
6+
The [Open Source Guides](https://opensource.guide/) website has a collection of resources for anyone who wants to learn
7+
how to [contribute to open source projects](https://opensource.guide/how-to-contribute/), along with a lot of other
8+
valuable information on open source.
69

7-
As a reminder, all contributors are expected to adhere to the [Code of Conduct](https://github.com/practicefusion/mmecalculator/blob/master/CODE-OF-CONDUCT.md).
10+
As a reminder, all contributors are expected to adhere to
11+
the [Code of Conduct](https://github.com/practicefusion/mmecalculator/blob/master/CODE-OF-CONDUCT.md).
812

913
## Ways to Contribute
10-
14+
1115
1. Contribute fixes, improvements and documentation
1216
2. Replying to and assisting with open issues
1317
3. Reviewing pull requests
@@ -16,15 +20,20 @@ As a reminder, all contributors are expected to adhere to the [Code of Conduct](
1620

1721
## Development Process
1822

19-
We use GitHub issues and pull requests to track bugs and contributions from the community, including Practice Fusion engineers. All changes are handled through pull requests, and before they are approved, the changes must meet the standards outlined in the [Contributing Code](#contributing-code) section below, including a review by Practice Fusion clinicians if there are any changes that might affect the clinical nature of the calculation results.
23+
We use GitHub issues and pull requests to track bugs and contributions from the community, including Practice Fusion
24+
engineers. All changes are handled through pull requests, and before they are approved, the changes must meet the
25+
standards outlined in the [Contributing Code](#contributing-code) section below, including a review by Practice Fusion
26+
clinicians if there are any changes that might affect the clinical nature of the calculation results.
2027

2128
### Changing Parsing Rules
2229

23-
Changes to the grammar require care and a lot of testing. Please follow the [guidelines](./src/Grammar/) when planning and developing grammar changes.
30+
Changes to the grammar require care and a lot of testing. Please follow the [guidelines](./src/Grammar/) when planning
31+
and developing grammar changes.
2432

25-
### Testing
33+
### Testing
2634

27-
Code coverage is generated using [Coverlet](https://github.com/coverlet-coverage/coverlet). We aim for more than 90% coverage, with the exclusions documented in the [coverlet runsettings](./src/coverlet.runsettings) file.
35+
Code coverage is generated using [Coverlet](https://github.com/coverlet-coverage/coverlet). We aim for more than 90%
36+
coverage, with the exclusions documented in the [coverlet runsettings](./src/coverlet.runsettings) file.
2837

2938
## Versioning Process
3039

@@ -36,7 +45,8 @@ We use MinVer.
3645

3746
## Workflow
3847

39-
Code-level contributions must be made through pull requests. This is done by forking the repository, making the changes locally, and using the testing projects to validate the changes you've made.
48+
Code-level contributions must be made through pull requests. This is done by forking the repository, making the changes
49+
locally, and using the testing projects to validate the changes you've made.
4050

4151
We recommend using the following workflow:
4252

README.md

Lines changed: 61 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,76 @@
11
[![CI](https://github.com/practicefusion/mmecalculator/actions/workflows/ci.yml/badge.svg)](https://github.com/practicefusion/mmecalculator/actions/workflows/ci.yml)
22

33
# Practice Fusion MME Calculator
4+
45
> Morphine Milligram Equivalent (MME) Calculator: APIs, Containers and Samples
56
6-
The calculator accepts two parameters:
7+
The calculator accepts two parameters:
78

8-
1. the [RxNorm](https://www.nlm.nih.gov/research/umls/rxnorm/overview.html) RxCUI (the drug identifier), which is used to retrieve the RxNorm normalized drug name
9-
2. the *sig*, free-text instructions from the prescriber or pharmacist indicating how the patient should use the medication
9+
1. the [RxNorm](https://www.nlm.nih.gov/research/umls/rxnorm/overview.html) RxCUI (the drug identifier), which is used
10+
to retrieve the RxNorm normalized drug name
11+
2. the *sig*, free-text instructions from the prescriber or pharmacist indicating how the patient should use the
12+
medication
1013

11-
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](https://www.hhs.gov/guidance/sites/default/files/hhs-guidance-documents/Opioid%20Morphine%20EQ%20Conversion%20Factors%20%28vFeb%202018%29.pdf), which sometimes requires additional information on the route or form of the drug, a maximum morphine milligram equivalence per day is calculated.
14+
The *sig* is used to establish a maximum or total daily dose. The normalized drug name is used to identify active
15+
opioids and their strengths, so that a total daily dose in milligrams (or the appropriate unit of measure) can be
16+
established. Finally, using the
17+
appropriate [conversion factor](https://www.hhs.gov/guidance/sites/default/files/hhs-guidance-documents/Opioid%20Morphine%20EQ%20Conversion%20Factors%20%28vFeb%202018%29.pdf),
18+
which sometimes requires additional information on the route or form of the drug, a maximum morphine milligram
19+
equivalence per day is calculated.
1220

13-
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.
21+
The result is returned along with analysis of the medications and sigs. The analysis breaks down the parsed and
22+
calculated information, and includes a confidence rating on the information, along with any explanation of failures.
23+
Currently, if there are any failures, the calculator returns a "no-confidence" result.
1424

15-
The calculator makes no recommendations regarding the [safety of the maximum MME per day](https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf), 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.
25+
The calculator makes no recommendations regarding
26+
the [safety of the maximum MME per day](https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf), that
27+
is instead left up to calling services (like clinical decision support services), which should analyze the calculated
28+
result and the confidence of the calculation before making a recommendation.
1629

1730
## Installing / Getting started
1831

1932
### Installing the [NuGet Package](https://www.nuget.org/packages/PracticeFusion.MmeCalculator.Core)
33+
2034
To use the calculator in your own project, add the package:
35+
2136
```
2237
dotnet add package PracticeFusion.MmeCalculator.Core
2338
```
39+
2440
See the sample CLI for more information on how to use the calculator.
2541

2642
### Running the web demo in a docker image
43+
2744
1. From the `src` directory, run:
45+
2846
```
2947
$ docker build -f Samples/PracticeFusion.MmeCalculator.WebDemo/Dockerfile . -t mmewebdemo
3048
$ docker run -d -p 80:80 --name mmewebdemo mmewebdemo
3149
```
50+
3251
2. Browse to http://localhost/ to see the demo
3352
3. Browse to http://localhost/docs to view the api documentation.
3453

54+
#### Web demo examples
55+
56+
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:
57+
58+
![A screenshot of the MME Calculator Demo web page, showing an MME calculation](docs/images/mme-calculator-demo.png?raw=true "Calculating MME")
59+
60+
The demo also includes a simple example of just parsing a sig:
61+
62+
![A screenshot of the MME Calculator Demo web page, showing a parsed sig](docs/images/sig-parser-demo.png?raw=true "Parsing sigs")
63+
3564
### Running the sample CLI in a docker image
65+
3666
1. From the `src` directory, run:
67+
3768
```
3869
$ docker build -f Tools/PracticeFusion.MmeCalculator.Cli/Dockerfile . -t mmecli
3970
```
71+
4072
2. Run an instance to see the help:
73+
4174
```
4275
$ docker run -i --rm mmecli --help
4376
@@ -60,36 +93,49 @@ Commands:
6093

6194
## How to Contribute
6295

63-
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.
96+
We want to make contributing to this project as simple as possible, and we are grateful to the community for
97+
contributing bug fixes, feature requests and code improvments. Read below to learn how you can take part in improving
98+
the MME calculator.
6499

65100
### Bug reports
66101

67-
To report a bug [click here](https://github.com/practicefusion/mmecalculator/issues/new?assignees=&labels=&template=bug_report.md&title=) and fill in the template. We'll look at it as soon as we can.
102+
To report a
103+
bug [click here](https://github.com/practicefusion/mmecalculator/issues/new?assignees=&labels=&template=bug_report.md&title=)
104+
and fill in the template. We'll look at it as soon as we can.
68105

69106
### Feature Requests
70107

71-
To request a new feature [click here](https://github.com/practicefusion/mmecalculator/issues/new?assignees=&labels=&template=feature_request.md&title=) and fill in the template.
108+
To request a new
109+
feature [click here](https://github.com/practicefusion/mmecalculator/issues/new?assignees=&labels=&template=feature_request.md&title=)
110+
and fill in the template.
72111

73112
### Contributing Guide
74113

75114
Read our [Contributing Guide](https://github.com/practicefusion/mmecalculator/blob/master/CONTRIBUTING.md)
76115

77116
### [Code of Conduct](https://github.com/practicefusion/mmecalculator/blob/master/CODE-OF-CONDUCT.md)
78-
We have adopted a Code of Conduct that we expect project participants to adhere to. Please read the [full text](https://github.com/practicefusion/mmecalculator/blob/master/CODE-OF-CONDUCT.md).
117+
118+
We have adopted a Code of Conduct that we expect project participants to adhere to. Please read
119+
the [full text](https://github.com/practicefusion/mmecalculator/blob/master/CODE-OF-CONDUCT.md).
79120

80121
## Links
81122

82123
- Project homepage: https://github.com/practicefusion/mmecalculator
83124
- Issue tracker: https://github.com/practicefusion/mmecalculator/issues
84-
- In case of sensitive bugs like security vulnerabilities, please contact [security@practicefusion.com](mailto:security@practicefusion.com) directly instead of using the issue tracker. We value your effort to improve the security and privacy of this project!
125+
- In case of sensitive bugs like security vulnerabilities, please
126+
contact [security@practicefusion.com](mailto:security@practicefusion.com) directly instead of using the issue
127+
tracker. We value your effort to improve the security and privacy of this project!
85128
- Special thanks to the following:
86-
- [Dr. David Hurwitz](https://github.com/dphurwitz), [Dr. Geoff Caplea](https://github.com/gcapmd), [Ken Sheppard](https://github.com/ken-sheppard), [Alex Dove](https://github.com/ardove), [Jeff Carter](https://github.com/codecarter9)
87-
- 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](https://bitbucket.org/opencds/fhir-utils/src/master/src/main/java/org/opencds/RxSig.java).
88-
129+
- [Dr. David Hurwitz](https://github.com/dphurwitz), [Dr. Geoff Caplea](https://github.com/gcapmd), [Ken Sheppard](https://github.com/ken-sheppard), [Alex Dove](https://github.com/ardove), [Jeff Carter](https://github.com/codecarter9)
130+
- Dr. Ken Kawamoto (via support from contracts HHS 75P00119F80176 and HHS 75P00120F80182 managed by Security Risk
131+
Solutions, Inc.), and the sig parsing for
132+
the [OpenCDS project](https://bitbucket.org/opencds/fhir-utils/src/master/src/main/java/org/opencds/RxSig.java).
133+
89134
## Maintainers
90135

91136
[@JonathanMalek](https://github.com/JonathanMalek)
92137

93138
## License
94139

95-
The Practice Fusion MME Calculator is licensed under the [MIT license](https://github.com/practicefusion/mmecalculator/blob/master/LICENSE).
140+
The Practice Fusion MME Calculator is licensed under
141+
the [MIT license](https://github.com/practicefusion/mmecalculator/blob/main/LICENSE).

SECURITY.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
The following versions are supported with security updates.
66

77
| Version | Supported |
8-
| ------- | ------------------ |
8+
|---------|--------------------|
99
| 1.2.x | :white_check_mark: |
1010
| 1.1.x | :white_check_mark: |
1111
| 1.0.x | :white_check_mark: |
1212
| < 1.0 | :x: |
1313

1414
## Reporting a Vulnerability
1515

16-
To report sensitive bugs like security vulnerabilities, please contact security@practicefusion.com directly instead of using the issue tracker. We value your effort to improve the security and privacy of this project!
16+
To report sensitive bugs like security vulnerabilities, please contact security@practicefusion.com directly instead of
17+
using the issue tracker. We value your effort to improve the security and privacy of this project!

docs/images/mme-calculator-demo.png

57 KB
Loading

docs/images/sig-parser-demo.png

62.5 KB
Loading

src/.editorconfig

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ dotnet_style_allow_statement_immediately_after_block_experimental = true
7676

7777
# var preferences
7878
csharp_style_var_elsewhere = false
79-
csharp_style_var_for_built_in_types =true:silent
80-
csharp_style_var_when_type_is_apparent =true:silent
79+
csharp_style_var_for_built_in_types = true:silent
80+
csharp_style_var_when_type_is_apparent = true:silent
8181

8282
# Expression-bodied members
8383
csharp_style_expression_bodied_accessors = true
@@ -101,7 +101,7 @@ csharp_style_conditional_delegate_call = true
101101

102102
# Modifier preferences
103103
csharp_prefer_static_local_function = true
104-
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
104+
csharp_preferred_modifier_order = public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async
105105

106106
# Code-block preferences
107107
csharp_prefer_braces = true
@@ -196,24 +196,24 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
196196

197197
dotnet_naming_symbols.interface.applicable_kinds = interface
198198
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
199-
dotnet_naming_symbols.interface.required_modifiers =
199+
dotnet_naming_symbols.interface.required_modifiers =
200200

201201
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
202202
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
203-
dotnet_naming_symbols.types.required_modifiers =
203+
dotnet_naming_symbols.types.required_modifiers =
204204

205205
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
206206
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
207-
dotnet_naming_symbols.non_field_members.required_modifiers =
207+
dotnet_naming_symbols.non_field_members.required_modifiers =
208208

209209
# Naming styles
210210

211-
dotnet_naming_style.pascal_case.required_prefix =
212-
dotnet_naming_style.pascal_case.required_suffix =
213-
dotnet_naming_style.pascal_case.word_separator =
211+
dotnet_naming_style.pascal_case.required_prefix =
212+
dotnet_naming_style.pascal_case.required_suffix =
213+
dotnet_naming_style.pascal_case.word_separator =
214214
dotnet_naming_style.pascal_case.capitalization = pascal_case
215215

216216
dotnet_naming_style.begins_with_i.required_prefix = I
217-
dotnet_naming_style.begins_with_i.required_suffix =
218-
dotnet_naming_style.begins_with_i.word_separator =
217+
dotnet_naming_style.begins_with_i.required_suffix =
218+
dotnet_naming_style.begins_with_i.word_separator =
219219
dotnet_naming_style.begins_with_i.capitalization = pascal_case

0 commit comments

Comments
 (0)