fhir_models 4.1.0 → 4.2.1

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
  SHA256:
3
- metadata.gz: 71b25db2dba6739f0186495302fc247b4479675488525afb5b3569408446cdd5
4
- data.tar.gz: 3760305ed63a524fd5d1fa6903904ad4c28cfc12ae90ed15cacc01f16478b4ef
3
+ metadata.gz: fadfd93d541495ffb2bef389e4f453b21463a56c9f50c39f8e894ee81ef039f8
4
+ data.tar.gz: 908a52232f3717ff22589707738e59f73276865c49d71a8eec31b9725b9fb623
5
5
  SHA512:
6
- metadata.gz: 422027ac41a10f913fcae1b772a615ef203ae54f2e2433fe3f7378526630d6a921e708ea87ef37d40c8be9c145b7701a7c4fc3136d65d6189aa519651b4372a4
7
- data.tar.gz: a370fb9b55024b8eda8e48d5414e8fb349ceb5242b893c798d8f5ae05d502d861868940e069ca54980f57c97d73e3d324b03d65de4ec012f1855bf59f3fbcd5f
6
+ metadata.gz: 333c284cada44d2ad27f70a66c0991f80143c53980d6c7cb11d15fbae54f7d28d8d8a6bed9bc12b268469e7f1cca950a9ddb961781bc762458d56db0d64ecfc1
7
+ data.tar.gz: e4cc9532a0a4f5c22194a6042a70adac2eeb54e8993704d81d1fd36988f106f3d3bf6e33e3eb55203d03099ea3ca3c7624ebe7ee3adc461b15f972b2f9875bed
data/.codeclimate.yml CHANGED
@@ -9,7 +9,7 @@ engines:
9
9
  enabled: true
10
10
  rubocop:
11
11
  enabled: true
12
- channel: rubocop-0-67
12
+ channel: rubocop-0-80
13
13
  ratings:
14
14
  paths:
15
15
  - "**.inc"
@@ -0,0 +1,26 @@
1
+ name: Ruby
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby-version: ['2.6', '2.7']
15
+
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ - name: Set up Ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby-version }}
22
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
23
+ - name: Run tests
24
+ run: bundle exec rake
25
+ - name: Rubocop
26
+ run: bundle exec rubocop
data/.rubocop.yml CHANGED
@@ -10,10 +10,16 @@ AllCops:
10
10
  - 'tmp/**/*'
11
11
  - '*.gemspec'
12
12
  - 'bin/*'
13
- Metrics/LineLength:
13
+ Layout/LineLength:
14
14
  Enabled: false
15
15
  Style/FrozenStringLiteralComment:
16
16
  Enabled: false
17
+ Style/HashEachMethods:
18
+ Enabled: true
19
+ Style/HashTransformKeys:
20
+ Enabled: true
21
+ Style/HashTransformValues:
22
+ Enabled: true
17
23
  inherit_mode:
18
24
  merge:
19
25
  - Exclude
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-07-01 12:11:28 -0400 using RuboCop version 0.67.2.
3
+ # on 2021-03-30 16:14:38 -0400 using RuboCop version 0.80.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -45,7 +45,7 @@ Metrics/AbcSize:
45
45
  Metrics/BlockLength:
46
46
  Max: 78
47
47
 
48
- # Offense count: 10
48
+ # Offense count: 12
49
49
  # Configuration parameters: CountBlocks.
50
50
  Metrics/BlockNesting:
51
51
  Max: 5
@@ -53,7 +53,7 @@ Metrics/BlockNesting:
53
53
  # Offense count: 7
54
54
  # Configuration parameters: CountComments.
55
55
  Metrics/ClassLength:
56
- Max: 358
56
+ Max: 356
57
57
 
58
58
  # Offense count: 23
59
59
  Metrics/CyclomaticComplexity:
@@ -62,7 +62,7 @@ Metrics/CyclomaticComplexity:
62
62
  # Offense count: 44
63
63
  # Configuration parameters: CountComments, ExcludedMethods.
64
64
  Metrics/MethodLength:
