Class: HQMF2::Coded

Inherits:
Object
  • Object
show all
Includes:
Utilities
Defined in:
lib/hqmf-parser/2.0/types.rb

Overview

Represents a HQMF CD value which has a code and codeSystem

Instance Method Summary collapse

Methods included from Utilities

#attr_val, attr_val, #strip_tokens, #to_xml

Methods included from HQMF::Conversion::Utilities

#build_hash, #check_equality, #json_array, #openstruct_to_json

Constructor Details

#initialize(entry) ⇒ Coded

Returns a new instance of Coded.



216
217
218
# File 'lib/hqmf-parser/2.0/types.rb', line 216

def initialize(entry)
  @entry = entry
end

Instance Method Details

#codeObject



228
229
230
# File 'lib/hqmf-parser/2.0/types.rb', line 228

def code
  attr_val('./@code')
end

#code_list_idObject



232
233
234
# File 'lib/hqmf-parser/2.0/types.rb', line 232

def code_list_id
  attr_val('./@valueSet')
end

#derived?Boolean

Returns:

  • (Boolean)


244
245
246
# File 'lib/hqmf-parser/2.0/types.rb', line 244

def derived?
  false
end

#systemObject



224
225
226
# File 'lib/hqmf-parser/2.0/types.rb', line 224

def system
  attr_val('./@codeSystem')
end

#titleObject



236
237
238
# File 'lib/hqmf-parser/2.0/types.rb', line 236

def title
  attr_val('./*/@value')
end

#to_modelObject

Generates this classes hqmf-model equivalent



253
254
255
# File 'lib/hqmf-parser/2.0/types.rb', line 253

def to_model
  HQMF::Coded.new(type, system, code, code_list_id, title)
end

#typeObject



220
221
222
# File 'lib/hqmf-parser/2.0/types.rb', line 220

def type
  attr_val('./@xsi:type') || 'CD'
end

#unitObject



248
249
250
# File 'lib/hqmf-parser/2.0/types.rb', line 248

def unit
  nil
end

#valueObject



240
241
242
# File 'lib/hqmf-parser/2.0/types.rb', line 240

def value
  code
end