|
87 | 87 | } |
88 | 88 |
|
89 | 89 | #(?:with|\bc\.|before|\ba|\ba\.|after|\bp|\bp\.|in the|at|every) |
| 90 | +# NOTE: attempting to exclude UMS by excluding "morning and" |
90 | 91 | WHEN = { |
91 | | - 'in the morning': [ r'(?:in the|every|each)\s?(?:morn(?:ing)?|a m\b|am)', r'a m\b', r'\bam\b', r'\bqam\b', r'q am\b' ], |
| 92 | + 'in the morning': [ r'(?:in the|every|each)\s?(?:morning|morn(?!ing)|a m\b|am)(?! and)', r'a m\b', r'\bam\b', r'\bqam\b', r'q am\b' ], |
92 | 93 | 'in the afternoon': [ r'(?:in the|every|each|at)\s?(?:aft(?:ernoon)?|p m\b|pm)', r'\bqpm\b', 'q afternoon' ], |
93 | 94 | 'in the evening at bedtime': [r'(?:in the|every)\s?evening at bed(?:\s)?time'], |
94 | 95 | 'in the evening': [ r'(?:in the|every|each)\s?eve(?:ning)?(?! at bed(?:\s)?time)' ], |
95 | 96 | 'at night': [ r'(?:in the|at|every|each)\s?night(?! at bed(?:\s)?time)', r'nightly(?! at bed(?:\s)?time)' ], |
96 | 97 | 'at bedtime': [ r'(?!eve(?:ning) )(?:in the|at|every|before|every night at|nightly at|each)\s?bed(?:\s)?time', r'\bqhs\b', r'q hs\b', r'bed(?:\s)?time', r'\bhs\b' ], |
97 | 98 | 'with meal': [ r'(?:with|each|every|at)?\s?meal(?:s)?', r'c c\b', r'\bcc\b' ], |
98 | | - 'with breakfast': [ r'(?:with|each|every|at)? breakfast' ], |
| 99 | + 'with breakfast and lunch': [], |
| 100 | + 'with breakfast and dinner': [], |
| 101 | + 'with breakfast': [ r'(?:with|each|every|at)? breakfast(?! and lunch| and dinner)' ], |
99 | 102 | 'with lunch': [ r'(?:with|each|every|at)?\s?lunch', r'\bcd\b', r'c d\b' ], |
100 | 103 | 'with dinner': [ r'(?:with|each|every|at)?\s?dinner', r'\bcv\b', r'c v\b' ], |
101 | 104 | 'before meal': [ r'before meal(?:s)?', r'\bac\b', r'a c\b' ], |
|
196 | 199 | 'vaginally': ['vaginal', r'(?:in to|into|in|per)(?: the)? vagina', r'p\.v\.', r'pv\b'], |
197 | 200 | 'into the uterus': ['intrauterine', 'uterus'], |
198 | 201 | 'under the tongue': ['sublingually', 'sublingual', r'under (?:the )?tongue', r'sub(?: |-)?lingual(?:ly)?', r'\bs\.l\.\b', r'\bsl\b'], |
199 | | - 'under the skin': ['subcutaneously', 'subcutaneous', r'(?:into|in|under) (?:the )?skin', r'sub(?: |-)*cutaneous(?:ly)?', r'subq\b', r'sub\.q\.', r'sc\b', r'subcu\b', r's\.c\.', r'sq\b', r's\.q\.', 's/q'], |
| 202 | + 'under the skin': ['subcutaneously', 'subcutaneous', r'(?<!massage )(?:into|in|under) (?:the )?skin', r'sub(?: |-)*cutaneous(?:ly)?', r'subq\b', r'sub\.q\.', r'sc\b', r'subcu\b', r's\.c\.', r'sq\b', r's\.q\.', 's/q'], |
200 | 203 | 'rectally': ['rectal', r'p\.r\.\b', r'pr\b', r'in(?:to)* (?:the )?(?:butt|anus|rectum)'], |
201 | 204 | 'into the muscle': ['intramuscularly', r'i\.m\.\b', r'\bim\b', 'intramuscular', r'in(?:to)?(?: the)? muscle', 'intramuscularrly'], |
202 | 205 | 'intravenously': [r'i\.v\.', r'\biv\b', 'intravenous'], |
|
219 | 222 | 'swish and swallow': [], |
220 | 223 | 'miscellaneous': ['misc', 'device', 'meter', 'needle', 'pen needle', 'strip', r'(?:test )?strip(?:s)', r'test(?:ing)?', r'check(?:ing|s)?', 'monitor'], |
221 | 224 | 'subdermal': [], |
| 225 | + 'to the mouth or throat': [], |
| 226 | + 'scalp': ['scalp area'], |
222 | 227 | } |
223 | 228 |
|
224 | 229 | """ |
|
350 | 355 | 'topically': [r'topical\b', r'\btop\b', 'application', 'apply', 'patch'], |
351 | 356 | 'affected areas': [r'involved (?:areas|sites)'], |
352 | 357 | 'affected area': [r'\baa\b', r'involved (?:area|site)\b'], |
| 358 | + 'affected and surrounding areas': [], |
353 | 359 | 'back': [], |
354 | 360 | 'scalp': [], |
355 | 361 | 'torso': [], |
|
377 | 383 | } |
378 | 384 |
|
379 | 385 | # TODO: add a lot more here (mL, mcg, g, etc) |
| 386 | +# NOTE: moved unit here - need to do more testing |
380 | 387 | STRENGTH_UNITS = { |
381 | 388 | 'mg': [r'(?:milligram(?:s)?|mgs)\b'], |
382 | 389 | 'mcg': [r'(?:microgram(?:s)?|mcgs)\b'], |
383 | 390 | 'g': [r'(?:gm|gms|gram(?:s)?)\b'], |
384 | 391 | 'international unit': [r'i\.u\.\b', r'iu\b', 'international units', r'int\'l unit(?:s)?', r'intl unit(?:s)?'], |
| 392 | + 'unit': [r'units', r'un\b', r'u\b'], |
385 | 393 | 'mEq': [r'milliequivalent(?:s)?'], |
386 | 394 | } |
387 | 395 |
|
|
439 | 447 | 'oz': ['ounce'], |
440 | 448 | 'cm': ['centimeter', r'cm\b', r'cms\b'], |
441 | 449 | 'inch': [], |
442 | | - 'unit': [r'units', r'un\b', r'u\b'], |
443 | 450 | 'teaspoon': [r'tsp\b', 'teaspoons', 'teaspoonsful', 'teaspoonful', 'teaspoonfuls'], |
444 | 451 | 'tablespoon': [r'tbsp\b', 'tablespoon', 'tablespoonsful', 'tablespoonful', 'tablespoonfuls'], |
445 | 452 | # tablet |
|
0 commit comments