Sha256: 4187cd190b1cd1ddcc93886c72ba95b8996f78cd78a5eeb4ce864ce8a571d38d

Contents?: true

Size: 1.75 KB

Versions: 13

Compression:

Stored size: 1.75 KB

Contents

require_relative '../../archetype/constraint_model'

module OpenEHR
  module AM
    module OpenEHRProfile
      module DataTypes
        module Quantity
          class CDvQuantity < OpenEHR::AM::Archetype::ConstraintModel::CDomainType
            attr_accessor :property, :list

            def initialize(args = { })
              super
              self.property = args[:property]
              self.list = args[:list]
            end

            def any_allowed?
              if @property.nil? && @list.nil?
                return true
              else
                return false
              end
            end
          end
          
          class CDvOrdinal < OpenEHR::AM::Archetype::ConstraintModel::CDomainType
            attr_accessor :list
            def initialize(args = { })
              super
              self.list = args[:list]
            end

            def any_allowed?
              @list.nil?
            end
          end

          class CQuantityItem
            attr_accessor :magnitude, :precision
            attr_reader :units

            def initialize(args = { })
              self.magnitude = args[:magnitude]
              self.precision = args[:precision]
              self.units = args[:units]
            end

            def units=(units)
              if units.nil? or units.empty?
                raise ArgumentError, 'units are mandatory'
              end
              @units = units
            end

            def precision_unconstrained?
              if @precision.upper == -1 && @precision.lower == -1
                return true
              else
                return false
              end
            end
          end
        end
      end # of DataTypes
    end # of OpenEHRProfile
  end # of AM
end # of OpenEHR

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
openehr-1.2.999999 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.99999 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.9999 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.999 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.99 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.16 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.15 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.14 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.13 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.12 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.11 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.10 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.9 lib/openehr/am/openehr_profile/data_types/quantity.rb