Sha256: 7c97c4cccb1a801e26e306508d6448441fc80fd6a1d69ea4827b5f99d6127b08

Contents?: true

Size: 1.67 KB

Versions: 19

Compression:

Stored size: 1.67 KB

Contents

module OpenEHR
  module AM
    module OpenEHRProfile
      module DataTypes
        module Quantity
          include OpenEHR::AM::Archetype::ConstraintModel

          class CDvQuantity < 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 < 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

19 entries across 19 versions & 2 rubygems

Version Path
openehr-1.2.8 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.7 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.6 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.5 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.4 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.3 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.2 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.1 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.2.0 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.1.6 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.1.5 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.1.4 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.1.3 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.1.2 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.1.1 lib/openehr/am/openehr_profile/data_types/quantity.rb
openehr-1.1.0 lib/openehr/am/openehr_profile/data_types/quantity.rb
open_ehr-1.0.2 lib/open_ehr/am/openehr_profile/data_types/quantity.rb
open_ehr-1.0.1 lib/open_ehr/am/openehr_profile/data_types/quantity.rb
open_ehr-1.0.0 lib/open_ehr/am/openehr_profile/data_types/quantity.rb