Module: Canql::Nodes::Age::BirthDateNode

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

Instance Method Summary collapse

Instance Method Details

#meta_data_itemObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/canql/nodes/age.rb', line 7

def 
  subject = reverse_scan_for_marker(:subject) == 'mother' ? 'mother' : 'patient'
  range = fuzzy_date.to_daterange
  {
    "#{subject}.birthdate" => {
      Canql::LIMITS => [
        range.date1.try(:to_date).try(:iso8601), range.date2.try(:to_date).try(:iso8601)
      ]
    }
  }
end