- Timestamp:
- Sep 27, 2009, 6:05:22 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/branches/TRY-open_ehr_gem/lib/rm/support/identification.rb
r297 r306 2 2 # http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109331021343_528780_2066Report.html 3 3 # Ticket refs #39 4 module OpenE HR4 module OpenEhr 5 5 module RM 6 6 module Support … … 15 15 def value=(value) 16 16 raise ArgumentError, "empty value" if value.nil? or value.empty? 17 @value = value 17 @value = value 18 18 end 19 19 … … 52 52 53 53 class ArchetypeID < ObjectID 54 attr_reader :rm_originator, :rm_name, :rm_entity, 55 :concept_name, :specialisation, :version_id 56 54 attr_accessor :rm_originator, :rm_name, :rm_entity, :concept_name, :specialisation, :version_id 55 57 56 def initialize(args = {}) 58 57 if args[:value].nil? 59 self.rm_originator = args[:rm_originator]60 self.rm_name = args[:rm_name]61 self.rm_entity = args[:rm_entity]62 self.concept_name = args[:concept_name]63 self.version_id = args[:version_id]64 self.specialisation = args[:specialisation]58 @rm_originator = args[:rm_originator] 59 @rm_name = args[:rm_name] 60 @rm_entity = args[:rm_entity] 61 @concept_name = args[:concept_name] 62 @version_id = args[:version_id] 63 @specialisation = args[:specialisation] 65 64 else 66 65 super(args) … … 98 97 end 99 98 100 def concept_name=(concept_name)101 if concept_name.nil? or concept_name.empty?102 raise ArgumentError, 'concept_name is mandatory'103 end104 @concept_name = concept_name105 end106 107 def domain_concept=(domain_concept)108 if domain_concept.nil? or domain_concept.empty?109 raise ArgumentError, "domain concept not valid"110 end111 if /([a-zA-Z]\w+)(-([a-zA-Z]\w))?/ =~ domain_concept112 self.concept_name = $1113 self.specialisation = $3114 else115 raise ArgumentError, 'invalid domain concept form'116 end117 end118 119 def rm_name=(rm_name)120 raise ArgumentError, "rm_name not valid" if rm_name.nil? or rm_name.empty?121 @rm_name = rm_name122 end123 124 def rm_entity=(rm_entity)125 if rm_entity.nil? or rm_entity.empty?126 raise ArgumentError, "rm_entity is mandatory"127 end128 @rm_entity = rm_entity129 end130 131 def rm_originator=(rm_originator)132 if rm_originator.nil? or rm_originator.empty?133 raise ArgumentError, "rm_originator not valid"134 end135 @rm_originator = rm_originator136 end137 138 def specialisation=(specialisation)139 if !specialisation.nil? and specialisation.empty?140 raise ArgumentError, "rm_specialisation not valid"141 end142 @specialisation = specialisation143 end144 145 def version_id=(version_id)146 raise ArgumentError, "version_id not valid" if version_id.nil? or version_id.empty?147 @version_id = version_id148 end99 # def concept_name=(concept_name) 100 # if concept_name.nil? or concept_name.empty? 101 # raise ArgumentError, 'concept_name is mandatory' 102 # end 103 # @concept_name = concept_name 104 # end 105 106 # def domain_concept=(domain_concept) 107 # if domain_concept.nil? or domain_concept.empty? 108 # raise ArgumentError, "domain concept not valid" 109 # end 110 # if /([a-zA-Z]\w+)(-([a-zA-Z]\w))?/ =~ domain_concept 111 # self.concept_name = $1 112 # self.specialisation = $3 113 # else 114 # raise ArgumentError, 'invalid domain concept form' 115 # end 116 # end 117 118 # def rm_name=(rm_name) 119 # raise ArgumentError, "rm_name not valid" if rm_name.nil? or rm_name.empty? 120 # @rm_name = rm_name 121 # end 122 123 # def rm_entity=(rm_entity) 124 # if rm_entity.nil? or rm_entity.empty? 125 # raise ArgumentError, "rm_entity is mandatory" 126 # end 127 # @rm_entity = rm_entity 128 # end 129 130 # def rm_originator=(rm_originator) 131 # if rm_originator.nil? or rm_originator.empty? 132 # raise ArgumentError, "rm_originator not valid" 133 # end 134 # @rm_originator = rm_originator 135 # end 136 137 # def specialisation=(specialisation) 138 # if !specialisation.nil? and specialisation.empty? 139 # raise ArgumentError, "rm_specialisation not valid" 140 # end 141 # @specialisation = specialisation 142 # end 143 144 # def version_id=(version_id) 145 # raise ArgumentError, "version_id not valid" if version_id.nil? or version_id.empty? 146 # @version_id = version_id 147 # end 149 148 end 150 149
Note:
See TracChangeset
for help on using the changeset viewer.