Class: OpenEHR::RM::Common::ChangeControl::Version

Inherits:
Object
  • Object
show all
Defined in:
lib/open_ehr/rm/common/change_control.rb

Direct Known Subclasses

ImportedVersion, OriginalVersion

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = { }) ⇒ Version

Returns a new instance of Version.



50
51
52
53
54
55
56
57
58
# File 'lib/open_ehr/rm/common/change_control.rb', line 50

def initialize(args = { })
  self.uid = args[:uid]
  self.preceding_version_uid = args[:preceding_version_uid]
  self.data = args[:data]
  self.lifcycle_state = args[:lifecycle_state]
  self.commit_audit = args[:commit_audit]
  self.contribution = args[:contribution]
  self.signature = args[:signature]
end

Instance Attribute Details

#commit_auditObject

Returns the value of attribute commit_audit.



46
47
48
# File 'lib/open_ehr/rm/common/change_control.rb', line 46

def commit_audit
  @commit_audit
end

#contributionObject

Returns the value of attribute contribution.



46
47
48
# File 'lib/open_ehr/rm/common/change_control.rb', line 46

def contribution
  @contribution
end

#dataObject

Returns the value of attribute data.



48
49
50
# File 'lib/open_ehr/rm/common/change_control.rb', line 48

def data
  @data
end

#lifecycle_stateObject (readonly)

Returns the value of attribute lifecycle_state.



46
47
48
# File 'lib/open_ehr/rm/common/change_control.rb', line 46

def lifecycle_state
  @lifecycle_state
end

#preceding_version_uidObject

Returns the value of attribute preceding_version_uid.



46
47
48
# File 'lib/open_ehr/rm/common/change_control.rb', line 46

def preceding_version_uid
  @preceding_version_uid
end

#signatureObject

Returns the value of attribute signature.



48
49
50
# File 'lib/open_ehr/rm/common/change_control.rb', line 48

def signature
  @signature
end

#uidObject

Returns the value of attribute uid.



46
47
48
# File 'lib/open_ehr/rm/common/change_control.rb', line 46

def uid
  @uid
end

Instance Method Details

#canonical_formObject

Raises:

  • (NotImplementedError)


108
109
110
# File 'lib/open_ehr/rm/common/change_control.rb', line 108

def canonical_form
  raise NotImplementedError, 'canonical form is not determined'
end

#is_branch?Boolean

Returns:

  • (Boolean)


104
105
106
# File 'lib/open_ehr/rm/common/change_control.rb', line 104

def is_branch?
  return @uid.is_branch?
end

#lifcycle_state=(lifecycle_state) ⇒ Object

remove hard coding of lifecycle



73
74
75
76
77
78
79
80
# File 'lib/open_ehr/rm/common/change_control.rb', line 73

def lifcycle_state=(lifecycle_state)
  if lifecycle_state.nil? ||
      !%w[532 553 523].include?(
                    lifecycle_state.defining_code.code_string)
    raise ArgumentError, 'invalid lifecycle_state'
  end
  @lifecycle_state = lifecycle_state
end

#owner_idObject



100
101
102
# File 'lib/open_ehr/rm/common/change_control.rb', line 100

def owner_id
  return HierObjectID.new(:value => @uid.value)
end