source: ruby/branches/0.5/lib/open_ehr/rm/composition/content/entry.rb@ 358

Last change on this file since 358 was 358, checked in by KOBAYASHI, Shinji, 14 years ago

refs #57 Activity, Action

File size: 5.0 KB
Line 
1# rm::composition::content::entry
2# entry module
3# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109264528523_312165_346Report.html
4# refs #56
5include OpenEHR::RM::Composition::Content
6
7module OpenEHR
8 module RM
9 module Composition
10 module Content
11 module Entry
12 class Entry < ContentItem
13 attr_reader :language, :encoding, :subject
14 attr_accessor :provider, :other_participations, :workflow_id
15 def initialize(args = { })
16 super(args)
17 self.language = args[:language]
18 self.encoding = args[:encoding]
19 self.subject = args[:subject]
20 self.provider = args[:provider]
21 self.other_participations = args[:other_participations]
22 self.workflow_id = args[:workflow_id]
23 end
24
25 def language=(language)
26 raise ArgumentError, 'language is mandatory' if language.nil?
27 @language = language
28 end
29
30 def encoding=(encoding)
31 raise ArgumentError, 'encoding is mandatory' if encoding.nil?
32 @encoding = encoding
33 end
34
35 def subject=(subject)
36 raise ArgumentError, 'subject is mandatory' if subject.nil?
37 @subject = subject
38 end
39
40 def subject_is_self?
41 return @subject.instance_of? PartySelf
42 end
43 end
44
45 class AdminEntry < Entry
46 attr_reader :data
47
48 def initialize(args = { })
49 super(args)
50 self.data = args[:data]
51 end
52
53 def data=(data)
54 raise ArgumentError, 'data are mandatory' if data.nil?
55 @data = data
56 end
57 end
58 class CareEntry < Entry
59 attr_accessor :protocol, :guideline_id
60
61 def initialize(args = { })
62 super(args)
63 self.protocol = args[:protocol]
64 self.guideline_id = args[:guideline_id]
65 end
66 end
67
68 class Observation < CareEntry
69 attr_reader :data
70 attr_accessor :state
71
72 def initialize(args = { })
73 super(args)
74 self.data = args[:data]
75 self.state = args[:state]
76 end
77
78 def data=(data)
79 raise ArgumentError, 'data are mandatory' if data.nil?
80 @data = data
81 end
82 end
83
84 class Evaluation < CareEntry
85 attr_reader :data
86
87 def initialize(args = { })
88 super(args)
89 self.data = args[:data]
90 end
91
92 def data=(data)
93 raise ArgumentError, 'data are mandatory' if data.nil?
94 @data = data
95 end
96 end
97
98 class Activity < Locatable
99 attr_reader :description, :timing, :action_archetype_id
100
101 def initialize(args = { })
102 super(args)
103 self.description = args[:description]
104 self.timing = args[:timing]
105 self.action_archetype_id = args[:action_archetype_id]
106 end
107
108 def description=(description)
109 if description.nil?
110 raise ArgumentError, 'description is mandatory'
111 end
112 @description = description
113 end
114
115 def timing=(timing)
116 if timing.nil?
117 raise ArgumentError, 'timing is mandatory'
118 end
119 @timing = timing
120 end
121 end
122
123 def action_archetype_id=(action_archetype_id)
124 if action_archetype_id.nil? || action_archetype_id.empty?
125 raise ArgumentError, 'action_archetype_id is mandatory'
126 end
127 @action_archetype_id = action_archetype_id
128 end
129
130 class Action < CareEntry
131 attr_reader :time, :description, :ism_transition
132 attr_accessor :instruction_details
133
134 def initialize(args = { })
135 super(args)
136 self.description = args[:description]
137 self.time = args[:time]
138 self.ism_transition = args[:ism_transition]
139 self.instruction_details = args[:instruction_details]
140 end
141
142 def time=(time)
143 if time.nil?
144 raise ArgumentError, 'time is mandatory'
145 end
146 @time = time
147 end
148
149 def description=(description)
150 if description.nil?
151 raise ArgumentError, 'description is mandatory'
152 end
153 @description = description
154 end
155
156 def ism_transition=(ism_transition)
157 if ism_transition.nil?
158 raise ArgumentError
159 end
160 @ism_transition = ism_transition
161 end
162 end
163
164 class InstructionDetails < Pathable
165
166 end
167
168 class IsmTransition < Pathable
169
170 end
171 end # of Entry
172 end # of Content
173 end # of Composition
174 end # of RM
175end # of OpenEHR
Note: See TracBrowser for help on using the repository browser.