Class: Stupidedi::Schema::CodeList::Internal
- Inherits:
-
Stupidedi::Schema::CodeList
- Object
- Stupidedi::Schema::CodeList
- Stupidedi::Schema::CodeList::Internal
- Defined in:
- lib/stupidedi/schema/code_list.rb
Instance Method Summary collapse
-
#code_lists(subset = Sets.universal) ⇒ AbstractSet<CodeList>
Some elements are qualifiers that select which code list is applicable to the qualified element.
- #codes ⇒ Array<String>
- #external? ⇒ Boolean
-
#initialize(hash) ⇒ Internal
constructor
A new instance of Internal.
Methods inherited from Stupidedi::Schema::CodeList
Methods included from Inspect
Constructor Details
#initialize(hash) ⇒ Internal
Returns a new instance of Internal.
21 22 23 |
# File 'lib/stupidedi/schema/code_list.rb', line 21 def initialize(hash) @hash = hash end |
Instance Method Details
#code_lists(subset = Sets.universal) ⇒ AbstractSet<CodeList>
Some elements are qualifiers that select which code list is applicable to the qualified element. For instance, the diagnosis codes in the HI segment are qualified by E1270 “Code List Qualifier Code”, which indicates which code list should be used to validate the E1271’s diagnosis code. It maybe ICD-9, ICD-10, etc.
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/stupidedi/schema/code_list.rb', line 42 def code_lists(subset = Sets.universal) = @hash.select do |k, v| subset.include?(k) and v.is_a?(Schema::CodeList) end if subset.finite? Sets.build([self]) + .map{|k,v| v } else Sets.build([self]) end end |
#codes ⇒ Array<String>
26 27 28 |
# File 'lib/stupidedi/schema/code_list.rb', line 26 def codes @hash.keys end |
#external? ⇒ Boolean
30 31 32 |
# File 'lib/stupidedi/schema/code_list.rb', line 30 def external? false end |