Changeset 23 for ruby/trunk/models


Ignore:
Timestamp:
May 1, 2008, 8:21:09 AM (16 years ago)
Author:
Tatsukawa, Akimichi
Message:

working on adl_parser semantic functions

Location:
ruby/trunk/models
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/models/Rakefile

    r21 r23  
    4848#  s.require_paths += [".","am","rm"]
    4949  s.require_path = "."
    50 #  s.has_rdoc = true
     50  s.has_rdoc = true
    5151#  s.extra_rdoc_files = ["README"]
    5252end
  • ruby/trunk/models/am.rb

    r21 r23  
    2727      module Constraint_Model
    2828        autoload :ARCHETYPE_CONSTRAINT, "am/archetype/constraint_model/archetype_constraint.rb"
    29         autoload :Assertion, "am/archetype/constraint_model/assertion.rb"
    3029        autoload :Primitive, "am/archetype/constraint_model/primitive.rb"
    3130      end #end of ConstraintModel
     31
     32      module Assertion
     33        autoload :ASSERTION, "am/archetype/constraint_model/assertion.rb"
     34      end
     35
    3236    end # of Archetype
     37
     38    module OpenEHR_Profile
     39      module Data_Types
     40        module Basic
     41          autoload :C_DV_STATE, "am/openehr_profile/data_types/basic.rb"
     42        end
     43
     44        module Text
     45          autoload :C_CODE_PHASE, "am/openehr_profile/data_types/text.rb"
     46        end
     47
     48        module Quantity
     49          autoload :C_DV_QUANTITY, "am/openehr_profile/data_types/quantity.rb"
     50          autoload :C_DV_ORDINAL, "am/openehr_profile/data_types/quantity.rb"
     51          autoload :C_QUANTITY_ITEM, "am/openehr_profile/data_types/quantity.rb"
     52        end
     53      end
     54    end
    3355  end # of AM
    3456end # of OpenEHR
  • ruby/trunk/models/am/archetype/archetype.rb

    r21 r23  
    7777        def version
    7878        end
    79       end
     79      end # end of ARCHETYPE
    8080      # original file:
    8181      # ref_imple_eiffel/components/adl_parser/src/interface/adl_definition.e
    82     end # end of Archetype
     82
     83      class VALIDITY_KIND
     84      end
     85    end
     86
     87
    8388  end # end of AM
    8489end # end of OpenEHR
  • ruby/trunk/models/am/archetype/archetype_description/archetype_description.rb

    r21 r23  
    1111        end
    1212
    13         class Archetype_Description_Item
     13        class ARCHETYPE_DESCRIPTION_ITEM
    1414          attr_accessor :archetype_package_uri, :lifecycle_state, :original_author, :other_contributors, :other_details
    1515        end
  • ruby/trunk/models/am/archetype/constraint_model/archetype_constraint.rb

    r21 r23  
    88        end
    99
    10         class C_OBJECT < ARCHETYPE_CONSTRAINT
     10        class CARDINALITY
    1111         
    1212        end
    1313
     14        class C_OBJECT < ARCHETYPE_CONSTRAINT
     15          attr_accessor :node_id, :occurrences, :rm_type_name
     16
     17          def initialize(args = { })
     18            @node_id = args[:node_id] if args[:node_id]
     19            @occurrences = args[:occurrences] if args[:occurrences]
     20            @rm_type_name = args[:rm_type_name] if args[:rm_type_name]
     21          end
     22        end
     23
    1424        class C_ATTRIBUTE < ARCHETYPE_CONSTRAINT
    15          
     25          attr_accessor :rm_attribute_name, :existence, :children
     26
     27          def initialize(args = { })
     28            @rm_attribute_name = args[:rm_attribute_name] if args[:rm_attribute_name]
     29            @existence = args[:existence] if args[:existence]
     30            @children = args[:children] ? args[:children] : []
     31           
     32          end
    1633        end
    1734
    1835        class C_DEFINED_OBJECT < C_OBJECT
     36          attr_accessor :assumed_value
    1937         
     38          def initialize(args = { })
     39            @assumed_value = args[:assumed_value] if args[:assumed_value]
     40            super
     41          end
    2042        end
    2143
    2244        class C_PRIMITIVE_OBJECT < C_DEFINED_OBJECT
     45          attr_accessor :item
    2346         
     47          def initialize(args = { })
     48            @attributes = args[:item] if args[:item]
     49            super
     50          end
    2451        end
    2552
     
    2754          attr_accessor :attributes, :attributes_valid
    2855         
     56          def initialize(args = { })
     57            @attributes = args[:attributes] ? args[:attributes] : []
     58            super
     59          end
     60
     61          def self.create(args = { }, &block)
     62            c_complex_object = new(args)
     63            if block_given?
     64              yield c_complex_object
     65            end
     66            return c_complex_object
     67          end
    2968        end
    3069
     
    4988        end
    5089
     90        class C_SINGLE_ATTRIBUTE < C_ATTRIBUTE
     91          attr_accessor :alternatives
     92
     93          def initialize(args = { })
     94            @alternatives = args[:alternatives] ? args[:alternatives] : []
     95            super
     96          end
     97        end
     98
     99        class C_MULTIPLE_ATTRIBUTE < C_ATTRIBUTE
     100          attr_accessor :members, :cardinality
     101         
     102          def initialize(args = { })
     103            @members = args[:members] ? args[:members] : []
     104            @cardinality = args[:cardinality] if args[:cardinality]
     105            super
     106          end
     107        end
    51108      end
    52109    end
  • ruby/trunk/models/am/archetype/constraint_model/assertion.rb

    r4 r23  
    22  module AM
    33    module Archetype
    4       module Constraint_Model
    5         module Assertion
    6           class Assertion
    7           end
     4      module Assertion
     5        class ASSERTION
     6        end
     7
     8        class ASSERTION_VARIABLE
     9        end
     10
     11        class OPERATOR_KIND
     12        end
     13
     14        class EXPR_ITEM
     15        end
     16
     17        class EXPR_LEAF < EXPR_ITEM
     18        end
     19
     20        class EXPR_OPERATOR < EXPR_ITEM
     21        end
     22
     23        class EXPR_UNARY_OPERATOR < EXPR_OPERATOR
     24        end
     25
     26        class EXPR_BINARY_OPERATOR < EXPR_OPERATOR
    827        end
    928      end
  • ruby/trunk/models/am/archetype/constraint_model/primitive.rb

    r21 r23  
    66        module Primitive
    77
    8           class C_Primitive
     8          class C_PRIMITIVE
    99            def assumed_value
    1010              raise NotImplementedError, "assumed_value should be implemented"
     
    2121          end
    2222
    23           class C_Boolean < C_Primitive
    24             attr_accessor :assumed_value
    25             def initialize(true_valid, false_valid, assumed_value)
    26               binary_consistency(true_valid, false_valid)
    27               @true_valid = true_valid
    28               @false_valid = false_valid
    29               @assumed_value = assumed_value
     23          class C_BOOLEAN < C_PRIMITIVE
     24            attr_reader :true_valid, :false_valid, :assumed_value
     25
     26            def initialize(args = { })
     27              @true_valid = args[:true_valid] ? args[:true_valid] : false
     28              @false_valid = args[:false_valid] ? args[:false_valid] : false
     29              @assumed_value = args[:assumed_value] ? args[:assumed_value] : false
     30              binary_consistency(@true_valid, @false_valid)
    3031            end
    31             def set_true_valid(true_valid)
     32
     33            def true_valid=(true_valid)
    3234              binary_consistency(true_valid, @false_valid)
    3335              @true_valid = true_valid
    3436            end
    35             def set_false_valid(false_valid)
     37
     38            def false_valid=(false_valid)
    3639              binary_consistency(@true_valid,false_valid)
    3740              @false_valid = false_valid
    3841            end
    39             def true_valid?
    40               @true_valid
    41             end
    42             def false_valid?
    43               @false_valid
    44             end
     42
    4543            def valid_value?
    4644             
    4745            end
    48             def default_value(a_value=nil)
     46
     47            def default_value(a_value = nil)
    4948              if a_value == nil
    5049                @true_valid
     
    6362          end # of C_Boolean
    6463
    65           class C_Integer < C_Primitive
     64          class C_STRING < C_PRIMITIVE
    6665           
    6766          end
     67
     68          class C_INTEGER < C_PRIMITIVE
     69           
     70          end
     71
     72          class C_REAL < C_PRIMITIVE
     73           
     74          end
     75
     76          class C_TIME < C_PRIMITIVE
     77           
     78          end
     79
     80          class C_DATE < C_PRIMITIVE
     81           
     82          end
     83
     84          class C_DATE_TIME < C_PRIMITIVE
     85           
     86          end
     87
     88          class C_DURATION < C_PRIMITIVE
     89           
     90          end
     91
     92
     93
    6894        end # of Primitive
    6995      end # of Constraint_Model
  • ruby/trunk/models/am/archetype/ontology.rb

    r4 r23  
    33    module Archetype
    44      module Ontology
    5         class Archetype_Ontology
     5        class ARCHETYPE_ONTOLOGY
    66          attr_accessor :constraint_codes, :specialisation_depth
    77          attr_accessor :term_attribute_names, :term_codes
    88          attr_accessor :terminologies_available
     9
    910          def constraint_binding(a_terminology, a_code)
    1011          end
     12
    1113          def constraint_definition(a_lang, a_code)
    1214          end
     15
    1316          def has_language?(a_lang)
    1417          end
     18
    1519          def has_terminology?(a_terminology)
    1620          end
     21
    1722          def term_binding(a_terminology, a_code)
    1823          end
     24
    1925          def term_definition(a_lang, a_code)
    2026          end
    2127        end
    22         class Archetype_Term
     28
     29        class ARCHETYPE_TERM
    2330          attr_accessor :code, :items
    24           def initialize(code, items)
    25             if code == nil
    26               raise ArgumentError, "Code is empty"
    27             end
    28             if items.keys == nil
    29               raise ArgumentError, "Items is empty"
    30             end
    31             @code = code
    32             @items = items
     31
     32          def initialize(args = { })
     33                         
     34            @code = if args[:code]
     35                      args[:code]
     36                    else
     37                      raise ArgumentError, "Code is empty"
     38                    end
     39            @items = if args[:items]
     40                       args[:items]
     41                     else
     42                       raise ArgumentError, "Items is empty"
     43                     end
    3344          end
     45
    3446          def keys
    35             items.keys
     47            @items.keys
    3648          end
    3749        end
  • ruby/trunk/models/am/openehr_profile/data_types/basic.rb

    r4 r23  
    11module OpenEHR
    2   module RM
     2  module AM
    33    module OpenEHR_Profile
    44      module Data_Types
     5        module Basic
     6          class C_DV_STATE
     7          end
     8
     9          class STATE_MACHINE
     10          end
     11
     12          class STATE
     13          end
     14
     15          class TERMINAL_STATE < STATE
     16          end
     17
     18          class NON_TERMINAL_STATE < STATE
     19          end
     20
     21          class TRANSITION
     22          end
     23        end
     24
     25       
    526      end # of Data_Types
    627    end # of OpenEHR Profile
  • ruby/trunk/models/tests/test_archetype_model.rb

    r21 r23  
    55class ArchetypeModelTest < Test::Unit::TestCase
    66  def setup
    7     @archetype = OpenEHR::AM::Archetype::ARCHETYPE.new #(nil,nil,nil,nil,nil,nil,nil,nil)
     7    @archetype = OpenEHR::AM::Archetype::ARCHETYPE.new
     8    @validity_kind = OpenEHR::AM::Archetype::VALIDITY_KIND.new
     9
    810    @archetype_description = OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION.new
     11    @archetype_description_item = OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION_ITEM.new
     12  end
     13 
     14  def test_init
     15    assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, @archetype
     16    assert_instance_of OpenEHR::AM::Archetype::VALIDITY_KIND, @validity_kind
     17    assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION, @archetype_description
     18    assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION_ITEM, @archetype_description_item
     19    assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, @archetype
     20  end
     21end
     22
     23class ArchetypeModelConstraintTest < Test::Unit::TestCase
     24  def setup
    925    @archetype_constraint = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT.new
    10     @assertion = OpenEHR::AM::Archetype::Constraint_Model::Assertion::Assertion.new
    11     @c_primitive = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Primitive.new
    12     @c_boolean = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Boolean.new(true, true, true)
    13     @c_integer = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Integer.new
    14     @archetype_ontology = OpenEHR::AM::Archetype::Ontology::Archetype_Ontology.new
    15 
     26    @cardinality = OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY.new   
     27   
    1628    @archetype_constraint = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT.new
    1729    @c_object = OpenEHR::AM::Archetype::Constraint_Model::C_OBJECT.new
    1830    @c_defined_object = OpenEHR::AM::Archetype::Constraint_Model::C_DEFINED_OBJECT.new
    1931    @c_attribute = OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE.new
     32    @c_single_attribute = OpenEHR::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE.new
     33    @c_multiple_attribute = OpenEHR::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE.new(:rm_attribute_name => 'attribute_name', :cardinality => @cardinality)
    2034    @c_primitive_object = OpenEHR::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT.new
    2135    @c_reference_object =  OpenEHR::AM::Archetype::Constraint_Model::C_REFERENCE_OBJECT.new
     
    2438    @constraint_ref = OpenEHR::AM::Archetype::Constraint_Model::CONSTRAINT_REF.new
    2539    @c_domain_type = OpenEHR::AM::Archetype::Constraint_Model::C_DOMAIN_TYPE.new
    26     @c_complex_object = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new
     40    @c_complex_object = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new(:attributes => [@c_single_attribute])
    2741  end
    28  
     42
    2943  def test_init
    30     assert_instance_of OpenEHR::AM::Archetype::Ontology::Archetype_Ontology, @archetype_ontology
    31     assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint
    32     assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION, @archetype_description
    33     assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, @archetype
    34     assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Assertion::Assertion, @assertion
    35     assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Primitive, @c_primitive
    36     assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Boolean, @c_boolean
    3744    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint
    3845    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_OBJECT, @c_object
    3946    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_DEFINED_OBJECT, @c_defined_object
    4047    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE, @c_attribute
     48    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE, @c_single_attribute
     49    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE, @c_multiple_attribute
     50    assert_equal 'attribute_name', @c_multiple_attribute.rm_attribute_name
     51    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY, @c_multiple_attribute.cardinality
    4152    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT, @c_primitive_object
    4253    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_REFERENCE_OBJECT, @c_reference_object
     
    4657    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_DOMAIN_TYPE, @c_domain_type
    4758    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, @c_complex_object
     59    assert_instance_of Array, @c_complex_object.attributes
     60    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint
     61    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY, @cardinality
     62  end
     63
     64  def test_create
     65    c_complex_object = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:node_id => 'test_node',
     66                                                                                         :attributes => [1,2],
     67                                                                                         :assumed_value => Array
     68                                                                                         )
     69    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, c_complex_object
     70    assert_equal 'test_node', c_complex_object.node_id
     71  end
     72end
     73
     74class ArchetypeModelPrimitiveTest < Test::Unit::TestCase
     75  def setup
     76    @c_primitive = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE.new
     77    @c_boolean = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true,
     78                                                                                    :false_valid => true,
     79                                                                                    :assumed_value => true)
     80    @c_string = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_STRING.new
     81    @c_integer = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_INTEGER.new
     82    @c_real = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_REAL.new
     83    @c_time = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_TIME.new
     84    @c_date = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE.new
     85    @c_date_time = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME.new
     86    @c_duration = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DURATION.new
     87  end
     88
     89  def test_init
     90    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE, @c_primitive
     91    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN, @c_boolean
     92    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_STRING, @c_string
     93    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_INTEGER, @c_integer
     94    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_REAL, @c_real
     95    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_TIME, @c_time
     96    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE, @c_date
     97    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME, @c_date_time
     98    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DURATION, @c_duration
    4899  end
    49100
    50101  def test_primitive
    51     assert @c_boolean.true_valid?
    52     assert @c_boolean.false_valid?
     102    assert @c_boolean.true_valid
     103    assert @c_boolean.false_valid
    53104    assert @c_boolean.assumed_value
    54105    assert @c_boolean.has_assumed_value?
    55106    assert @c_boolean.default_value
    56107    assert @c_boolean.default_value(true)
    57     assert_raise(ArgumentError) {@c_boolean.set_true_valid(false); @c_boolean.set_false_valid(false)}
    58     assert_raise(ArgumentError) {OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Boolean.new(false,false,false)}
     108    assert_raise(ArgumentError) do
     109      @c_boolean.true_valid = false
     110      @c_boolean.false_valid = false
     111    end
     112    assert_raise(ArgumentError) do
     113      OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid =>false,
     114                                                                         :false_valid => false,
     115                                                                         :assumed_value => false)
     116    end
     117  end
     118 
     119end
     120
     121class ArchetypeModelOntologyTest < Test::Unit::TestCase
     122  def setup
     123    @archetype_ontology = OpenEHR::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY.new
     124    @archetype_term = OpenEHR::AM::Archetype::Ontology::ARCHETYPE_TERM.new(:code => '', :items => '')
     125  end
     126
     127  def test_init
     128    assert_instance_of OpenEHR::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY, @archetype_ontology
     129    assert_instance_of OpenEHR::AM::Archetype::Ontology::ARCHETYPE_TERM, @archetype_term
     130  end
     131end
     132   
     133class ArchetypeModelAssertionTest < Test::Unit::TestCase
     134  def setup
     135    @assertion = OpenEHR::AM::Archetype::Assertion::ASSERTION.new
     136    @assertion_variable = OpenEHR::AM::Archetype::Assertion::ASSERTION_VARIABLE.new
     137    @operator_kind = OpenEHR::AM::Archetype::Assertion::OPERATOR_KIND.new
     138    @expr_item = OpenEHR::AM::Archetype::Assertion::EXPR_ITEM.new
     139    @expr_leaf = OpenEHR::AM::Archetype::Assertion::EXPR_LEAF.new
     140    @expr_operator = OpenEHR::AM::Archetype::Assertion::EXPR_OPERATOR.new
     141    @expr_unary_operator = OpenEHR::AM::Archetype::Assertion::EXPR_UNARY_OPERATOR.new
     142    @expr_binary_operator = OpenEHR::AM::Archetype::Assertion::EXPR_BINARY_OPERATOR.new
     143  end
     144
     145  def test_init
     146    assert_instance_of OpenEHR::AM::Archetype::Assertion::ASSERTION, @assertion
     147    assert_instance_of OpenEHR::AM::Archetype::Assertion::ASSERTION_VARIABLE, @assertion_variable
     148    assert_instance_of OpenEHR::AM::Archetype::Assertion::OPERATOR_KIND, @operator_kind
     149    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_ITEM, @expr_item
     150    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_LEAF, @expr_leaf
     151    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_OPERATOR, @expr_operator
     152    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_UNARY_OPERATOR, @expr_unary_operator
     153    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_BINARY_OPERATOR, @expr_binary_operator
    59154  end
    60155end
    61156
     157class ArchetypeModelProfileTest < Test::Unit::TestCase
     158  def setup
     159    @c_dv_state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::C_DV_STATE.new
     160    @state_machine = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE_MACHINE.new
     161    @state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE.new
     162    @terminal_state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TERMINAL_STATE.new
     163    @non_terminal_state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::NON_TERMINAL_STATE.new
     164    @transition = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TRANSITION.new
     165
     166    @c_code_phase = OpenEHR::AM::OpenEHR_Profile::Data_Types::Text::C_CODE_PHASE.new
     167
     168    @c_dv_quantity = OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_QUANTITY.new
     169    @c_dv_ordinal = OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_ORDINAL.new
     170    @c_quantity_item = OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_QUANTITY_ITEM.new
     171  end
     172
     173  def test_init
     174    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::C_DV_STATE, @c_dv_state
     175    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE_MACHINE, @state_machine
     176    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE, @state
     177    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TERMINAL_STATE, @terminal_state
     178    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::NON_TERMINAL_STATE, @non_terminal_state
     179    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TRANSITION, @transition
     180    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Text::C_CODE_PHASE, @c_code_phase
     181    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_QUANTITY, @c_dv_quantity
     182    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_ORDINAL, @c_dv_ordinal
     183    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_QUANTITY_ITEM, @c_quantity_item
     184  end
     185end
Note: See TracChangeset for help on using the changeset viewer.