Sha256: 39cd9f9e3729da9ce6b0684f9fb344d76753825b571d6efcc6615b69c03d65a9

Contents?: true

Size: 1.14 KB

Versions: 67

Compression:

Stored size: 1.14 KB

Contents

module HQMF
  
  module Converter
  
    class SimplePrecondition < HQMF::Precondition

      COMPARISON = "COMPARISON"
      PRECONDITION = "PRECONDITION"

      attr_accessor :klass, :processed, :subset_comparison, :conjunction_code

      def initialize(id, preconditions,reference,conjunction_code,negation)
        super(id, preconditions,reference,conjunction_code,negation)
        @id = HQMF::Counter.instance.next if (@id.nil?)
        @klass = PRECONDITION
      end
      
      def to_json
        json = super
#        json[:klass] = @klass
        json
      end
      
      def comparison?
        @klass == COMPARISON
      end
      def restriction?
        false
      end
      
      def has_preconditions?
        preconditions and !preconditions.empty?
      end
      
      def restrictions
        preconditions.select {|precondition| precondition.restriction?}
      end
      
      def reference=(reference)
        @reference = reference
      end
      
      def delete_converted_restrictions!
        preconditions.delete_if {|precondition| precondition.restriction? and precondition.converted}
      end
      
    end
  end
  
  
end

Version data entries

67 entries across 67 versions & 2 rubygems

Version Path
health-data-standards-3.2.0 lib/hqmf-parser/converter/pass1/simple_precondition.rb
health-data-standards-3.1.1 lib/hqmf-parser/converter/pass1/simple_precondition.rb
health-data-standards-3.1.0 lib/hqmf-parser/converter/pass1/simple_precondition.rb
health-data-standards-3.0.6 lib/hqmf-parser/converter/pass1/simple_precondition.rb
health-data-standards-3.0.5 lib/hqmf-parser/converter/pass1/simple_precondition.rb
health-data-standards-3.0.4 lib/hqmf-parser/converter/pass1/simple_precondition.rb
health-data-standards-3.0.3 lib/hqmf-parser/converter/pass1/simple_precondition.rb