65
- Max: 135
65
+ Max: 133
66
66
 
67
67
  # Offense count: 2
68
68
  # Configuration parameters: CountComments.
@@ -73,30 +73,19 @@ Metrics/ModuleLength:
73
73
  Metrics/PerceivedComplexity:
74
74
  Max: 68
75
75
 
76
- # Offense count: 1
77
- # Configuration parameters: PreferredName.
78
- Naming/RescuedExceptionsVariableName:
79
- Exclude:
80
- - 'lib/fhir_models/bootstrap/hashable.rb'
81
-
82
76
  # Offense count: 4
83
77
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
84
- # AllowedNames: io, id, to, by, on, in, at, ip, db
85
- Naming/UncommunicativeMethodParamName:
78
+ # AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
79
+ Naming/MethodParameterName:
86
80
  Exclude:
87
81
  - 'lib/fhir_models/fhir_ext/structure_definition_compare.rb'
88
82
 
89
- # Offense count: 3
90
- Performance/Caller:
91
- Exclude:
92
- - 'lib/fhir_models/bootstrap/model.rb'
93
- - 'lib/fhir_models/deprecate.rb'
94
-
95
- # Offense count: 1
83
+ # Offense count: 2
96
84
  # Cop supports --auto-correct.
97
- Performance/InefficientHashSearch:
85
+ # Configuration parameters: PreferredName.
86
+ Naming/RescuedExceptionsVariableName:
98
87
  Exclude:
99
- - 'lib/fhir_models/bootstrap/template.rb'
88
+ - 'lib/fhir_models/bootstrap/hashable.rb'
100
89
 
101
90
  # Offense count: 1
102
91
  # Configuration parameters: .
@@ -141,7 +130,6 @@ Style/Documentation:
141
130
  Style/IfUnlessModifier:
142
131
  Exclude:
143
132
  - 'lib/fhir_models/bootstrap/generator.rb'
144
- - 'lib/fhir_models/bootstrap/hashable.rb'
145
133
  - 'lib/fhir_models/bootstrap/model.rb'
146
134
  - 'lib/fhir_models/bootstrap/template.rb'
147
135
  - 'lib/fhir_models/bootstrap/xml.rb'
@@ -175,7 +163,7 @@ Style/NumericPredicate:
175
163
  - 'spec/**/*'
176
164
  - 'lib/fhir_models/fhir_ext/structure_definition_compare.rb'
177
165
 
178
- # Offense count: 2
166
+ # Offense count: 1
179
167
  # Cop supports --auto-correct.
180
168
  Style/OrAssignment:
181
169
  Exclude:
@@ -200,8 +188,8 @@ Style/RescueStandardError:
200
188
 
201
189
  # Offense count: 4
202
190
  # Cop supports --auto-correct.
203
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, Whitelist.
204
- # Whitelist: present?, blank?, presence, try, try!
191
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
192
+ # AllowedMethods: present?, blank?, presence, try, try!
205
193
  Style/SafeNavigation:
206
194
  Exclude:
207
195
  - 'lib/fhir_models/bootstrap/definitions.rb'
data/Gemfile.lock CHANGED
@@ -1,28 +1,28 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fhir_models (4.1.0)
4
+ fhir_models (4.2.1)
5
5
  bcp47 (>= 0.3)
6
6
  date_time_precision (>= 0.8)
7
7
  mime-types (>= 3.0)
8
- nokogiri (>= 1.10.4)
8
+ nokogiri (>= 1.11.4)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- ast (2.4.0)
13
+ ast (2.4.2)
14
14
  bcp47 (0.3.3)
15
15
  i18n
16
- coderay (1.1.2)
17
- concurrent-ruby (1.1.6)
16
+ coderay (1.1.3)
17
+ concurrent-ruby (1.1.9)
18
18
  coolline (0.5.0)
19
19
  unicode_utils (~> 1.4)
20
20
  date_time_precision (0.8.1)
21
- diff-lcs (1.3)
21
+ diff-lcs (1.4.4)
22
22
  docile (1.3.2)
