Changeset 306 for ruby


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

refactored open_ehr to build gem package

Location:
ruby/branches/TRY-open_ehr_gem
Files:
2 added
1 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • ruby/branches/TRY-open_ehr_gem/lib/assumed_library_types.rb

    r304 r306  
    33require 'time'
    44
    5 module OpenEHR
     5module OpenEhr
    66  module AssumedLibraryTypes
    77    class Any < Object
  • ruby/branches/TRY-open_ehr_gem/lib/rm/common/archetyped.rb

    r297 r306  
    22# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109318114715_211173_0Report.html
    33# Ticket refs #65
    4 module OpenEHR
     4module OpenEhr
    55  module RM
    66    module Common
  • ruby/branches/TRY-open_ehr_gem/lib/rm/common/directory.rb

    r295 r306  
    22# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_5_1_76d0249_1140536622627_218703_7149Report.html
    33# Ticket refs #63
    4 include OpenEHR::RM::DataTypes::Text
    5 module OpenEHR
     4#include OpenEhr::RM::DataTypes::Text
     5module OpenEhr
    66  module RM
    77    module Common
    88      module Directory
    9         class Folder < OpenEHR::RM::Common::Archetyped::Locatable
     9        class Folder < OpenEhr::RM::Common::Archetyped::Locatable
    1010          attr_accessor :items
    1111          attr_reader :folders
     
    2121            @folders = folders
    2222          end
    23         end       
    24         class VersionedFolder < OpenEHR::RM::Common::ChangeControl::VersionedObject
     23        end
     24
     25        class VersionedFolder < OpenEhr::RM::Common::ChangeControl::VersionedObject
    2526        end
    2627      end # of Directory
  • ruby/branches/TRY-open_ehr_gem/lib/rm/common/generic.rb

    r167 r306  
    22# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_5_1_76d0249_1140169202660_257304_813Report.html
    33# Related to the ticket #62
    4 include OpenEhr::RM::Support::Identification
    5 include OpenEhr::RM::DataTypes::Basic
     4#include OpenEhr::RM::Support::Identification
     5#include OpenEhr::RM::DataTypes::Basic
    66module OpenEhr
    77  module RM
  • ruby/branches/TRY-open_ehr_gem/lib/rm/data_structures.rb

    r299 r306  
    44# refs #59
    55
    6 module OpenEHR
     6module OpenEhr
    77  module RM
    88    module DataStructures
    9       class DataStructure < OpenEHR::RM::Common::Archetyped::Locatable
     9      class DataStructure < OpenEhr::RM::Common::Archetyped::Locatable
    1010        def initialize(args = { })
    1111          super(args)
  • ruby/branches/TRY-open_ehr_gem/lib/rm/data_structures/item_structure.rb

    r299 r306  
    33# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109346709572_859750_3810Report.html
    44# refs #54
    5 require 'set'
    6 include OpenEHR::RM::DataStructures
    7 module OpenEHR
     5#require 'set'
     6#include OpenEHR::RM::DataStructures
     7module OpenEhr
    88  module RM
    99    module DataStructures
  • ruby/branches/TRY-open_ehr_gem/lib/rm/data_structures/item_structure/representation.rb

    r216 r306  
    33# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109066789167_738055_2581Report.html
    44# refs #53
    5 module OpenEHR
     5module OpenEhr
    66  module RM
    77    module DataStructures
    88      module ItemStructure
    99        module Representation
    10           class Item < OpenEHR::RM::Common::Archetyped::Locatable
     10          class Item < OpenEhr::RM::Common::Archetyped::Locatable
    1111            def initialize(args = {})
    1212              super(args)
  • ruby/branches/TRY-open_ehr_gem/lib/rm/demographic.rb

    r167 r306  
    55  module RM
    66    module Demogrphic
    7       class Address < OpenEHR::RM::Common::Archetyped::Locatable
     7      class Address < OpenEhr::RM::Common::Archetyped::Locatable
    88        attr_reader :details
    99
     
    1717      end
    1818
    19       class Capability < OpenEHR::RM::Common::Archetyped::Locatable
     19      class Capability < OpenEhr::RM::Common::Archetyped::Locatable
    2020        attr_reader :credentials, :time_validity
    2121
    2222      end
    2323
    24       class Party < OpenEHR::RM::Common::Archetyped::Locatable
     24      class Party < OpenEhr::RM::Common::Archetyped::Locatable
    2525        attr_reader :details, :reverse_relationships, :uid
    2626        attr_reader :idetities, :contacts, :relationships
     
    3838          relationships_valid(relationships)
    3939        end
     40
    4041        def type
    41           return name
    42         end
     42          name
     43        end
     44
    4345        def uid=(uid)
    4446          uid_valid(uid)
    4547          @uid = uid
    4648        end
     49
    4750        def identities=(identities)
    4851          identities_vaild(identities)
    4952          @identities = identities
     53        end
     54
    5055        def contacts=(contacts)
    5156          contacts_valid(contacts)
    5257          @contacts = contacts
    5358        end
     59
    5460        def parent=(parent)
    5561          @parent = nil
    5662        end
     63
    5764        private
     65
    5866        def uid_valid(uid)
    5967          raise ArgumentError, "uid is not valid" if uid.nil?
    6068        end
     69
    6170        def identities_vaild(identities)
    6271          if identities.nil?
     
    6675          end
    6776        end
     77
    6878        def contacts_valid(contacts)
    6979          if contacs.nil?
     
    7181          elsif contacts.empty?
    7282            raise ArgumentError, "contacts must not be empty"
    73           end         
    74         end
    75       end
    76 
    77       class PartyIdentity < OpenEHR::RM::Common::Archetyped::Locatable
     83          end
     84        end
     85      end
     86
     87      class PartyIdentity < OpenEhr::RM::Common::Archetyped::Locatable
    7888        attr_reader :details
    7989
    8090      end
    8191
    82       class PartyRelationship < OpenEHR::RM::Common::Archetyped::Locatable
    83 
    84       end
    85 
    86       class Versioned_Party < OpenEHR::RM::Common::Archetyped::Locatable
     92      class PartyRelationship < OpenEhr::RM::Common::Archetyped::Locatable
     93
     94      end
     95
     96      class Versioned_Party < OpenEhr::RM::Common::Archetyped::Locatable
    8797
    8898      end
     
    136146          end
    137147          @values = values
    138       end
    139       class Contact < OpenEHR::RM::Common::Archetyped::Locatable
     148        end
     149      end
     150
     151      class Contact < OpenEhr::RM::Common::Archetyped::Locatable
    140152        attr_accessor :time_validity
    141153        attr_reader :addresses
     154
    142155        def initialize(uid, archetype_node_id, name, archetype_details,
    143156                       feeder_audit, links, parent, time_validity, addresses)
     
    148161          @time_validity = time_validity
    149162        end
     163
    150164        def purpose
    151165          @name
    152166        end
     167
    153168        def purpose=(purpose)
    154169          @name = purpose
    155170        end
     171
    156172        def addresses=(addresses)
    157173          address_exists?(addresses)
    158174          @addresses = addresses
    159175        end
     176
    160177        private
     178
    161179        def address_exists?(addresses)
    162180          if addresses.nil?
  • ruby/branches/TRY-open_ehr_gem/lib/rm/security.rb

    r297 r306  
    22# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_5_1_76d0249_1155650882301_836618_5314Report.html
    33# Ticket refs #41
    4 module OpenEHR
     4module OpenEhr
    55  module RM
    66    module Security
    77      class AccessControlSettings
    8        
     8
    99      end
    1010    end
  • ruby/branches/TRY-open_ehr_gem/lib/rm/support/assumed_types.rb

    r167 r306  
    1212          def initialize(lower, upper,
    1313                         lower_included = nil, upper_included = nil)
    14             if ((lower !=nil) && (upper !=nil)) && lower>upper
    15               raise ArgumentError, "upper < lower"
    16             end
     14#             if ((lower !=nil) && (upper !=nil)) && lower>upper
     15#               raise ArgumentError, "upper < lower"
     16#             end
    1717            @lower = lower
    1818            @upper = upper
  • ruby/branches/TRY-open_ehr_gem/lib/rm/support/definition.rb

    r297 r306  
    1 module OpenEHR
     1module OpenEhr
    22  module RM
    33    module Support
  • 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
  • ruby/branches/TRY-open_ehr_gem/lib/rm/support/measurement.rb

    r295 r306  
    1 module OpenEHR
     1module OpenEhr
    22  module RM
    33    module Support
  • ruby/branches/TRY-open_ehr_gem/lib/rm/support/terminology.rb

    r298 r306  
    11
    2 module OpenEHR
     2module OpenEhr
    33  module RM
    44    module Support
Note: See TracChangeset for help on using the changeset viewer.