Ignore:
Timestamp:
Sep 27, 2009, 6:05:22 PM (15 years ago)
Author:
Tatsukawa, Akimichi
Message:

refactored open_ehr to build gem package

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/branches/TRY-open_ehr_gem/lib/rm/support/identification.rb

    r297 r306  
    22# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109331021343_528780_2066Report.html
    33# Ticket refs #39
    4 module OpenEHR
     4module OpenEhr
    55  module RM
    66    module Support
     
    1515          def value=(value)
    1616            raise ArgumentError, "empty value" if value.nil? or value.empty?
    17             @value = value           
     17            @value = value
    1818          end
    1919
     
    5252
    5353        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
    5756          def initialize(args = {})
    5857            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]
    6564            else
    6665              super(args)
     
    9897          end
    9998
    100           def concept_name=(concept_name)
    101             if concept_name.nil? or concept_name.empty?
    102               raise ArgumentError, 'concept_name is mandatory'
    103             end
    104             @concept_name = concept_name
    105           end
    106 
    107           def domain_concept=(domain_concept)
    108             if domain_concept.nil? or domain_concept.empty?
    109               raise ArgumentError, "domain concept not valid"
    110             end
    111             if /([a-zA-Z]\w+)(-([a-zA-Z]\w))?/ =~ domain_concept
    112               self.concept_name = $1
    113               self.specialisation = $3
    114             else
    115               raise ArgumentError, 'invalid domain concept form'
    116             end
    117           end
    118 
    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_name
    122           end
    123 
    124           def rm_entity=(rm_entity)
    125             if rm_entity.nil? or rm_entity.empty?
    126               raise ArgumentError, "rm_entity is mandatory"
    127             end
    128             @rm_entity = rm_entity
    129           end
    130 
    131           def rm_originator=(rm_originator)
    132             if rm_originator.nil? or rm_originator.empty?
    133               raise ArgumentError, "rm_originator not valid"
    134             end
    135             @rm_originator = rm_originator
    136           end
    137 
    138           def specialisation=(specialisation)
    139             if !specialisation.nil? and specialisation.empty?
    140               raise ArgumentError, "rm_specialisation not valid"
    141             end
    142             @specialisation = specialisation
    143           end
    144 
    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_id
    148           end
     99#           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
    149148        end
    150149
Note: See TracChangeset for help on using the changeset viewer.