23
- ffi (1.11.1)
23
+ ffi (1.13.1)
24
24
  formatador (0.2.5)
25
- guard (2.15.0)
25
+ guard (2.16.2)
26
26
  formatador (>= 0.2.4)
27
27
  listen (>= 2.7, < 4.0)
28
28
  lumberjack (>= 1.0.12, < 2.0)
@@ -39,78 +39,78 @@ GEM
39
39
  guard-test (2.0.8)
40
40
  guard-compat (~> 1.2)
41
41
  test-unit (~> 3.0)
42
- i18n (1.8.2)
42
+ i18n (1.8.10)
43
43
  concurrent-ruby (~> 1.0)
44
- jaro_winkler (1.5.3)
45
- json (2.2.0)
46
- listen (3.1.5)
47
- rb-fsevent (~> 0.9, >= 0.9.4)
48
- rb-inotify (~> 0.9, >= 0.9.7)
49
- ruby_dep (~> 1.2)
50
- lumberjack (1.0.13)
51
- method_source (0.9.2)
44
+ jaro_winkler (1.5.4)
45
+ json (2.3.1)
46
+ listen (3.3.1)
47
+ rb-fsevent (~> 0.10, >= 0.10.3)
48
+ rb-inotify (~> 0.9, >= 0.9.10)
49
+ lumberjack (1.2.8)
50
+ method_source (1.0.0)
52
51
  mime-types (3.3.1)
53
52
  mime-types-data (~> 3.2015)
54
- mime-types-data (3.2019.1009)
55
- mini_portile2 (2.4.0)
53
+ mime-types-data (3.2021.0901)
54
+ mini_portile2 (2.5.3)
56
55
  nenv (0.3.0)
57
- nokogiri (1.10.8)
58
- mini_portile2 (~> 2.4.0)
56
+ nokogiri (1.11.7)
57
+ mini_portile2 (~> 2.5.0)
58
+ racc (~> 1.4)
59
59
  nokogiri-diff (0.2.0)
60
60
  nokogiri (~> 1.5)
61
61
  tdiff (~> 0.3, >= 0.3.2)
62
62
  notiffany (0.1.3)
63
63
  nenv (~> 0.1)
64
64
  shellany (~> 0.0)
65
- parallel (1.17.0)
66
- parser (2.6.3.0)
67
- ast (~> 2.4.0)
68
- power_assert (1.1.5)
69
- pry (0.12.2)
70
- coderay (~> 1.1.0)
71
- method_source (~> 0.9.0)
65
+ parallel (1.20.1)
66
+ parser (3.0.0.0)
67
+ ast (~> 2.4.1)
68
+ power_assert (1.2.0)
69
+ pry (0.13.1)
70
+ coderay (~> 1.1)
71
+ method_source (~> 1.0)
72
72
  pry-coolline (0.2.5)
73
73
  coolline (~> 0.5)
74
- psych (3.1.0)
74
+ racc (1.5.2)
75
75
  rainbow (3.0.0)
76
- rake (12.3.3)
77
- rb-fsevent (0.10.3)
78
- rb-inotify (0.10.0)
76
+ rake (13.0.1)
77
+ rb-fsevent (0.10.4)
78
+ rb-inotify (0.10.1)
79
79
  ffi (~> 1.0)
80
- rspec (3.8.0)
81
- rspec-core (~> 3.8.0)
82
- rspec-expectations (~> 3.8.0)
83
- rspec-mocks (~> 3.8.0)
84
- rspec-core (3.8.2)
85
- rspec-support (~> 3.8.0)
86
- rspec-expectations (3.8.4)
80
+ rexml (3.2.5)
81
+ rspec (3.10.0)
82
+ rspec-core (~> 3.10.0)
83
+ rspec-expectations (~> 3.10.0)
84
+ rspec-mocks (~> 3.10.0)
85
+ rspec-core (3.10.0)
86
+ rspec-support (~> 3.10.0)
87
+ rspec-expectations (3.10.0)
87
88
  diff-lcs (>= 1.2.0, < 2.0)
