Class: Genericode::CodeListSet

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/genericode/code_list_set.rb

Instance Method Summary collapse

Instance Method Details

#validate_verboseObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/genericode/code_list_set.rb', line 37

def validate_verbose
  errors = []

  # Rule 47: CodeListSet reference validation
  code_list_set_ref&.each do |ref|
    unless valid_uri?(ref.canonical_uri) && valid_uri?(ref.canonical_version_uri)
      errors << { code: "INVALID_CODELIST_SET_REF", message: "Invalid CodeListSet reference URI" }
    end
  end

  # Rule 48-51: URI validations
  [canonical_uri, canonical_version_uri].each do |uri|
    errors << { code: "INVALID_URI", message: "Invalid URI: #{uri}" } unless valid_uri?(uri)
  end

  # Rule 52-53: LocationUri validation
  location_uri&.each do |uri|
    unless valid_genericode_uri?(uri)
      errors << { code: "INVALID_LOCATION_URI", message: "Invalid LocationUri: #{uri}" }
    end
  end

  errors
end