Class: OpenEHR::RM::Support::Identification::ArchetypeID
- Defined in:
- lib/openehr/rm/support/identification.rb
Instance Attribute Summary collapse
-
#concept_name ⇒ Object
Returns the value of attribute concept_name.
-
#rm_entity ⇒ Object
Returns the value of attribute rm_entity.
-
#rm_name ⇒ Object
Returns the value of attribute rm_name.
-
#rm_originator ⇒ Object
Returns the value of attribute rm_originator.
-
#specialisation ⇒ Object
Returns the value of attribute specialisation.
-
#version_id ⇒ Object
Returns the value of attribute version_id.
Instance Method Summary collapse
- #domain_concept ⇒ Object
- #domain_concept=(domain_concept) ⇒ Object
-
#initialize(args = {}) ⇒ ArchetypeID
constructor
A new instance of ArchetypeID.
- #qualified_rm_entity ⇒ Object
- #value ⇒ Object
- #value=(value) ⇒ Object
Methods inherited from ObjectID
Constructor Details
#initialize(args = {}) ⇒ ArchetypeID
Returns a new instance of ArchetypeID.
57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/openehr/rm/support/identification.rb', line 57 def initialize(args = {}) if args[:value].nil? self.rm_originator = args[:rm_originator] self.rm_name = args[:rm_name] self.rm_entity = args[:rm_entity] self.concept_name = args[:concept_name] self.version_id = args[:version_id] self.specialisation = args[:specialisation] else super(args) end end |
Instance Attribute Details
#concept_name ⇒ Object
Returns the value of attribute concept_name.
54 55 56 |
# File 'lib/openehr/rm/support/identification.rb', line 54 def concept_name @concept_name end |
#rm_entity ⇒ Object
Returns the value of attribute rm_entity.
54 55 56 |
# File 'lib/openehr/rm/support/identification.rb', line 54 def rm_entity @rm_entity end |
#rm_name ⇒ Object
Returns the value of attribute rm_name.
54 55 56 |
# File 'lib/openehr/rm/support/identification.rb', line 54 def rm_name @rm_name end |
#rm_originator ⇒ Object
Returns the value of attribute rm_originator.
54 55 56 |
# File 'lib/openehr/rm/support/identification.rb', line 54 def rm_originator @rm_originator end |
#specialisation ⇒ Object
Returns the value of attribute specialisation.
54 55 56 |
# File 'lib/openehr/rm/support/identification.rb', line 54 def specialisation @specialisation end |
#version_id ⇒ Object
Returns the value of attribute version_id.
54 55 56 |
# File 'lib/openehr/rm/support/identification.rb', line 54 def version_id @version_id end |
Instance Method Details
#domain_concept ⇒ Object
87 88 89 90 91 92 93 |
# File 'lib/openehr/rm/support/identification.rb', line 87 def domain_concept if @specialisation.nil? return @concept_name else return @concept_name + '-' + @specialisation end end |
#domain_concept=(domain_concept) ⇒ Object
107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/openehr/rm/support/identification.rb', line 107 def domain_concept=(domain_concept) if domain_concept.nil? or domain_concept.empty? raise ArgumentError, "domain concept not valid" end if /([a-zA-Z]\w+)(-([a-zA-Z]\w))?/ =~ domain_concept self.concept_name = $1 self.specialisation = $3 else raise ArgumentError, 'invalid domain concept form' end end |
#qualified_rm_entity ⇒ Object
83 84 85 |
# File 'lib/openehr/rm/support/identification.rb', line 83 def qualified_rm_entity return @rm_originator + '-' + @rm_name + '-' + @rm_entity end |
#value ⇒ Object
95 96 97 98 |
# File 'lib/openehr/rm/support/identification.rb', line 95 def value return self.qualified_rm_entity + '.' + self.domain_concept + '.' + @version_id end |
#value=(value) ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/openehr/rm/support/identification.rb', line 70 def value=(value) if /([a-zA-Z]\w+)-([a-zA-Z]\w+)-([a-zA-Z]\w+)\.([a-zA-Z]\w+)(-([a-zA-Z]\w+))?\.(v[1-9]\d*)/ =~ value self.rm_originator = $1 self.rm_name = $2 self.rm_entity = $3 self.concept_name = $4 self.specialisation = $6 self.version_id = $7 else raise ArgumentError, 'invalid archetype id form' end end |