fhir_models 4.2.1 → 4.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -6
- data/lib/fhir_models/bootstrap/hashable.rb +14 -10
- data/lib/fhir_models/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1519a66581a704c52e44ce3aa98f23528fe691ecf3af22bce5b0eaa8b45af05f
|
4
|
+
data.tar.gz: ed8c1093325205391c68b9f71ab81e2c80d6515660aaf59e4d51bbf4ebd80ba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 886b58b3631c5a7ba06f10b40f5721d12ededddc20ad692b830c88a1ea370e635fe6dae144ec90746588fc33415045936aed6f04cc803a1ec3275751d615caab
|
7
|
+
data.tar.gz: 2f29ad97d1f8b68a3f7e3631d7e06d6656982eff5efff162f560cd7dc715860c6d6a46d7f86b8da606bbf0e61dcec89eb80a5c732c26489c690d24d95b037939
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fhir_models (4.2.
|
4
|
+
fhir_models (4.2.2)
|
5
5
|
bcp47 (>= 0.3)
|
6
6
|
date_time_precision (>= 0.8)
|
7
7
|
mime-types (>= 3.0)
|
@@ -14,7 +14,7 @@ GEM
|
|
14
14
|
bcp47 (0.3.3)
|
15
15
|
i18n
|
16
16
|
coderay (1.1.3)
|
17
|
-
concurrent-ruby (1.1.
|
17
|
+
concurrent-ruby (1.1.10)
|
18
18
|
coolline (0.5.0)
|
19
19
|
unicode_utils (~> 1.4)
|
20
20
|
date_time_precision (0.8.1)
|
@@ -39,7 +39,7 @@ GEM
|
|
39
39
|
guard-test (2.0.8)
|
40
40
|
guard-compat (~> 1.2)
|
41
41
|
test-unit (~> 3.0)
|
42
|
-
i18n (1.
|
42
|
+
i18n (1.12.0)
|
43
43
|
concurrent-ruby (~> 1.0)
|
44
44
|
jaro_winkler (1.5.4)
|
45
45
|
json (2.3.1)
|
@@ -48,9 +48,9 @@ GEM
|
|
48
48
|
rb-inotify (~> 0.9, >= 0.9.10)
|
49
49
|
lumberjack (1.2.8)
|
50
50
|
method_source (1.0.0)
|
51
|
-
mime-types (3.
|
51
|
+
mime-types (3.4.1)
|
52
52
|
mime-types-data (~> 3.2015)
|
53
|
-
mime-types-data (3.
|
53
|
+
mime-types-data (3.2022.0105)
|
54
54
|
mini_portile2 (2.5.3)
|
55
55
|
nenv (0.3.0)
|
56
56
|
nokogiri (1.11.7)
|
@@ -131,7 +131,7 @@ DEPENDENCIES
|
|
131
131
|
test-unit
|
132
132
|
|
133
133
|
RUBY VERSION
|
134
|
-
ruby 2.
|
134
|
+
ruby 2.7.4p191
|
135
135
|
|
136
136
|
BUNDLED WITH
|
137
137
|
2.2.21
|
@@ -27,23 +27,26 @@ module FHIR
|
|
27
27
|
blank = ->(obj) { obj.respond_to?(:empty?) ? obj.empty? : obj.nil? }
|
28
28
|
if thing.is_a?(Array)
|
29
29
|
return nil if thing.empty?
|
30
|
-
|
31
|
-
thing
|
30
|
+
|
31
|
+
thing
|
32
|
+
.map { |i| prune(i) }
|
33
|
+
.reject(&blank)
|
32
34
|
elsif thing.is_a?(Hash)
|
33
35
|
return {} if thing.empty?
|
36
|
+
|
37
|
+
new_thing = {}
|
34
38
|
thing.each do |key, value|
|
35
|
-
|
36
|
-
end
|
37
|
-
thing.delete_if do |_key, value|
|
38
|
-
blank.call(value)
|
39
|
+
new_thing[key] = prune(value) unless blank.call(value)
|
39
40
|
end
|
41
|
+
new_thing
|
42
|
+
else
|
43
|
+
thing
|
40
44
|
end
|
41
|
-
thing
|
42
45
|
end
|
43
46
|
|
44
|
-
def from_hash(
|
47
|
+
def from_hash(original_hash)
|
45
48
|
# eliminate empty stuff
|
46
|
-
|
49
|
+
pruned_hash = prune(original_hash) unless original_hash.empty?
|
47
50
|
# clear the existing variables
|
48
51
|
self.class::METADATA.each do |key, value|
|
49
52
|
local_name = key
|
@@ -51,7 +54,8 @@ module FHIR
|
|
51
54
|
instance_variable_set("@#{local_name}", nil)
|
52
55
|
end
|
53
56
|
# set the variables to the hash values
|
54
|
-
|
57
|
+
pruned_hash&.each_key do |key|
|
58
|
+
value = original_hash[key]
|
55
59
|
key = key.to_s
|
56
60
|
meta = self.class::METADATA[key]
|
57
61
|
next if meta.nil?
|
data/lib/fhir_models/version.rb
CHANGED
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: 4.2.
|
4
|
+
version: 4.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Walonoski
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: exe
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2022-09-12 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: nokogiri
|