Skip to content

Instantly share code, notes, and snippets.

@patricksrobertson
Last active October 29, 2015 14:32
Show Gist options
  • Save patricksrobertson/b5e0ad9ea646f7eb7b50 to your computer and use it in GitHub Desktop.
Save patricksrobertson/b5e0ad9ea646f7eb7b50 to your computer and use it in GitHub Desktop.
enumerated_marker 'this-cname' do
label_mapping yes: 'Current',
no: 'Never',
quit_over_a_year_ago: 'Quit > 1 year ago',
quit_over_15_years_ago: 'Quit > 15 years ago',
quit_less_than_a_year_ago: 'Quit < 1 year ago'
daily_frequency do
condition {|patient| patient.has_measurement_and_value_for?('this-cname', :yes) ||
patient.has_measurement_and_value_for?('this-cname', :no) }
value 365 * 10
end
daily_frequency do
condition {|patient| patient.has_measurement_and_value_for?('this-cname', :quit_over_a_year_ago) }
value 365 * 5
end
daily_frequency do
value 365
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment