Changeset 167 for ruby/branches/0.5.0/lib/open_ehr
- Timestamp:
- Aug 6, 2009, 1:20:05 AM (15 years ago)
- Location:
- ruby/branches/0.5.0/lib/open_ehr
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/branches/0.5.0/lib/open_ehr/am.rb
r165 r167 14 14 require 'rm/common/resource.rb' 15 15 #require 'rm/support/terminology/openehr_code_set_identifier.rb' 16 module OpenE HR16 module OpenEhr 17 17 module AM 18 18 module Archetype … … 38 38 39 39 module OpenEHR_Profile 40 module Data _Types40 module DataTypes 41 41 module Basic 42 42 autoload :C_DV_STATE, "am/openehr_profile/data_types/basic.rb" -
ruby/branches/0.5.0/lib/open_ehr/am/archetype/archetype.rb
r163 r167 1 1 require 'rm/support/terminology.rb' 2 2 3 module OpenE HR3 module OpenEhr 4 4 module AM 5 5 module Archetype 6 6 module ADL_Definition 7 7 # include OpenEHR::RM::Support::Terminology::OpenEHR_Code_Set_Identifier 8 include OpenE HR::RM::Support::Terminology8 include OpenEhr::RM::Support::Terminology 9 9 CURRENT_ADL_VERSION = "1.4" 10 10 end 11 11 12 class ARCHETYPE < OpenE HR::RM::Common::Resource::Authored_Resource12 class ARCHETYPE < OpenEhr::RM::Common::Resource::AuthoredResource 13 13 include ADL_Definition 14 14 attr_accessor :archetype_id, :concept_code, :is_controlled, :original_language, :parent_archtype_id, :uid -
ruby/branches/0.5.0/lib/open_ehr/am/archetype/archetype_description/archetype_description.rb
r23 r167 1 1 2 module OpenE HR2 module OpenEhr 3 3 module AM 4 4 module Archetype -
ruby/branches/0.5.0/lib/open_ehr/am/archetype/constraint_model/archetype_constraint.rb
r35 r167 1 1 2 module OpenE HR2 module OpenEhr 3 3 module AM 4 4 module Archetype -
ruby/branches/0.5.0/lib/open_ehr/am/archetype/constraint_model/assertion.rb
r23 r167 1 module OpenE HR1 module OpenEhr 2 2 module AM 3 3 module Archetype -
ruby/branches/0.5.0/lib/open_ehr/am/archetype/constraint_model/primitive.rb
r32 r167 1 module OpenE HR1 module OpenEhr 2 2 module AM 3 3 module Archetype -
ruby/branches/0.5.0/lib/open_ehr/am/archetype/ontology.rb
r23 r167 1 module OpenE HR1 module OpenEhr 2 2 module AM 3 3 module Archetype -
ruby/branches/0.5.0/lib/open_ehr/am/archetype/validity_kind.rb
r47 r167 1 module OpenE HR1 module OpenEhr 2 2 module AM 3 3 module Archetype -
ruby/branches/0.5.0/lib/open_ehr/assumed_library_types.rb
r165 r167 3 3 require 'time' 4 4 5 module OpenE HR6 module Assumed _Library_Types5 module OpenEhr 6 module AssumedLibraryTypes 7 7 class Any < Object 8 8 -
ruby/branches/0.5.0/lib/open_ehr/rm.rb
r165 r167 9 9 10 10 # OpenEHR::RM 11 module OpenE HR11 module OpenEhr 12 12 13 13 autoload :Assumed_Library_Types, "assumed_library_types.rb" … … 31 31 end 32 32 33 module Data _Types33 module DataTypes 34 34 autoload :Basic, "rm/data_types/basic.rb" 35 35 autoload :Text, "rm/data_types/text.rb" … … 40 40 end 41 41 42 module Data _Structures42 module DataStructures 43 43 autoload :Data_Structure, "rm/data_structure.rb" 44 44 autoload :History, 'rm/data_structures/history.rb' -
ruby/branches/0.5.0/lib/open_ehr/rm/common/archetyped.rb
r162 r167 2 2 # http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109318114715_211173_0Report.html 3 3 # Ticket refs #65 4 module OpenE HR4 module OpenEhr 5 5 module RM 6 6 module Common 7 7 module Archetyped 8 module Locater _Constants8 module LocaterConstants 9 9 CURRENT_TRANSACTION_ID = "current" 10 10 FRAGMENT_SEPARATOR = "#" … … 43 43 44 44 class Locatable < Pathable 45 include Locater _Constants45 include LocaterConstants 46 46 attr_reader :archetype_node_id, :name, :links 47 47 attr_accessor :uid, :archetype_details, :feeder_audit … … 138 138 end # of Link 139 139 140 class Feeder _Audit140 class FeederAudit 141 141 attr_reader :originating_system_audit 142 142 attr_accessor :originating_system_item_ids, :feeder_system_audit, … … 157 157 @originating_system_audit = originating_system_audit 158 158 end 159 end # of Feeder _Audit159 end # of FeederAudit 160 160 161 class Feeder _Audit_Details161 class FeederAuditDetails 162 162 attr_reader :system_id 163 163 attr_accessor :provider, :location, :time, :subject, :version_id … … 176 176 @system_id = system_id 177 177 end 178 end # of Feeder _Audit_Details178 end # of FeederAudit_Details 179 179 end # of Archetyped 180 180 end # of Common -
ruby/branches/0.5.0/lib/open_ehr/rm/common/change_control.rb
r161 r167 3 3 # Ticket refs #64 4 4 5 module OpenE HR5 module OpenEhr 6 6 module RM 7 7 module Common 8 module Change _Control8 module ChangeControl 9 9 class Contribution 10 10 attr_reader :uid, :versions, :audit … … 93 93 94 94 def owner_id 95 return Hier _Object_ID.new(@uid.object_id.value)95 return HierObjectId.new(@uid.object_id.value) 96 96 end 97 97 … … 105 105 end 106 106 107 class Imported _Version < Version107 class ImportedVersion < Version 108 108 attr_reader :item 109 109 … … 126 126 end 127 127 128 class Original _Version < Version128 class OriginalVersion < Version 129 129 attr_reader :attestations, :other_input_version_uids 130 130 … … 155 155 end 156 156 157 class Versioned _Object157 class VersionedObject 158 158 attr_reader :uid, :owner_id, :time_created, :all_versions 159 159 … … 208 208 raise ArgumentError, 'invalid a_ver_id' 209 209 end 210 return @all_versions[self.all_version_ids.index(a_ver_id)].instance_of? Original _Version210 return @all_versions[self.all_version_ids.index(a_ver_id)].instance_of? OriginalVersion 211 211 end 212 212 … … 267 267 @all_versions.each do |ver| 268 268 audits = [ ] 269 if ver.instance_of? Original _Version269 if ver.instance_of? OriginalVersion 270 270 audits << ver.attestations 271 271 end 272 272 audits << ver.commit_audit 273 revision_history_items << Revision _History_Item.new(273 revision_history_items << RevisionHistoryItem.new( 274 274 :audits => audits, 275 275 :version_id => ver.uid) 276 276 end 277 return Revision _History.new(revision_history_items)277 return RevisionHistory.new(revision_history_items) 278 278 end 279 279 280 280 def commit_original_version(args={ }) 281 @all_versions << Original _Version.new(:uid => args[:uid],281 @all_versions << OriginalVersion.new(:uid => args[:uid], 282 282 :preceding_version_uid => args[:preceding_version_uid], 283 283 :contribution => args[:contribution], … … 290 290 291 291 def commit_original_merged_version(args = { }) 292 @all_versions << Original _Version.new(:uid => args[:uid],292 @all_versions << OriginalVersion.new(:uid => args[:uid], 293 293 :contribution => args[:contribution], 294 294 :preceding_version_uid => args[:preceding_version_uid], … … 302 302 303 303 def commit_imported_version(args = { }) 304 @all_versions << Imported _Version.new(:item => args[:item],304 @all_versions << ImportedVersion.new(:item => args[:item], 305 305 :contribution => args[:contribution], 306 306 :commit_audit => args[:commit_audit]) … … 319 319 end 320 320 end 321 end # of Change _Control321 end # of ChangeControl 322 322 end # of Common 323 323 end # of RM -
ruby/branches/0.5.0/lib/open_ehr/rm/common/directory.rb
r162 r167 2 2 # http://www.openehr.org/uml/release-1.0.1/Browsable/_9_5_1_76d0249_1140536622627_218703_7149Report.html 3 3 # Ticket refs #63 4 include OpenE HR::RM::Data_Types::Text5 module OpenE HR4 include OpenEhr::RM::DataTypes::Text 5 module OpenEhr 6 6 module RM 7 7 module Common 8 8 module Directory 9 class Folder < OpenE HR::RM::Common::Archetyped::Locatable9 class Folder < OpenEhr::RM::Common::Archetyped::Locatable 10 10 attr_accessor :items 11 11 attr_reader :folders … … 22 22 end 23 23 end 24 class Versioned _Folder < OpenEHR::RM::Common::Change_Control::Versioned_Object24 class VersionedFolder < OpenEhr::RM::Common::ChangeControl::VersionedObject 25 25 end 26 26 end # of Directory -
ruby/branches/0.5.0/lib/open_ehr/rm/common/generic.rb
r157 r167 2 2 # http://www.openehr.org/uml/release-1.0.1/Browsable/_9_5_1_76d0249_1140169202660_257304_813Report.html 3 3 # Related to the ticket #62 4 include OpenE HR::RM::Support::Identification5 include OpenE HR::RM::Data_Types::Basic6 module OpenE HR4 include OpenEhr::RM::Support::Identification 5 include OpenEhr::RM::DataTypes::Basic 6 module OpenEhr 7 7 module RM 8 8 module Common 9 9 module Generic 10 class Audit _Details10 class AuditDetails 11 11 attr_reader :system_id, :committer, :time_committed, :change_type 12 12 attr_accessor :description … … 45 45 end 46 46 47 class Revision _History47 class RevisionHistory 48 48 attr_reader :items 49 49 … … 66 66 return @items.last.audits.first.time_committed.value 67 67 end 68 end # of Revision _History68 end # of RevisionHistory 69 69 70 class Revision _History_Item70 class RevisionHistoryItem 71 71 attr_reader :version_id, :audits 72 72 … … 87 87 @version_id = version_id 88 88 end 89 end # of Revision _History_Item89 end # of RevisionHistory_Item 90 90 91 class Party _Proxy91 class PartyProxy 92 92 attr_accessor :external_ref 93 93 … … 97 97 end 98 98 99 class Party _Self < Party_Proxy99 class PartySelf < PartyProxy 100 100 101 101 end 102 102 103 class Party _Identified < Party_Proxy103 class PartyIdentified < PartyProxy 104 104 attr_reader :name, :identifier 105 105 def initialize(args = { }) … … 132 132 end 133 133 134 class Party _Related < Party_Identified134 class PartyRelated < PartyIdentified 135 135 attr_reader :relationship 136 136 def initialize(args = { }) … … 174 174 end 175 175 176 class Attestation < Audit _Details176 class Attestation < AuditDetails 177 177 attr_reader :reason 178 178 attr_accessor :proof, :items -
ruby/branches/0.5.0/lib/open_ehr/rm/common/resource.rb
r163 r167 1 1 require 'set' 2 module OpenE HR2 module OpenEhr 3 3 module RM 4 4 module Common 5 5 module Resource 6 class Authored _Resource6 class AuthoredResource 7 7 attr_reader :original_language, :translations 8 8 attr_accessor :description, :revision_history … … 42 42 end 43 43 44 class Translation _Details44 class TranslationDetails 45 45 attr_reader :language, :author 46 46 attr_accessor :accreditation, :other_details … … 64 64 end 65 65 66 class Resource _Description66 class ResourceDescription 67 67 attr_reader :original_author, :lifecycle_state, :details 68 68 attr_accessor :other_contributors, :resource_package_uri, … … 101 101 end 102 102 103 class Resource _Description_Item103 class ResourceDescriptionItem 104 104 attr_reader :language, :purpose, :use, :misuse, :copyright 105 105 attr_accessor :keywords, :original_resource_uri, :other_details -
ruby/branches/0.5.0/lib/open_ehr/rm/composition/content/entry.rb
r4 r167 1 module OpenE HR1 module OpenEhr 2 2 module RM 3 3 module Content … … 5 5 class Entry < Content_Item 6 6 end 7 class Care _Entry < Entry7 class CareEntry < Entry 8 8 end 9 class Action < Care _Entry9 class Action < CareEntry 10 10 attr_accessor :description, :time 11 11 attr_accessor :ism_transition, :instruction_details -
ruby/branches/0.5.0/lib/open_ehr/rm/data_structure.rb
r164 r167 4 4 # refs #59 5 5 6 module OpenE HR6 module OpenEhr 7 7 module RM 8 module Data _Structures9 class Data _Structure < OpenEHR::RM::Common::Archetyped::Locatable8 module DataStructures 9 class DataStructure < OpenEhr::RM::Common::Archetyped::Locatable 10 10 def initialize(args = { }) 11 11 super(args) -
ruby/branches/0.5.0/lib/open_ehr/rm/data_types/basic.rb
r109 r167 2 2 # http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109067591791_562382_3151Report.html 3 3 # Ticket refs #52 4 module OpenE HR4 module OpenEhr 5 5 module RM 6 module Data _Types6 module DataTypes 7 7 module Basic 8 module Canonical _Fragment8 module CanonicalFragment 9 9 end 10 10 11 class Data _Value12 include OpenE HR::RM::Support::Definition::Basic_Definition11 class DataValue 12 include OpenEhr::RM::Support::Definition::BasicDefinition 13 13 end 14 14 15 class D V_Boolean < Data_Value15 class DvBoolean < DataValue 16 16 def initialize(value) 17 17 self.value = value … … 28 28 @value == true 29 29 end 30 end # end of D V_Boolean30 end # end of DvBoolean 31 31 32 class D V_State < Data_Value32 class DvState < DataValue 33 33 attr_reader :value 34 34 … … 48 48 @is_terminal = s 49 49 end 50 end # end of D V_State50 end # end of DvState 51 51 52 class D V_Identifier52 class DvIdentifier 53 53 attr_accessor :issuer, :assigner, :id, :type 54 54 def initialize(assigner, id, issuer, type) … … 63 63 @type = type 64 64 end 65 end #end of D V_Identifier65 end #end of DvIdentifier 66 66 end # end of Basic 67 end # end of Data _types67 end # end of DataTypes 68 68 end # end of RM 69 69 end # end of OpenEHR -
ruby/branches/0.5.0/lib/open_ehr/rm/data_types/encapsulated.rb
r134 r167 5 5 require 'locale/info' 6 6 7 module OpenE HR7 module OpenEhr 8 8 module RM 9 module Data _Types9 module DataTypes 10 10 module Encapsulated 11 class D V_Encapsulated < OpenEHR::RM::Data_Types::Basic::Data_Value11 class DvEncapsulated < OpenEhr::RM::DataTypes::Basic::DataValue 12 12 attr_reader :language, :charset, :size 13 13 def initialize(charset, language, size) … … 59 59 60 60 # media type http://www.iana.org/assignments/media-types/text/ 61 class D V_Multimedia < DV_Encapsulated61 class DvMultimedia < DvEncapsulated 62 62 attr_reader :media_type 63 63 attr_accessor :uri, :data, :compression_algorithm, … … 84 84 end 85 85 86 class D V_Parsable < DV_Encapsulated86 class DvParsable < DvEncapsulated 87 87 attr_reader :value, :formalism 88 88 def initialize(charset, language, size, formalism, value) … … 107 107 end 108 108 end # of Encapsulated 109 end # of Data _Types109 end # of DataTypes 110 110 end # of RM 111 111 end # of OpenEHR -
ruby/branches/0.5.0/lib/open_ehr/rm/data_types/quantity.rb
r149 r167 3 3 # Ticket refs #50 4 4 require 'assumed_library_types' 5 module OpenE HR5 module OpenEhr 6 6 module RM 7 module Data _Types7 module DataTypes 8 8 module Quantity 9 9 10 10 autoload :Date_Time, "rm/data_types/quantity/date_time.rb" 11 11 12 class D V_Ordered < OpenEHR::RM::Data_Types::Basic::Data_Value12 class DvOrdered < OpenEhr::RM::DataTypes::Basic::DataValue 13 13 include Comparable 14 14 attr_accessor :normal_range, :other_refference_ranges, :normal_status … … 51 51 end 52 52 53 class D V_Interval < OpenEHR::Assumed_Library_Types::Interval54 55 end 56 57 class D V_Quantified < DV_Ordered53 class DvInterval < OpenEhr::AssumedLibraryTypes::Interval 54 55 end 56 57 class DvQuantified < DvOrdered 58 58 attr_reader :magnitude, :magnitude_status 59 59 … … 78 78 if magnitude_status.nil? 79 79 @magnitude_status = '=' 80 elsif D V_Quantified.valid_magnitude_status?(magnitude_status)80 elsif DvQuantified.valid_magnitude_status?(magnitude_status) 81 81 @magnitude_status = magnitude_status 82 82 else … … 99 99 end 100 100 101 class D V_Ordinal < DV_Ordered101 class DvOrdinal < DvOrdered 102 102 attr_reader :value, :symbol, :limits 103 103 … … 121 121 122 122 def is_strictly_comparable_to?(others) 123 unless others.instance_of? OpenE HR::RM::Data_Types::Quantity::DV_Ordinal123 unless others.instance_of? OpenEhr::RM::DataTypes::Quantity::DvOrdinal 124 124 return false 125 125 end … … 144 144 end 145 145 146 class D V_Absolute_Quantity < DV_Quantified146 class DvAbsoluteQuantity < DvQuantified 147 147 attr_accessor :accuracy 148 148 … … 168 168 end 169 169 170 class D V_Amount < DV_Quantified170 class DvAmount < DvQuantified 171 171 attr_reader :accuracy, :accuracy_percent 172 172 def initialize(magnitude, magnitude_status=nil, accuracy=nil, … … 186 186 raise ArgumentError, 'type mismatch' 187 187 end 188 return D V_Amount.new(@magnitude+other.magnitude, @magnitude_status,188 return DvAmount.new(@magnitude+other.magnitude, @magnitude_status, 189 189 @accuracy, @accuracy_percent, @normal_range, 190 190 @normal_status, @other_reference_ranges) … … 210 210 end 211 211 212 class D V_Quantity < DV_Amount212 class DvQuantity < DvAmount 213 213 attr_reader :units, :precision 214 214 def initialize(magnitude, units, magnitude_status=nil, precision=nil, … … 235 235 def is_strictly_comparable_to?(others) 236 236 return false if others.nil? 237 if others.instance_of?(D V_Quantity) && others.units == @units237 if others.instance_of?(DvQuantity) && others.units == @units 238 238 return true 239 239 else … … 252 252 def +(other) 253 253 dv_amount = super(other) 254 return D V_Quantity.new(dv_amount.magnitude, @units,254 return DvQuantity.new(dv_amount.magnitude, @units, 255 255 @magnitude_status, @precision, 256 256 @accuracy, @accuracy_percent, @normal_range, … … 259 259 end 260 260 261 class D V_Count < DV_Amount261 class DvCount < DvAmount 262 262 def is_strictly_comparable_to?(others) 263 263 return false if others.nil? 264 if others.instance_of?(D V_Count)264 if others.instance_of?(DvCount) 265 265 return true 266 266 else … … 270 270 end 271 271 272 class Reference _Range272 class ReferenceRange 273 273 attr_reader :meaning, :range 274 274 … … 297 297 end 298 298 299 module Proportion _Kind299 module ProportionKind 300 300 PK_RATIO = 0 301 301 PK_UNITARY = 1 … … 304 304 PK_INTEGER_FRACTION = 4 305 305 306 def Proportion _Kind.valid_proportion_kind?(kind)306 def ProportionKind.valid_proportion_kind?(kind) 307 307 return true if kind >= 0 && kind <= 4 308 308 return false 309 309 end 310 end # end of Proportion _Kind311 312 class D V_Proportion < DV_Amount313 include Proportion _Kind310 end # end of ProportionKind 311 312 class DvProportion < DvAmount 313 include ProportionKind 314 314 attr_reader :numerator, :denominator, :type, :precision 315 315 … … 360 360 361 361 def type=(type) 362 if Proportion _Kind.valid_proportion_kind?(type)362 if ProportionKind.valid_proportion_kind?(type) 363 363 @type = type 364 364 else … … 386 386 387 387 def is_strictly_comparable_to?(other) 388 unless other.instance_of?(D V_Proportion)388 unless other.instance_of?(DvProportion) 389 389 return false 390 390 end … … 395 395 end 396 396 end 397 end # end of DV_Proportion 398 397 end # end of DvProportion 399 398 end # of Quantity 400 399 end # of Data_Types -
ruby/branches/0.5.0/lib/open_ehr/rm/data_types/quantity/date_time.rb
r157 r167 5 5 require 'date' 6 6 7 module OpenE HR7 module OpenEhr 8 8 module RM 9 module Data _Types9 module DataTypes 10 10 module Quantity 11 module Date _Time12 class D V_Temporal < OpenEHR::RM::Data_Types::Quantity::DV_Absolute_Quantity11 module DateTime 12 class DvTemporal < OpenEhr::RM::DataTypes::Quantity::DvAbsoluteQuantity 13 13 include Comparable 14 14 attr_reader :value … … 37 37 end 38 38 39 class D V_Date < DV_Temporal40 include OpenE HR::Assumed_Library_Types::ISO8601_DATE_MODULE39 class DvDate < DvTemporal 40 include OpenEhr::AssumedLibraryTypes::ISO8601_DATE_MODULE 41 41 42 42 DAYS_IN_MONTH = [0,31,28,31,30,31,30,31,31,30,31,30,31] … … 51 51 def value=(value) 52 52 super(value) 53 iso8601_date = Assumed _Library_Types::ISO8601_DATE.new(value)53 iso8601_date = AssumedLibraryTypes::ISO8601_DATE.new(value) 54 54 @year = iso8601_date.year 55 55 @month = iso8601_date.month … … 91 91 end 92 92 year += future.year - past.year 93 return D V_Duration.new(93 return DvDuration.new( 94 94 'P' + year.to_s + 'Y' + month.to_s + 'M' + 95 95 week.to_s + 'W' + day.to_s + 'D') … … 97 97 end 98 98 99 class D V_Time < DV_Temporal100 include OpenE HR::Assumed_Library_Types::ISO8601_TIME_MODULE99 class DvTime < DvTemporal 100 include OpenEhr::AssumedLibraryTypes::ISO8601_TIME_MODULE 101 101 def initialize(value, magnitude_status=nil, accuracy=nil, 102 102 normal_range=nil, normal_status=nil, … … 108 108 def value=(value) 109 109 super(value) 110 iso8601_time = Assumed _Library_Types::ISO8601_TIME.new(value)110 iso8601_time = AssumedLibraryTypes::ISO8601_TIME.new(value) 111 111 @hour = iso8601_time.hour 112 112 @minute = iso8601_time.minute … … 125 125 second = (diff - hour * 60 *60 - minute * 60).to_i 126 126 fractional_second = ((diff - diff.to_i)*1000000.0).to_i/1000000.0 127 return D V_Duration.new('P0Y0M0W0DT' + hour.to_s + 'H' +127 return DvDuration.new('P0Y0M0W0DT' + hour.to_s + 'H' + 128 128 minute.to_s + 'M' + 129 129 second.to_s + fractional_second.to_s[1..-1] + 'S') … … 131 131 end 132 132 133 class D V_Date_Time < DV_Temporal134 include OpenE HR::Assumed_Library_Types::ISO8601_DATE_TIME_MODULE133 class DvDateTime < DvTemporal 134 include OpenEhr::AssumedLibraryTypes::ISO8601_DATE_TIME_MODULE 135 135 attr_reader :value 136 136 … … 144 144 def value=(value) 145 145 super(value) 146 iso8601date_time = Assumed _Library_Types::ISO8601_DATE_TIME.new(value)146 iso8601date_time = AssumedLibraryTypes::ISO8601_DATE_TIME.new(value) 147 147 self.year = iso8601date_time.year 148 148 self.month = iso8601date_time.month … … 186 186 fractional_second = ((time_diff - time_diff.to_i)*1000000.0).to_i/1000000.0 187 187 188 return D V_Duration.new(date_duration.value + 'T' +188 return DvDuration.new(date_duration.value + 'T' + 189 189 hour.to_s + 'H' + 190 190 minute.to_s + 'M' + … … 197 197 def split_date_time(date_time) 198 198 /^(.*)T(.*)$/ =~ date_time.as_string 199 return D V_Date.new($1), DV_Time.new($2)200 end 201 end 202 203 class D V_Duration < DV_Amount204 include Assumed _Library_Types::ISO8601_DURATION_MODULE199 return DvDate.new($1), DvTime.new($2) 200 end 201 end 202 203 class DvDuration < DvAmount 204 include AssumedLibraryTypes::ISO8601_DURATION_MODULE 205 205 attr_reader :value 206 206 … … 214 214 raise ArgumentError, 'value must be not nil' if value.nil? 215 215 @value = value 216 iso8601_duration = Assumed _Library_Types::ISO8601_DURATION.new(value)216 iso8601_duration = AssumedLibraryTypes::ISO8601_DURATION.new(value) 217 217 self.years = iso8601_duration.years 218 218 self.months = iso8601_duration.months … … 234 234 235 235 end 236 end # of Date _Time236 end # of DateTime 237 237 end # of Quantity 238 238 end # of Data_Types -
ruby/branches/0.5.0/lib/open_ehr/rm/data_types/text.rb
r124 r167 2 2 # http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109067605961_209522_3179Report.html 3 3 # Ticket refs #48 4 module OpenE HR4 module OpenEhr 5 5 module RM 6 module Data _Types6 module DataTypes 7 7 module Text 8 class Term _Mapping8 class TermMapping 9 9 attr_reader :match, :purpose, :target 10 10 def initialize(match, purpose, target) … … 26 26 match == '?' 27 27 end 28 def Term _Mapping.is_valid_mach_code?(c)28 def TermMapping.is_valid_mach_code?(c) 29 29 c == '>' or c == '=' or c == '<' or c == '?' 30 30 end 31 31 private 32 32 def match_valid(match) 33 raise ArgumentError, "match is not valid" if !Term _Mapping.is_valid_mach_code? match33 raise ArgumentError, "match is not valid" if !TermMapping.is_valid_mach_code? match 34 34 end 35 35 def purpose_valid(purpose) 36 if purpose.nil? or !purpose.instance_of? D V_Coded_Text36 if purpose.nil? or !purpose.instance_of? DvCodedText 37 37 raise ArgumentError, "purpose is not valid" 38 38 end … … 44 44 end 45 45 46 class Code _Phrase46 class CodePhrase 47 47 attr_reader :terminology_id, :code_string 48 48 def initialize(code_string, terminology_id) … … 60 60 @code_string = code_string 61 61 end 62 end # of Code _Phrase62 end # of CodePhrase 63 63 64 class D V_Text < OpenEHR::RM::Data_Types::Basic::Data_Value64 class DvText < OpenEhr::RM::DataTypes::Basic::DataValue 65 65 attr_reader :value, :formatting, :hyperlink, :mappings 66 66 attr_reader :language, :encoding … … 68 68 mappings = nil, language = nil, encoding = nil) 69 69 value_valid(value) 70 D V_Text.formatting_valid(formatting)71 D V_Text.encoding_valid(encoding)72 D V_Text.mapping_valid(mappings)73 D V_Text.language_valid(language)70 DvText.formatting_valid(formatting) 71 DvText.encoding_valid(encoding) 72 DvText.mapping_valid(mappings) 73 DvText.language_valid(language) 74 74 @value, @formatting, @encoding = value, formatting, encoding 75 75 @mappings, @language = mappings, language … … 80 80 end 81 81 def formatting=(formatting) 82 D V_Text.formatting_valid(formatting)82 DvText.formatting_valid(formatting) 83 83 @formatting = formatting 84 84 end 85 85 def encoding=(encoding) 86 D V_Text.encoding_valid(encoding)86 DvText.encoding_valid(encoding) 87 87 @encoding = encoding 88 88 end 89 89 def mappings=(mappings) 90 D V_Text.mapping_valid(mappings)90 DvText.mapping_valid(mappings) 91 91 @mappings = mappings 92 92 end 93 93 def language=(language) 94 D V_Text.language_valid(language)94 DvText.language_valid(language) 95 95 @language = language 96 96 end … … 99 99 if value.nil? or value.empty? or value.include? CR or value.include? LF 100 100 raise ArgumentError, "value is not valid" 101 # CR and LF are defined in Basic_Definition inherited Data _Value.101 # CR and LF are defined in Basic_Definition inherited DataValue. 102 102 end 103 103 end … … 128 128 end 129 129 130 class D V_Coded_Text < DV_Text130 class DvCodedText < DvText 131 131 attr_reader :defining_code 132 132 … … 146 146 end 147 147 148 class D V_Paragraph < OpenEHR::RM::Data_Types::Basic::Data_Value148 class DvParagraph < OpenEhr::RM::DataTypes::Basic::DataValue 149 149 attr_reader :items 150 150 def initialize(items) … … 167 167 168 168 end # of Text 169 end # of Data _Type169 end # of DataTypes 170 170 end # of RM 171 171 end # of OpenEHR -
ruby/branches/0.5.0/lib/open_ehr/rm/data_types/time_specification.rb
r153 r167 1 1 # This module is related to the ticket #47 2 2 3 module OpenE HR3 module OpenEhr 4 4 module RM 5 module Data _Types6 module Time _Specification7 class D V_Time_Specification < OpenEHR::RM::Data_Types::Basic::Data_Value5 module DataTypes 6 module TimeSpecification 7 class DvTimeSpecification < OpenEhr::RM::DataTypes::Basic::DataValue 8 8 attr_reader :value 9 9 … … 34 34 35 35 36 class D V_General_Time_Specification < DV_Time_Specification36 class DvGeneralTimeSpecification < DvTimeSpecification 37 37 attr_reader :value 38 38 def initialize(value) … … 48 48 end 49 49 50 class D V_Periodic_Time_Specification < DV_Time_Specification50 class DvPeriodicTimeSpecification < DvTimeSpecification 51 51 attr_reader :value, :calender_alignment, :event_alingment, :period 52 52 def initialize(value) -
ruby/branches/0.5.0/lib/open_ehr/rm/data_types/uri.rb
r104 r167 5 5 require 'uri' 6 6 #require 'uri/generic' 7 module U RI8 class E HR< ::URI::Generic7 module Uri 8 class Ehr < ::URI::Generic 9 9 COMPONENT = [ 10 10 :scheme, :path, :fragment, :query … … 21 21 end 22 22 end 23 @@schemes['EHR'] = E HR23 @@schemes['EHR'] = Ehr 24 24 end 25 25 26 module OpenE HR26 module OpenEhr 27 27 module RM 28 module Data _Types29 module U RI30 class D V_URI < OpenEHR::RM::Data_Types::Basic::Data_Value28 module DataTypes 29 module Uri 30 class DvUri < OpenEhr::RM::DataTypes::Basic::DataValue 31 31 def initialize(value) 32 32 self.value = value … … 57 57 end 58 58 59 class D V_EHR_URI < DV_URI59 class DvEhrUri < DvUri 60 60 def initialize(value) 61 61 super(value) … … 67 67 end # of DV_EHR_URI 68 68 end # of URI 69 end # of Data _Type69 end # of DataTypes 70 70 end # of RM 71 71 end # of OpenEHR -
ruby/branches/0.5.0/lib/open_ehr/rm/demographic.rb
r87 r167 75 75 end 76 76 77 class Party _Identity < OpenEHR::RM::Common::Archetyped::Locatable77 class PartyIdentity < OpenEHR::RM::Common::Archetyped::Locatable 78 78 attr_reader :details 79 79 80 80 end 81 81 82 class Party _Relationship < OpenEHR::RM::Common::Archetyped::Locatable82 class PartyRelationship < OpenEHR::RM::Common::Archetyped::Locatable 83 83 84 84 end -
ruby/branches/0.5.0/lib/open_ehr/rm/security.rb
r137 r167 2 2 # http://www.openehr.org/uml/release-1.0.1/Browsable/_9_5_1_76d0249_1155650882301_836618_5314Report.html 3 3 # Ticket refs #41 4 module OpenE HR4 module OpenEhr 5 5 module RM 6 6 module Security 7 class Access _Control_Settings7 class AccessControlSettings 8 8 9 9 end -
ruby/branches/0.5.0/lib/open_ehr/rm/support/assumed_types.rb
r85 r167 2 2 # and am, I will integrated to /lib/models/assumed_types.rb. 3 3 # By Shinji KOBAYASHI, 2008-07-20 4 module OpenE HR4 module OpenEhr 5 5 module RM 6 6 module Support 7 module Assumed _Types7 module AssumedTypes 8 8 class Interval 9 9 attr_accessor :lower, :upper -
ruby/branches/0.5.0/lib/open_ehr/rm/support/definition.rb
r4 r167 1 module OpenE HR1 module OpenEhr 2 2 module RM 3 3 module Support 4 4 module Definition 5 module Basic _Definition5 module BasicDefinition 6 6 CR = "\015" 7 7 LF = "\012" 8 8 end 9 class OpenEHR _Definitions10 include Basic _Definition9 class OpenEHRDefinitions 10 include BasicDefinition 11 11 end 12 12 end -
ruby/branches/0.5.0/lib/open_ehr/rm/support/identification.rb
r158 r167 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 7 7 module Identification 8 9 class Object_ID 8 class ObjectId 10 9 attr_reader :value 11 10 … … 23 22 end # of ObjectID 24 23 25 class Object _Ref24 class ObjectRef 26 25 attr_reader :namespace, :type, :id 27 26 … … 48 47 end 49 48 50 class Archetype _ID < Object_ID49 class ArchetypeId < ObjectId 51 50 attr_reader :domain_concept, :rm_name, :rm_entity, :rm_originator, :specialisation, :version_id 52 51 … … 91 90 end 92 91 93 class Terminology _ID < Object_ID92 class TerminologyId < ObjectId 94 93 attr_reader :name, :version_id 95 94 … … 130 129 end # of Terminology_ID 131 130 132 class Generic _ID < Object_ID131 class GenericId < ObjectId 133 132 attr_reader :scheme 134 133 … … 144 143 end # of Generic_ID 145 144 146 class Template _ID < Object_ID147 148 end 149 150 class U ID_Based_ID < Object_ID145 class TemplateId < ObjectId 146 147 end 148 149 class UidBasedId < ObjectId 151 150 def initialize(value) 152 151 super(value) … … 174 173 end 175 174 176 class Object _Version_ID < UID_Based_ID175 class ObjectVersionId < UidBasedId 177 176 attr_reader :object_id, :creating_system_id, :version_tree_id 178 177 … … 184 183 super(value) 185 184 if /^(\w+)::(\w+)::((\d|\.)+)$/ =~ value 186 self.object_id = U ID.new($1)187 self.creating_system_id = U ID.new($2)188 self.version_tree_id = Version _Tree_ID.new($3)185 self.object_id = Uid.new($1) 186 self.creating_system_id = Uid.new($2) 187 self.version_tree_id = VersionTreeId.new($3) 189 188 else 190 189 raise ArgumentError, 'invalid format' … … 216 215 end 217 216 218 class Locatable _Ref < Object_Ref217 class LocatableRef < ObjectRef 219 218 attr_reader :namespace, :type, :id, :path 220 219 … … 234 233 end 235 234 236 class Party _Ref < Object_Ref235 class PartyRef < ObjectRef 237 236 238 237 def type=(type) … … 243 242 end 244 243 245 class Access _Group_Ref < Object_Ref244 class AccessGroupRef < ObjectRef 246 245 def type=(type) 247 246 raise ArgumentError, 'type invalid' unless type == 'ACCESS_GROUP' … … 250 249 end 251 250 252 class Hier _Object_ID < UID_Based_ID253 254 end 255 256 class Version _Tree_ID251 class HierObjectId < UidBasedId 252 253 end 254 255 class VersionTreeId 257 256 attr_reader :value, :trunk_version, :branch_number, :branch_version 258 257 … … 303 302 end 304 303 305 class U ID304 class Uid 306 305 attr_reader :value 307 306 … … 316 315 end 317 316 318 class U UID < UID319 320 end 321 322 class Internet _ID <UID317 class Uuid < Uid 318 319 end 320 321 class InternetId <Uid 323 322 324 323 end 325 324 326 class I SO_OID <UID325 class IsoOid <Uid 327 326 328 327 end -
ruby/branches/0.5.0/lib/open_ehr/rm/support/measurement.rb
r90 r167 1 module OpenE HR1 module OpenEhr 2 2 module RM 3 3 module Support 4 4 module Measurement 5 class Measurement _Service5 class MeasurementService 6 6 end 7 module External _Environment_Access7 module ExternalEnvironmentAccess 8 8 def eea_terminology_svc 9 9 end -
ruby/branches/0.5.0/lib/open_ehr/rm/support/terminology.rb
r4 r167 1 1 2 module OpenE HR2 module OpenEhr 3 3 module RM 4 4 module Support 5 5 module Terminology 6 class Code _Set_Access6 class CodeSetAccess 7 7 def all_codes 8 8 raise NotImplementedError, "all_codes must be implemented" … … 18 18 end 19 19 end 20 module OpenE HR_Code_Set_Identifier20 module OpenEhrCodeSetIdentifier 21 21 CODE_SET_ID_CHARACER_SETS = "character sets".freeze 22 22 CODE_SET_ID_COMPRESSION_ALGORITHMS = "compression algorithms".freeze … … 29 29 end 30 30 end 31 module OpenE HR_Terminology_Group_Identifiers31 module OpenEhrTerminologyGroupIdentifiers 32 32 GROUP_ID_ATTESTATION_REASON = "attestation reason".freeze 33 33 GROUP_ID_AUDIT_CHANGE_TYPE = "audit change type".freeze … … 46 46 TERMINOLOGY_ID = "openehr".freeze 47 47 end 48 class Terminology _Access48 class TerminologyAccess 49 49 def all_codes 50 50 raise NotImplementedError, "all_codes is not implemented" … … 74 74 end 75 75 end 76 class Terminology _Service77 include OpenE HR_Code_Set_Identifier, OpenEHR_Terminology_Group_Identifiers76 class TerminologyService 77 include OpenEhrCodeSetIdentifier, OpenEhrTerminologyGroupIdentifiers 78 78 def code_set(name) 79 79 raise NotImplementedError, "code_set is not implemented"
Note:
See TracChangeset
for help on using the changeset viewer.