Ignore:
Timestamp:
Sep 15, 2009, 11:09:11 AM (15 years ago)
Author:
KOBAYASHI, Shinji
Message:

fixed around identification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/models/tests/rm/test_support.rb

    r158 r268  
    1515    assert_nothing_raised(Exception){@object_id = OpenEHR::RM::Support::Identification::Object_ID.new("0.0.3")}
    1616    assert_nothing_raised(Exception){@object_ref = OpenEHR::RM::Support::Identification::Object_Ref.new('local', 'ANY', @object_id)}
    17     assert_nothing_raised(Exception){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
     17    assert_nothing_raised(Exception){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new('openEHR-EHR-SECTION.physical_examination-prenatal.v2')}
    1818    assert_nothing_raised(Exception){@terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new('ICD10(2003)')}
    1919    assert_nothing_raised(Exception){@generic_id = OpenEHR::RM::Support::Identification::Generic_ID.new("0.0.3", "openehr")}
     
    8585
    8686  def test_archetype_id
    87     assert_equal "0.0.5", @archetype_id.value
    88     assert_nothing_raised(Exception){@archetype_id.value = "0.0.6"}
    89     assert_equal "0.0.6", @archetype_id.value
    90     assert_raise(ArgumentError){@archetype_id.value=nil}
    91     assert_raise(ArgumentError){@archetype_id.value=""}
    92     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new}
    93     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new(nil, "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
    94     assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
    95     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", nil, "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
    96     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
    97     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", nil, "ehr_rm", "openehr","cholesterol","0.0.3")}
    98     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "", "ehr_rm", "openehr","cholesterol","0.0.3")}
    99     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", nil, "openehr","cholesterol","0.0.3")}
    100     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "", "openehr","cholesterol","0.0.3")}
    101     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", nil,"cholesterol","0.0.3")}
    102     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "","cholesterol","0.0.3")}
    103     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr",nil ,"0.0.3")}
    104     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","","0.0.3")}
    105     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol", nil)}
    106     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","")}
    107 
    108     assert_equal "biochemistry result_cholesterol", @archetype_id.domain_concept
    109     assert_nothing_raised(Exception){(@archetype_id.domain_concept = "biochemistry result_triglyceride")}
    110     assert_equal "biochemistry result_triglyceride", @archetype_id.domain_concept
    111     assert_raise(ArgumentError){@archetype_id.domain_concept = nil}
    112     assert_raise(ArgumentError){@archetype_id.domain_concept = ""}
    113 
    114     assert_equal "entry", @archetype_id.rm_name
    115     assert_nothing_raised(Exception){@archetype_id.rm_name = "section"}
    116     assert_equal "section", @archetype_id.rm_name
    117     assert_raise(ArgumentError){@archetype_id.rm_name = nil}
    118     assert_raise(ArgumentError){@archetype_id.rm_name = ""}
    119 
    120     assert_equal "ehr_rm", @archetype_id.rm_entity
    121     assert_nothing_raised(Exception){@archetype_id.rm_entity = "13606"}
    122     assert_equal "13606", @archetype_id.rm_entity
    123     assert_raise(ArgumentError){@archetype_id.rm_entity = nil}
    124     assert_raise(ArgumentError){@archetype_id.rm_entity = ""}
    125 
    126     assert_equal "openehr", @archetype_id.rm_originator
    127     assert_nothing_raised(Exception){@archetype_id.rm_originator = "cen"}
    128     assert_equal "cen", @archetype_id.rm_originator
    129     assert_raise(ArgumentError){@archetype_id.rm_originator = nil}
    130     assert_raise(ArgumentError){@archetype_id.rm_originator = ""}
    131 
    132     assert_equal "cholesterol", @archetype_id.specialisation
    133     assert_nothing_raised(Exception){@archetype_id.specialisation = "triglyceride"}
    134     assert_equal "triglyceride", @archetype_id.specialisation
    135     assert_raise(ArgumentError){@archetype_id.specialisation = nil}
    136     assert_raise(ArgumentError){@archetype_id.specialisation = ""}
    137 
    138     assert_equal "0.0.3", @archetype_id.version_id
    139     assert_nothing_raised(Exception){@archetype_id.version_id = "0.0.7"}
    140     assert_equal "0.0.7", @archetype_id.version_id
    141     assert_raise(ArgumentError){@archetype_id.version_id = nil}
    142     assert_raise(ArgumentError){@archetype_id.version_id = ""}
     87    assert_equal 'openEHR-EHR-SECTION.physical_examination-prenatal.v2', @archetype_id.value
     88    assert_equal 'openEHR-EHR-SECTION', @archetype_id.qualified_rm_entity
     89    assert_equal 'openEHR', @archetype_id.rm_originator
     90    assert_equal 'EHR', @archetype_id.rm_name
     91    assert_equal 'SECTION', @archetype_id.rm_entity
     92    assert_equal 'physical_examination', @archetype_id.concept_name
     93    assert_equal 'prenatal', @archetype_id.specialisation
     94    assert_equal 'v2', @archetype_id.version_id
    14395  end
    14496
Note: See TracChangeset for help on using the changeset viewer.