Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add clinical grammar #3

Open
bethard opened this issue Mar 28, 2014 · 0 comments
Open

add clinical grammar #3

bethard opened this issue Mar 28, 2014 · 0 comments

Comments

@bethard
Copy link
Collaborator

bethard commented Mar 28, 2014

From Sean Finan:

I just started playing with timenorm and have added a few items to the grammar to cover clinical terms.

// medication specification: at night -- SPF
[FieldValue:Time] ||| noct ||| ( FieldValue:HourOfDay HOUR_OF_DAY 19 ) ( FieldValue:MinuteOfHour MINUTE_OF_HOUR 0 ) ||| 1.0

// medication specifications; od/opd/sid = once daily, eod/qad/qod = every other day, dieb. alt. = every other day
// qds/qid = 4x per day, qqh = every 4 hrs, tds/tid = 3x per day, bd/bid = twice daily, qh = every hour, qwk = every week
// alt. h. = every other hour -- SPF
[PeriodSet] ||| od ||| WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| o . d ||| WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| opd ||| WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| o . p . d ||| WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| sid ||| WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| s . i . d ||| WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| eod ||| WithQuantifier ( Period Simple 2 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| e . o . d ||| WithQuantifier ( Period Simple 2 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| qad ||| WithQuantifier ( Period Simple 2 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| q . a . d ||| WithQuantifier ( Period Simple 2 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| qod ||| WithQuantifier ( Period Simple 2 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| q . o . d ||| WithQuantifier ( Period Simple 2 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| dieb alt ||| WithQuantifier ( Period Simple 2 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| dieb . alt ||| WithQuantifier ( Period Simple 2 DAYS ) EVERY ||| 1.0
[PeriodSet] ||| qds ||| WithQuantifier ( Period Simple 6 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| q . d . s ||| WithQuantifier ( Period Simple 6 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| qid ||| WithQuantifier ( Period Simple 6 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| q . i . d ||| WithQuantifier ( Period Simple 6 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| qqh ||| WithQuantifier ( Period Simple 4 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| q . q . h ||| WithQuantifier ( Period Simple 4 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| tds ||| WithQuantifier ( Period Simple 8 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| t . d . s ||| WithQuantifier ( Period Simple 8 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| tid ||| WithQuantifier ( Period Simple 8 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| t . i . d ||| WithQuantifier ( Period Simple 8 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| bd ||| WithQuantifier ( Period Simple 12 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| b . d ||| WithQuantifier ( Period Simple 12 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| bid ||| WithQuantifier ( Period Simple 12 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| b . i . d ||| WithQuantifier ( Period Simple 12 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| qh ||| WithQuantifier ( Period Simple 1 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| q . h ||| WithQuantifier ( Period Simple 1 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| qwk ||| WithQuantifier ( Period Simple 1 WEEKS ) EVERY ||| 1.0
[PeriodSet] ||| q . w . k ||| WithQuantifier ( Period Simple 1 WEEKS ) EVERY ||| 1.0
[PeriodSet] ||| alt h ||| WithQuantifier ( Period Simple 2 HOURS ) EVERY ||| 1.0
[PeriodSet] ||| alt . h ||| WithQuantifier ( Period Simple 2 HOURS ) EVERY ||| 1.0

// medication specifications; om = every morning, qam = every day before noon, qpm = every afternoon, on = every night, qhs = every night at bedtime -- SPF
// [PeriodSet] ||| om ||| ( FieldValue:HourOfDay HOUR_OF_DAY 7 ) ( FieldValue:MinuteOfHour MINUTE_OF_HOUR 0 ) WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
// [PeriodSet] ||| o . m ||| ( FieldValue:HourOfDay HOUR_OF_DAY 7 ) ( FieldValue:MinuteOfHour MINUTE_OF_HOUR 0 ) WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
// [PeriodSet] ||| qam ||| ( FieldValue:HourOfDay HOUR_OF_DAY 11 ) ( FieldValue:MinuteOfHour MINUTE_OF_HOUR 0 ) WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
// [PeriodSet] ||| q . a . m ||| ( FieldValue:HourOfDay HOUR_OF_DAY 11 ) ( FieldValue:MinuteOfHour MINUTE_OF_HOUR 0 ) WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
// [PeriodSet] ||| qpm ||| ( FieldValue:HourOfDay HOUR_OF_DAY 15 ) ( FieldValue:MinuteOfHour MINUTE_OF_HOUR 0 ) WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
// [PeriodSet] ||| q . p . m ||| ( FieldValue:HourOfDay HOUR_OF_DAY 15 ) ( FieldValue:MinuteOfHour MINUTE_OF_HOUR 0 ) WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
// [PeriodSet] ||| on ||| ( FieldValue:HourOfDay HOUR_OF_DAY 19 ) ( FieldValue:MinuteOfHour MINUTE_OF_HOUR 0 ) WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
// [PeriodSet] ||| o . n ||| ( FieldValue:HourOfDay HOUR_OF_DAY 19 ) ( FieldValue:MinuteOfHour MINUTE_OF_HOUR 0 ) WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
// [PeriodSet] ||| nightly ||| ( FieldValue:HourOfDay HOUR_OF_DAY 19 ) ( FieldValue:MinuteOfHour MINUTE_OF_HOUR 0 ) WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
// [PeriodSet] ||| qhs ||| ( FieldValue:HourOfDay HOUR_OF_DAY 19 ) ( FieldValue:MinuteOfHour MINUTE_OF_HOUR 0 ) WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0
// [PeriodSet] ||| q . h . s ||| ( FieldValue:HourOfDay HOUR_OF_DAY 19 ) ( FieldValue:MinuteOfHour MINUTE_OF_HOUR 0 ) WithQuantifier ( Period Simple 1 DAYS ) EVERY ||| 1.0

// "at this time" is popular in clinical text -- SPF
[TimeSpan:Regular] ||| at this time ||| Simple PRESENT ||| 1.0

// Pre-op -- SPF
[TimeSpan:Regular] ||| preop ||| EndAtStartOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 7 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| preoperative ||| EndAtStartOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 7 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| pre - op ||| EndAtStartOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 7 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| pre - operative ||| EndAtStartOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 7 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| presurg ||| EndAtStartOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 7 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| presurgery ||| EndAtStartOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 7 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| presurgical ||| EndAtStartOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 7 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| pre - surg ||| EndAtStartOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 7 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| pre - surgery ||| EndAtStartOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 7 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| pre - surgical ||| EndAtStartOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 7 DAYS ) ||| 1.0

// post-op -- SPF
[TimeSpan:Regular] ||| postop ||| StartAtEndOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 30 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| postoperative ||| StartAtEndOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 30 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| post - op ||| StartAtEndOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 30 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| post - operative ||| StartAtEndOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 30 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| postsurg ||| StartAtEndOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 30 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| postsurgery ||| StartAtEndOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 30 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| postsurgical ||| StartAtEndOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 30 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| post - surg ||| StartAtEndOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 30 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| post - surgery ||| StartAtEndOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 30 DAYS ) ||| 1.0
[TimeSpan:Regular] ||| post - surgical ||| StartAtEndOf ( TimeSpan FindEnclosing PRESENT DAYS ) ( Period Simple 30 DAYS ) ||| 1.0

// medication specifications; prn = as needed, ac = before meals, ad lib = as desired, emp/mdu/ud/ut. dict = as directed -- SPF
// [PeriodSet:Unspecified] ||| prn ||| DAY 1 ||| 1.0
// [PeriodSet:Unspecified] ||| p . r . n ||| DAY 1 ||| 1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant