Changeset 359 for ruby/branches/0.5/lib/open_ehr/rm/composition
- Timestamp:
- Nov 18, 2009, 9:35:55 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/branches/0.5/lib/open_ehr/rm/composition/content/entry.rb
r358 r359 96 96 end 97 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 98 125 class Activity < Locatable 99 126 attr_reader :description, :timing, :action_archetype_id … … 163 190 164 191 class InstructionDetails < Pathable 165 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 166 215 end 167 216 168 217 class IsmTransition < Pathable 169 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 170 241 end 171 242 end # of Entry
Note:
See TracChangeset
for help on using the changeset viewer.