Changeset 108


Ignore:
Timestamp:
Oct 12, 2008, 5:56:41 PM (10 years ago)
Author:
KOBAYASHI, Shinji
Message:

refs #48

Location:
ruby/trunk/lib/models
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/models/rm/data_types/text.rb

    r107 r108  
    134134                         encoding = nil)
    135135            super(value, formatting, hyperlink, mappings, language, encoding)
    136             definition_exists(defining_code)
    137             @defining_code = defining_code
     136            self.defining_code = defining_code
    138137          end
    139138          def defining_code=(defining_code)
  • ruby/trunk/lib/models/tests/test_reference_model.rb

    r107 r108  
    352352  def setup
    353353    assert_nothing_raised(Exception){@dv_boolean = OpenEHR::RM::Data_Types::Basic::DV_Boolean.new("TRUE")}
    354     @terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new('ICD10')
    355     @code_phrase = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('C92.0', @terminology_id)
    356     @dv_coded_text = OpenEHR::RM::Data_Types::Text::DV_Coded_Text.new("Acute Myeloyd Leukemia", @code_phrase)
    357     @dv_state = OpenEHR::RM::Data_Types::Basic::DV_State.new(@dv_coded_text, true)
    358     @dv_identifier = OpenEHR::RM::Data_Types::Basic::DV_Identifier.new("Ruby Hospital","0123456-0", "Information office", "personal id")
     354    @terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new('openEHR','1.0.2')
     355    @code_phrase = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('PROPOSED', @terminology_id)
     356    @dv_coded_text = OpenEHR::RM::Data_Types::Text::DV_Coded_Text.new("Blood examination", @code_phrase)
     357    assert_nothing_raised(Exception){@dv_state = OpenEHR::RM::Data_Types::Basic::DV_State.new(@dv_coded_text, false)}
     358    assert_nothing_raised(Exception){@dv_identifier = OpenEHR::RM::Data_Types::Basic::DV_Identifier.new("Ruby Hospital","0123456-0", "Information office", "personal id")}
    359359  end
    360360
     
    375375
    376376  def test_dv_state
    377     assert_equal(@dv_coded_text, @dv_state.value)
    378     assert_nothing_raised(Exception){@dv_state.value = "code2"}
    379     assert_equal("code2", @dv_state.value)
     377    assert_equal 'Blood examination', @dv_state.value.value
     378    assert_equal 'PROPOSED', @dv_state.value.defining_code.code_string
     379    assert_equal 'openEHR', @dv_state.value.defining_code.terminology_id.name
     380    assert_equal '1.0.2', @dv_state.value.defining_code.terminology_id.version_id
     381    assert !@dv_state.is_terminal?
     382    assert_nothing_raised(Exception){@dv_state.value.defining_code.code_string = "COMPLETED"}
     383    assert_nothing_raised(Exception){@dv_state.is_terminal = true}
     384    assert_equal 'COMPLETED', @dv_state.value.defining_code.code_string
    380385    assert @dv_state.is_terminal?
    381     assert_nothing_raised(Exception){@dv_state.is_terminal = false}
    382     assert !@dv_state.is_terminal?
    383386    assert_raise(ArgumentError) {OpenEHR::RM::Data_Types::Basic::DV_State.new(nil,nil)}
    384387    assert_raise(ArgumentError) {@dv_state.value=nil}
Note: See TracChangeset for help on using the changeset viewer.