Class: Stupidedi::Schema::CodeList::Internal
- Inherits:
-
Stupidedi::Schema::CodeList
- Object
- Stupidedi::Schema::CodeList
- Stupidedi::Schema::CodeList::Internal
- Extended by:
- Forwardable
- 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.
18 19 20 |
# File 'lib/stupidedi/schema/code_list.rb', line 18 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.
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/stupidedi/schema/code_list.rb', line 39 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>
23 24 25 |
# File 'lib/stupidedi/schema/code_list.rb', line 23 def codes @hash.keys end |
#external? ⇒ Boolean
27 28 29 |
# File 'lib/stupidedi/schema/code_list.rb', line 27 def external? false end |