88
- rspec-support (~> 3.8.0)
89
- rspec-mocks (3.8.1)
89
+ rspec-support (~> 3.10.0)
90
+ rspec-mocks (3.10.0)
90
91
  diff-lcs (>= 1.2.0, < 2.0)
91
- rspec-support (~> 3.8.0)
92
- rspec-support (3.8.2)
93
- rubocop (0.67.0)
92
+ rspec-support (~> 3.10.0)
93
+ rspec-support (3.10.0)
94
+ rubocop (0.80.0)
94
95
  jaro_winkler (~> 1.5.1)
95
96
  parallel (~> 1.10)
96
- parser (>= 2.5, != 2.5.1.1)
97
- psych (>= 3.1.0)
97
+ parser (>= 2.7.0.1)
98
98
  rainbow (>= 2.2.2, < 4.0)
99
+ rexml
99
100
  ruby-progressbar (~> 1.7)
100
- unicode-display_width (>= 1.4.0, < 1.6)
101
- ruby-progressbar (1.10.1)
102
- ruby_dep (1.5.0)
101
+ unicode-display_width (>= 1.4.0, < 1.7)
102
+ ruby-progressbar (1.11.0)
103
103
  shellany (0.0.1)
104
- simplecov (0.17.0)
104
+ simplecov (0.17.1)
105
105
  docile (~> 1.1)
106
106
  json (>= 1.8, < 3)
107
107
  simplecov-html (~> 0.10.0)
108
108
  simplecov-html (0.10.2)
109
109
  tdiff (0.3.4)
110
- test-unit (3.3.3)
110
+ test-unit (3.3.6)
111
111
  power_assert
112
- thor (0.20.3)
113
- unicode-display_width (1.5.0)
112
+ thor (1.0.1)
113
+ unicode-display_width (1.6.1)
114
114
  unicode_utils (1.4.0)
115
115
 
116
116
  PLATFORMS
@@ -126,12 +126,12 @@ DEPENDENCIES
126
126
  pry-coolline
127
127
  rake
128
128
  rspec
129
- rubocop (= 0.67)
129
+ rubocop (= 0.80)
130
130
  simplecov (~> 0.17.0)
131
131
  test-unit
132
132
 
133
133
  RUBY VERSION
134
- ruby 2.5.1p57
134
+ ruby 2.5.6p201
135
135
 
136
136
  BUNDLED WITH
137
- 2.0.1
137
+ 2.2.21
data/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright {yyyy} {name of copyright owner}
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
data/README.md CHANGED
@@ -54,6 +54,16 @@ $ bundle exec rake fhir:console
54
54
  'system' => 'http://unitsofmeasure.org'
55
55
  )
56
56
  ```
57
+
58
+ Iterating over all elements in a resource, including nested elements...
59
+ ```ruby
60
+ patient.each_element do |value, metadata, path|
61
+ puts "Info for #{path}:"
62
+ puts "- value: #{value}"
63
+ puts "- type: #{metadata['type']}"
64
+ puts "- cardinality: #{metadata['min']}..#{metadata['max']}"
65
+ end
66
+ ```
57
67
 
58
68
  ### Validation
59
69
 
@@ -73,7 +83,7 @@ $ bundle exec rake fhir:console
73
83
  ```
74
84
  # License
75
85
 
76
- Copyright 2014-2019 The MITRE Corporation
86
+ Copyright 2014-2021 The MITRE Corporation
77
87
 
78
88
  Licensed under the Apache License, Version 2.0 (the "License");
79
89
  you may not use this file except in compliance with the License.
data/fhir_models.gemspec CHANGED
@@ -8,6 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = FHIR::Models::VERSION
9
9
  spec.authors = ['Jason Walonoski', 'Andre Quina', "Michael O'Keefe", 'Robert Scanlon', 'Reece Adamson']
10
10
  spec.email = ['jwalonoski@mitre.org']
11
+ spec.licenses = ['Apache-2.0']
11
12
 
12
13
  spec.summary = %q{A Gem for handling FHIR models in ruby}
