ruby-hl7 1.2.3 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +7 -0
  3. data/.rubocop.yml +127 -0
  4. data/.travis.yml +20 -0
  5. data/Gemfile +3 -0
  6. data/Gemfile.lock +58 -0
  7. data/NOTES.md +121 -0
  8. data/README.rdoc +5 -0
  9. data/Rakefile +77 -0
  10. data/VERSION +1 -0
  11. data/VERSION.yml +4 -0
  12. data/examples/proxy_server.rb +26 -0
  13. data/lib/ruby-hl7.rb +1 -1
  14. data/lib/segments/pid.rb +13 -1
  15. data/ruby-hl7.gemspec +38 -0
  16. data/spec/ail_segment_spec.rb +28 -0
  17. data/spec/aip_segment_spec.rb +31 -0
  18. data/spec/basic_parsing_spec.rb +319 -0
  19. data/spec/batch_parsing_spec.rb +52 -0
  20. data/spec/child_segment_spec.rb +66 -0
  21. data/spec/core_ext/date_time_spec.rb +43 -0
  22. data/spec/default_segment_spec.rb +31 -0
  23. data/spec/dg1_spec.rb +42 -0
  24. data/spec/dynamic_segment_def_spec.rb +37 -0
  25. data/spec/err_segment_spec.rb +26 -0
  26. data/spec/evn_segment_spec.rb +23 -0
  27. data/spec/fts_segment_spec.rb +19 -0
  28. data/spec/in1_segment_spec.rb +34 -0
  29. data/spec/message_spec.rb +53 -0
  30. data/spec/messages_spec.rb +24 -0
  31. data/spec/mfe_segment_spec.rb +28 -0
  32. data/spec/mfi_segment_spec.rb +28 -0
  33. data/spec/msa_segment_spec.rb +27 -0
  34. data/spec/msh_segment_spec.rb +28 -0
  35. data/spec/nk1_segment_spec.rb +26 -0
  36. data/spec/obr_segment_spec.rb +45 -0
  37. data/spec/obx_segment_spec.rb +68 -0
  38. data/spec/orc_segment_spec.rb +27 -0
  39. data/spec/pid_segment_spec.rb +78 -0
  40. data/spec/prd_segment_spec.rb +29 -0
  41. data/spec/pv1_segment_spec.rb +23 -0
  42. data/spec/rf1_segment_spec.rb +29 -0
  43. data/spec/sch_segment_spec.rb +32 -0
  44. data/spec/segment_field_spec.rb +110 -0
  45. data/spec/segment_generator_spec.rb +32 -0
  46. data/spec/segment_list_storage_spec.rb +47 -0
  47. data/spec/segment_spec.rb +38 -0
  48. data/spec/sft_segment_spec.rb +26 -0
  49. data/spec/spec_helper.rb +13 -0
  50. data/spec/speed_parsing_spec.rb +19 -0
  51. data/spec/spm_segment_spec.rb +26 -0
  52. metadata +117 -13
  53. data/lib/segments/zcf.rb +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f8f63eebddc15165ad878ecb3b78935ce3892131
4
- data.tar.gz: 134b5d4f57b5ff439921b3f4d8f509a49f7ec4d2
3
+ metadata.gz: 2bd60d7ea43a61d43ad3cb37f9271310f002f595
4
+ data.tar.gz: 6689e9e620ad9ba0d6391eb0ca5504dd84ce8802
5
5
  SHA512:
