Skip to content

Commit

Permalink
Merge pull request #113 from fhir-crucible/FI-2832-version-support
Browse files Browse the repository at this point in the history
FI-2832 Add multi-version support
360dgries authored Sep 25, 2024
2 parents cc9180e + a30149b commit 00acb83
Showing 619 changed files with 2,360,129 additions and 25,137 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -7,3 +7,6 @@ tmp/

# User-specific
.idea

# ig-extraction
lib/fhir_models/igs/packages
10 changes: 10 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -6,22 +6,32 @@ AllCops:
- 'spec/**/*'
- 'lib/fhir_models/fhir/**/*'
- 'lib/fhir_models/fhirpath/evaluate.rb'
- 'lib/fhir_models/r4/generated/**/*'
- 'lib/fhir_models/r4b/generated/**/*'
- 'lib/**/*.rake'
- 'tmp/**/*'
- '*.gemspec'
- 'bin/*'
Layout/LineLength:
Enabled: false
Naming/MethodName:
Enabled: false
Style/AccessorGrouping:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Style/Documentation:
Enabled: false
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/ModuleFunction:
Enabled: false
Style/SymbolArray:
Enabled: false
Style/WordArray:
EnforcedStyle: brackets
inherit_mode:
114 changes: 59 additions & 55 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,52 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-12-13 19:55:27 UTC using RuboCop version 1.23.0.
# on 2024-08-29 16:52:13 UTC using RuboCop version 1.23.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 38
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
Layout/EmptyLineBetweenDefs:
Exclude:
- 'lib/fhir_models/fhir_ext/common_structure_definition.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
Layout/EmptyLinesAroundModuleBody:
Exclude:
- 'lib/fhir_models/fhir_ext/common_element_definition.rb'
- 'lib/fhir_models/fhir_ext/common_structure_definition.rb'
- 'lib/fhir_models/fhir_ext/common_structure_definition_finding.rb'

# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: final_newline, final_blank_line
Layout/TrailingEmptyLines:
Exclude:
- 'lib/fhir_models/bootstrap/json.rb'
- 'lib/fhir_models/r4/fhir_ext/structure_definition.rb'
- 'lib/fhir_models/r4/fhir_ext/structure_definition_compare.rb'
- 'lib/fhir_models/r4/fhir_ext/structure_definition_finding.rb'
- 'lib/fhir_models/r4b/fhir_ext/structure_definition.rb'
- 'lib/fhir_models/r4b/fhir_ext/structure_definition_compare.rb'
- 'lib/fhir_models/r4b/fhir_ext/structure_definition_finding.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: AllowInHeredoc.
Layout/TrailingWhitespace:
Exclude:
- 'lib/fhir_models/fhir_ext/common_structure_definition.rb'
- 'lib/fhir_models/fhir_ext/common_structure_definition_compare.rb'
- 'lib/fhir_models/fhir_ext/common_structure_definition_finding.rb'

# Offense count: 43
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 394
@@ -17,32 +57,32 @@ Metrics/AbcSize:
Metrics/BlockLength:
Max: 78

# Offense count: 12
# Offense count: 10
# Configuration parameters: CountBlocks.
Metrics/BlockNesting:
Max: 5

# Offense count: 7
# Offense count: 5
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 355
Max: 281

# Offense count: 32
# Offense count: 34
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 73

# Offense count: 45
# Offense count: 49
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
Metrics/MethodLength:
Max: 132
Max: 130

# Offense count: 2
# Offense count: 4
# Configuration parameters: CountComments, CountAsOne.
Metrics/ModuleLength:
Max: 115
Max: 354

# Offense count: 28
# Offense count: 30
# Configuration parameters: IgnoredMethods.
Metrics/PerceivedComplexity:
Max: 76
@@ -52,14 +92,14 @@ Metrics/PerceivedComplexity:
# SupportedStyles: snake_case, camelCase
Naming/MethodName:
Exclude:
- 'lib/fhir_models/fhir_ext/structure_definition_finding.rb'
- 'lib/fhir_models/fhir_ext/common_structure_definition_finding.rb'

# Offense count: 4
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
Exclude:
- 'lib/fhir_models/fhir_ext/structure_definition_compare.rb'
- 'lib/fhir_models/fhir_ext/common_structure_definition_compare.rb'

# Offense count: 1
# Cop supports --auto-correct.
@@ -69,16 +109,15 @@ Style/ClassAndModuleChildren:
Exclude:
- '.simplecov'

# Offense count: 17
# Offense count: 1
Style/ClassVars:
Exclude:
- 'lib/fhir_models/bootstrap/definitions.rb'
- 'lib/fhir_models/fhirpath/parse.rb'

# Offense count: 1
Style/CombinableLoops:
Exclude:
- 'lib/fhir_models/fhir_ext/structure_definition_compare.rb'
- 'lib/fhir_models/fhir_ext/common_structure_definition_compare.rb'

# Offense count: 6
# Cop supports --auto-correct.
@@ -87,53 +126,18 @@ Style/CommentedKeyword:
- 'lib/fhir_models/bootstrap/hashable.rb'
- 'lib/fhir_models/bootstrap/model.rb'

