source: ruby/trunk/models/rm/common/resource.rb@ 24

Last change on this file since 24 was 24, checked in by Tatsukawa, Akimichi, 16 years ago

working on AM::Archetype::ARCHETYPE

File size: 1.8 KB
Line 
1require 'set'
2module OpenEHR
3 module RM
4 module Common
5 module Resource
6 class AUTHORED_RESOURCE
7 attr_reader :is_controled,:revision_history, :translations
8 attr_accessor :description, :original_language
9
10 def initialize(args = { })
11 @original_language = args[:original_language] if args[:original_language]
12 @translations = args[:translations] if args[:translations]
13 @revision_history = args[:revision_history] ? args[:revision_history] : nil
14
15 unless @revision_history
16 @is_controled = false
17 else
18 @is_controled = true
19 end
20
21 @original_language = args[:original_language] if args[:original_language]
22 @translations = args[:translations] if args[:translations]
23 @description = args[:description] if args[:description]
24 end
25
26 def current_version
27 @revision_history.most_recent_revision
28 end
29
30 def language_available
31 languages = Set.new
32 if @translations != nil
33 languages << @translations.keys
34 end
35 languages << @original_language.code_string
36 end
37 end
38
39 class TRANSLATION_DETAILS
40 attr_accessor :language, :author, :accreditation
41 attr_accessor :other_details, :terminology_service
42
43 def initialize(language, author, accreditation, other_details,
44 terminology_service)
45 @language = language
46 @author = author
47 @accreditation = accreditation
48 @other_details = other_details
49 @terminology_service = terminology_service
50 end
51 end
52 end
53 end # end of module Common
54 end # end of module RM
55end # end of module OpenEHR
Note: See TracBrowser for help on using the repository browser.