6
- metadata.gz: 0a72a3aebd6f19860238bb8bd9a60c09dedcf5dc54dc0a40812eaed0598cfd38c339432b20b6f09a51cf758f03440e086bc24ca72ca2dfefd3b962f3191487cc
7
- data.tar.gz: f254e4d43d6696bd135e01a6415d856b4e4f58ec4bcedeeb51f0afe21335f33a4fe9e88019ac2c82220d50ce0c0be945c14054811676773351dfe7b9957b45ab
6
+ metadata.gz: 17fbea8014712fac948f7adc2af0fd800c5e248dc9596d7fba6529224f44418818e0b1516894ec3f7120fbb1fccd099209b6c086937c2415e5b561b96c31f379
7
+ data.tar.gz: 30e760b9a7b4f2bfc3309f3eec68df101e21898ff74b035d13d168d71383d5a50fa292679eeee9e32b4fbf43961a7e92be6b2473de3b99a1a511b599edd4db7f
@@ -0,0 +1,7 @@
1
+ .bundle
2
+ coverage
3
+ doc
4
+ pkg
5
+ .rspec
6
+ .DS_Store
7
+ .rspec
@@ -0,0 +1,127 @@
1
+ # Copied from bundler :)
2
+
3
+ AllCops:
4
+ TargetRubyVersion: 1.9
5
+ Exclude:
6
+ - tmp/**/*
7
+ DisplayCopNames: true
8
+
9
+ # They are idiomatic
10
+ Lint/AssignmentInCondition:
11
+ Enabled: false
12
+
13
+ Lint/EndAlignment:
14
+ EnforcedStyleAlignWith: variable
15
+ AutoCorrect: true
16
+
17
+ Lint/UnusedMethodArgument:
18
+ Enabled: false
19
+
20
+ # Style
21
+
22
+ Style/AccessModifierIndentation:
23
+ EnforcedStyle: outdent
24
+
25
+ Style/Alias:
26
+ EnforcedStyle: prefer_alias_method
27
+
28
+ Style/AlignParameters:
29
+ EnforcedStyle: with_fixed_indentation
30
+
31
+ Style/FrozenStringLiteralComment:
32
+ EnforcedStyle: always
33
+
34
+ Style/MultilineBlockChain:
35
+ Enabled: false
36
+
37
+ Style/MultilineOperationIndentation:
38
+ EnforcedStyle: indented
39
+
40
+ Style/PerlBackrefs:
41
+ Enabled: false
42
+
43
+ Style/SingleLineBlockParams:
44
+ Enabled: false
45
+
46
+ Style/SpaceInsideBlockBraces:
47
+ SpaceBeforeBlockParameters: false
48
+
49
+ Style/TrivialAccessors:
50
+ Enabled: false
51
+
52
+ # We adopted raise instead of fail.
53
+ Style/SignalException:
54
+ EnforcedStyle: only_raise
55
+
56
+ Style/StringLiterals:
57
+ EnforcedStyle: double_quotes
58
+
59
+ Style/StringLiteralsInInterpolation:
60
+ EnforcedStyle: double_quotes
61
+
62
+ # Having these make it easier to *not* forget to add one when adding a new
63
+ # value and you can simply copy the previous line.
64
+ Style/TrailingCommaInLiteral:
65
+ EnforcedStyleForMultiline: comma
66
+
67
+ Style/TrailingUnderscoreVariable:
68
+ Enabled: false
69
+
70
+ # `String.new` is preferred style with enabled frozen string literal
71
+ Style/EmptyLiteral:
72
+ Enabled: false
73
+
74
+ # 1.8.7 support
75
+
76
+ Style/HashSyntax:
77
+ EnforcedStyle: hash_rockets
78
+
79
+ Style/Lambda:
80
+ Enabled: false
81
+
82
+ Style/DotPosition:
83
+ EnforcedStyle: trailing
84
+
85
+ Style/EachWithObject:
86
+ Enabled: false
87
+
88
+ Style/SpecialGlobalVars:
89
+ Enabled: false
90
+
91
+ Style/TrailingCommaInArguments:
92
+ Enabled: false
93
+
94
+ Performance/FlatMap:
95
+ Enabled: false
96
+
97
+ # Metrics
98
+
99
+ # We've chosen to use Rubocop only for style, and not for complexity or quality checks.
100
+ Metrics/ClassLength:
101
+ Enabled: false
102
+
103
+ Metrics/ModuleLength:
104
+ Enabled: false
105
+
106
+ Metrics/MethodLength:
107
+ Enabled: false
108
+
109
+ Metrics/BlockNesting:
110
+ Enabled: false
111
+
112
+ Metrics/AbcSize:
113
+ Enabled: false
114
+
115
+ Metrics/CyclomaticComplexity:
116
+ Enabled: false
117
+
118
+ Metrics/ParameterLists:
119
+ Enabled: false
120
+
121
+ Metrics/BlockLength:
122
+ Enabled: false
123
+
124
+ # It will be obvious which code is complex, Rubocop should only lint simple
125
+ # rules for us.
126
+ Metrics/PerceivedComplexity:
127
+ Enabled: false
@@ -0,0 +1,20 @@
1
+ branches:
2
+ only:
3
+ - master
4
+ language: ruby
5
+ matrix:
6
+ allow_failures:
7
+ - rvm:
8
+ - ruby-head
9
+ - 1.9.3
10
+ sudo: required
11
+ dist: trusty
12
+ addons:
13
+ apt:
14
+ packages:
15
+ - haveged
16
+ rvm:
17
+ - 2.4
18
+ - 2.3
19
+ - 2.2
20
+ - jruby-9.1.5.0
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,58 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ruby-hl7 (1.3.0)
5
+ rake (~> 11.0)
6
+ rdoc (~> 3.12)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ coderay (1.1.2)
12
+ diff-lcs (1.3)
13
+ docile (1.3.0)
14
+ ffi (1.10.0-java)
15
+ json (1.8.6)
16
+ json (1.8.6-java)
17
+ method_source (0.9.0)
18
+ pry (0.11.3)
19
+ coderay (~> 1.1.0)
20
+ method_source (~> 0.9.0)
21
+ pry (0.11.3-java)
22
+ coderay (~> 1.1.0)
23
+ method_source (~> 0.9.0)
24
+ spoon (~> 0.0)
25
+ rake (11.3.0)
26
+ rdoc (3.12.2)
27
+ json (~> 1.4)
28
+ rspec (2.99.0)
29
+ rspec-core (~> 2.99.0)
30
+ rspec-expectations (~> 2.99.0)
31
+ rspec-mocks (~> 2.99.0)
32
+ rspec-core (2.99.2)
33
+ rspec-expectations (2.99.2)
34
+ diff-lcs (>= 1.1.3, < 2.0)
35
+ rspec-mocks (2.99.4)
36
+ simplecov (0.16.1)
37
+ docile (~> 1.1)
38
+ json (>= 1.8, < 3)
39
+ simplecov-html (~> 0.10.0)
40
+ simplecov-html (0.10.2)
41
+ spoon (0.0.6)
42
+ ffi
43
+
44
+ PLATFORMS
45
+ java
46
+ ruby
47
+ x86-mingw32
48
+
49
+ DEPENDENCIES
50
+ bundler (~> 1.17)
51
+ pry
52
+ rspec (~> 2.99)
53
+ ruby-hl7!
54
+ simplecov (~> 0.15)
55
+
56
+ BUNDLED WITH
57
+ 1.17.2
58
+
@@ -0,0 +1,121 @@
1
+ ## Overview
2
+
3
+ **Version 1.3.0**
4
+ Removed ZCF segment
5
+ Renamed PID-12 from country_code to county_code (deprecation warnings)
6
+ Bumped gem dependency versions
7
+
8
+ https://github.com/ruby-hl7/ruby-hl7/pull/90
9
+ https://github.com/ruby-hl7/ruby-hl7/pull/91
10
+ https://github.com/ruby-hl7/ruby-hl7/pull/93
11
+ https://github.com/ruby-hl7/ruby-hl7/pull/95
12
+ https://github.com/ruby-hl7/ruby-hl7/pull/97
13
+
14
+ Thanks to:
15
+ @mogox @rclavel @mullican
16
+
17
+ **Version 1.2.3**
18
+ New Segments:
19
+ AIG
20
+ AIS
21
+ MRG
22
+ RGS
23
+ TQ1
24
+ IN1
25
+
26
+ https://github.com/ruby-hl7/ruby-hl7/pull/86
27
+ https://github.com/ruby-hl7/ruby-hl7/pull/87
28
+
29
+
30
+ Thanks to:
31
+ @finnhowell, @rclavel
32
+
33
+ **Version 1.2.2**
34
+ New segments:
35
+ AIL
36
+ AIP
37
+ SCH
38
+
39
+ Feature Updates
40
+ https://github.com/ruby-hl7/ruby-hl7/pull/69
41
+ https://github.com/ruby-hl7/ruby-hl7/pull/79
42
+ https://github.com/ruby-hl7/ruby-hl7/pull/81
43
+ https://github.com/ruby-hl7/ruby-hl7/pull/82
44
+ https://github.com/ruby-hl7/ruby-hl7/pull/83
45
+
46
+ Thanks to @finnhowell, @myokoym, and @mogox for contributions.
47
+
48
+ **Version 1.2.1**
49
+ New segments:
50
+ DG1
51
+
52
+ https://github.com/ruby-hl7/ruby-hl7/pull/61
53
+ https://github.com/ruby-hl7/ruby-hl7/pull/66
54
+ https://github.com/ruby-hl7/ruby-hl7/pull/68
55
+ https://github.com/ruby-hl7/ruby-hl7/pull/72
56
+ https://github.com/ruby-hl7/ruby-hl7/pull/74
57
+
58
+ Thanks to:
59
+ @caseyprovost, @adamjubert, @vadeolu
60
+
61
+ **Version 1.2.0**
62
+ Included in this release:
63
+ https://github.com/ruby-hl7/ruby-hl7/pull/52
64
+ https://github.com/ruby-hl7/ruby-hl7/pull/56
65
+ https://github.com/ruby-hl7/ruby-hl7/pull/58
66
+ https://github.com/ruby-hl7/ruby-hl7/pull/59
67
+
68
+ Thanks to:
69
+ @adamstegman, @clausti, @evanmthw, @mitch-lindsay
70
+
71
+ **Version 1.1.1**
72
+ Included in this release:
73
+
74
+ - https://github.com/ruby-hl7/ruby-hl7/pull/48
75
+ - https://github.com/ruby-hl7/ruby-hl7/pull/44
76
+
77
+ **Version 1.1.0**
78
+ Included in this release:
79
+ - https://github.com/ruby-hl7/ruby-hl7/pull/7
80
+ - https://github.com/ruby-hl7/ruby-hl7/pull/9
81
+ - https://github.com/ruby-hl7/ruby-hl7/pull/10
82
+ - https://github.com/ruby-hl7/ruby-hl7/pull/13
83
+ - https://github.com/ruby-hl7/ruby-hl7/pull/17
84
+ - https://github.com/ruby-hl7/ruby-hl7/pull/18
85
+ - https://github.com/ruby-hl7/ruby-hl7/pull/19
86
+ - https://github.com/ruby-hl7/ruby-hl7/pull/20
87
+ - https://github.com/ruby-hl7/ruby-hl7/pull/21
88
+ - https://github.com/ruby-hl7/ruby-hl7/pull/22
89
+ - https://github.com/ruby-hl7/ruby-hl7/pull/23
90
+ - https://github.com/ruby-hl7/ruby-hl7/pull/24
91
+ - https://github.com/ruby-hl7/ruby-hl7/pull/25
92
+ - https://github.com/ruby-hl7/ruby-hl7/pull/27
93
+ - https://github.com/ruby-hl7/ruby-hl7/pull/28
94
+ - https://github.com/ruby-hl7/ruby-hl7/pull/33
95
+ - https://github.com/ruby-hl7/ruby-hl7/pull/34
96
+ - https://github.com/ruby-hl7/ruby-hl7/pull/35
97
+ - https://github.com/ruby-hl7/ruby-hl7/pull/41
98
+
99
+ Thanks to:
100
+ @untoldone, @tomsabin, @patricksrobertson, @rojotek, @calebwoods and @jdee
101
+
102
+
103
+ **Version 1.0.3**
104
+ The ruby-hl7 gem removes some sample messages.
105
+
106
+ ## Release Date
107
+
108
+ January 25, 2011
109
+
110
+ ## In this release
111
+
112
+ * Sample messages from Cerner were removed.
113
+ * Some gem dependencies were updated.
114
+
115
+ ### Bug fixes
116
+
117
+ There are no bug fixes in this release.
118
+
119
+ ## Known Issues
120
+
121
+ There are currently no known open issues with the ruby-hl7 gem.
@@ -38,5 +38,10 @@ In your Gemfile:
38
38
 
