source: ruby/trunk/models/rm/common/archetyped.rb@ 4

Last change on this file since 4 was 4, checked in by KOBAYASHI, Shinji, 16 years ago

restructuring repository tree

File size: 2.5 KB
Line 
1module OpenEHR
2 module RM
3 module Common
4 module Archetyped
5 module Locater_Constants
6 CURRENT_TRANSACTION_ID = "current"
7 FRAGMENT_SEPARATOR = "#"
8 CONTENT_PATH_SEPARATOR = "|"
9 ORGANIZER_PATH_SEPARATOR = "/"
10 MULTIPART_ID_DELIMITER = "::"
11 end
12 class Pathable
13 attr_reader :parent
14 def initialize(parent)
15 @parent = parent
16 end
17 def item_at_path(path)
18 raise NotImplementError, "item_at_path must be implemented"
19 end
20 def items_at_path(path)
21 raise NotImplementError, "items_at_path must be implemented"
22 end
23 def path_exists?(path)
24 raise NotImplementError, "path_exists? must be implemented"
25 end
26 def path_of_item(item)
27 raise NotImplementError, "path_of_item must be implemented"
28 end
29 def path_unique(path)
30 raise NotImplementError, "path_unique must be implemented"
31 end
32 module
33 class Locatable < Pathable
34 include Locater_Constants
35 attr_accessor :uid, :archetype_node_id, archetype_details
36 attr_accessor :feeder_audit, :links, :parent
37 def initialize(uid, archetype_node_id, name, archetype_details
38 feeder_audit, links, parent)
39 super(parent)
40 if archetype_node_id == nil
41 raise ArgumentError, "null archetype_node_id"
42 end
43 if name == nil
44 raise ArgumentError, "name is empty"
45 end
46 if links == nil
47 raise ArgumentError, "links is empty"
48 end
49 @uid = uid
50 @archetype_node_id = archetype_node_id
51 @archetype_details = archetype_details
52 @feeder_audit = feeder_audit
53 @links = links
54 end
55 def item_at_path(path)
56 if @path == nil
57
58 end
59 def items_at_path
60 raise NotImplementError, "items_at_path must be implemented"
61 end
62 def path_exists?
63 raise NotImplementError, "path_exists? must be implemented"
64 end
65 def path_unique
66 raise NotImplementError, "path_unique must be implemented"
67 end
68 def concept
69 end
70 def is_archetype_root?
71 archetype_details != nil
72 end
73 end
74 end # end of Archetyped
75 end # end of Common
76 end # end of RM
77end # end of OpenEHR
Note: See TracBrowser for help on using the repository browser.