13
14
  spec.description = %q{A Gem for handling FHIR models in ruby}
@@ -20,7 +21,7 @@ Gem::Specification.new do |spec|
20
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
22
  spec.require_paths = ['lib']
22
23
 
23
- spec.add_dependency 'nokogiri', '>= 1.10.4'
24
+ spec.add_dependency 'nokogiri', '>= 1.11.4'
24
25
  spec.add_dependency 'date_time_precision', '>= 0.8'
25
26
  spec.add_dependency 'bcp47', '>= 0.3'
26
27
  spec.add_dependency 'mime-types', '>= 3.0'
@@ -33,7 +34,7 @@ Gem::Specification.new do |spec|
33
34
  spec.add_development_dependency 'rspec'
34
35
  spec.add_development_dependency 'simplecov', '~> 0.17.0'
35
36
  spec.add_development_dependency 'nokogiri-diff'
36
- spec.add_development_dependency 'rubocop', '0.67'
37
+ spec.add_development_dependency 'rubocop', '0.80'
37
38
  spec.add_development_dependency 'guard-rspec'
38
39
  spec.add_development_dependency 'guard-test'
39
40
  end
@@ -6,8 +6,8 @@ module FHIR
6
6
  # This module includes methods to serialize or deserialize FHIR resources to and from JSON.
7
7
  #
8
8
 
9
- def to_json
10
- JSON.pretty_unparse(to_hash)
9
+ def to_json(opts = nil)
10
+ JSON.pretty_generate(to_hash, opts)
11
11
  end
12
12
 
13
13
  def self.from_json(json)
@@ -17,8 +17,8 @@ module FHIR
17
17
  resource_type = hash['resourceType']
18
18
  klass = Module.const_get("FHIR::#{resource_type}")
19
19
  resource = klass.new(hash)
20
- rescue => ex
21
- FHIR.logger.error("Failed to deserialize JSON:\n#{ex.backtrace}")
20
+ rescue => e
21
+ FHIR.logger.error("Failed to deserialize JSON:\n#{e.backtrace}")
22
22
  FHIR.logger.debug("JSON:\n#{json}")
23
23
  resource = nil
24
24
  end
@@ -55,7 +55,7 @@ module FHIR
55
55
  return ext.first.value.nil? ? ext.first : ext.first.value
56
56
  end
57
57
  end
58
- raise NoMethodError.new("undefined method `#{method}' for #{inspect}", method)
58
+ raise NoMethodError.new("undefined method `#{method}' for #{self.class.name}", method)
59
59
  end
60
60
 
61
61
  def to_reference
@@ -300,6 +300,27 @@ module FHIR
300
300
  valid
301
301
  end
302
302
 
303
+ def each_element(path = nil, &block)
304
+ self.class::METADATA.each do |element_name, metadata|
305
+ local_name = metadata.fetch :local_name, element_name
306
+ values = [instance_variable_get("@#{local_name}")].flatten.compact
307
+ next if values.empty?
308
+
309
+ values.each_with_index do |value, i|
310
+ child_path =
311
+ if path.nil?
312
+ element_name
313
+ else
314
+ "#{path}.#{element_name}"
315
+ end
316
+ child_path += "[#{i}]" if metadata['max'] > 1
317
+ yield value, metadata, child_path
318
+ value.each_element child_path, &block unless FHIR::PRIMITIVES.include? metadata['type']
319
+ end
320
+ end
321
+ self
322
+ end
323
+
303
324
  private :validate_reference_type, :check_binding_uri, :validate_field
304
325
  end
305
326
  end
@@ -78,8 +78,8 @@ module FHIR
78
78
  resource_type = doc.root.name
79
79
  klass = Module.const_get("FHIR::#{resource_type}")
80
80
  resource = klass.new(hash)
81
- rescue => ex
82
- FHIR.logger.error("Failed to deserialize XML:\n#{ex.backtrace}")
81
+ rescue => e
82
+ FHIR.logger.error("Failed to deserialize XML:\n#{e.backtrace}")
83
83
  FHIR.logger.debug("XML:\n#{xml}")