39
39
  gem 'ruby-hl7'
40
40
 
41
+ === Migrating from 1.2.3 to 1.3.0
42
+
43
+ The ZCF segment has been removed, as it is not standard.
44
+ To continue using it, please use the {ruby-hl7-zcf gem}[https://github.com/doctolib/ruby-hl7-zcf].
45
+
41
46
  == License
42
47
  See the LICENSE file.
@@ -0,0 +1,77 @@
1
+ # $Id$
2
+ require 'rubygems'
3
+ require 'rake'
4
+ require 'rdoc/task'
5
+ require 'rubygems/package_task'
6
+ require 'rake/contrib/sshpublisher'
7
+ require 'rbconfig'
8
+ require 'rspec'
9
+ require 'rspec/core/rake_task'
10
+ require 'simplecov'
11
+
12
+ $: << './lib'
13
+ require 'ruby-hl7'
14
+ require 'message_parser'
15
+ require 'message'
16
+ require 'segment_list_storage'
17
+ require 'segment_generator'
18
+ require 'segment'
19
+
20
+ full_name = "Ruby-HL7"
21
+ RAKEVERSION = 11.0
22
+
23
+ # Many of these tasks were garnered from zenspider's Hoe
24
+ # just forced to work my way
25
+
26
+ desc 'Default: Run all examples'
27
+ task :default => :spec
28
+
29
+ spec = Gem::Specification.new do |s|
30
+ s.homepage = "https://github.com/ruby-hl7/ruby-hl7"
31
+ s.platform = Gem::Platform::RUBY
32
+ s.summary = "Ruby HL7 Library"
33
+ s.description = "A simple library to parse and generate HL7 2.x messages"
34
+ s.files = FileList["{bin,lib,test_data}/**/*"].to_a
35
+ s.require_path = "lib"
36
+ s.test_files = FileList["{test}/**/test*.rb"].to_a
37
+ s.has_rdoc = true
38
+ s.required_ruby_version = '>= 1.8.6'
39
+ s.extra_rdoc_files = %w[README.rdoc LICENSE]
40
+ s.add_dependency("rake", ">= #{RAKEVERSION}")
41
+ end
42
+
43
+ desc "Run all examples"
44
+ RSpec::Core::RakeTask.new(:spec) do |spec|
45
+ spec.pattern = 'spec/**/*.rb'
46
+ spec.ruby_opts = '-w'
47
+ end
48
+
49
+ desc "Run all examples with SimpleCov"
50
+ RSpec::Core::RakeTask.new(:spec_with_simplecov) do |spec|
51
+ ENV['COVERAGE'] = 'true'
52
+ spec.pattern = 'spec/**/*.rb'
53
+ end
54
+
55
+ RDoc::Task.new do |rd|
56
+ rd.main = "README.rdoc"
57
+ rd.rdoc_files.include("README.rdoc", "LICENSE", "lib/**/*.rb")
58
+ rd.title = "%s (%s) Documentation" % [ full_name, spec.version ]
59
+ rd.rdoc_dir = 'doc'
60
+ end
61
+
62
+ Gem::PackageTask.new(spec) do |pkg|
63
+ pkg.need_tar = true
64
+ end
65
+
66
+ desc 'Clean up all the extras'
67
+ task :clean => [ :clobber_rdoc, :clobber_package ] do
68
+ %w[*.gem ri coverage*].each do |pattern|
69
+ files = Dir[pattern]
70
+ rm_rf files unless files.empty?
71
+ end
72
+ end
73
+
74
+ desc 'Install the package as a gem'
75
+ task :install_gem => [:clean, :package] do
76
+ sh "sudo gem install pkg/*.gem"
77
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.3.0