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, #to_xml
#build_hash, #check_equality, #json_array, #openstruct_to_json
Constructor Details
#initialize(entry) ⇒ Coded
Returns a new instance of Coded.
134
135
136
|
# File 'lib/hqmf-parser/2.0/types.rb', line 134
def initialize(entry)
@entry = entry
end
|
Instance Method Details
#code ⇒ Object
146
147
148
|
# File 'lib/hqmf-parser/2.0/types.rb', line 146
def code
attr_val('./@code')
end
|
#code_list_id ⇒ Object
150
151
152
|
# File 'lib/hqmf-parser/2.0/types.rb', line 150
def code_list_id
attr_val('./@valueSet')
end
|
#derived? ⇒ Boolean
162
163
164
|
# File 'lib/hqmf-parser/2.0/types.rb', line 162
def derived?
false
end
|
#system ⇒ Object
142
143
144
|
# File 'lib/hqmf-parser/2.0/types.rb', line 142
def system
attr_val('./@codeSystem')
end
|
#title ⇒ Object
154
155
156
|
# File 'lib/hqmf-parser/2.0/types.rb', line 154
def title
attr_val('./*/@value')
end
|
#to_model ⇒ Object
170
171
172
|
# File 'lib/hqmf-parser/2.0/types.rb', line 170
def to_model
HQMF::Coded.new(type, system, code, code_list_id, title)
end
|
#type ⇒ Object
138
139
140
|
# File 'lib/hqmf-parser/2.0/types.rb', line 138
def type
attr_val('./@xsi:type') || 'CD'
end
|
#unit ⇒ Object
166
167
168
|
# File 'lib/hqmf-parser/2.0/types.rb', line 166
def unit
nil
end
|
#value ⇒ Object
158
159
160
|
# File 'lib/hqmf-parser/2.0/types.rb', line 158
def value
code
end
|