[406] | 1 | require File.dirname(__FILE__) + '/../../../spec_helper'
|
---|
| 2 | include OpenEHR::AM::Archetype
|
---|
[407] | 3 | include OpenEHR::AM::Archetype::ConstraintModel
|
---|
| 4 | include OpenEHR::AM::Archetype::Ontology
|
---|
[406] | 5 | include OpenEHR::RM::Support::Identification
|
---|
| 6 | include OpenEHR::RM::DataTypes::Text
|
---|
[407] | 7 | include OpenEHR::AssumedLibraryTypes
|
---|
[406] | 8 |
|
---|
| 9 | shared_examples_for 'sample archetype' do
|
---|
| 10 | before(:all) do
|
---|
[412] | 11 | archetype_term = ArchetypeTerm.new(:code => 'at0000',
|
---|
[407] | 12 | :items => {'text' => 'simple test',
|
---|
| 13 | 'description' => 'simple test for serializer'})
|
---|
[412] | 14 | term_definitions = {'ja' => [archetype_term]}
|
---|
[407] | 15 | ontology =
|
---|
[412] | 16 | ArchetypeOntology.new(:specialisation_depth => 0,
|
---|
[407] | 17 | :term_definitions => term_definitions)
|
---|
[406] | 18 | archetype_id = ArchetypeID.new(:value =>
|
---|
[407] | 19 | 'openEHR-EHR-SECTION.test.v1')
|
---|
[408] | 20 | terminology_id = TerminologyID.new(:value => 'ISO_639-1')
|
---|
[407] | 21 | original_language = CodePhrase.new(:code_string => 'ja',
|
---|
[406] | 22 | :terminology_id => terminology_id)
|
---|
[407] | 23 | occurrences = Interval.new(:upper => 1, :lower => 1)
|
---|
| 24 | definition = CComplexObject.new(:path => '/',
|
---|
| 25 | :rm_type_name => 'SECTION',
|
---|
| 26 | :occurrences => occurrences,
|
---|
| 27 | :node_id => 'at0000')
|
---|
| 28 | original_author = {'email' => 'skoba@moss.gr.jp',
|
---|
| 29 | 'organisation' => 'openEHR.jp',
|
---|
| 30 | 'name' => 'Shinji KOBAYASHI'}
|
---|
| 31 | resource_description_item =
|
---|
| 32 | ResourceDescriptionItem.new(:language => original_language,
|
---|
| 33 | :purpose => 'Serializer test',
|
---|
| 34 | :misuse => 'evaluate message')
|
---|
| 35 | details = {'ja' => resource_description_item}
|
---|
[408] | 36 | description = ResourceDescription.new(:original_author => original_author,
|
---|
| 37 | :lifecycle_state => 'draft',
|
---|
| 38 | :details => details)
|
---|
[407] | 39 | @archetype = Archetype.new(:archetype_id => archetype_id,
|
---|
| 40 | :concept => 'at0000',
|
---|
| 41 | :original_language => original_language,
|
---|
| 42 | :ontology => ontology,
|
---|
| 43 | :description => description,
|
---|
| 44 | :definition => definition)
|
---|
[406] | 45 | end
|
---|
| 46 | end
|
---|