[113] | 1 | # This module is based on the UML,
|
---|
| 2 | # http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109326589721_134411_997Report.html
|
---|
| 3 | # Ticket refs #64
|
---|
| 4 |
|
---|
| 5 | module OpenEHR
|
---|
| 6 | module RM
|
---|
| 7 | module Common
|
---|
| 8 | module Change_Control
|
---|
| 9 | class Contribution
|
---|
[115] | 10 | attr_reader :uid, :versions, :audit
|
---|
| 11 | def initialize(uid, versions, audit)
|
---|
| 12 | self.uid = uid
|
---|
| 13 | self.versions = versions
|
---|
| 14 | self.audit = audit
|
---|
| 15 | end
|
---|
| 16 | def uid=(uid)
|
---|
| 17 | if uid.nil?
|
---|
| 18 | raise ArgumentError, "uid should not be nil."
|
---|
| 19 | end
|
---|
| 20 | @uid = uid
|
---|
| 21 | end
|
---|
| 22 | def versions=(versions)
|
---|
[117] | 23 | unless versions.nil?
|
---|
| 24 | if versions.empty?
|
---|
[115] | 25 | raise ArgumentError, 'versions shoud not be nil or empty.'
|
---|
| 26 | end
|
---|
| 27 | end
|
---|
| 28 | @versions = versions
|
---|
| 29 | end
|
---|
| 30 | def audit=(audit)
|
---|
| 31 | if audit.nil?
|
---|
| 32 | raise ArgumentError, 'audit should not be nil.'
|
---|
| 33 | end
|
---|
| 34 | if audit.description.nil?
|
---|
| 35 | raise ArgumentError, 'audit.description should not be nil.'
|
---|
| 36 | end
|
---|
| 37 | @audit = audit
|
---|
| 38 | end
|
---|
[113] | 39 | end
|
---|
| 40 | class Versioned_Object
|
---|
| 41 | end
|
---|
[117] | 42 |
|
---|
[113] | 43 | class Version
|
---|
[117] | 44 | attr_reader :uid, :contribution, :commit_audit, :signature
|
---|
| 45 | attr_reader :attestations, :data
|
---|
| 46 | def initialize(uid, contribution, commit_audit, signature=nil, attestations=nil, data=nil)
|
---|
| 47 | self.uid = uid
|
---|
| 48 | self.contribution = contribution
|
---|
| 49 | self.commit_audit = commit_audit
|
---|
| 50 | end
|
---|
| 51 | def uid=(uid)
|
---|
| 52 | raise ArgumentError, "uid should not be nil" if uid.nil?
|
---|
| 53 | end
|
---|
| 54 | def contribution=(contribution)
|
---|
| 55 | raise ArgumentError, "contribution should not be nil" if contribution.nil? or contribution.type == ''
|
---|
| 56 | @contribution = contribution
|
---|
| 57 | end
|
---|
| 58 | def commit_audit=(commit_audit)
|
---|
| 59 | raise ArgumentError, "commit_audit should not be nil" if commit_audit.nil?
|
---|
| 60 | @commit_audit = commit_audit
|
---|
| 61 | end
|
---|
[113] | 62 | end
|
---|
[117] | 63 |
|
---|
[113] | 64 | class Imported_Version < Version
|
---|
| 65 | end
|
---|
[117] | 66 |
|
---|
[113] | 67 | class Original_Version < Version
|
---|
| 68 | end
|
---|
| 69 | end # of Change_Control
|
---|
| 70 | end # of Common
|
---|
| 71 | end # of RM
|
---|
| 72 | end # of OpenEHR
|
---|