[353] | 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 |
|
---|
[216] | 7 | module OpenEHR
|
---|
[4] | 8 | module RM
|
---|
[353] | 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
|
---|
[4] | 43 | end
|
---|
[354] | 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
|
---|
[353] | 58 | class CareEntry < Entry
|
---|
[355] | 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
|
---|
[353] | 66 | end
|
---|
[356] | 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 |
|
---|
[353] | 84 | class Action < CareEntry
|
---|
| 85 | attr_accessor :description, :time
|
---|
| 86 | attr_accessor :ism_transition, :instruction_details
|
---|
| 87 |
|
---|
| 88 | def initialize(description, time, ism_transition, instruction_details)
|
---|
| 89 | raise Exception.new("invalid argument") if description == nil || time == nil || ism_transition == nil
|
---|
| 90 | @description = description
|
---|
| 91 | @time = time
|
---|
| 92 | @ism_transition = ism_transition
|
---|
| 93 | @instruction_details = instruction_details if instruction_details != nil
|
---|
| 94 | end
|
---|
| 95 | end # of Action
|
---|
| 96 | end # of Entry
|
---|
| 97 | end # of Content
|
---|
| 98 | end # of Composition
|
---|
| 99 | end # of RM
|
---|
| 100 | end # of OpenEHR
|
---|