84
84
  resource = nil
85
85
  end
@@ -59,8 +59,8 @@ module FHIR
59
59
  if json.is_a? String
60
60
  begin
61
61
  json = JSON.parse(json)
62
- rescue => ex
63
- @errors << "Failed to parse JSON: #{ex.message} %n #{h} %n #{ex.backtrace.join("\n")}"
62
+ rescue => e
63
+ @errors << "Failed to parse JSON: #{e.message} %n #{h} %n #{e.backtrace.join("\n")}"
64
64
  return false
65
65
  end
66
66
  end
@@ -161,7 +161,6 @@ module FHIR
161
161
  if !element.type.empty? && element.path != id
162
162
  # element.type not being empty implies data_type_found != nil, for valid profiles
163
163
  codeable_concept_pattern = element.pattern && element.pattern.is_a?(FHIR::CodeableConcept)
164
- codeable_concept_binding = element.binding
165
164
  matching_pattern = false
166
165
  nodes.each do |value|
167
166
  matching_type = 0
@@ -30,8 +30,8 @@ module FHIR
30
30
  hash.each do |key, value|
31
31
  obj.send("#{key}=".to_sym, value) if value
32
32
  end
33
- rescue => ex
34
- FHIR.logger.error "Failed to parse JSON: #{ex.message}"
33
+ rescue => e
34
+ FHIR.logger.error "Failed to parse JSON: #{e.message}"
35
35
  return nil
36
36
  end
37
37
  end
@@ -287,7 +287,7 @@ module FHIRPath
287
287
  tree[index] = (previous_node == :null || previous_node.empty? rescue previous_node.nil?)
288
288
  clean_index(tree, previous_index)
289
289
  when :exists
290
- tree[index] = !previous_node.nil? && previous_node != :null
290
+ tree[index] = !previous_node.nil? && previous_node != :null && previous_node != []
291
291
  clean_index(tree, previous_index)
292
292
  when :distinct
293
293
  tree[index] = (previous_node.uniq rescue previous_node)
@@ -1,5 +1,5 @@
1
1
  module FHIR
2
2
  module Models
3
- VERSION = '4.1.0'.freeze
3
+ VERSION = '4.2.1'.freeze
4
4
  end
5
5
  end
data/lib/fhir_models.rb CHANGED
@@ -7,29 +7,29 @@ require File.join(root, 'lib', 'fhir_models', 'deprecate')
7
7
  require File.join(root, 'lib', 'fhir_models', 'bootstrap', 'hashable.rb')
8
8
  require File.join(root, 'lib', 'fhir_models', 'bootstrap', 'json.rb')
9
9
 
10
- Dir.glob(File.join(root, 'lib', 'fhir_models', 'bootstrap', '*.rb')).each do |file|
10
+ Dir.glob(File.join(root, 'lib', 'fhir_models', 'bootstrap', '*.rb')).sort.each do |file|
11
11
  require file
12
12
  end
13
- Dir.glob(File.join(root, 'lib', 'fhir_models', 'bootstrap', '**', '*.rb')).each do |file|
13
+ Dir.glob(File.join(root, 'lib', 'fhir_models', 'bootstrap', '**', '*.rb')).sort.each do |file|
14
14
  require file
15
15
  end
16
16
 
17
17
  require File.join(root, 'lib', 'fhir_models', 'fhir.rb')
18
18
 
19
19
  # Require the generated code
20
- Dir.glob(File.join(root, 'lib', 'fhir_models', 'fhir', '*.rb')).each do |file|
20
+ Dir.glob(File.join(root, 'lib', 'fhir_models', 'fhir', '*.rb')).sort.each do |file|
21
21
  require file
22
22
  end
23
- Dir.glob(File.join(root, 'lib', 'fhir_models', 'fhir', '**', '*.rb')).each do |file|
23
+ Dir.glob(File.join(root, 'lib', 'fhir_models', 'fhir', '**', '*.rb')).sort.each do |file|
24
24
  require file
25
25
  end
26
26
 
