open_ehr 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +3 -3
- data/README.rdoc +6 -5
- data/VERSION +1 -1
- data/lib/open_ehr/am/archetype/ontology.rb +4 -1
- data/lib/open_ehr/parser/adl_grammar.tt +49 -10
- data/lib/open_ehr/parser/adl_parser.rb +1 -16
- data/lib/open_ehr/parser/dadl_grammar.tt +30 -30
- data/lib/open_ehr/parser/shared_token_grammar.tt +4 -4
- data/open_ehr.gemspec +4 -2
- data/spec/lib/open_ehr/am/archetype/ontology/archetype_ontology_spec.rb +11 -1
- data/spec/lib/open_ehr/parser/adl14/adl-test-entry.archetype_description.test.adl +1 -1
- data/spec/lib/open_ehr/parser/adl14/adl-test-entry.archetype_identification.test.adl +1 -1
- data/spec/lib/open_ehr/parser/adl_description_spec.rb +153 -0
- data/spec/lib/open_ehr/parser/adl_identification_spec.rb +18 -0
- data/spec/lib/open_ehr/parser/adl_parser_spec.rb +19 -20
- data/spec/lib/open_ehr/parser/adl_path_spec.rb +2 -6
- metadata +39 -37
data/Gemfile.lock
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activesupport (3.1.
|
4
|
+
activesupport (3.1.2)
|
5
5
|
multi_json (~> 1.0)
|
6
6
|
archive-tar-minitar (0.5.2)
|
7
7
|
builder (3.0.0)
|
8
8
|
columnize (0.3.4)
|
9
9
|
diff-lcs (1.1.3)
|
10
|
-
ffi (1.0.
|
10
|
+
ffi (1.0.11)
|
11
11
|
git (1.2.5)
|
12
12
|
guard (0.8.8)
|
13
13
|
thor (~> 0.14.6)
|
14
|
-
guard-rspec (0.5.
|
14
|
+
guard-rspec (0.5.4)
|
15
15
|
guard (>= 0.8.4)
|
16
16
|
guard-spork (0.3.1)
|
17
17
|
guard (>= 0.8.4)
|
data/README.rdoc
CHANGED
@@ -5,7 +5,7 @@ Ruby openEHR implementation project.
|
|
5
5
|
|
6
6
|
= Version
|
7
7
|
|
8
|
-
Release-0.9.
|
8
|
+
Release-0.9.3
|
9
9
|
|
10
10
|
= Requirements
|
11
11
|
|
@@ -20,7 +20,7 @@ Release-0.9.0b
|
|
20
20
|
|
21
21
|
== DESCRIPTION:
|
22
22
|
|
23
|
-
This is the beta version 0.9.
|
23
|
+
This is the beta version 0.9.3 release of Ruby openEHR implementation
|
24
24
|
project. This release is still experimental preview of our work based
|
25
25
|
on openEHR specification release 1.0.2. We implemented almost of the
|
26
26
|
specifications of the openEHR. The work is still in progress. The
|
@@ -30,8 +30,8 @@ quickly with Ruby on Rails.
|
|
30
30
|
Parser is nearly performing completely. We now consider to descrive
|
31
31
|
archetype as another formalism such as YAML, instead of ADL.
|
32
32
|
|
33
|
-
Almost all classes passed the test constructed by
|
34
|
-
test/unit). These test
|
33
|
+
Almost all classes passed the test constructed by RSpec2 (formaly used
|
34
|
+
test/unit). These test specifications are under /spec.
|
35
35
|
|
36
36
|
Some specifications are not well determined yet, such as rm/security
|
37
37
|
and so on. We postponed to implement such classes.
|
@@ -44,7 +44,8 @@ project.
|
|
44
44
|
Akimichi Tatsukawa, Shinji Kobayashi
|
45
45
|
openEHR.jp, <http://openehr.jp>
|
46
46
|
|
47
|
-
* ADL parser test cases are derived from Java and Eiffel
|
47
|
+
* ADL parser test cases are derived from Java and Eiffel
|
48
|
+
reference implementation project of the openEHR.
|
48
49
|
|
49
50
|
= Copyright
|
50
51
|
The software, including all files in this directory and
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.3
|
@@ -3,11 +3,14 @@ module OpenEHR
|
|
3
3
|
module Archetype
|
4
4
|
module Ontology
|
5
5
|
class ArchetypeOntology
|
6
|
-
attr_accessor :specialisation_depth
|
6
|
+
attr_accessor :specialisation_depth, :primary_language
|
7
7
|
attr_accessor :term_attribute_names, :term_bindings
|
8
|
+
attr_accessor :languages_available
|
8
9
|
attr_reader :term_definitions, :constraint_definitions
|
9
10
|
|
10
11
|
def initialize(args = { })
|
12
|
+
self.primary_language = args[:primary_language]
|
13
|
+
self.languages_available = args[:languages_available]
|
11
14
|
self.specialisation_depth = args[:specialisation_depth]
|
12
15
|
self.term_definitions = args[:term_definitions]
|
13
16
|
if args[:constraint_definitions]
|
@@ -33,7 +33,11 @@ module OpenEHR
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def original_language
|
36
|
-
lang.original_language
|
36
|
+
tid, la = lang.original_language.split('::')
|
37
|
+
OpenEHR::RM::DataTypes::Text::CodePhrase.new(
|
38
|
+
:terminology_id =>
|
39
|
+
OpenEHR::RM::Support::Identification::TerminologyID.new(:value => tid),
|
40
|
+
:code_string => la)
|
37
41
|
end
|
38
42
|
|
39
43
|
def translations
|
@@ -41,7 +45,7 @@ module OpenEHR
|
|
41
45
|
end
|
42
46
|
|
43
47
|
def description
|
44
|
-
desc.
|
48
|
+
desc.value unless desc.empty?
|
45
49
|
end
|
46
50
|
|
47
51
|
def definition
|
@@ -55,9 +59,9 @@ module OpenEHR
|
|
55
59
|
end
|
56
60
|
|
57
61
|
rule arch_identification
|
58
|
-
head:arch_head V_ARCHETYPE_ID space {
|
62
|
+
head:arch_head id:V_ARCHETYPE_ID space {
|
59
63
|
def archetype_id
|
60
|
-
|
64
|
+
id.value
|
61
65
|
end
|
62
66
|
|
63
67
|
def adl_version
|
@@ -102,9 +106,9 @@ module OpenEHR
|
|
102
106
|
end
|
103
107
|
|
104
108
|
rule arch_meta_data_item
|
105
|
-
SYM_ADL_VERSION SYM_EQ V_VERSION_STRING space {
|
109
|
+
SYM_ADL_VERSION SYM_EQ ver:V_VERSION_STRING space {
|
106
110
|
def value
|
107
|
-
{:adl_version =>
|
111
|
+
{:adl_version => ver.value}
|
108
112
|
end
|
109
113
|
}
|
110
114
|
/ SYM_IS_CONTROLED space {
|
@@ -121,7 +125,7 @@ module OpenEHR
|
|
121
125
|
end
|
122
126
|
|
123
127
|
def archetype_id
|
124
|
-
arch_id.
|
128
|
+
arch_id.value
|
125
129
|
end
|
126
130
|
}
|
127
131
|
end
|
@@ -140,8 +144,43 @@ module OpenEHR
|
|
140
144
|
|
141
145
|
rule arch_description
|
142
146
|
SYM_DESCRIPTION desc:V_DADL_TEXT space {
|
143
|
-
def
|
144
|
-
desc.value
|
147
|
+
def value
|
148
|
+
params = desc.value
|
149
|
+
details = { }
|
150
|
+
params[:details].each do |lang, attrs|
|
151
|
+
term_id, la = attrs[:language].split('::')
|
152
|
+
terminology_id =
|
153
|
+
OpenEHR::RM::Support::Identification::TerminologyID.new(
|
154
|
+
:value => term_id)
|
155
|
+
misuse = attrs[:misuse].empty? ? nil : attrs[:misuse]
|
156
|
+
item =
|
157
|
+
OpenEHR::RM::Common::Resource::ResourceDescriptionItem.new(
|
158
|
+
:language => OpenEHR::RM::DataTypes::Text::CodePhrase.new(
|
159
|
+
:terminology_id => terminology_id,
|
160
|
+
:code_string => la),
|
161
|
+
:purpose => attrs[:purpose],
|
162
|
+
:keywords => attrs[:keywords],
|
163
|
+
:use => attrs[:use],
|
164
|
+
:misuse => misuse,
|
165
|
+
:copyright => attrs[:copyright],
|
166
|
+
:original_resource_uri => attrs[:original_resource_uri],
|
167
|
+
:other_details => attrs[:other_details])
|
168
|
+
details[lang.to_s] = item
|
169
|
+
end
|
170
|
+
oc = params[:other_contributors].nil? ? nil : params[:other_contributors].values
|
171
|
+
original_author = key_s params[:original_author]
|
172
|
+
other_details = key_s params[:other_details] if params[:other_details]
|
173
|
+
OpenEHR::RM::Common::Resource::ResourceDescription.new(
|
174
|
+
:original_author => original_author,
|
175
|
+
:other_contributors => oc,
|
176
|
+
:lifecycle_state => params[:lifecycle_state],
|
177
|
+
:details => details,
|
178
|
+
:resource_package_uri => params[:archetype_package_uri],
|
179
|
+
:other_details => other_details)
|
180
|
+
end
|
181
|
+
|
182
|
+
def key_s(hash)
|
183
|
+
hash.inject({ }) {|h,i| h.update Hash[i[0].to_s,i[1]]}
|
145
184
|
end
|
146
185
|
}
|
147
186
|
end
|
@@ -163,7 +202,7 @@ module OpenEHR
|
|
163
202
|
def value
|
164
203
|
ao = ontology.value[:term_definitions]
|
165
204
|
term_definitions = {}
|
166
|
-
ao.
|
205
|
+
ao.each do |lang, term_defs|
|
167
206
|
items = term_defs[:items]
|
168
207
|
terms = items.map do |code, item|
|
169
208
|
OpenEHR::AM::Archetype::Ontology::ArchetypeTerm.new(
|
@@ -25,10 +25,7 @@ module OpenEHR
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def parse
|
28
|
-
|
29
|
-
original_language = CodePhrase.new(
|
30
|
-
:terminology_id => terminology_id,
|
31
|
-
:code_string => @result.original_language)
|
28
|
+
original_language = @result.original_language
|
32
29
|
archetype_id = ArchetypeID.new(:value => @result.archetype_id)
|
33
30
|
definition = @result.definition
|
34
31
|
ontology = @result.ontology
|
@@ -42,18 +39,6 @@ module OpenEHR
|
|
42
39
|
:ontology => @result.ontology)
|
43
40
|
return archetype
|
44
41
|
end
|
45
|
-
|
46
|
-
# temporary class for parser building
|
47
|
-
|
48
|
-
class ArchetypeMock
|
49
|
-
def initialize(args = { })
|
50
|
-
@params = args
|
51
|
-
end
|
52
|
-
|
53
|
-
def method_missing(name)
|
54
|
-
@params[name]
|
55
|
-
end
|
56
|
-
end
|
57
42
|
end
|
58
43
|
end # of Parser
|
59
44
|
end # of OpenEHR
|
@@ -23,23 +23,19 @@ module OpenEHR
|
|
23
23
|
rule attr_vals
|
24
24
|
first:attr_val second:(';'? space attr_val space)* {
|
25
25
|
def value
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
end
|
26
|
+
attrs.inject({ }) {|val, a| val.update a.value}
|
27
|
+
end
|
28
|
+
|
29
|
+
def attrs
|
30
|
+
[first] + second.elements.map {|e| e.attr_val}
|
31
|
+
end
|
32
32
|
}
|
33
33
|
end
|
34
34
|
|
35
35
|
rule attr_val
|
36
36
|
attr_id SYM_EQ object_block {
|
37
|
-
def id
|
38
|
-
attr_id.value
|
39
|
-
end
|
40
|
-
|
41
37
|
def value
|
42
|
-
object_block.value
|
38
|
+
{attr_id.value.to_sym => object_block.value}
|
43
39
|
end
|
44
40
|
}
|
45
41
|
end
|
@@ -99,25 +95,17 @@ module OpenEHR
|
|
99
95
|
end
|
100
96
|
|
101
97
|
rule keyed_objects
|
102
|
-
keyed_object+
|
98
|
+
keyed_object+ {
|
103
99
|
def value
|
104
|
-
val
|
105
|
-
elements.each do |e|
|
106
|
-
val[e.key.to_sym] = e.value
|
107
|
-
end
|
108
|
-
val
|
100
|
+
elements.inject({ }) {|val, e| val.update e.value}
|
109
101
|
end
|
110
102
|
}
|
111
103
|
end
|
112
104
|
|
113
105
|
rule keyed_object
|
114
106
|
object_key SYM_EQ object_block {
|
115
|
-
def key
|
116
|
-
object_key.value
|
117
|
-
end
|
118
|
-
|
119
107
|
def value
|
120
|
-
object_block.value
|
108
|
+
{object_key.value.to_sym => object_block.value}
|
121
109
|
end
|
122
110
|
}
|
123
111
|
end
|
@@ -132,9 +120,9 @@ module OpenEHR
|
|
132
120
|
|
133
121
|
rule single_attr_object_block
|
134
122
|
type_identifier? untyped_single_attr_object_block {
|
135
|
-
|
136
|
-
|
137
|
-
|
123
|
+
def value
|
124
|
+
untyped_single_attr_object_block.value
|
125
|
+
end
|
138
126
|
}
|
139
127
|
end
|
140
128
|
|
@@ -182,12 +170,12 @@ module OpenEHR
|
|
182
170
|
simple_list_value.value
|
183
171
|
end
|
184
172
|
}
|
185
|
-
/ simple_interval_value {
|
173
|
+
/ simple_interval_value '' {
|
186
174
|
def value
|
187
175
|
simple_interval_value.value
|
188
176
|
end
|
189
177
|
}
|
190
|
-
/ term_code_list_value {
|
178
|
+
/ term_code_list_value '' {
|
191
179
|
def value
|
192
180
|
term_code_list_value.value
|
193
181
|
end
|
@@ -326,7 +314,7 @@ module OpenEHR
|
|
326
314
|
date_time_interval_value.value
|
327
315
|
end
|
328
316
|
}
|
329
|
-
/ duration_interval_value {
|
317
|
+
/ duration_interval_value '' {
|
330
318
|
def value
|
331
319
|
duration_interval_value.value
|
332
320
|
end
|
@@ -342,8 +330,20 @@ module OpenEHR
|
|
342
330
|
end
|
343
331
|
|
344
332
|
rule term_code_list_value
|
345
|
-
term_code (',' term_code)+
|
346
|
-
|
333
|
+
first:term_code more:(',' term_code)+ {
|
334
|
+
def value
|
335
|
+
term_codes.map {|t| t.value}
|
336
|
+
end
|
337
|
+
|
338
|
+
def term_codes
|
339
|
+
[first] + more.elements.map {|e| e.term_code}
|
340
|
+
end
|
341
|
+
}
|
342
|
+
/ term_code ',' SYM_LIST_CONTINUE {
|
343
|
+
def value
|
344
|
+
[term_code.value]
|
345
|
+
end
|
346
|
+
}
|
347
347
|
end
|
348
348
|
|
349
349
|
rule uri_value
|
@@ -525,9 +525,9 @@ module OpenEHR
|
|
525
525
|
end
|
526
526
|
|
527
527
|
rule date_time_value
|
528
|
-
V_ISO8601_EXTENDED_DATE_TIME {
|
528
|
+
dt:V_ISO8601_EXTENDED_DATE_TIME '' {
|
529
529
|
def value
|
530
|
-
OpenEHR::AssumedLibraryTypes::ISO8601DateTime.new(text_value)
|
530
|
+
OpenEHR::AssumedLibraryTypes::ISO8601DateTime.new(dt.text_value)
|
531
531
|
end
|
532
532
|
}
|
533
533
|
end
|
@@ -626,9 +626,9 @@ module OpenEHR
|
|
626
626
|
end
|
627
627
|
|
628
628
|
rule duration_value
|
629
|
-
V_ISO8601_DURATION {
|
629
|
+
V_ISO8601_DURATION '' {
|
630
630
|
def value
|
631
|
-
OpenEHR::AssumedLibraryTypes::ISO8601Duration(text_value)
|
631
|
+
OpenEHR::AssumedLibraryTypes::ISO8601Duration(V_ISO8601_DURATION.text_value)
|
632
632
|
end
|
633
633
|
}
|
634
634
|
end
|
data/open_ehr.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "open_ehr"
|
8
|
-
s.version = "0.9.
|
8
|
+
s.version = "0.9.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Shinji KOBAYASHI", "Akimichi Tatsukawa"]
|
12
|
-
s.date = "2011-11-
|
12
|
+
s.date = "2011-11-19"
|
13
13
|
s.description = "This project is an implementation of the openEHR specification on Ruby."
|
14
14
|
s.email = "skoba@moss.gr.jp"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -223,6 +223,8 @@ Gem::Specification.new do |s|
|
|
223
223
|
"spec/lib/open_ehr/parser/adl14/openEHR-EHR-SECTION.reason_for_encounter.v1.adl",
|
224
224
|
"spec/lib/open_ehr/parser/adl14/openEHR-EHR-SECTION.summary.v1.adl",
|
225
225
|
"spec/lib/open_ehr/parser/adl14/openEHR-EHR-SECTION.vital_signs.v1.adl",
|
226
|
+
"spec/lib/open_ehr/parser/adl_description_spec.rb",
|
227
|
+
"spec/lib/open_ehr/parser/adl_identification_spec.rb",
|
226
228
|
"spec/lib/open_ehr/parser/adl_parser_spec.rb",
|
227
229
|
"spec/lib/open_ehr/parser/adl_path_spec.rb",
|
228
230
|
"spec/lib/open_ehr/parser/base_spec.rb",
|
@@ -16,7 +16,9 @@ describe ArchetypeOntology do
|
|
16
16
|
bind = {'at0000' => code_phrase}
|
17
17
|
term_bindings = {'SNOMED-CT(2003)' => [bind]}
|
18
18
|
@archetype_ontology =
|
19
|
-
ArchetypeOntology.new(:
|
19
|
+
ArchetypeOntology.new(:primary_language => "ja",
|
20
|
+
:languages_available => ['ja', 'en'],
|
21
|
+
:term_definitions => term_definitions,
|
20
22
|
:constraint_definitions => constraint_definitions,
|
21
23
|
:term_bindings => term_bindings,
|
22
24
|
:specialisation_depth => 0)
|
@@ -30,6 +32,14 @@ describe ArchetypeOntology do
|
|
30
32
|
@archetype_ontology.specialisation_depth.should be_equal 0
|
31
33
|
end
|
32
34
|
|
35
|
+
it 'primary language is ja' do
|
36
|
+
@archetype_ontology.primary_language.should == 'ja'
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'languages available are ja, en' do
|
40
|
+
@archetype_ontology.languages_available.should == ['ja', 'en']
|
41
|
+
end
|
42
|
+
|
33
43
|
it 'term_definition should be assigned properly' do
|
34
44
|
@archetype_ontology.term_definition(:lang => 'ja', :code => 'at0000')[:text].should == 'Archetype Concept'
|
35
45
|
end
|
@@ -0,0 +1,153 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
include OpenEHR::Parser
|
3
|
+
|
4
|
+
describe ADLParser do
|
5
|
+
context 'Description' do
|
6
|
+
before(:all) do
|
7
|
+
adl_dir = File.dirname(__FILE__) + '/adl14/'
|
8
|
+
ap = ADLParser.new(adl_dir + 'adl-test-entry.archetype_description.test.adl')
|
9
|
+
archetype = ap.parse
|
10
|
+
@description = archetype.description
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'description is not null' do
|
14
|
+
@description.should_not be_nil
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'lifecycle state is AuthorDraft' do
|
18
|
+
@description.lifecycle_state.should == 'AuthorDraft'
|
19
|
+
end
|
20
|
+
it 'resource package uri is www.aihw.org.au/data_sets/diabetic_archetypes.html' do
|
21
|
+
@description.resource_package_uri.should == 'www.aihw.org.au/data_sets/diabetic_archetypes.html'
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'original author' do
|
25
|
+
before(:all) do
|
26
|
+
@original_author = @description.original_author
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'name is Sam Heard' do
|
30
|
+
@original_author["name"].should == 'Sam Heard'
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'organisation is Ocean Informatics' do
|
34
|
+
@original_author["organisation"].should == 'Ocean Informatics'
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'date is 23/04/2006' do
|
38
|
+
@original_author["date"].should == '23/04/2006'
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'email is sam.heard@oceaninformatics.biz' do
|
42
|
+
@original_author["email"].should == 'sam.heard@oceaninformatics.biz'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context 'details' do
|
47
|
+
before(:all) do
|
48
|
+
@details = @description.details
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'details is not nil' do
|
52
|
+
@details.should_not be_nil
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'details size is 1' do
|
56
|
+
@details.size.should be 1
|
57
|
+
end
|
58
|
+
|
59
|
+
context 'item' do
|
60
|
+
before(:all) do
|
61
|
+
@item = @details['en']
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'is not nil' do
|
65
|
+
@item.should_not be_nil
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'language is en' do
|
69
|
+
@item.language.code_string.should == 'en'
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'terminolopgy id is ISO_639-1' do
|
73
|
+
@item.language.terminology_id.value.should == 'ISO_639-1'
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'purpose is For recording...' do
|
77
|
+
@item.purpose.should == "For recording a problem, condition " +
|
78
|
+
"or issue that has ongoing significance to the person's health."
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'use is Used for recording any....' do
|
82
|
+
@item.use.should == "Used for recording any problem, " +
|
83
|
+
"present or past - so is used for recording past " +
|
84
|
+
"history as well as current problems. Used with changed " +
|
85
|
+
"'Subject of care' for recording problems of relatives " +
|
86
|
+
"and so for family history."
|
87
|
+
end
|
88
|
+
|
89
|
+
it 'misuse is Use specialisations for ...' do
|
90
|
+
@item.misuse.should == "Use specialisations for medical " +
|
91
|
+
"diagnoses, 'openEHR-EHR-EVALUATION.problem-diagnosis' and " +
|
92
|
+
"histological diagnoses 'openEHR-EHR-EVALUATION.problem-" +
|
93
|
+
"diagnosis-histological'"
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'copyright is copyright (c) 2004 The openEHR Foundation' do
|
97
|
+
@item.copyright.should == 'copyright (c) 2004 The openEHR Foundation'
|
98
|
+
end
|
99
|
+
|
100
|
+
it 'keywords are issue and condition' do
|
101
|
+
@item.keywords.should == ['issue', 'condition']
|
102
|
+
end
|
103
|
+
|
104
|
+
context 'original resource uri' do
|
105
|
+
before(:all) do
|
106
|
+
@original_resource_uri = @item.original_resource_uri
|
107
|
+
end
|
108
|
+
|
109
|
+
it 'ligne guide is http://guidelines.are.us/wherever/fr' do
|
110
|
+
@original_resource_uri[:'ligne guide'].should ==
|
111
|
+
'http://guidelines.are.us/wherever/fr'
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'medline is http://some%20medline%20ref' do
|
115
|
+
@original_resource_uri[:medline].should == 'http://some%20medline%20ref'
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
context 'other contributors' do
|
122
|
+
before(:all) do
|
123
|
+
@other_contributors = @description.other_contributors
|
124
|
+
end
|
125
|
+
|
126
|
+
it 'other contrubutor(s) are not nil' do
|
127
|
+
@other_contributors.should_not be_nil
|
128
|
+
end
|
129
|
+
|
130
|
+
it 'other contributor(s) is one' do
|
131
|
+
@other_contributors.size.should be 1
|
132
|
+
end
|
133
|
+
|
134
|
+
it 'other_contributor(s) is Ian McNicoll, MD' do
|
135
|
+
@other_contributors[0].should == 'Ian McNicoll, MD'
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
context 'other details' do
|
140
|
+
before(:all) do
|
141
|
+
@other_details = @description.other_details
|
142
|
+
end
|
143
|
+
|
144
|
+
it 'other 1 is details 1' do
|
145
|
+
@other_details['other 1'].should == 'details 1'
|
146
|
+
end
|
147
|
+
|
148
|
+
it 'other 2 is detals 2' do
|
149
|
+
@other_details['other 2'].should == 'details 2'
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
include OpenEHR::Parser
|
3
|
+
|
4
|
+
describe ADLParser do
|
5
|
+
context 'ADL identification' do
|
6
|
+
before(:all) do
|
7
|
+
adl_dir = File.dirname(__FILE__) + '/adl14/'
|
8
|
+
adl_id_test_file = 'adl-test-entry.archetype_identification.test.adl'
|
9
|
+
ap = ADLParser.new(adl_dir + adl_id_test_file)
|
10
|
+
archetype = ap.parse
|
11
|
+
@adl_version = archetype.adl_version
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'ADL version is 1.4' do
|
15
|
+
@adl_version.should == '1.4'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -13,7 +13,7 @@ describe ADLParser do
|
|
13
13
|
|
14
14
|
context 'openEHR-EHR-SECTION-summary.v1.adl' do
|
15
15
|
before(:all) do
|
16
|
-
@ap =
|
16
|
+
@ap = ADLParser.new(@adl_dir + 'openEHR-EHR-SECTION.summary.v1.adl')
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'is an instance fo ADLParser' do
|
@@ -43,9 +43,8 @@ describe ADLParser do
|
|
43
43
|
@archetype.concept.should == 'at0000'
|
44
44
|
end
|
45
45
|
|
46
|
-
it 'original language is
|
47
|
-
@archetype.original_language.code_string.should ==
|
48
|
-
'ISO_639-1::en'
|
46
|
+
it 'original language is en' do
|
47
|
+
@archetype.original_language.code_string.should == 'en'
|
49
48
|
end
|
50
49
|
|
51
50
|
context 'description' do
|
@@ -55,63 +54,63 @@ describe ADLParser do
|
|
55
54
|
|
56
55
|
context 'original author' do
|
57
56
|
before(:all) do
|
58
|
-
@original_author = @description
|
57
|
+
@original_author = @description.original_author
|
59
58
|
end
|
60
59
|
|
61
60
|
it 'name is Sam Heard' do
|
62
|
-
@original_author[
|
61
|
+
@original_author['name'].should == 'Sam Heard'
|
63
62
|
end
|
64
63
|
|
65
64
|
it 'organisation is Ocean Informatics' do
|
66
|
-
@original_author[
|
65
|
+
@original_author['organisation'].should == 'Ocean Informatics'
|
67
66
|
end
|
68
67
|
|
69
68
|
it 'date is 9/01/2007' do
|
70
|
-
@original_author[
|
69
|
+
@original_author['date'].should == '9/01/2007'
|
71
70
|
end
|
72
71
|
|
73
72
|
it 'email is sam.heard@oceaninformatics.biz' do
|
74
|
-
@original_author[
|
73
|
+
@original_author['email'].should == 'sam.heard@oceaninformatics.biz'
|
75
74
|
end
|
76
75
|
end
|
77
76
|
|
78
77
|
context 'details' do
|
79
78
|
before(:all) do
|
80
|
-
@details = @description
|
79
|
+
@details = @description.details
|
81
80
|
end
|
82
81
|
|
83
82
|
context 'en details' do
|
84
83
|
before(:all) do
|
85
|
-
@en = @details[
|
84
|
+
@en = @details['en']
|
86
85
|
end
|
87
86
|
|
88
|
-
it 'language is
|
89
|
-
@en
|
87
|
+
it 'language is en' do
|
88
|
+
@en.language.code_string.should == 'en'
|
90
89
|
end
|
91
90
|
|
92
91
|
it 'purpose is A heading...' do
|
93
|
-
@en
|
92
|
+
@en.purpose.should == "A heading containing summary information based on particular evaluation entries"
|
94
93
|
end
|
95
94
|
|
96
95
|
it 'use is A heading for...' do
|
97
|
-
@en
|
96
|
+
@en.use.should == "A heading for organising clinical data under a heading of summary"
|
98
97
|
end
|
99
98
|
|
100
99
|
it 'keywords are review, conclusions, risk' do
|
101
|
-
@en
|
100
|
+
@en.keywords.should == ['review', 'conclusions', 'risk']
|
102
101
|
end
|
103
102
|
|
104
|
-
it 'misuse should
|
105
|
-
@en
|
103
|
+
it 'misuse should be nil' do
|
104
|
+
@en.misuse.should be_nil
|
106
105
|
end
|
107
106
|
end
|
108
107
|
|
109
108
|
it 'lifecycle_state is Initial' do
|
110
|
-
@description
|
109
|
+
@description.lifecycle_state.should == 'Initial'
|
111
110
|
end
|
112
111
|
|
113
112
|
it 'other_contributors is nil' do
|
114
|
-
@description
|
113
|
+
@description.other_contributors.should be_nil
|
115
114
|
end
|
116
115
|
end # of details
|
117
116
|
end # of description
|
@@ -1,19 +1,15 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
2
|
include OpenEHR::Parser
|
3
|
-
|
4
|
-
include OpenEHR::AM::Archetype::ConstraintModel
|
5
|
-
include OpenEHR::AM::Archetype::Assertion
|
6
|
-
include OpenEHR::AM::Archetype::Ontology
|
3
|
+
|
7
4
|
|
8
5
|
describe ADLParser do
|
9
6
|
before(:all) do
|
10
7
|
adl_dir = File.dirname(__FILE__) + '/adl14/'
|
11
8
|
adl_path_test_file = 'adl-test-car.paths.test.adl'
|
12
|
-
ap =
|
9
|
+
ap = ADLParser.new(adl_dir + adl_path_test_file)
|
13
10
|
@root = ap.parse.definition
|
14
11
|
end
|
15
12
|
|
16
|
-
|
17
13
|
it 'root path is /' do
|
18
14
|
@root.path.should == '/'
|
19
15
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open_ehr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2011-11-
|
13
|
+
date: 2011-11-19 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: xml-simple
|
17
|
-
requirement: &
|
17
|
+
requirement: &17208044800 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *17208044800
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: activesupport
|
28
|
-
requirement: &
|
28
|
+
requirement: &17208044060 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *17208044060
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: locale
|
39
|
-
requirement: &
|
39
|
+
requirement: &17208043420 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *17208043420
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: builder
|
50
|
-
requirement: &
|
50
|
+
requirement: &17208042600 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *17208042600
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: jeweler
|
61
|
-
requirement: &
|
61
|
+
requirement: &17208041640 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: '0'
|
67
67
|
type: :runtime
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *17208041640
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: i18n
|
72
|
-
requirement: &
|
72
|
+
requirement: &17208040380 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: '0'
|
78
78
|
type: :runtime
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *17208040380
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: treetop
|
83
|
-
requirement: &
|
83
|
+
requirement: &17208038840 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ! '>='
|
@@ -88,10 +88,10 @@ dependencies:
|
|
88
88
|
version: '0'
|
89
89
|
type: :runtime
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *17208038840
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
93
|
name: polyglot
|
94
|
-
requirement: &
|
94
|
+
requirement: &17208038020 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
97
97
|
- - ! '>='
|
@@ -99,10 +99,10 @@ dependencies:
|
|
99
99
|
version: '0'
|
100
100
|
type: :runtime
|
101
101
|
prerelease: false
|
102
|
-
version_requirements: *
|
102
|
+
version_requirements: *17208038020
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rdoc
|
105
|
-
requirement: &
|
105
|
+
requirement: &17208037180 !ruby/object:Gem::Requirement
|
106
106
|
none: false
|
107
107
|
requirements:
|
108
108
|
- - ! '>='
|
@@ -110,10 +110,10 @@ dependencies:
|
|
110
110
|
version: '0'
|
111
111
|
type: :runtime
|
112
112
|
prerelease: false
|
113
|
-
version_requirements: *
|
113
|
+
version_requirements: *17208037180
|
114
114
|
- !ruby/object:Gem::Dependency
|
115
115
|
name: rspec
|
116
|
-
requirement: &
|
116
|
+
requirement: &17208036100 !ruby/object:Gem::Requirement
|
117
117
|
none: false
|
118
118
|
requirements:
|
119
119
|
- - ! '>='
|
@@ -121,10 +121,10 @@ dependencies:
|
|
121
121
|
version: '0'
|
122
122
|
type: :development
|
123
123
|
prerelease: false
|
124
|
-
version_requirements: *
|
124
|
+
version_requirements: *17208036100
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: guard-rspec
|
127
|
-
requirement: &
|
127
|
+
requirement: &17208028880 !ruby/object:Gem::Requirement
|
128
128
|
none: false
|
129
129
|
requirements:
|
130
130
|
- - ! '>='
|
@@ -132,10 +132,10 @@ dependencies:
|
|
132
132
|
version: '0'
|
133
133
|
type: :development
|
134
134
|
prerelease: false
|
135
|
-
version_requirements: *
|
135
|
+
version_requirements: *17208028880
|
136
136
|
- !ruby/object:Gem::Dependency
|
137
137
|
name: ruby-debug19
|
138
|
-
requirement: &
|
138
|
+
requirement: &17208027180 !ruby/object:Gem::Requirement
|
139
139
|
none: false
|
140
140
|
requirements:
|
141
141
|
- - ! '>='
|
@@ -143,10 +143,10 @@ dependencies:
|
|
143
143
|
version: '0'
|
144
144
|
type: :development
|
145
145
|
prerelease: false
|
146
|
-
version_requirements: *
|
146
|
+
version_requirements: *17208027180
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
148
|
name: spork
|
149
|
-
requirement: &
|
149
|
+
requirement: &17208026100 !ruby/object:Gem::Requirement
|
150
150
|
none: false
|
151
151
|
requirements:
|
152
152
|
- - ! '>='
|
@@ -154,10 +154,10 @@ dependencies:
|
|
154
154
|
version: 0.9.0.rc2
|
155
155
|
type: :development
|
156
156
|
prerelease: false
|
157
|
-
version_requirements: *
|
157
|
+
version_requirements: *17208026100
|
158
158
|
- !ruby/object:Gem::Dependency
|
159
159
|
name: guard-spork
|
160
|
-
requirement: &
|
160
|
+
requirement: &17208025060 !ruby/object:Gem::Requirement
|
161
161
|
none: false
|
162
162
|
requirements:
|
163
163
|
- - ! '>='
|
@@ -165,10 +165,10 @@ dependencies:
|
|
165
165
|
version: '0'
|
166
166
|
type: :development
|
167
167
|
prerelease: false
|
168
|
-
version_requirements: *
|
168
|
+
version_requirements: *17208025060
|
169
169
|
- !ruby/object:Gem::Dependency
|
170
170
|
name: simplecov
|
171
|
-
requirement: &
|
171
|
+
requirement: &17208024000 !ruby/object:Gem::Requirement
|
172
172
|
none: false
|
173
173
|
requirements:
|
174
174
|
- - ! '>='
|
@@ -176,10 +176,10 @@ dependencies:
|
|
176
176
|
version: '0'
|
177
177
|
type: :development
|
178
178
|
prerelease: false
|
179
|
-
version_requirements: *
|
179
|
+
version_requirements: *17208024000
|
180
180
|
- !ruby/object:Gem::Dependency
|
181
181
|
name: rb-inotify
|
182
|
-
requirement: &
|
182
|
+
requirement: &17208023040 !ruby/object:Gem::Requirement
|
183
183
|
none: false
|
184
184
|
requirements:
|
185
185
|
- - ! '>='
|
@@ -187,10 +187,10 @@ dependencies:
|
|
187
187
|
version: '0'
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
|
-
version_requirements: *
|
190
|
+
version_requirements: *17208023040
|
191
191
|
- !ruby/object:Gem::Dependency
|
192
192
|
name: libnotify
|
193
|
-
requirement: &
|
193
|
+
requirement: &17208022020 !ruby/object:Gem::Requirement
|
194
194
|
none: false
|
195
195
|
requirements:
|
196
196
|
- - ! '>='
|
@@ -198,7 +198,7 @@ dependencies:
|
|
198
198
|
version: '0'
|
199
199
|
type: :development
|
200
200
|
prerelease: false
|
201
|
-
version_requirements: *
|
201
|
+
version_requirements: *17208022020
|
202
202
|
description: This project is an implementation of the openEHR specification on Ruby.
|
203
203
|
email: skoba@moss.gr.jp
|
204
204
|
executables: []
|
@@ -413,6 +413,8 @@ files:
|
|
413
413
|
- spec/lib/open_ehr/parser/adl14/openEHR-EHR-SECTION.reason_for_encounter.v1.adl
|
414
414
|
- spec/lib/open_ehr/parser/adl14/openEHR-EHR-SECTION.summary.v1.adl
|
415
415
|
- spec/lib/open_ehr/parser/adl14/openEHR-EHR-SECTION.vital_signs.v1.adl
|
416
|
+
- spec/lib/open_ehr/parser/adl_description_spec.rb
|
417
|
+
- spec/lib/open_ehr/parser/adl_identification_spec.rb
|
416
418
|
- spec/lib/open_ehr/parser/adl_parser_spec.rb
|
417
419
|
- spec/lib/open_ehr/parser/adl_path_spec.rb
|
418
420
|
- spec/lib/open_ehr/parser/base_spec.rb
|
@@ -547,7 +549,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
547
549
|
version: '0'
|
548
550
|
segments:
|
549
551
|
- 0
|
550
|
-
hash: -
|
552
|
+
hash: -2889533999169533225
|
551
553
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
552
554
|
none: false
|
553
555
|
requirements:
|