Class: HQMF2::Coded
- Inherits:
-
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
#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
#code ⇒ Object
228
229
230
|
# File 'lib/hqmf-parser/2.0/types.rb', line 228
def code
attr_val('./@code')
end
|
#code_list_id ⇒ Object
232
233
234
|
# File 'lib/hqmf-parser/2.0/types.rb', line 232
def code_list_id
attr_val('./@valueSet')
end
|
#derived? ⇒ Boolean
244
245
246
|
# File 'lib/hqmf-parser/2.0/types.rb', line 244
def derived?
false
end
|
#system ⇒ Object
224
225
226
|
# File 'lib/hqmf-parser/2.0/types.rb', line 224
def system
attr_val('./@codeSystem')
end
|
#title ⇒ Object
236
237
238
|
# File 'lib/hqmf-parser/2.0/types.rb', line 236
def title
attr_val('./*/@value')
end
|
#to_model ⇒ Object
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
|
#type ⇒ Object
220
221
222
|
# File 'lib/hqmf-parser/2.0/types.rb', line 220
def type
attr_val('./@xsi:type') || 'CD'
end
|
#unit ⇒ Object
248
249
250
|
# File 'lib/hqmf-parser/2.0/types.rb', line 248
def unit
nil
end
|
#value ⇒ Object
240
241
242
|
# File 'lib/hqmf-parser/2.0/types.rb', line 240
def value
code
end
|