Module: Canql::Nodes::Patient::CategoryNode

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

Instance Method Summary collapse

Instance Method Details

#clean_categoryObject



29
30
31
32
33
34
35
36
37
38
# File 'lib/canql/nodes/patient.rb', line 29

def clean_category
  if category.text_value.start_with?('eurocat ') || category.text_value.start_with?('fasp ')
    filter_value = category.text_value.gsub(/( )/, '_').downcase.gsub(/(_and_)/, '_')
    filter_value = 'fasp_red_amber' if filter_value == 'fasp_amber_red'
    filter_value = 'fasp_amber_green' if filter_value == 'fasp_green_amber'
    return filter_value
  end

  category.text_value
end

#meta_data_itemObject



25
26
27
# File 'lib/canql/nodes/patient.rb', line 25

def 
  { 'patient.category' => { Canql::EQUALS => clean_category } }
end