# Offense count: 15
# Configuration parameters: AllowedConstants.
Style/Documentation:
Exclude:
- '.simplecov'
- 'lib/fhir_models/bootstrap/definitions.rb'
- 'lib/fhir_models/bootstrap/field.rb'
- 'lib/fhir_models/bootstrap/generator.rb'
- 'lib/fhir_models/bootstrap/hashable.rb'
- 'lib/fhir_models/bootstrap/json.rb'
- 'lib/fhir_models/bootstrap/model.rb'
- 'lib/fhir_models/bootstrap/preprocess.rb'
- 'lib/fhir_models/bootstrap/template.rb'
- 'lib/fhir_models/bootstrap/xml.rb'
- 'lib/fhir_models/fhir.rb'
- 'lib/fhir_models/fhir_ext/structure_definition.rb'
- 'lib/fhir_models/fhir_ext/structure_definition_finding.rb'
- 'lib/fhir_models/fhirpath/expression.rb'
- 'lib/fhir_models/fhirpath/parse.rb'

# Offense count: 28
# Offense count: 26
# Cop supports --auto-correct.
Style/IfUnlessModifier:
Exclude:
- 'lib/fhir_models/bootstrap/generator.rb'
- 'lib/fhir_models/bootstrap/model.rb'
- 'lib/fhir_models/bootstrap/template.rb'
- 'lib/fhir_models/bootstrap/xml.rb'
- 'lib/fhir_models/fhir_ext/structure_definition.rb'
- 'lib/fhir_models/fhir_ext/structure_definition_compare.rb'

# Offense count: 1
Style/MissingRespondToMissing:
Exclude:
- 'lib/fhir_models/bootstrap/model.rb'

# Offense count: 2
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
Exclude:
- 'lib/fhir_models/bootstrap/generator.rb'
- 'lib/fhir_models/bootstrap/template.rb'
- 'lib/fhir_models/fhir_ext/common_structure_definition.rb'
- 'lib/fhir_models/fhir_ext/common_structure_definition_compare.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowModifier.
Style/SoleNestedConditional:
Exclude:
- 'lib/fhir_models/fhir_ext/structure_definition_compare.rb'
- 'lib/fhir_models/fhir_ext/common_structure_definition_compare.rb'
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -2,3 +2,9 @@ source 'https://rubygems.org'
ruby RUBY_VERSION
# Specify your gem's dependencies in fhir_models.gemspec
gemspec

group :development, :test do
gem 'debug'
gem 'pry'
gem 'pry-byebug'
end
20 changes: 20 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -13,11 +13,15 @@ GEM
ast (2.4.2)
bcp47 (0.3.3)
i18n
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.3.1)
coolline (0.5.0)
unicode_utils (~> 1.4)
date_time_precision (0.8.1)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
diff-lcs (1.4.4)
docile (1.3.2)
ffi (1.13.1)
@@ -41,6 +45,10 @@ GEM
test-unit (~> 3.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.13.2)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.3.1)
listen (3.3.1)
rb-fsevent (~> 0.10, >= 0.10.3)
@@ -69,15 +77,24 @@ GEM
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
pry-coolline (0.2.5)
coolline (~> 0.5)
psych (5.1.2)
stringio
racc (1.8.0)
rainbow (3.1.1)
rake (13.0.1)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdoc (6.7.0)
psych (>= 4.0.0)
regexp_parser (2.8.2)
reline (0.5.9)
io-console (~> 0.5)
rexml (3.2.8)
strscan (>= 3.0.9)
rspec (3.10.0)
@@ -111,6 +128,7 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
stringio (3.1.1)
strscan (3.1.0)
tdiff (0.3.4)
test-unit (3.3.6)
@@ -124,11 +142,13 @@ PLATFORMS

DEPENDENCIES
bundler
debug
fhir_models!
guard-rspec
guard-test
nokogiri-diff
pry
pry-byebug
pry-coolline
rake
rspec
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ require 'rake/testtask'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'pry'
require 'pry-byebug'

Dir['lib/fhir_models/tasks/**/*.rake'].each do |file|
load file
38 changes: 3 additions & 35 deletions lib/fhir_models.rb
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
root = File.expand_path '..', File.dirname(File.absolute_path(__FILE__))

require File.join(root, 'lib', 'fhir_models', 'version')
require File.join(root, 'lib', 'fhir_models', 'deprecate')

# Need to require Hashable first
require File.join(root, 'lib', 'fhir_models', 'bootstrap', 'hashable.rb')
require File.join(root, 'lib', 'fhir_models', 'bootstrap', 'json.rb')

Dir.glob(File.join(root, 'lib', 'fhir_models', 'bootstrap', '*.rb')).sort.each do |file|
require file
end
Dir.glob(File.join(root, 'lib', 'fhir_models', 'bootstrap', '**', '*.rb')).sort.each do |file|
require file
end

require File.join(root, 'lib', 'fhir_models', 'fhir.rb')

# Require the generated code
Dir.glob(File.join(root, 'lib', 'fhir_models', 'fhir', '*.rb')).sort.each do |file|
require file
end
Dir.glob(File.join(root, 'lib', 'fhir_models', 'fhir', '**', '*.rb')).sort.each do |file|
require file
end

# Require the FHIRPath code
Dir.glob(File.join(root, 'lib', 'fhir_models', 'fhirpath', '*.rb')).sort.each do |file|
require file
end

# Require the fhir_ext code
Dir.glob(File.join(root, 'lib', 'fhir_models', 'fhir_ext', '*.rb')).sort.each do |file|
require file
end
# require versions
require_relative 'fhir_models/r4'
require_relative 'fhir_models/r4b'
Loading

0 comments on commit 00acb83

Please sign in to comment.