🧠ParseRx
A modern, lightweight medication sig parser.
GitHub repo
Getting started
Input free text medication sigs, output discrete sig elements.
- Extract method, dose, strength, frequency, route, duration, indication, and additional info
- Calculate maximum daily dose (preferring explicit MDD in sig over maximum possible dose per day)
- Parse single sigs for validation or entire CSVs of sigs
Medication "sigs" are the instructions you see on your prescription label - i.e. "take 1-2 tablets by mouth daily".
Parsed sig components
Text
sig_text
A string containing the modified sig_text from the request, converted to lower case, extraneous characters removed, and duplicate spaces converted to single spaces.
sig_readable
A human-readable version of the parsed sig for quick and easy validation.
Method
method
How the medication is administered (i.e. take, inject, inhale).
Dose
dose
dose_max
dose_unit
How much medication patient is instructed to take based on dosage (i.e. 2 tablets, 30 units, 1-2 puffs).
Numbers represented as words in the sig will be converted to integers (i.e. “one” will be converted to 1).
Strength
strength
strength_max
strength_unit
How much medication the patient is instructed to take based on strength (i.e. 500 mg, 15 mL, 17 g).
NOTE: ParseRx intentionally does not parse multiple ingredient strengths (i.e. if 5/325 mg is in a sig, it will return null for strength).
Route
route
Route of administration of the medication (i.e. by mouth, via inhalation, in left eye).
Frequency
frequency
frequency_max
period
period_max
period_unit
time_duration
time_duration_unit
day_of_week
time_of_day
when
offset
bounds
count
frequency_readable
How often medication should be administered (i.e. every 4-6 hours, three times daily, once daily in the morning with meal).
Due to the complexity and variety of medication instructions, these elements are based off of an existing standard - FHIR Timing.
For convenience, a frequency_readable is generated to represent a human-readable representation of the sig frequency.
Duration
duration
duration_max
duration_unit
How long the patient is instructed to take the medication (i.e. for 7 days, for 7-10 days, for 28 days).
NOTE: this is different from days’ supply, which represents how long a given supply of medication should last.
Indication / PRN
as_needed
indication
Whether the medication should be taken “as needed” (i.e. PRN), and the specific reason the patient is taking the medication (i.e. for pain, for wheezing and shortness of breath, for insomnia).
NOTE: indication may be populated even if as_needed is false. There are chronic indications represented in sigs as well (i.e. for cholesterol, for high blood pressure, for diabetes).
Maximum daily dose
max_dose_per_day
max_numerator_value
max_numerator_unit
max_denominator_value
max_deniminator_unit
Max numerator and denominator elements are extracted from text explicitly stated in the sig (i.e. if a prescriber writes mdd or nte).
Max dose per day looks to both the maximum dose possible per the sig instructions and any explicit mdd or or nte directions, preferring the mdd or nte directions if present.
Examples:
- take 1 tab every 6 hours mdd 3/d -> max_dose_per_day should be 3, max numerator/denominator should have values
- take 1 tab every 6 hours -> max_dose_per_day should be 4, max numerator/denominator should not have values
Additional info
additional_info
Extra instructions such as "take with food" - things that might be on auxillary labels on a prescription bottle.