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
|
---|
5 | include OpenEHR::RM::Composition::Content
|
---|
6 |
|
---|
7 | module 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 Instruction < CareEntry
|
---|
99 | attr_reader :narrative, :activities
|
---|
100 | attr_accessor :expiry_time, :wf_definition
|
---|
101 |
|
---|
102 | def initialize(args = { })
|
---|
103 | super(args)
|
---|
104 | self.narrative = args[:narrative]
|
---|
105 | self.activities = args[:activities]
|
---|
106 | self.expiry_time = args[:expiry_time]
|
---|
107 | self.wf_definition = args[:wf_definition]
|
---|
108 | end
|
---|
109 |
|
---|
110 | def narrative=(narrative)
|
---|
111 | if narrative.nil?
|
---|
112 | raise ArgumentError, 'narrative is mandatory'
|
---|
113 | end
|
---|
114 | @narrative = narrative
|
---|
115 | end
|
---|
116 |
|
---|
117 | def activities=(activities)
|
---|
118 | if !activities.nil? && activities.empty?
|
---|
119 | raise ArgumentError, 'activities should not be empty'
|
---|
120 | end
|
---|
121 | @activities = activities
|
---|
122 | end
|
---|
123 | end
|
---|
124 |
|
---|
125 | class Activity < Locatable
|
---|
126 | attr_reader :description, :timing, :action_archetype_id
|
---|
127 |
|
---|
128 | def initialize(args = { })
|
---|
129 | super(args)
|
---|
130 | self.description = args[:description]
|
---|
131 | self.timing = args[:timing]
|
---|
132 | self.action_archetype_id = args[:action_archetype_id]
|
---|
133 | end
|
---|
134 |
|
---|
135 | def description=(description)
|
---|
136 | if description.nil?
|
---|
137 | raise ArgumentError, 'description is mandatory'
|
---|
138 | end
|
---|
139 | @description = description
|
---|
140 | end
|
---|
141 |
|
---|
142 | def timing=(timing)
|
---|
143 | if timing.nil?
|
---|
144 | raise ArgumentError, 'timing is mandatory'
|
---|
145 | end
|
---|
146 | @timing = timing
|
---|
147 | end
|
---|
148 | end
|
---|
149 |
|
---|
150 | def action_archetype_id=(action_archetype_id)
|
---|
151 | if action_archetype_id.nil? || action_archetype_id.empty?
|
---|
152 | raise ArgumentError, 'action_archetype_id is mandatory'
|
---|
153 | end
|
---|
154 | @action_archetype_id = action_archetype_id
|
---|
155 | end
|
---|
156 |
|
---|
157 | class Action < CareEntry
|
---|
158 | attr_reader :time, :description, :ism_transition
|
---|
159 | attr_accessor :instruction_details
|
---|
160 |
|
---|
161 | def initialize(args = { })
|
---|
162 | super(args)
|
---|
163 | self.description = args[:description]
|
---|
164 | self.time = args[:time]
|
---|
165 | self.ism_transition = args[:ism_transition]
|
---|
166 | self.instruction_details = args[:instruction_details]
|
---|
167 | end
|
---|
168 |
|
---|
169 | def time=(time)
|
---|
170 | if time.nil?
|
---|
171 | raise ArgumentError, 'time is mandatory'
|
---|
172 | end
|
---|
173 | @time = time
|
---|
174 | end
|
---|
175 |
|
---|
176 | def description=(description)
|
---|
177 | if description.nil?
|
---|
178 | raise ArgumentError, 'description is mandatory'
|
---|
179 | end
|
---|
180 | @description = description
|
---|
181 | end
|
---|
182 |
|
---|
183 | def ism_transition=(ism_transition)
|
---|
184 | if ism_transition.nil?
|
---|
185 | raise ArgumentError
|
---|
186 | end
|
---|
187 | @ism_transition = ism_transition
|
---|
188 | end
|
---|
189 | end
|
---|
190 |
|
---|
191 | class InstructionDetails < Pathable
|
---|
192 | attr_reader :instruction_id, :activity_id
|
---|
193 | attr_accessor :wf_details
|
---|
194 |
|
---|
195 | def initialize(args = { })
|
---|
196 | super(args)
|
---|
197 | self.instruction_id = args[:instruction_id]
|
---|
198 | self.activity_id = args[:activity_id]
|
---|
199 | self.wf_details = args[:wf_details]
|
---|
200 | end
|
---|
201 |
|
---|
202 | def instruction_id=(instruction_id)
|
---|
203 | if instruction_id.nil?
|
---|
204 | raise ArgumentError, 'instruction_id is mandatory'
|
---|
205 | end
|
---|
206 | @instruction_id = instruction_id
|
---|
207 | end
|
---|
208 |
|
---|
209 | def activity_id=(activity_id)
|
---|
210 | if activity_id.nil? || activity_id.empty?
|
---|
211 | raise ArgumentError, 'activity_id is mandatory'
|
---|
212 | end
|
---|
213 | @activity_id = activity_id
|
---|
214 | end
|
---|
215 | end
|
---|
216 |
|
---|
217 | class IsmTransition < Pathable
|
---|
218 | attr_reader :current_state, :transition
|
---|
219 | attr_accessor :careflow_step
|
---|
220 |
|
---|
221 | def initialize(args = { })
|
---|
222 | super(args)
|
---|
223 | self.current_state = args[:current_state]
|
---|
224 | self.transition = args[:transition]
|
---|
225 | self.careflow_step = args[:careflow_step]
|
---|
226 | end
|
---|
227 |
|
---|
228 | def current_state=(current_state)
|
---|
229 | if current_state.nil?
|
---|
230 | raise ArgumentError, 'current_state is mandatory'
|
---|
231 | end
|
---|
232 | @current_state = current_state
|
---|
233 | end
|
---|
234 |
|
---|
235 | def transition=(transition)
|
---|
236 | if transition.nil?
|
---|
237 | raise ArgumentError, 'transition is mandatory'
|
---|
238 | end
|
---|
239 | @transition = transition
|
---|
240 | end
|
---|
241 | end
|
---|
242 | end # of Entry
|
---|
243 | end # of Content
|
---|
244 | end # of Composition
|
---|
245 | end # of RM
|
---|
246 | end # of OpenEHR
|
---|