Line | |
---|
1 | module OpenEHR
|
---|
2 | module RM
|
---|
3 | module Support
|
---|
4 | module Identification
|
---|
5 |
|
---|
6 | class OBJECT_ID
|
---|
7 | attr_accessor :value
|
---|
8 |
|
---|
9 | def initiallize(value)
|
---|
10 | raise "empty value" unless value
|
---|
11 | @value = value
|
---|
12 | end
|
---|
13 | end # of ObjectID
|
---|
14 |
|
---|
15 | class ARCHETYPE_ID < OBJECT_ID
|
---|
16 | end
|
---|
17 |
|
---|
18 | class TERMINOLOGY_ID < OBJECT_ID
|
---|
19 | attr_reader :name
|
---|
20 |
|
---|
21 | def initialize(name , version_id)
|
---|
22 | @name , @version_id = name , version_id
|
---|
23 | # if arg1 == nil
|
---|
24 | # super(arg0)
|
---|
25 | # else
|
---|
26 | # super(toValue(arg0, arg1))
|
---|
27 | # @name = arg0
|
---|
28 | # @version = arg1
|
---|
29 | # end
|
---|
30 | end
|
---|
31 |
|
---|
32 | def setValue(value)
|
---|
33 | loadValue(value)
|
---|
34 | super.value = value
|
---|
35 | end
|
---|
36 |
|
---|
37 | def version_id
|
---|
38 | @version
|
---|
39 | end
|
---|
40 |
|
---|
41 | private
|
---|
42 |
|
---|
43 | def loadValue(value)
|
---|
44 | if /\(.*\)$/ =~ value
|
---|
45 | # @name, @version = value.split(\())
|
---|
46 | @version.chop!
|
---|
47 | else
|
---|
48 | @name = value
|
---|
49 | @version = nil
|
---|
50 | end
|
---|
51 | end
|
---|
52 |
|
---|
53 | def toValue(name, version)
|
---|
54 | if name == ""
|
---|
55 | raise Exception.new("empty name")
|
---|
56 | end
|
---|
57 | name + (version == nil ? "" : "(" + version + ")")
|
---|
58 | end
|
---|
59 | end # of TerminologyID
|
---|
60 | end # of Definition
|
---|
61 | end # of Support
|
---|
62 | end # of RM
|
---|
63 | end # of OpenEHR
|
---|
Note:
See
TracBrowser
for help on using the repository browser.