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.
123
124
125
|
# File 'lib/hqmf-parser/2.0/types.rb', line 123
def initialize(entry)
@entry = entry
end
|
Instance Method Details
#code ⇒ Object
135
136
137
|
# File 'lib/hqmf-parser/2.0/types.rb', line 135
def code
attr_val('./@code')
end
|
#code_list_id ⇒ Object
139
140
141
|
# File 'lib/hqmf-parser/2.0/types.rb', line 139
def code_list_id
attr_val('./@valueSet')
end
|
#derived? ⇒ Boolean
151
152
153
|
# File 'lib/hqmf-parser/2.0/types.rb', line 151
def derived?
false
end
|
#system ⇒ Object
131
132
133
|
# File 'lib/hqmf-parser/2.0/types.rb', line 131
def system
attr_val('./@codeSystem')
end
|
#title ⇒ Object
143
144
145
|
# File 'lib/hqmf-parser/2.0/types.rb', line 143
def title
attr_val('./@displayName')
end
|
#to_model ⇒ Object
159
160
161
|
# File 'lib/hqmf-parser/2.0/types.rb', line 159
def to_model
HQMF::Coded.new(type, system, code, code_list_id, title)
end
|
#type ⇒ Object
127
128
129
|
# File 'lib/hqmf-parser/2.0/types.rb', line 127
def type
attr_val('./@xsi:type') || 'CD'
end
|
#unit ⇒ Object
155
156
157
|
# File 'lib/hqmf-parser/2.0/types.rb', line 155
def unit
nil
end
|
#value ⇒ Object
147
148
149
|
# File 'lib/hqmf-parser/2.0/types.rb', line 147
def value
code
end
|