Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/fhir_models/bootstrap/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def ==(other)
def method_missing(method_name, *_args, &_block)
if defined?(self.class::MULTIPLE_TYPES) && self.class::MULTIPLE_TYPES[method_name.to_s]
self.class::MULTIPLE_TYPES[method_name.to_s].each do |type|
type[0] = type[0].upcase
value = send("#{method_name}#{type}".to_sym)
capitalized_type = "#{type[0].upcase}#{type[1..]}"
value = send("#{method_name}#{capitalized_type}".to_sym)
return value unless value.nil?
end
return nil
Expand Down Expand Up @@ -284,10 +284,10 @@ def primitive?(datatype, value)
end
deprecate :is_primitive?, :primitive?

def check_binding_uri(uri, value)
def check_binding_uri(uri_with_version, value)
valid = false
# Strip off the |4.0.0 or |4.0.1 or |2014-03-26 or similar from the ends of URLs
uri&.gsub!(/\|[A-Za-z0-9.-]*/, '')
uri = uri_with_version&.gsub(/\|[A-Za-z0-9.-]*/, '')
valueset = versioned_fhir_module::Definitions.get_codes(uri)

if ['http://hl7.org/fhir/ValueSet/mimetypes', 'http://www.rfc-editor.org/bcp/bcp13.txt'].include?(uri)
Expand Down
16 changes: 8 additions & 8 deletions lib/fhir_models/fhirpath/evaluate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ def self.evaluate(expression, hash, parent = nil)

# Get a value from a hash, with some special handling of
# self references
def self.get(key, hash)
return @@context if ['$context', '$resource'].include?(key)
return @@parent if key == '$parent'
return 'http://unitsofmeasure.org' if key == '%ucum'
return 'http://snomed.info/sct' if key == '%sct'
return 'http://loinc.org' if key == '%loinc'
return key.gsub!(/\A\'|\'\Z/, '') if key.start_with?("'") && key.end_with?("'")
key.gsub!(/\A"|"\Z/, '') # remove quotes around path if they exist
def self.get(raw_key, hash)
return @@context if ['$context', '$resource'].include?(raw_key)
return @@parent if raw_key == '$parent'
return 'http://unitsofmeasure.org' if raw_key == '%ucum'
return 'http://snomed.info/sct' if raw_key == '%sct'
return 'http://loinc.org' if raw_key == '%loinc'
return raw_key.gsub(/\A\'|\'\Z/, '') if raw_key.start_with?("'") && raw_key.end_with?("'")
key = raw_key.gsub(/\A"|"\Z/, '') # remove quotes around path if they exist
if hash.is_a?(Array)
response = []
hash.each do |e|
Expand Down
Loading