Method: Canql::Nodes::Anomaly::WithCondition#code_filter

Defined in:
lib/canql/nodes/anomaly.rb

#code_filterObject



100
101
102
103
104
105
106
107
108
109
# File 'lib/canql/nodes/anomaly.rb', line 100

def code_filter
  return {} if code_data.text_value.blank?

  code_arrays = { icd_code: [], code_group: [], fasp_rating: [] }
  code_arrays[code_type(code_data.first)] << code_value(code_data.first)
  code_data.rest.elements.each do |code|
    code_arrays[code_type(code)] << code_value(code)
  end
  prepare_code_filters(code_arrays)
end