Sha256: 6305382b4ddb07db6648113659ab4d6c7dce8a0e4f6a9f76ee486e4a0021bfeb

Contents?: true

Size: 1.86 KB

Versions: 8

Compression:

Stored size: 1.86 KB

Contents

module Tnql
  grammar EBaseRecords
    rule with_clause
      with_keyword action_or_ebr
    end

    rule action_or_ebr
      action_and_ebr / actions / e_base_records
    end

    rule action_and_ebr
      actions and_keyword e_base_records
    end

    rule e_base_records
      unprocessed_keyword types:batch_types? records_keyword <Nodes::EBaseRecordsNode>
    end

    rule batch_types
      space allowed_types word_break <Nodes::BatchTypesNode>
    end

    rule allowed_types
      batch_type types:more_types* <Nodes::AllowedTypesNode>
    end

    rule more_types
      ','? space? ('or' space)? batch_type <Nodes::MoreTypesNode>
    end

    rule with_keyword
      space 'with' word_break
    end

    rule actions
      action_type action_keyword action_provider? <Nodes::ActionsNode>
    end

    rule action_provider
      space 'at' space provider:(action_provider_code / action_provider_name)
    end

    rule action_type
      space accepted_action word_break
    end

    rule accepted_action
     'pathl' / 'patho' / 'wait' / 'proforma' / 'transfer' / 'notes' / 'child' /
      'qa' / 'staged' / 'tag' / 'qc' / 'query' / 'stage' / 'searchforstaging' /
      'moreinfo' / 'search' / 'check' / 'gpsearch'
    end

    rule action_keyword
      space 'action' word_break
    end

    rule at_keyword
      space 'at' word_break
    end

    rule action_provider_code
      provider_type space code:(!' ' .)+ <Nodes::ActionProviderCodeNode>
    end

    rule action_provider_name
      short_desc:(!(space provider_type) .)+ space provider_type <Nodes::ActionProviderNameNode>
    end

    # TODO: support cancer network?
    rule provider_type
      'hospital'
    end

    rule unprocessed_keyword
      space 'unprocessed' word_break
    end

    rule records_keyword
      space 'records' word_break
    end

    rule and_keyword
      space 'and' word_break
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tnql-1.1.2 lib/tnql/grammars/e_base_records.treetop
tnql-1.1.1 lib/tnql/grammars/e_base_records.treetop
tnql-1.1.0 lib/tnql/grammars/e_base_records.treetop
tnql-1.0.4 lib/tnql/grammars/e_base_records.treetop
tnql-1.0.3 lib/tnql/grammars/e_base_records.treetop
tnql-1.0.2 lib/tnql/grammars/e_base_records.treetop
tnql-1.0.1 lib/tnql/grammars/e_base_records.treetop
tnql-1.0.0 lib/tnql/grammars/e_base_records.treetop