hqmf2js 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/.gitignore +10 -0
  2. data/.travis.yml +17 -0
  3. data/Gemfile +41 -0
  4. data/Gemfile.lock +202 -0
  5. data/README.md +7 -0
  6. data/Rakefile +22 -0
  7. data/VERSION +1 -0
  8. data/app/assets/javascripts/hqmf_util.js.coffee +776 -0
  9. data/app/assets/javascripts/logging_utils.js.coffee +150 -0
  10. data/app/assets/javascripts/patient_api_extension.js.coffee +36 -0
  11. data/app/assets/javascripts/specifics.js.coffee +462 -0
  12. data/bin/hqmf2js.rb +25 -0
  13. data/config/warble.rb +144 -0
  14. data/hqmf2js.gemspec +20 -0
  15. data/lib/config/codes.xml +1935 -0
  16. data/lib/generator/characteristic.js.erb +19 -0
  17. data/lib/generator/codes_to_json.rb +81 -0
  18. data/lib/generator/converter.rb +60 -0
  19. data/lib/generator/data_criteria.js.erb +47 -0
  20. data/lib/generator/derived_data.js.erb +5 -0
  21. data/lib/generator/js.rb +263 -0
  22. data/lib/generator/measure_period.js.erb +18 -0
  23. data/lib/generator/patient_data.js.erb +22 -0
  24. data/lib/generator/population_criteria.js.erb +4 -0
  25. data/lib/generator/precondition.js.erb +14 -0
  26. data/lib/hqmf2js.rb +20 -0
  27. data/lib/hquery/engine.rb +4 -0
  28. data/lib/tasks/codes.rake +12 -0
  29. data/lib/tasks/coffee.rake +15 -0
  30. data/lib/tasks/convert.rake +47 -0
  31. data/lib/tasks/cover_me.rake +8 -0
  32. data/test/fixtures/NQF59New.xml +1047 -0
  33. data/test/fixtures/codes/codes.xls +0 -0
  34. data/test/fixtures/codes/codes.xml +1941 -0
  35. data/test/fixtures/i2b2.xml +305 -0
  36. data/test/fixtures/invalid/missing_id.xml +18 -0
  37. data/test/fixtures/invalid/unknown_criteria_type.xml +16 -0
  38. data/test/fixtures/invalid/unknown_demographic_entry.xml +16 -0
  39. data/test/fixtures/invalid/unknown_population_type.xml +9 -0
  40. data/test/fixtures/invalid/unknown_value_type.xml +18 -0
  41. data/test/fixtures/js/59New.js +366 -0
  42. data/test/fixtures/js/test1.js +356 -0
  43. data/test/fixtures/js/test2.js +366 -0
  44. data/test/fixtures/json/0043.json +6 -0
  45. data/test/fixtures/json/0043_hqmf1.json +1 -0
  46. data/test/fixtures/json/0043_hqmf2.json +172 -0
  47. data/test/fixtures/json/59New.json +1352 -0
  48. data/test/fixtures/patient_api.js +2823 -0
  49. data/test/fixtures/patients/francis_drake.json +1180 -0
  50. data/test/fixtures/patients/larry_vanderman.json +645 -0
  51. data/test/test_helper.rb +58 -0
  52. data/test/unit/codes_to_json_test.rb +38 -0
  53. data/test/unit/effective_date_test.rb +48 -0
  54. data/test/unit/hqmf_from_json_javascript_test.rb +108 -0
  55. data/test/unit/hqmf_javascript_test.rb +175 -0
  56. data/test/unit/library_function_test.rb +553 -0
  57. data/test/unit/specifics_test.rb +757 -0
  58. metadata +183 -0
