ion_orders_engine_mockingjay 1.0.1.SNAPSHOT
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +0 -0
- data/Rakefile +4 -0
- data/app/assets/images/rails.png +0 -0
- data/app/assets/javascripts/application.js +16 -0
- data/app/assets/javascripts/bootstrap_additions.js.coffee +4 -0
- data/app/assets/javascripts/interchange/patients.js.coffee +3 -0
- data/app/assets/javascripts/interchange/physicians.js.coffee +3 -0
- data/app/assets/javascripts/mock/allergies.js.coffee +3 -0
- data/app/assets/javascripts/mock/appointments.js.coffee +3 -0
- data/app/assets/javascripts/mock/assignments.js.coffee +17 -0
- data/app/assets/javascripts/mock/chart_reviews.js.coffee +3 -0
- data/app/assets/javascripts/mock/comments.js.coffee +3 -0
- data/app/assets/javascripts/mock/conditions.js.coffee +3 -0
- data/app/assets/javascripts/mock/diagnoses.js.coffee +3 -0
- data/app/assets/javascripts/mock/documents.js.coffee +3 -0
- data/app/assets/javascripts/mock/employments.js.coffee +3 -0
- data/app/assets/javascripts/mock/encounters.js.coffee +3 -0
- data/app/assets/javascripts/mock/family_contacts.js.coffee +3 -0
- data/app/assets/javascripts/mock/family_histories.js.coffee +3 -0
- data/app/assets/javascripts/mock/guarantors.js.coffee +3 -0
- data/app/assets/javascripts/mock/insurance_plans.js.coffee +3 -0
- data/app/assets/javascripts/mock/lab_concepts.js.coffee +4 -0
- data/app/assets/javascripts/mock/lab_results.js.coffee +3 -0
- data/app/assets/javascripts/mock/locations.js.coffee +3 -0
- data/app/assets/javascripts/mock/medical_record_numbers.js.coffee +3 -0
- data/app/assets/javascripts/mock/metadata_keywords.js.coffee +3 -0
- data/app/assets/javascripts/mock/pharmacies.js.coffee +3 -0
- data/app/assets/javascripts/mock/phone_numbers.js.coffee +3 -0
- data/app/assets/javascripts/mock/physicians.js.coffee +3 -0
- data/app/assets/javascripts/mock/procedure_histories.js.coffee +3 -0
- data/app/assets/javascripts/mock/providers.js.coffee +14 -0
- data/app/assets/javascripts/mock/questions.js.coffee +3 -0
- data/app/assets/javascripts/mock/reference_range.js.coffee +3 -0
- data/app/assets/javascripts/mock/sections.js.coffee +3 -0
- data/app/assets/javascripts/mock/social_histories.js.coffee +3 -0
- data/app/assets/javascripts/mock/state_health_identifiers.js.coffee +3 -0
- data/app/assets/javascripts/mock/statistics.js.coffee +3 -0
- data/app/assets/javascripts/mock/test_assertions.js.coffee +3 -0
- data/app/assets/javascripts/mock/visit.js.coffee +3 -0
- data/app/assets/javascripts/mock/vitals_measurement.js.coffee +3 -0
- data/app/assets/javascripts/reference/data_elements.js.coffee +3 -0
- data/app/assets/javascripts/reference/data_lists.js.coffee +3 -0
- data/app/assets/javascripts/reference/data_sets.js.coffee +3 -0
- data/app/assets/stylesheets/application.css.scss +13 -0
- data/app/assets/stylesheets/bootstrap_and_overrides.css.scss +79 -0
- data/app/assets/stylesheets/forms.css.scss +67 -0
- data/app/assets/stylesheets/interchange/patients.css.scss +3 -0
- data/app/assets/stylesheets/interchange/physicians.css.scss +3 -0
- data/app/assets/stylesheets/mock/allergies.css.scss +3 -0
- data/app/assets/stylesheets/mock/appointments.css.scss +3 -0
- data/app/assets/stylesheets/mock/chart_reviews.css.scss +3 -0
- data/app/assets/stylesheets/mock/comments.css.scss +3 -0
- data/app/assets/stylesheets/mock/conditions.css.scss +3 -0
- data/app/assets/stylesheets/mock/diagnoses.css.scss +3 -0
- data/app/assets/stylesheets/mock/documents.css.scss +3 -0
- data/app/assets/stylesheets/mock/employments.css.scss +3 -0
- data/app/assets/stylesheets/mock/encounters.css.scss +3 -0
- data/app/assets/stylesheets/mock/family_contacts.css.scss +3 -0
- data/app/assets/stylesheets/mock/family_histories.css.scss +3 -0
- data/app/assets/stylesheets/mock/guarantors.css.scss +3 -0
- data/app/assets/stylesheets/mock/insurance_plans.css.scss +3 -0
- data/app/assets/stylesheets/mock/lab_concepts.css.scss +3 -0
- data/app/assets/stylesheets/mock/lab_results.css.scss +3 -0
- data/app/assets/stylesheets/mock/locations.css.scss +3 -0
- data/app/assets/stylesheets/mock/medical_record_numbers.css.scss +3 -0
- data/app/assets/stylesheets/mock/metadata_keywords.css.scss +3 -0
- data/app/assets/stylesheets/mock/pharmacies.css.scss +3 -0
- data/app/assets/stylesheets/mock/phone_numbers.css.scss +3 -0
- data/app/assets/stylesheets/mock/physicians.css.scss +3 -0
- data/app/assets/stylesheets/mock/procedure_histories.css.scss +3 -0
- data/app/assets/stylesheets/mock/providers.css.scss +3 -0
- data/app/assets/stylesheets/mock/questions.css.scss +3 -0
- data/app/assets/stylesheets/mock/reference_range.css.scss +3 -0
- data/app/assets/stylesheets/mock/sections.css.scss +3 -0
- data/app/assets/stylesheets/mock/social_histories.css.scss +3 -0
- data/app/assets/stylesheets/mock/state_health_identifiers.css.scss +3 -0
- data/app/assets/stylesheets/mock/statistics.css.scss +3 -0
- data/app/assets/stylesheets/mock/test_assertions.css.scss +3 -0
- data/app/assets/stylesheets/mock/visit.css.scss +3 -0
- data/app/assets/stylesheets/mock/vitals_measurement.css.scss +3 -0
- data/app/assets/stylesheets/reference/data_elements.css.scss +3 -0
- data/app/assets/stylesheets/reference/data_lists.css.scss +3 -0
- data/app/assets/stylesheets/reference/data_sets.css.scss +3 -0
- data/app/assets/stylesheets/scaffolds.css.scss +66 -0
- data/app/controllers/api/base_controller.rb +78 -0
- data/app/controllers/api/ion_orders_engine/order_by_id/order_by_id_controller.rb +3220 -0
- data/app/controllers/api/ion_orders_engine/order_profile/inpatient_order_profile_controller.rb +3156 -0
- data/app/controllers/application_controller.rb +25 -0
- data/app/controllers/crud/base_controller.rb +90 -0
- data/app/controllers/interchange/base_controller.rb +63 -0
- data/app/controllers/interchange/data_sets_controller.rb +40 -0
- data/app/controllers/interchange/exports_controller.rb +120 -0
- data/app/controllers/interchange/imports_controller.rb +141 -0
- data/app/controllers/reference/base_controller.rb +7 -0
- data/app/controllers/reference/data_lists_controller.rb +177 -0
- data/app/controllers/reference/data_options_controller.rb +147 -0
- data/app/controllers/reference/data_sets_controller.rb +160 -0
- data/app/helpers/application_helper.rb +389 -0
- data/app/helpers/error_messages_helper.rb +23 -0
- data/app/helpers/interchange/exports_helper.rb +9 -0
- data/app/helpers/interchange/imports_helper.rb +31 -0
- data/app/helpers/layout_helper.rb +40 -0
- data/app/helpers/reference/data_elements_helper.rb +2 -0
- data/app/helpers/reference/data_lists_helper.rb +2 -0
- data/app/helpers/reference/data_sets_helper.rb +2 -0
- data/app/views/interchange/common/_database_info.json.jbuilder +6 -0
- data/app/views/interchange/common/_metadata_keywords.json.jbuilder +13 -0
- data/app/views/interchange/common/_test_assertions.json.jbuilder +17 -0
- data/app/views/interchange/data_sets/_data_list.json.jbuilder +14 -0
- data/app/views/interchange/data_sets/_data_option.json.jbuilder +12 -0
- data/app/views/interchange/data_sets/_data_set.json.jbuilder +17 -0
- data/app/views/interchange/data_sets/_nested_data_list.json.jbuilder +12 -0
- data/app/views/interchange/data_sets/show.json.jbuilder +10 -0
- data/app/views/interchange/document_templates/_document_template.json.jbuilder +23 -0
- data/app/views/interchange/document_templates/_section.json.jbuilder +11 -0
- data/app/views/interchange/document_templates/show.json.jbuilder +10 -0
- data/app/views/interchange/exports/_export_summary.html.erb +49 -0
- data/app/views/interchange/exports/show.html.erb +35 -0
- data/app/views/interchange/imports/_import_summary.html.erb +72 -0
- data/app/views/interchange/imports/show.html.erb +37 -0
- data/app/views/layouts/_flashbar.html.erb +6 -0
- data/app/views/layouts/_navbar.html.erb +38 -0
- data/app/views/layouts/_protected_warning.html.erb +7 -0
- data/app/views/layouts/_root_model_layout.erb +33 -0
- data/app/views/layouts/application.html.erb +39 -0
- data/app/views/layouts/reference/data_sets.html.erb +5 -0
- data/app/views/reference/data_lists/_data_options.html.erb +31 -0
- data/app/views/reference/data_lists/_form.html.erb +23 -0
- data/app/views/reference/data_lists/edit.html.erb +6 -0
- data/app/views/reference/data_lists/index.html.erb +31 -0
- data/app/views/reference/data_lists/new.html.erb +6 -0
- data/app/views/reference/data_lists/show.html.erb +55 -0
- data/app/views/reference/data_options/_form.html.erb +23 -0
- data/app/views/reference/data_options/edit.html.erb +5 -0
- data/app/views/reference/data_options/index.html.erb +38 -0
- data/app/views/reference/data_options/new.html.erb +5 -0
- data/app/views/reference/data_options/show.html.erb +33 -0
- data/app/views/reference/data_sets/_form.html.erb +25 -0
- data/app/views/reference/data_sets/edit.html.erb +5 -0
- data/app/views/reference/data_sets/index.html.erb +40 -0
- data/app/views/reference/data_sets/new.html.erb +5 -0
- data/app/views/reference/data_sets/show.html.erb +38 -0
- data/config/application.rb +100 -0
- data/config/boot.rb +6 -0
- data/config/database.yml +25 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +42 -0
- data/config/environments/production.rb +64 -0
- data/config/environments/test.rb +35 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/extensions/active_record.rb +13 -0
- data/config/initializers/extensions/hash.rb +11 -0
- data/config/initializers/extensions/string.rb +15 -0
- data/config/initializers/inflections.rb +15 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/reference.rb +77 -0
- data/config/initializers/secret_token.rb +7 -0
- data/config/initializers/session_store.rb +8 -0
- data/config/initializers/simple_form.rb +142 -0
- data/config/initializers/simple_form_bootstrap.rb +45 -0
- data/config/initializers/wrap_parameters.rb +10 -0
- data/config/locales/en.yml +207 -0
- data/config/locales/simple_form.en.yml +26 -0
- data/config/mongo.yml +18 -0
- data/config/routes.rb +4 -0
- data/db/schema.rb +16 -0
- data/db/seeds.rb +66 -0
- data/lib/ion_orders_engine_mockingjay/engine.rb +13 -0
- data/lib/ion_orders_engine_mockingjay/version.rb +3 -0
- data/lib/ion_orders_engine_mockingjay.rb +4 -0
- data/lib/tasks/ion_orders_engine_mockingjay_tasks.rake +4 -0
- metadata +215 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
class Hash
|
2
|
+
def underscore_keys
|
3
|
+
result = {}
|
4
|
+
self.map do |k,v|
|
5
|
+
mapped_key = k.underscore
|
6
|
+
result[mapped_key] = v.kind_of?(Hash) ? v.underscore_keys : v
|
7
|
+
result[mapped_key] = v.collect{ |obj| obj.underscore_keys if obj.kind_of?(Hash)} if v.kind_of?(Array)
|
8
|
+
end
|
9
|
+
result
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class String
|
2
|
+
|
3
|
+
def singular?
|
4
|
+
self.pluralize != self and self.singularize == self
|
5
|
+
end
|
6
|
+
|
7
|
+
def plural?
|
8
|
+
self.singularize != self and self.pluralize == self
|
9
|
+
end
|
10
|
+
|
11
|
+
def capitalize_words
|
12
|
+
self.split(' ').map { |w| w.capitalize }.join(' ')
|
13
|
+
end
|
14
|
+
|
15
|
+
end # class String
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
11
|
+
#
|
12
|
+
# These inflection rules are supported but not enabled by default:
|
13
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
14
|
+
# inflect.acronym 'RESTful'
|
15
|
+
# end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module Reference
|
2
|
+
|
3
|
+
# This Array holds a list of classes that should be mapped from the database 'DataOption' model instances
|
4
|
+
# to Ruby classes concretely defined in app/models/reference. Only include those root level reference classes;
|
5
|
+
# any nested classes should be bootstrapped from the initialize() method of the parent reference class.
|
6
|
+
ROOT_REFERENCE_MODEL_CLASSES = [
|
7
|
+
Reference::LabGroup,
|
8
|
+
Reference::LabResultDataType,
|
9
|
+
Reference::AllergyReactionType,
|
10
|
+
Reference::ConditionStatusType,
|
11
|
+
Reference::NotificationConceptType,
|
12
|
+
Reference::AllergyStatusType,
|
13
|
+
Reference::AllergySeverity,
|
14
|
+
Reference::AllergyCancelReason,
|
15
|
+
Reference::VisitType,
|
16
|
+
Reference::VitalsMeasurementType,
|
17
|
+
Reference::VitalsMeasurementStatusType,
|
18
|
+
Reference::VitalsMeasurementNormalcy,
|
19
|
+
Reference::VitalsMeasurementUnit,
|
20
|
+
Reference::VitalsMeasurementContributorSystem,
|
21
|
+
Reference::VitalsMeasurementSystem,
|
22
|
+
Reference::VitalsMeasurementResultType,
|
23
|
+
Reference::DiagnosisConfirmationStatus,
|
24
|
+
Reference::ProblemClassification,
|
25
|
+
Reference::DiagType,
|
26
|
+
Reference::LifeCycleStatus,
|
27
|
+
Reference::ClinicalDiagnosisClinicalService,
|
28
|
+
Reference::HealthRecordCancelReason
|
29
|
+
]
|
30
|
+
|
31
|
+
# This Array holds only those classes that are nested reference models, (ultimately) dependent on one class in the
|
32
|
+
# ROOT_REFERENCE_MODEL_CLASSES Array.
|
33
|
+
NESTED_REFERENCE_MODEL_CLASSES = [
|
34
|
+
Reference::LabConcept
|
35
|
+
]
|
36
|
+
|
37
|
+
# Where reference data is read from and written to
|
38
|
+
BASE_PATH = '/data/reference/'
|
39
|
+
|
40
|
+
# This is where our arrays of reference model instances will go, keyed by a variant on their class name.
|
41
|
+
@@instances_hash = {}
|
42
|
+
|
43
|
+
def self.set_instances_hash(x)
|
44
|
+
@@instances_hash = x
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.get_instances_hash
|
48
|
+
@@instances_hash
|
49
|
+
end
|
50
|
+
|
51
|
+
# Determines if we have an empty cache, by traversing into the first level of keys and looking at the size of their
|
52
|
+
# Arrays.
|
53
|
+
def self.empty_cache?
|
54
|
+
num_cached_models = 0
|
55
|
+
self.get_instances_hash.each_pair do | key, cache_array |
|
56
|
+
num_cached_models += cache_array.count
|
57
|
+
end
|
58
|
+
|
59
|
+
num_cached_models < 1
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
# If the migration to add reference tables has not yet run, our importing into them and
|
64
|
+
# creating Ruby class instances from them, will be futile. This method provides that check.
|
65
|
+
def self.has_reference_tables?
|
66
|
+
ActiveRecord::Base.connection.table_exists? 'reference_data_sets'
|
67
|
+
end
|
68
|
+
|
69
|
+
end # module: Reference
|
70
|
+
|
71
|
+
|
72
|
+
# Pre-reference every single reference data type we use (whether top level or nested) so that the Rails Console
|
73
|
+
# does not complain. This is the workaround to the known bug described here: https://github.com/rails/rails/issues/8167
|
74
|
+
Reference::ROOT_REFERENCE_MODEL_CLASSES.each { |reference_class| reference_class.to_s }
|
75
|
+
Reference::NESTED_REFERENCE_MODEL_CLASSES.each { |reference_class| reference_class.to_s }
|
76
|
+
|
77
|
+
#
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
Mockingjay::Application.config.secret_token = '6ef43553057e32d18af2ba582afa2f356f195def0c7970dd8efdcb3a6323f0675cf34b69baa0d2001ec7e2a58a6b3c2eb8eae94e0fae4982ae66495f1a3bdafa'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
Mockingjay::Application.config.session_store :cookie_store, key: '_mockingjay_session'
|
4
|
+
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
6
|
+
# which shouldn't be used to store highly confidential information
|
7
|
+
# (create the session table with "rails generate session_migration")
|
8
|
+
# Mockingjay::Application.config.session_store :active_record_store
|
@@ -0,0 +1,142 @@
|
|
1
|
+
# Use this setup block to configure all options available in SimpleForm.
|
2
|
+
SimpleForm.setup do |config|
|
3
|
+
# Wrappers are used by the form builder to generate a
|
4
|
+
# complete input. You can remove any component from the
|
5
|
+
# wrapper, change the order or even add your own to the
|
6
|
+
# stack. The options given below are used to wrap the
|
7
|
+
# whole input.
|
8
|
+
config.wrappers :default, class: :input,
|
9
|
+
:hint_class => :field_with_hint, :error_class => :field_with_errors do |b|
|
10
|
+
## Extensions enabled by default
|
11
|
+
# Any of these extensions can be disabled for a
|
12
|
+
# given input by passing: `f.input EXTENSION_NAME => false`.
|
13
|
+
# You can make any of these extensions optional by
|
14
|
+
# renaming `b.use` to `b.optional`.
|
15
|
+
|
16
|
+
# Determines whether to use HTML5 (:email, :url, ...)
|
17
|
+
# and required attributes
|
18
|
+
b.use :html5
|
19
|
+
|
20
|
+
# Calculates placeholders automatically from I18n
|
21
|
+
# You can also pass a string as f.input :placeholder => "Placeholder"
|
22
|
+
b.use :placeholder
|
23
|
+
|
24
|
+
## Optional extensions
|
25
|
+
# They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
|
26
|
+
# to the input. If so, they will retrieve the values from the model
|
27
|
+
# if any exists. If you want to enable the lookup for any of those
|
28
|
+
# extensions by default, you can change `b.optional` to `b.use`.
|
29
|
+
|
30
|
+
# Calculates maxlength from length validations for string inputs
|
31
|
+
b.optional :maxlength
|
32
|
+
|
33
|
+
# Calculates pattern from format validations for string inputs
|
34
|
+
b.optional :pattern
|
35
|
+
|
36
|
+
# Calculates min and max from length validations for numeric inputs
|
37
|
+
b.optional :min_max
|
38
|
+
|
39
|
+
# Calculates readonly automatically from readonly attributes
|
40
|
+
b.optional :readonly
|
41
|
+
|
42
|
+
## Inputs
|
43
|
+
b.use :label_input
|
44
|
+
b.use :hint, :wrap_with => { :tag => :span, class: :hint }
|
45
|
+
b.use :error, :wrap_with => { :tag => :span, class: :error }
|
46
|
+
end
|
47
|
+
|
48
|
+
# The default wrapper to be used by the FormBuilder.
|
49
|
+
config.default_wrapper = :default
|
50
|
+
|
51
|
+
# Define the way to render check boxes / radio buttons with labels.
|
52
|
+
# Defaults to :nested for bootstrap config.
|
53
|
+
# :inline => input + label
|
54
|
+
# :nested => label > input
|
55
|
+
config.boolean_style = :nested
|
56
|
+
|
57
|
+
# Default class for buttons
|
58
|
+
config.button_class = 'btn'
|
59
|
+
|
60
|
+
# Method used to tidy up errors. Specify any Rails Array method.
|
61
|
+
# :first lists the first message for each field.
|
62
|
+
# Use :to_sentence to list all errors for each field.
|
63
|
+
# config.error_method = :first
|
64
|
+
|
65
|
+
# Default tag used for error notification helper.
|
66
|
+
config.error_notification_tag = :div
|
67
|
+
|
68
|
+
# CSS class to add for error notification helper.
|
69
|
+
config.error_notification_class = 'alert alert-error'
|
70
|
+
|
71
|
+
# ID to add for error notification helper.
|
72
|
+
# config.error_notification_id = nil
|
73
|
+
|
74
|
+
# Series of attempts to detect a default label method for collection.
|
75
|
+
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
|
76
|
+
|
77
|
+
# Series of attempts to detect a default value method for collection.
|
78
|
+
# config.collection_value_methods = [ :id, :to_s ]
|
79
|
+
|
80
|
+
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
|
81
|
+
# config.collection_wrapper_tag = nil
|
82
|
+
|
83
|
+
# You can define the class to use on all collection wrappers. Defaulting to none.
|
84
|
+
# config.collection_wrapper_class = nil
|
85
|
+
|
86
|
+
# You can wrap each item in a collection of radio/check boxes with a tag,
|
87
|
+
# defaulting to :span. Please note that when using :boolean_style = :nested,
|
88
|
+
# SimpleForm will force this option to be a label.
|
89
|
+
# config.item_wrapper_tag = :span
|
90
|
+
|
91
|
+
# You can define a class to use in all item wrappers. Defaulting to none.
|
92
|
+
# config.item_wrapper_class = nil
|
93
|
+
|
94
|
+
# How the label text should be generated altogether with the required text.
|
95
|
+
# config.label_text = lambda { |label, required| "#{required} #{label}" }
|
96
|
+
|
97
|
+
# You can define the class to use on all labels. Default is nil.
|
98
|
+
config.label_class = 'control-label'
|
99
|
+
|
100
|
+
# You can define the class to use on all forms. Default is simple_form.
|
101
|
+
# config.form_class = :simple_form
|
102
|
+
|
103
|
+
# You can define which elements should obtain additional classes
|
104
|
+
# config.generate_additional_classes_for = [:wrapper, :label, :input]
|
105
|
+
|
106
|
+
# Whether attributes are required by default (or not). Default is true.
|
107
|
+
# config.required_by_default = true
|
108
|
+
|
109
|
+
# Tell browsers whether to use default HTML5 validations (novalidate option).
|
110
|
+
# Default is enabled.
|
111
|
+
config.browser_validations = false
|
112
|
+
|
113
|
+
# Collection of methods to detect if a file type was given.
|
114
|
+
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
115
|
+
|
116
|
+
# Custom mappings for input types. This should be a hash containing a regexp
|
117
|
+
# to match as key, and the input type that will be used when the field name
|
118
|
+
# matches the regexp as value.
|
119
|
+
# config.input_mappings = { /count/ => :integer }
|
120
|
+
|
121
|
+
# Custom wrappers for input types. This should be a hash containing an input
|
122
|
+
# type as key and the wrapper that will be used for all inputs with specified type.
|
123
|
+
# config.wrapper_mappings = { :string => :prepend }
|
124
|
+
|
125
|
+
# Default priority for time_zone inputs.
|
126
|
+
# config.time_zone_priority = nil
|
127
|
+
|
128
|
+
# Default priority for country inputs.
|
129
|
+
# config.country_priority = nil
|
130
|
+
|
131
|
+
# Default size for text inputs.
|
132
|
+
# config.default_input_size = 50
|
133
|
+
|
134
|
+
# When false, do not use translations for labels.
|
135
|
+
# config.translate_labels = true
|
136
|
+
|
137
|
+
# Automatically discover new inputs in Rails' autoload path.
|
138
|
+
# config.inputs_discovery = true
|
139
|
+
|
140
|
+
# Cache SimpleForm inputs discovery
|
141
|
+
# config.cache_discovery = !Rails.env.development?
|
142
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Use this setup block to configure all options available in SimpleForm.
|
2
|
+
SimpleForm.setup do |config|
|
3
|
+
config.wrappers :bootstrap, :tag => 'div', class: 'control-group', :error_class => 'error' do |b|
|
4
|
+
b.use :html5
|
5
|
+
b.use :placeholder
|
6
|
+
b.use :label
|
7
|
+
b.wrapper :tag => 'div', class: 'controls' do |ba|
|
8
|
+
ba.use :input
|
9
|
+
ba.use :error, :wrap_with => { :tag => 'span', class: 'help-inline' }
|
10
|
+
ba.use :hint, :wrap_with => { :tag => 'p', class: 'help-block' }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
config.wrappers :prepend, :tag => 'div', class: "control-group", :error_class => 'error' do |b|
|
15
|
+
b.use :html5
|
16
|
+
b.use :placeholder
|
17
|
+
b.use :label
|
18
|
+
b.wrapper :tag => 'div', class: 'controls' do |input|
|
19
|
+
input.wrapper :tag => 'div', class: 'input-prepend' do |prepend|
|
20
|
+
prepend.use :input
|
21
|
+
end
|
22
|
+
input.use :hint, :wrap_with => { :tag => 'span', class: 'help-block' }
|
23
|
+
input.use :error, :wrap_with => { :tag => 'span', class: 'help-inline' }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
config.wrappers :append, :tag => 'div', class: "control-group", :error_class => 'error' do |b|
|
28
|
+
b.use :html5
|
29
|
+
b.use :placeholder
|
30
|
+
b.use :label
|
31
|
+
b.wrapper :tag => 'div', class: 'controls' do |input|
|
32
|
+
input.wrapper :tag => 'div', class: 'input-append' do |append|
|
33
|
+
append.use :input
|
34
|
+
end
|
35
|
+
input.use :hint, :wrap_with => { :tag => 'span', class: 'help-block' }
|
36
|
+
input.use :error, :wrap_with => { :tag => 'span', class: 'help-inline' }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
|
41
|
+
# Check the Bootstrap docs (http://twitter.github.com/bootstrap)
|
42
|
+
# to learn about the different styles for forms and inputs,
|
43
|
+
# buttons and other elements.
|
44
|
+
config.default_wrapper = :bootstrap
|
45
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
#
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json]
|
9
|
+
end
|
10
|
+
|
@@ -0,0 +1,207 @@
|
|
1
|
+
# Sample localization file for English. Add more files in this directory for other locales.
|
2
|
+
# Starting point for this file from: https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale
|
3
|
+
en:
|
4
|
+
date:
|
5
|
+
abbr_day_names:
|
6
|
+
- Sun
|
7
|
+
- Mon
|
8
|
+
- Tue
|
9
|
+
- Wed
|
10
|
+
- Thu
|
11
|
+
- Fri
|
12
|
+
- Sat
|
13
|
+
abbr_month_names:
|
14
|
+
-
|
15
|
+
- Jan
|
16
|
+
- Feb
|
17
|
+
- Mar
|
18
|
+
- Apr
|
19
|
+
- May
|
20
|
+
- Jun
|
21
|
+
- Jul
|
22
|
+
- Aug
|
23
|
+
- Sep
|
24
|
+
- Oct
|
25
|
+
- Nov
|
26
|
+
- Dec
|
27
|
+
day_names:
|
28
|
+
- Sunday
|
29
|
+
- Monday
|
30
|
+
- Tuesday
|
31
|
+
- Wednesday
|
32
|
+
- Thursday
|
33
|
+
- Friday
|
34
|
+
- Saturday
|
35
|
+
formats:
|
36
|
+
default: ! '%Y-%m-%d'
|
37
|
+
long: ! '%B %d, %Y'
|
38
|
+
short: ! '%b %d'
|
39
|
+
month_names:
|
40
|
+
-
|
41
|
+
- January
|
42
|
+
- February
|
43
|
+
- March
|
44
|
+
- April
|
45
|
+
- May
|
46
|
+
- June
|
47
|
+
- July
|
48
|
+
- August
|
49
|
+
- September
|
50
|
+
- October
|
51
|
+
- November
|
52
|
+
- December
|
53
|
+
order:
|
54
|
+
- :year
|
55
|
+
- :month
|
56
|
+
- :day
|
57
|
+
datetime:
|
58
|
+
distance_in_words:
|
59
|
+
about_x_hours:
|
60
|
+
one: about 1 hour
|
61
|
+
other: about %{count} hours
|
62
|
+
about_x_months:
|
63
|
+
one: about 1 month
|
64
|
+
other: about %{count} months
|
65
|
+
about_x_years:
|
66
|
+
one: about 1 year
|
67
|
+
other: about %{count} years
|
68
|
+
almost_x_years:
|
69
|
+
one: almost 1 year
|
70
|
+
other: almost %{count} years
|
71
|
+
half_a_minute: half a minute
|
72
|
+
less_than_x_minutes:
|
73
|
+
one: less than a minute
|
74
|
+
other: less than %{count} minutes
|
75
|
+
less_than_x_seconds:
|
76
|
+
one: less than 1 second
|
77
|
+
other: less than %{count} seconds
|
78
|
+
over_x_years:
|
79
|
+
one: over 1 year
|
80
|
+
other: over %{count} years
|
81
|
+
x_days:
|
82
|
+
one: 1 day
|
83
|
+
other: ! '%{count} days'
|
84
|
+
x_minutes:
|
85
|
+
one: 1 minute
|
86
|
+
other: ! '%{count} minutes'
|
87
|
+
x_months:
|
88
|
+
one: 1 month
|
89
|
+
other: ! '%{count} months'
|
90
|
+
x_seconds:
|
91
|
+
one: 1 second
|
92
|
+
other: ! '%{count} seconds'
|
93
|
+
prompts:
|
94
|
+
day: Day
|
95
|
+
hour: Hour
|
96
|
+
minute: Minute
|
97
|
+
month: Month
|
98
|
+
second: Seconds
|
99
|
+
year: Year
|
100
|
+
errors: &errors
|
101
|
+
format: ! '%{attribute} %{message}'
|
102
|
+
messages:
|
103
|
+
accepted: must be accepted
|
104
|
+
blank: can't be blank
|
105
|
+
confirmation: doesn't match confirmation
|
106
|
+
empty: can't be empty
|
107
|
+
equal_to: must be equal to %{count}
|
108
|
+
even: must be even
|
109
|
+
exclusion: is reserved
|
110
|
+
greater_than: must be greater than %{count}
|
111
|
+
greater_than_or_equal_to: must be greater than or equal to %{count}
|
112
|
+
inclusion: is not included in the list
|
113
|
+
invalid: is invalid
|
114
|
+
less_than: must be less than %{count}
|
115
|
+
less_than_or_equal_to: must be less than or equal to %{count}
|
116
|
+
not_a_number: is not a number
|
117
|
+
not_an_integer: must be an integer
|
118
|
+
odd: must be odd
|
119
|
+
record_invalid: ! 'Validation failed: %{errors}'
|
120
|
+
taken: has already been taken
|
121
|
+
too_long:
|
122
|
+
one: is too long (maximum is 1 character)
|
123
|
+
other: is too long (maximum is %{count} characters)
|
124
|
+
too_short:
|
125
|
+
one: is too short (minimum is 1 character)
|
126
|
+
other: is too short (minimum is %{count} characters)
|
127
|
+
wrong_length:
|
128
|
+
one: is the wrong length (should be 1 character)
|
129
|
+
other: is the wrong length (should be %{count} characters)
|
130
|
+
template:
|
131
|
+
body: ! 'There were problems with the following fields:'
|
132
|
+
header:
|
133
|
+
one: 1 error prohibited this %{model} from being saved
|
134
|
+
other: ! '%{count} errors prohibited this %{model} from being saved'
|
135
|
+
helpers:
|
136
|
+
links:
|
137
|
+
edit: Edit
|
138
|
+
destroy: Destroy
|
139
|
+
show: Show
|
140
|
+
new: New
|
141
|
+
cancel: Cancel
|
142
|
+
search: Search
|
143
|
+
select:
|
144
|
+
prompt: Please select
|
145
|
+
submit:
|
146
|
+
create: Create %{model}
|
147
|
+
submit: Save %{model}
|
148
|
+
update: Update %{model}
|
149
|
+
number:
|
150
|
+
currency:
|
151
|
+
format:
|
152
|
+
delimiter: ! ','
|
153
|
+
format: ! '%u%n'
|
154
|
+
precision: 2
|
155
|
+
separator: .
|
156
|
+
significant: false
|
157
|
+
strip_insignificant_zeros: false
|
158
|
+
unit: $
|
159
|
+
format:
|
160
|
+
delimiter: ! ','
|
161
|
+
precision: 3
|
162
|
+
separator: .
|
163
|
+
significant: false
|
164
|
+
strip_insignificant_zeros: false
|
165
|
+
human:
|
166
|
+
decimal_units:
|
167
|
+
format: ! '%n %u'
|
168
|
+
units:
|
169
|
+
billion: Billion
|
170
|
+
million: Million
|
171
|
+
quadrillion: Quadrillion
|
172
|
+
thousand: Thousand
|
173
|
+
trillion: Trillion
|
174
|
+
unit: ''
|
175
|
+
format:
|
176
|
+
delimiter: ''
|
177
|
+
precision: 3
|
178
|
+
significant: true
|
179
|
+
strip_insignificant_zeros: true
|
180
|
+
storage_units:
|
181
|
+
format: ! '%n %u'
|
182
|
+
units:
|
183
|
+
byte:
|
184
|
+
one: Byte
|
185
|
+
other: Bytes
|
186
|
+
gb: GB
|
187
|
+
kb: KB
|
188
|
+
mb: MB
|
189
|
+
tb: TB
|
190
|
+
percentage:
|
191
|
+
format:
|
192
|
+
delimiter: ''
|
193
|
+
precision:
|
194
|
+
format:
|
195
|
+
delimiter: ''
|
196
|
+
support:
|
197
|
+
array:
|
198
|
+
last_word_connector: ! ', and '
|
199
|
+
two_words_connector: ! ' and '
|
200
|
+
words_connector: ! ', '
|
201
|
+
time:
|
202
|
+
am: am
|
203
|
+
formats:
|
204
|
+
default: ! '%a, %d %b %Y %H:%M:%S %z'
|
205
|
+
long: ! '%B %d, %Y %H:%M'
|
206
|
+
short: ! '%d %b %H:%M'
|
207
|
+
pm: pm
|
@@ -0,0 +1,26 @@
|
|
1
|
+
en:
|
2
|
+
simple_form:
|
3
|
+
"yes": 'Yes'
|
4
|
+
"no": 'No'
|
5
|
+
required:
|
6
|
+
text: 'required'
|
7
|
+
mark: '*'
|
8
|
+
# You can uncomment the line below if you need to overwrite the whole required html.
|
9
|
+
# When using html, text and mark won't be used.
|
10
|
+
# html: '<abbr title="required">*</abbr>'
|
11
|
+
error_notification:
|
12
|
+
default_message: "Please review the problems below:"
|
13
|
+
# Labels and hints examples
|
14
|
+
# labels:
|
15
|
+
# defaults:
|
16
|
+
# password: 'Password'
|
17
|
+
# user:
|
18
|
+
# new:
|
19
|
+
# email: 'E-mail to sign in.'
|
20
|
+
# edit:
|
21
|
+
# email: 'E-mail.'
|
22
|
+
# hints:
|
23
|
+
# defaults:
|
24
|
+
# username: 'User name to sign in.'
|
25
|
+
# password: 'No special characters, please.'
|
26
|
+
|
data/config/mongo.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
defaults: &defaults
|
2
|
+
host: 127.0.0.1
|
3
|
+
port: 27017
|
4
|
+
|
5
|
+
development:
|
6
|
+
<<: *defaults
|
7
|
+
database: mockingjay_development
|
8
|
+
|
9
|
+
test:
|
10
|
+
<<: *defaults
|
11
|
+
database: mockingjay_test
|
12
|
+
|
13
|
+
# set these environment variables on your prod server
|
14
|
+
production:
|
15
|
+
<<: *defaults
|
16
|
+
database: mockingjay
|
17
|
+
username: <%= ENV['MONGO_USERNAME'] %>
|
18
|
+
password: <%= ENV['MONGO_PASSWORD'] %>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,4 @@
|
|
1
|
+
Mockingjay.Application.routes.draw do
|
2
|
+
match '/patients/:patientId/orders/inpatient' => 'api/ion_orders_engine/order_profile/inpatient_order_profile#show', via: :get, :constraints => {:patientId => /\d+/}
|
3
|
+
match '/patients/:patientId/orders/:orderId' => 'api/ion_orders_engine/order_by_id/order_by_id#show', via: :get, :constraints => {:patientId => /\d+/, :orderId => /\d+/}
|
4
|
+
end
|
data/db/schema.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended to check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(:version => 20130627145834) do
|
15
|
+
|
16
|
+
end
|
data/db/seeds.rb
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# Public: This class handles the import of data located in the 'data/seed/' folder.
|
2
|
+
# This class is followed by commands to create an instance and perform the actual import.
|
3
|
+
# The logic in this class is automatically invoked when the command 'rake db:seed' is issued.
|
4
|
+
#
|
5
|
+
# We seed the database with default values for everything except reference data, which is
|
6
|
+
# automatically handled on each server startup anyways.
|
7
|
+
#
|
8
|
+
# Note: If you include reference data here, it will be loaded. However, by convention, you
|
9
|
+
# are discouraged from putting reference data files in the data/seed/ folder, because
|
10
|
+
# reference data already lives elsewhere.
|
11
|
+
module Seeds
|
12
|
+
class Loader
|
13
|
+
|
14
|
+
# Mixins
|
15
|
+
include ::Mixins::Logging
|
16
|
+
|
17
|
+
# Constants
|
18
|
+
BASE_PATH = '/data/seed/'
|
19
|
+
|
20
|
+
# Internal: Creates our instance of Reader, that handles the actual import.
|
21
|
+
def initialize
|
22
|
+
@reader = Interchange::Reader.new
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
# Public: The primary interface to this class. We setup to load all seed data in the
|
27
|
+
# data/seeds/ folder, such that we leave the seed files intact, do not destroy existing data prior,
|
28
|
+
# and that we just skip any imports for data that already exists based on each model's determination
|
29
|
+
# of uniqueness.
|
30
|
+
def perform_import
|
31
|
+
# Set the parameters guiding how the import should be run:
|
32
|
+
cleanup = false
|
33
|
+
duplicate_strategy = Enums::DuplicateStrategy::SKIP
|
34
|
+
|
35
|
+
# Wrap the import process in a block that can log the overall status:
|
36
|
+
@reader.mark_import_operation do
|
37
|
+
# Kick off the underlying import operation on the model(s) requested:
|
38
|
+
root_model_classes.each do |model_class|
|
39
|
+
puts "Loading seed data (if any) for model: #{model_class.to_s}"
|
40
|
+
@reader.import model_class, cleanup, duplicate_strategy, BASE_PATH
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
# Determines which of our models are root resources. Only these attempt to get loaded.
|
49
|
+
def root_model_classes
|
50
|
+
Rails.application.eager_load! # Needed to ensure all models are loaded for our asking them if they are root resources.
|
51
|
+
all_model_classes = ActiveRecord::Base.descendants
|
52
|
+
all_model_classes.select { |model_class| model_class.included_modules.include? Mock::RootModelConcern }
|
53
|
+
end
|
54
|
+
|
55
|
+
end # class
|
56
|
+
end # module
|
57
|
+
|
58
|
+
|
59
|
+
# Use the logic in this Seeds class to kick off the import:
|
60
|
+
loader = Seeds::Loader.new
|
61
|
+
loader.perform_import
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|