Sha256: 9884d16ed03dc8c4614ee637ddb4aa04d967e2d369b3d592a727998efc9d4254

Contents?: true

Size: 1.19 KB

Versions: 8

Compression:

Stored size: 1.19 KB

Contents

module Tnql #:nodoc: all
  module Nodes
    module TreatmentDateRangeNode
      def meta_data_item
        {
          'treatment.startoradmissiondate' => {
            Tnql::LIMITS => [
              start.to_daterange.date1.try(:to_date).try(:iso8601),
              finish.to_daterange.date2.try(:to_date).try(:iso8601)
            ]
          }
        }
      end
    end

    module TreatmentPreciseDateNode
      def meta_data_item
        date_range = date_fragment.to_daterange

        {
          'treatment.startoradmissiondate' => {
            Tnql::LIMITS => [
              date_range.date1.try(:to_date).try(:iso8601),
              date_range.date2.try(:to_date).try(:iso8601)
            ]
          }
        }
      end
    end

    module TreatmentProviderNameNode
      def meta_data_item
        { 'treatment.providername' => { Tnql::MESSAGE => 'TODO: "' + text_value + '" ignored' } }
      end
    end

    module TreatmentProviderCodeNode
      def meta_data_item
        # default to provider
        key = provider_type.text_value == 'cancer network' ? 'cn_ukacr' : 'providercode'
        { "treatment.#{key}" => { Tnql::EQUALS => code.text_value.upcase } }
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tnql-1.1.2 lib/tnql/nodes/treatment.rb
tnql-1.1.1 lib/tnql/nodes/treatment.rb
tnql-1.1.0 lib/tnql/nodes/treatment.rb
tnql-1.0.4 lib/tnql/nodes/treatment.rb
tnql-1.0.3 lib/tnql/nodes/treatment.rb
tnql-1.0.2 lib/tnql/nodes/treatment.rb
tnql-1.0.1 lib/tnql/nodes/treatment.rb
tnql-1.0.0 lib/tnql/nodes/treatment.rb