[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
|
---|
| 11 | end
|
---|
[4] | 12 | class Revision_History
|
---|
[104] | 13 |
|
---|
[4] | 14 | end # of Revision_History
|
---|
[104] | 15 |
|
---|
| 16 | class Revision_History_Item
|
---|
| 17 |
|
---|
| 18 | end # of Revision_History_Item
|
---|
| 19 |
|
---|
| 20 | class Party_Proxy
|
---|
[153] | 21 | attr_accessor :external_ref
|
---|
| 22 |
|
---|
| 23 | def initialize(args = { })
|
---|
| 24 | self.external_ref = args[:external_ref]
|
---|
[104] | 25 | end
|
---|
| 26 | end
|
---|
| 27 |
|
---|
| 28 | class Party_Self < Party_Proxy
|
---|
| 29 |
|
---|
| 30 | end
|
---|
| 31 |
|
---|
| 32 | class Party_Identified < Party_Proxy
|
---|
[153] | 33 | attr_reader :name, :identifier
|
---|
| 34 | def initialize(args = { })
|
---|
| 35 | if args[:external_ref].nil? && args[:name].nil? &&
|
---|
| 36 | args[:identifier].nil?
|
---|
| 37 | raise ArgumentError, 'cannot identified'
|
---|
| 38 | end
|
---|
| 39 | super(:external_ref => args[:external_ref])
|
---|
| 40 | self.name = args[:name]
|
---|
| 41 | self.identifier = args[:identifier]
|
---|
| 42 | end
|
---|
[104] | 43 |
|
---|
[153] | 44 | def name=(name)
|
---|
| 45 | if name.nil? && @external_ref.nil? && @identifier.nil?
|
---|
| 46 | raise ArgumentError, 'cannot identified'
|
---|
| 47 | end
|
---|
| 48 | raise ArgumentError, 'invaild name' unless name.nil? || !name.empty?
|
---|
| 49 | @name = name
|
---|
| 50 | end
|
---|
| 51 |
|
---|
| 52 | def identifier=(identifier)
|
---|
| 53 | if @name.nil? && @external_ref.nil? && identifier.nil?
|
---|
| 54 | raise ArgumentError, 'cannot identified'
|
---|
| 55 | end
|
---|
| 56 | unless identifier.nil? || !identifier.empty?
|
---|
| 57 | raise ArgumentError, 'invaild identifier'
|
---|
| 58 | end
|
---|
| 59 | @identifier = identifier
|
---|
| 60 | end
|
---|
[104] | 61 | end
|
---|
| 62 |
|
---|
[155] | 63 | class Party_Related < Party_Identified
|
---|
| 64 | attr_reader :relationship
|
---|
| 65 | def initialize(args = { })
|
---|
| 66 | super(args)
|
---|
| 67 | self.relationship = args[:relationship]
|
---|
| 68 | end
|
---|
| 69 |
|
---|
| 70 | def relationship=(relationship)
|
---|
| 71 | if relationship.nil?
|
---|
| 72 | raise ArgumentError, 'relationship must not be nil'
|
---|
| 73 | end
|
---|
| 74 | @relationship = relationship
|
---|
| 75 | end
|
---|
| 76 | end
|
---|
[4] | 77 | end # of Generic
|
---|
| 78 | end # of Common
|
---|
| 79 | end # of RM
|
---|
| 80 | end # of OpenEHR
|
---|