[83] | 1 | # This module is a implementation of the bellow UML
|
---|
| 2 | # http://www.openehr.org/uml/release-1.0.1/Browsable/_9_5_1_76d0249_1140169202660_257304_813Report.html
|
---|
| 3 | # Related to the ticket #62
|
---|
[153] | 4 | include OpenEHR::RM::Support::Identification
|
---|
| 5 | include OpenEHR::RM::Data_Types::Basic
|
---|
[4] | 6 | module OpenEHR
|
---|
| 7 | module RM
|
---|
| 8 | module Common
|
---|
| 9 | module Generic
|
---|
[104] | 10 | class Audit_Details
|
---|
[156] | 11 | attr_reader :system_id, :committer, :time_committed, :change_type
|
---|
| 12 | attr_accessor :description
|
---|
| 13 |
|
---|
| 14 | def initialize(args = { })
|
---|
| 15 | self.system_id = args[:system_id]
|
---|
| 16 | self.committer = args[:committer]
|
---|
| 17 | self.time_committed = args[:time_committed]
|
---|
| 18 | self.change_type = args[:change_type]
|
---|
| 19 | self.description = args[:description]
|
---|
| 20 | end
|
---|
| 21 |
|
---|
| 22 | def system_id=(system_id)
|
---|
| 23 | if system_id.nil? or system_id.empty?
|
---|
| 24 | raise ArgumentError, 'system_id is mandatory'
|
---|
| 25 | end
|
---|
| 26 | @system_id = system_id
|
---|
| 27 | end
|
---|
| 28 |
|
---|
| 29 | def committer=(committer)
|
---|
| 30 | raise ArgumentError, 'committer is mandatory' if committer.nil?
|
---|
| 31 | @committer = committer
|
---|
| 32 | end
|
---|
| 33 |
|
---|
| 34 | def time_committed=(time_committed)
|
---|
| 35 | if time_committed.nil?
|
---|
| 36 | raise ArgumentError, 'time_commited is mandatory'
|
---|
| 37 | end
|
---|
| 38 | @time_committed = time_committed
|
---|
| 39 | end
|
---|
| 40 |
|
---|
| 41 | def change_type=(change_type)
|
---|
| 42 | raise ArgumentError, 'change_type is mandatory' if change_type.nil?
|
---|
| 43 | @change_type = change_type
|
---|
| 44 | end
|
---|
[104] | 45 | end
|
---|
[156] | 46 |
|
---|
[4] | 47 | class Revision_History
|
---|
[104] | 48 |
|
---|
[4] | 49 | end # of Revision_History
|
---|
[104] | 50 |
|
---|
| 51 | class Revision_History_Item
|
---|
| 52 |
|
---|
| 53 | end # of Revision_History_Item
|
---|
| 54 |
|
---|
| 55 | class Party_Proxy
|
---|
[153] | 56 | attr_accessor :external_ref
|
---|
| 57 |
|
---|
| 58 | def initialize(args = { })
|
---|
| 59 | self.external_ref = args[:external_ref]
|
---|
[104] | 60 | end
|
---|
| 61 | end
|
---|
| 62 |
|
---|
| 63 | class Party_Self < Party_Proxy
|
---|
| 64 |
|
---|
| 65 | end
|
---|
| 66 |
|
---|
| 67 | class Party_Identified < Party_Proxy
|
---|
[153] | 68 | attr_reader :name, :identifier
|
---|
| 69 | def initialize(args = { })
|
---|
| 70 | if args[:external_ref].nil? && args[:name].nil? &&
|
---|
| 71 | args[:identifier].nil?
|
---|
| 72 | raise ArgumentError, 'cannot identified'
|
---|
| 73 | end
|
---|
| 74 | super(:external_ref => args[:external_ref])
|
---|
| 75 | self.name = args[:name]
|
---|
| 76 | self.identifier = args[:identifier]
|
---|
| 77 | end
|
---|
[104] | 78 |
|
---|
[153] | 79 | def name=(name)
|
---|
| 80 | if name.nil? && @external_ref.nil? && @identifier.nil?
|
---|
| 81 | raise ArgumentError, 'cannot identified'
|
---|
| 82 | end
|
---|
| 83 | raise ArgumentError, 'invaild name' unless name.nil? || !name.empty?
|
---|
| 84 | @name = name
|
---|
| 85 | end
|
---|
| 86 |
|
---|
| 87 | def identifier=(identifier)
|
---|
| 88 | if @name.nil? && @external_ref.nil? && identifier.nil?
|
---|
| 89 | raise ArgumentError, 'cannot identified'
|
---|
| 90 | end
|
---|
| 91 | unless identifier.nil? || !identifier.empty?
|
---|
| 92 | raise ArgumentError, 'invaild identifier'
|
---|
| 93 | end
|
---|
| 94 | @identifier = identifier
|
---|
| 95 | end
|
---|
[104] | 96 | end
|
---|
| 97 |
|
---|
[155] | 98 | class Party_Related < Party_Identified
|
---|
| 99 | attr_reader :relationship
|
---|
| 100 | def initialize(args = { })
|
---|
| 101 | super(args)
|
---|
| 102 | self.relationship = args[:relationship]
|
---|
| 103 | end
|
---|
| 104 |
|
---|
| 105 | def relationship=(relationship)
|
---|
| 106 | if relationship.nil?
|
---|
| 107 | raise ArgumentError, 'relationship must not be nil'
|
---|
| 108 | end
|
---|
| 109 | @relationship = relationship
|
---|
| 110 | end
|
---|
| 111 | end
|
---|
[156] | 112 |
|
---|
| 113 | class Participation
|
---|
| 114 | attr_reader :performer, :function, :mode
|
---|
| 115 | attr_accessor :time
|
---|
| 116 |
|
---|
| 117 | def initialize(args ={ })
|
---|
| 118 | self.performer = args[:performer]
|
---|
| 119 | self.function = args[:function]
|
---|
| 120 | self.mode = args[:mode]
|
---|
| 121 | self.time = args[:time]
|
---|
| 122 | end
|
---|
| 123 |
|
---|
| 124 | def performer=(performer)
|
---|
| 125 | raise ArgumentError, 'performer is mandatory' if performer.nil?
|
---|
| 126 | @performer = performer
|
---|
| 127 | end
|
---|
| 128 |
|
---|
| 129 | def function=(function)
|
---|
| 130 | raise ArgumentError, 'function is mandatory' if function.nil?
|
---|
| 131 | @function = function
|
---|
| 132 | end
|
---|
| 133 |
|
---|
| 134 | def mode=(mode)
|
---|
| 135 | raise ArgumentError, 'mode is mandatory' if mode.nil?
|
---|
| 136 | @mode = mode
|
---|
| 137 | end
|
---|
| 138 | end
|
---|
[4] | 139 | end # of Generic
|
---|
| 140 | end # of Common
|
---|
| 141 | end # of RM
|
---|
| 142 | end # of OpenEHR
|
---|