27
27
  # Require the FHIRPath code
28
- Dir.glob(File.join(root, 'lib', 'fhir_models', 'fhirpath', '*.rb')).each do |file|
28
+ Dir.glob(File.join(root, 'lib', 'fhir_models', 'fhirpath', '*.rb')).sort.each do |file|
29
29
  require file
30
30
  end
31
31
 
32
32
  # Require the fhir_ext code
33
- Dir.glob(File.join(root, 'lib', 'fhir_models', 'fhir_ext', '*.rb')).each do |file|
33
+ Dir.glob(File.join(root, 'lib', 'fhir_models', 'fhir_ext', '*.rb')).sort.each do |file|
34
34
  require file
35
35
  end
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.1.0
4
+ version: 4.2.1
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: 2020-04-08 00:00:00.000000000 Z
15
+ date: 2021-09-23 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: nokogiri
@@ -20,14 +20,14 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.10.4
23
+ version: 1.11.4
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
- version: 1.10.4
30
+ version: 1.11.4
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: date_time_precision
33
33
  requirement: !ruby/object:Gem::Requirement
@@ -188,14 +188,14 @@ dependencies:
188
188
  requirements:
189
189
  - - '='
190
190
  - !ruby/object:Gem::Version
191
- version: '0.67'
191
+ version: '0.80'
192
192
  type: :development
193
193
  prerelease: false
194
194
  version_requirements: !ruby/object:Gem::Requirement
195
195
  requirements:
196
196
  - - '='
197
197
  - !ruby/object:Gem::Version
198
- version: '0.67'
198
+ version: '0.80'
199
199
  - !ruby/object:Gem::Dependency
200
200
  name: guard-rspec
201
201
  requirement: !ruby/object:Gem::Requirement
@@ -233,15 +233,16 @@ extra_rdoc_files: []
233
233
  files:
234
234
  - ".codeclimate.yml"
235
235
  - ".gitattributes"
236
+ - ".github/workflows/ruby.yml"
236
237
  - ".gitignore"
237
238
  - ".rspec"
238
239
  - ".rubocop.yml"
239
240
  - ".rubocop_todo.yml"
240
241
  - ".simplecov"
241
- - ".travis.yml"
242
242
  - Gemfile
243
243
  - Gemfile.lock
244
244
  - Guardfile
245
+ - LICENSE
245
246
  - README.md
246
247
  - Rakefile
247
248
  - bin/console
@@ -3955,7 +3956,8 @@ files:
3955
3956
  - lib/fhir_models/tasks/tasks.rake
3956
3957
  - lib/fhir_models/version.rb
3957
3958
  homepage: https://github.com/fhir-crucible/fhir_models
3958
- licenses: []
3959
+ licenses:
3960
+ - Apache-2.0
3959
3961
  metadata: {}
3960
3962
  post_install_message:
3961
3963
  rdoc_options: []
@@ -3972,7 +3974,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
3972
3974
  - !ruby/object:Gem::Version
3973
3975
  version: '0'
3974
3976
  requirements: []
3975
- rubygems_version: 3.0.2
3977
+ rubygems_version: 3.1.6
3976
3978
  signing_key:
3977
3979
  specification_version: 4
3978
3980
  summary: A Gem for handling FHIR models in ruby
data/.travis.yml DELETED
@@ -1,23 +0,0 @@
1
- language: ruby
2
- env:
3
- - TESTMEMORY=0 GCDELAY=2.0
4
- rvm:
5
- - 2.4
6
- - 2.5
7
- - 2.6
8
- before_script:
9
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
10
- - chmod +x ./cc-test-reporter
11
- - ./cc-test-reporter before-build
12
- script:
13
- - travis_wait bundle exec rake
14
- after_script:
15
- - ./cc-test-reporter after-build -t simplecov --exit-code $TRAVIS_TEST_RESULT
16
- notifications:
17
- email:
18
- recipients:
19
- - fhir-testing-list@lists.mitre.org
20
- on_failure: change
21
- before_install:
22
- - gem update --system
23
- - gem update bundler