Sha256: e12e408a7d465e997f4650a11b689cf1864478f3e231ff5b79d0c9fc7ec98019

Contents?: true

Size: 882 Bytes

Versions: 8

Compression:

Stored size: 882 Bytes

Contents

module Tnql
  grammar Patient
    rule for_patients_clause
      for_keyword pre:patient_pre_classifiers* patient_keyword post:more_patient_filters?
    end

    rule patient_keyword
      space 'patients' word_break
    end

    rule patient_pre_classifiers
      dead_or_alive / gender / age_group
    end

    rule more_patient_filters
      who_keyword first:patient_post_classifier rest:more_post_classifiers*
    end

    rule patient_post_classifier
      with_age_at_diagnosis / with_death_date / with_birth_date / death_certificate
    end

    rule more_post_classifiers
      (',' and_keyword / and_keyword / ',' )? patient_post_classifier
    end

    rule gender
      space gender:('male' / 'female') word_break <Nodes::GenderNode>
    end

    rule who_keyword
      space 'who' word_break
    end

    rule for_keyword
      space 'for' word_break
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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