Skip to content

Commit

Permalink
update versioned_resource_class
Browse files Browse the repository at this point in the history
  • Loading branch information
radamson committed Apr 11, 2019
1 parent ba8037b commit 66daa03
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/fhir_client/version_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ module FHIR
module VersionManagement

def versioned_resource_class(klass = nil)
return FHIR if klass.nil?
if @fhir_version == :stu3
FHIR::STU3.const_get(klass)
else
FHIR::DSTU2.const_get(klass)
end
mod = case @fhir_version
when :stu3
FHIR::STU3
when :dstu2
FHIR::DSTU2
else
FHIR
end
return mod if klass.nil?
mod.const_get(klass)
end

def versioned_format_class(format = nil)
Expand Down

0 comments on commit 66daa03

Please sign in to comment.