data/config/warble.rb ADDED
@@ -0,0 +1,144 @@
1
+ # Disable Rake-environment-task framework detection by uncommenting/setting to false
2
+ # Warbler.framework_detection = false
3
+
4
+ # Warbler web application assembly configuration file
5
+ Warbler::Config.new do |config|
6
+ # Features: additional options controlling how the jar is built.
7
+ # Currently the following features are supported:
8
+ # - gemjar: package the gem repository in a jar file in WEB-INF/lib
9
+ # - executable: embed a web server and make the war executable
10
+ # - compiled: compile .rb files to .class files
11
+ # config.features = %w(gemjar)
12
+
13
+ # Application directories to be included in the webapp.
14
+ config.dirs = %w(app bin config lib)
15
+
16
+ # Additional files/directories to include, above those in config.dirs
17
+ # config.includes = FileList["db"]
18
+
19
+ # Additional files/directories to exclude
20
+ config.excludes = FileList["lib/tasks/*"]
21
+
22
+ # Additional Java .jar files to include. Note that if .jar files are placed
23
+ # in lib (and not otherwise excluded) then they need not be mentioned here.
24
+ # JRuby and JRuby-Rack are pre-loaded in this list. Be sure to include your
25
+ # own versions if you directly set the value
26
+ # config.java_libs += FileList["lib/java/*.jar"]
27
+
28
+ # Loose Java classes and miscellaneous files to be included.
29
+ # config.java_classes = FileList["target/classes/**.*"]
30
+
31
+ # One or more pathmaps defining how the java classes should be copied into
32
+ # the archive. The example pathmap below accompanies the java_classes
33
+ # configuration above. See http://rake.rubyforge.org/classes/String.html#M000017
34
+ # for details of how to specify a pathmap.
35
+ # config.pathmaps.java_classes << "%{target/classes/,}p"
36
+
37
+ # Bundler support is built-in. If Warbler finds a Gemfile in the
38
+ # project directory, it will be used to collect the gems to bundle
39
+ # in your application. If you wish to explicitly disable this
40
+ # functionality, uncomment here.
41
+ # config.bundler = false
42
+
43
+ # An array of Bundler groups to avoid including in the war file.
44
+ # Defaults to ["development", "test"].
45
+ # config.bundle_without = []
46
+
47
+ # Other gems to be included. If you don't use Bundler or a gemspec
48
+ # file, you need to tell Warbler which gems your application needs
49
+ # so that they can be packaged in the archive.
50
+ # For Rails applications, the Rails gems are included by default
51
+ # unless the vendor/rails directory is present.
52
+ # config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"]
53
+ # config.gems << "tzinfo"
54
+
55
+ # Uncomment this if you don't want to package rails gem.
56
+ # config.gems -= ["rails"]
57
+
58
+ # The most recent versions of gems are used.
59
+ # You can specify versions of gems by using a hash assignment:
60
+ # config.gems["rails"] = "2.3.10"
61
+
62
+ # You can also use regexps or Gem::Dependency objects for flexibility or
63
+ # finer-grained control.
64
+ # config.gems << /^merb-/
65
+ # config.gems << Gem::Dependency.new("merb-core", "= 0.9.3")
66
+
67
+ # Include gem dependencies not mentioned specifically. Default is
68
+ # true, uncomment to turn off.
69
+ # config.gem_dependencies = false
70
+
71
+ # Array of regular expressions matching relative paths in gems to be
72
+ # excluded from the war. Defaults to empty, but you can set it like
73
+ # below, which excludes test files.
74
+ # config.gem_excludes = [/^(test|spec)\//]
75
+
76
+ # Pathmaps for controlling how application files are copied into the archive
77
+ # config.pathmaps.application = ["WEB-INF/%p"]
78
+
79
+ # Name of the archive (without the extension). Defaults to the basename
80
+ # of the project directory.
81
+ config.jar_name = "hqmf2js"
82
+
83
+ # Name of the MANIFEST.MF template for the war file. Defaults to a simple
84
+ # MANIFEST.MF that contains the version of Warbler used to create the war file.
85
+ # config.manifest_file = "config/MANIFEST.MF"
86
+
87
+ # When using the 'compiled' feature and specified, only these Ruby
88
+ # files will be compiled. Default is to compile all \.rb files in
89
+ # the application.
90
+ # config.compiled_ruby_files = FileList['app/**/*.rb']
91
+
92
+ # === War files only below here ===
93
+
94
+ # Path to the pre-bundled gem directory inside the war file. Default
95
+ # is 'WEB-INF/gems'. Specify path if gems are already bundled
96
+ # before running Warbler. This also sets 'gem.path' inside web.xml.
97
+ # config.gem_path = "WEB-INF/vendor/bundler_gems"
98
+
99
+ # Files for WEB-INF directory (next to web.xml). This contains
100
+ # web.xml by default. If there is an .erb-File it will be processed
101
+ # with webxml-config. You may want to exclude this file via
102
+ # config.excludes.
103
+ # config.webinf_files += FileList["jboss-web.xml"]
104
+
105
+ # Files to be included in the root of the webapp. Note that files in public
106
+ # will have the leading 'public/' part of the path stripped during staging.
107
+ # config.public_html = FileList["public/**/*", "doc/**/*"]
108
+
109
+ # Pathmaps for controlling how public HTML files are copied into the .war
110
+ # config.pathmaps.public_html = ["%{public/,}p"]
111
+
112
+ # Value of RAILS_ENV for the webapp -- default as shown below
113
+ # config.webxml.rails.env = ENV['RAILS_ENV'] || 'production'
114
+
115
+ # Application booter to use, one of :rack, :rails, or :merb (autodetected by default)
116
+ # config.webxml.booter = :rails
117
+
118
+ # Set JRuby to run in 1.9 mode.
119
+ # config.webxml.jruby.compat.version = "1.9"
120
+
121
+ # When using the :rack booter, "Rackup" script to use.
122
+ # - For 'rackup.path', the value points to the location of the rackup
123
+ # script in the web archive file. You need to make sure this file
124
+ # gets included in the war, possibly by adding it to config.includes
125
+ # or config.webinf_files above.
126
+ # - For 'rackup', the rackup script you provide as an inline string
127
+ # is simply embedded in web.xml.
128
+ # The script is evaluated in a Rack::Builder to load the application.
129
+ # Examples:
130
+ # config.webxml.rackup.path = 'WEB-INF/hello.ru'
131
+ # config.webxml.rackup = %{require './lib/demo'; run Rack::Adapter::Camping.new(Demo)}
132
+ # config.webxml.rackup = require 'cgi' && CGI::escapeHTML(File.read("config.ru"))
133
+
134
+ # Control the pool of Rails runtimes. Leaving unspecified means
135
+ # the pool will grow as needed to service requests. It is recommended
136
+ # that you fix these values when running a production server!
137
+ # If you're using threadsafe! mode, you probably don't want to set these values,
138
+ # since 1 runtime(default for threadsafe mode) will be enough.
139
+ # config.webxml.jruby.min.runtimes = 2
140
+ # config.webxml.jruby.max.runtimes = 4
141
+
142
+ # JNDI data source name
143
+ # config.webxml.jndi = 'jdbc/rails'
144
+ end
data/hqmf2js.gemspec ADDED
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "hqmf2js"
5
+ s.summary = "A library for converting HQMF files to JavaScript"
6
+ s.description = "A library for converting HQMF files to executable JavaScript suitable for use with the hQuery Gateway"
7
+ s.email = "hquery-talk@googlegroups.com"
8
+ s.homepage = "http://github.com/hquery/hqmf2js"
9
+ s.authors = ["Marc Hadley"]
10
+ s.version = '1.0.0'
11
+
12
+ s.add_dependency 'nokogiri', '~> 1.5.2'
13
+ s.add_dependency 'tilt', '~> 1.3.3'
14
+ s.add_dependency 'coffee-script', '~> 2.2.0'
15
+ s.add_dependency 'sprockets', '~> 2.1.2'
16
+ s.add_development_dependency "awesome_print", "~> 0.3"
17
+
18
+ s.files = s.files = `git ls-files`.split("\n")
19
+ end
20
+