Skip to content

Instantly share code, notes, and snippets.

@jherskovic
Created October 15, 2013 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jherskovic/6991929 to your computer and use it in GitHub Desktop.
Save jherskovic/6991929 to your computer and use it in GitHub Desktop.
This is the default expected medication format for the MedRec project
medication_parser = re.compile(r"""^\s*(?P<name>.*?)
\s+(?P<dose>[0-9\.\/]+)
\s*(?P<units>([mck]|mc)g|[md]l)
\s*(?P<formulation>.*?)
;
\s*?(?P<instructions>.*)""",
re.IGNORECASE | re.VERBOSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment