fhir_models 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e71a0c8cd83f3871b3f9a1d3c881c9b0d01c64d7
4
- data.tar.gz: 7c55e946fbd82fe8accb6a0fc15fd3e34f768143
3
+ metadata.gz: bee3770940059e03438d83d5796331896b4b00ba
4
+ data.tar.gz: 2d3d96330595dcc6811da5f9a1f78bdd43af90e0
5
5
  SHA512:
6
- metadata.gz: 2606c5670d5983a86af5f4b6ddcee9d0ec791be3489325e81b8a9982ea0dd601c9317516be7ed8307c66ed22e59b13af26cae51d1b56d1859bc01ac679296291
7
- data.tar.gz: 089670e82c830e365d3ad84655aeaae392854aebf1a5c41aa7907866dc72660c84e65e3b3bc9959384d85626711db4cdb033d8b2583da1770748bf5718bd837b
6
+ metadata.gz: 8de95c1ddc6a7e064cab82c31226fe2c39027bca2385cabf0fc7251b76b5ba22435da6e60d739f1ab32c4b34c5e0ae1e40ceecae4134d6a5217c2977a7e4c65b
7
+ data.tar.gz: ce89ad4aca54dc75637f58184ea36bd8baebdef0396f0ee809a9f09ba07b7a8082d87b01df3cb73296dde40a56aa5cd43bfb8cf5e85624d44c62dbb0315d58a6
File without changes
data/Gemfile CHANGED
@@ -2,9 +2,9 @@ source "http://rubygems.org"
2
2
  gemspec
3
3
 
4
4
  group :test do
5
- gem 'simplecov', :require => false
5
+ gem 'simplecov'
6
6
  gem 'minitest', "~> 4.0"
7
- gem 'turn', :require => false
7
+ gem 'turn'
8
8
  gem 'awesome_print', :require => 'ap'
9
9
  gem 'nokogiri-diff'
10
10
  end
data/fhir_models.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.email = "jwalonoski@mitre.org"
8
8
  s.homepage = "https://github.com/fhir-crucible/fhir_models"
9
9
  s.authors = ["Jason Walonoski", "Andre Quina", "Michael O'Keefe"]
10
- s.version = '1.6.1'
10
+ s.version = '1.6.2'
11
11
  s.files = s.files = `git ls-files`.split("\n")
12
12
  s.add_development_dependency 'pry'
13
13
  s.add_dependency 'rake', '>= 0.8.7'
@@ -132,12 +132,21 @@ module FHIR
132
132
  multiple_types = self.class::MULTIPLE_TYPES rescue {}
133
133
  multiple_types.each do |prefix,suffixes|
134
134
  count = 0
135
+ present = []
135
136
  suffixes.each do |suffix|
136
- count += 1 if errors["#{prefix}#{suffix}"]
137
- # TODO check if multiple data types are actually present, not just errors
137
+ typename = "#{prefix}#{suffix[0].upcase}#{suffix[1..-1]}"
138
+ count += 1 if errors[typename]
139
+ # check which multiple data types are actually present, not just errors
138
140
  # actually, this might be allowed depending on cardinality
141
+ value = self.instance_variable_get("@#{typename}")
142
+ present << typename if !value.nil? || (value.is_a?(Array) && !value.empty?)
139
143
  end
140
144
  errors[prefix] = ["#{prefix}[x]: more than one type present."] if(count > 1)
145
+ # remove errors for suffixes that are not present
146
+ suffixes.each do |suffix|
147
+ typename = "#{prefix}#{suffix[0].upcase}#{suffix[1..-1]}"
148
+ errors.delete(typename) if !present.include?(typename)
149
+ end
141
150
  end
142
151
  errors.keep_if{|k,v|(v && !v.empty?)}
143
152
  end
@@ -245,7 +254,7 @@ module FHIR
245
254
  end
246
255
  end
247
256
  end # value.each
248
- errors.delete(field) if value.empty?
257
+ errors.delete(field) if errors[field].empty?
249
258
  end
250
259
 
251
260
  def is_primitive?(datatype,value)
@@ -0,0 +1,10 @@
1
+ require 'simplecov'
2
+ require_relative '../lib/fhir_models'
3
+
4
+ require 'fileutils'
5
+ require 'pry'
6
+ require 'nokogiri/diff'
7
+ require 'minitest/autorun'
8
+ require 'bundler/setup'
9
+ require 'test/unit'
10
+ require 'turn'
@@ -1,11 +1,4 @@
1
- require_relative "../simplecov"
2
- require_relative '../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../test_helper'
9
2
 
10
3
  class ContentsTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../simplecov"
2
- require_relative '../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../test_helper'
9
2
 
10
3
  class EqualityTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../simplecov"
2
- require_relative '../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../test_helper'
9
2
 
10
3
  class ExpansionsTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../simplecov"
2
- require_relative '../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../test_helper'
9
2
 
10
3
  class ExtensionByNameTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../../simplecov"
2
- require_relative '../../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../../test_helper'
9
2
 
10
3
  class AndOrNotTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../../simplecov"
2
- require_relative '../../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../../test_helper'
9
2
 
10
3
  class ConvertToBooleanTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../../simplecov"
2
- require_relative '../../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../../test_helper'
9
2
 
10
3
  class ExistenceTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../../simplecov"
2
- require_relative '../../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../../test_helper'
9
2
 
10
3
  class ExtensionTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../../simplecov"
2
- require_relative '../../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../../test_helper'
9
2
 
10
3
  class FluentEqualityTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../../simplecov"
2
- require_relative '../../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../../test_helper'
9
2
 
10
3
  class InvariantsTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../../simplecov"
2
- require_relative '../../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../../test_helper'
9
2
 
10
3
  class MathTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../../simplecov"
2
- require_relative '../../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../../test_helper'
9
2
 
10
3
  class PathTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../../simplecov"
2
- require_relative '../../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../../test_helper'
9
2
 
10
3
  class StringTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../simplecov"
2
- require_relative '../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../test_helper'
9
2
 
10
3
  class JsonFormatTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../simplecov"
2
- require_relative '../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../test_helper'
9
2
 
10
3
  class JsonValidationTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../simplecov"
2
- require_relative '../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../test_helper'
9
2
 
10
3
  class MultipleTypesTest < Test::Unit::TestCase
11
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../simplecov"
2
- require_relative '../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../test_helper'
9
2
 
10
3
  class ProfileValidationTest < Test::Unit::TestCase
11
4
 
@@ -1,12 +1,4 @@
1
- require_relative "../simplecov"
2
- require_relative '../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'nokogiri/diff'
7
- require 'minitest/autorun'
8
- require 'bundler/setup'
9
- require 'test/unit'
1
+ require_relative '../test_helper'
10
2
 
11
3
  class XmlFormatTest < Test::Unit::TestCase
12
4
 
@@ -1,12 +1,4 @@
1
- require_relative "../simplecov"
2
- require_relative '../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'nokogiri/diff'
7
- require 'minitest/autorun'
8
- require 'bundler/setup'
9
- require 'test/unit'
1
+ require_relative '../test_helper'
10
2
 
11
3
  class XmlSchemaValidationTest < Test::Unit::TestCase
12
4
 
@@ -1,11 +1,4 @@
1
- require_relative "../simplecov"
2
- require_relative '../../lib/fhir_models'
3
-
4
- require 'fileutils'
5
- require 'pry'
6
- require 'minitest/autorun'
7
- require 'bundler/setup'
8
- require 'test/unit'
1
+ require_relative '../test_helper'
9
2
 
10
3
  class XmlValidationTest < Test::Unit::TestCase
11
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fhir_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Walonoski
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-08-22 00:00:00.000000000 Z
13
+ date: 2016-08-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: pry
@@ -109,6 +109,7 @@ extensions: []
109
109
  extra_rdoc_files: []
110
110
  files:
111
111
  - .gitignore
112
+ - .simplecov
112
113
  - .travis.yml
113
114
  - Gemfile
114
115
  - Gemfile.lock
@@ -1210,7 +1211,7 @@ files:
1210
1211
  - lib/fluentpath/expression.rb
1211
1212
  - lib/fluentpath/parse.rb
1212
1213
  - lib/tasks/tasks.rake
1213
- - test/simplecov.rb
1214
+ - test/test_helper.rb
1214
1215
  - test/unit/contents_test.rb
1215
1216
  - test/unit/equality_test.rb
1216
1217
  - test/unit/expansions_test.rb