1 | require File.dirname(__FILE__) + '/../../../spec_helper'
|
---|
2 | include OpenEHR::AM::Archetype
|
---|
3 | include OpenEHR::AM::Archetype::ConstraintModel
|
---|
4 | include OpenEHR::AM::Archetype::Ontology
|
---|
5 | include OpenEHR::RM::Support::Identification
|
---|
6 | include OpenEHR::RM::DataTypes::Text
|
---|
7 | include OpenEHR::AssumedLibraryTypes
|
---|
8 |
|
---|
9 | shared_examples_for 'sample archetype' do
|
---|
10 | before(:all) do
|
---|
11 | archetype_term = ArchetypeTerm.new(:code => 'at0000',
|
---|
12 | :items => {'text' => 'simple test',
|
---|
13 | 'description' => 'simple test for serializer'})
|
---|
14 | term_definitions = {'ja' => [archetype_term]}
|
---|
15 | ontology =
|
---|
16 | ArchetypeOntology.new(:specialisation_depth => 0,
|
---|
17 | :term_definitions => term_definitions)
|
---|
18 | archetype_id = ArchetypeID.new(:value =>
|
---|
19 | 'openEHR-EHR-SECTION.test.v1')
|
---|
20 | terminology_id = TerminologyID.new(:value => 'ISO_639-1')
|
---|
21 | original_language = CodePhrase.new(:code_string => 'ja',
|
---|
22 | :terminology_id => terminology_id)
|
---|
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}
|
---|
36 | description = ResourceDescription.new(:original_author => original_author,
|
---|
37 | :lifecycle_state => 'draft',
|
---|
38 | :details => details)
|
---|
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)
|
---|
45 | end
|
---|
46 | end
|
---|