openehr-rails 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -104,6 +104,20 @@ LOCALE
104
104
 
105
105
  protected
106
106
 
107
+ def index_data(tree = archetype.definition)
108
+ data = tree.attributes.inject([]) do |values, attribute|
109
+ attribute.children.each do |child|
110
+ if child.rm_type_name == 'ELEMENT'
111
+ values << child.node_id
112
+ else
113
+ values.concat index_data(child) if child.respond_to? :attributes
114
+ end
115
+ end if attribute.has_children?
116
+ values
117
+ end
118
+ data
119
+ end
120
+
107
121
  def generate_view(filename)
108
122
  template filename, File.join("app/views", controller_file_path, filename)
109
123
  end
@@ -55,35 +55,6 @@ module Openehr
55
55
  def controller_class_name
56
56
  model_class_name + 'Controller'
57
57
  end
58
-
59
- def data_tree
60
- archetype.definition.attributes.each do |attribute|
61
- return attribute if attribute.rm_attribute_name == "data"
62
- end
63
- end
64
-
65
- def index_data(tree = data_tree)
66
- data = []
67
- if tree.has_children?
68
- data = tree.children.inject([]) do |values, child|
69
- if child.respond_to? :attributes
70
- child.attributes.each do |attribute|
71
- if attribute.rm_attribute_name == 'value'
72
- values << child.node_id unless child.node_id.nil?
73
- end
74
- if attribute.has_children?
75
- values.concat index_data(attribute)
76
- end
77
- end
78
- end
79
- values
80
- end
81
- end
82
- data
83
- end
84
-
85
- def show_data(tree = archetype.definition)
86
- end
87
58
  end
88
59
  end
89
60
  end
@@ -1,5 +1,5 @@
1
1
  module OpenEHR
2
2
  module Rails
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
@@ -22,32 +22,6 @@ module Openehr
22
22
  @archetyped_base.send(:archetype_path).should == 'app/archetypes'
23
23
  end
24
24
  end
25
-
26
- context 'data_tree' do
27
- it 'rm_attribute_name.should data' do
28
- @archetyped_base.send(:data_tree).rm_attribute_name.should == 'data'
29
- end
30
- end
31
-
32
- context 'index data' do
33
- it 'includes value data' do
34
- @archetyped_base.send(:index_data).should include 'at0004'
35
- end
36
-
37
- it 'includes at0005, too' do
38
- @archetyped_base.send(:index_data).should include 'at0005'
39
- end
40
-
41
- it 'does not include at0006' do
42
- @archetyped_base.send(:index_data).should_not include 'at0006'
43
- end
44
- end
45
-
46
- # context 'show data' do
47
- # subject { @archetyped_base. }
48
-
49
- # it { should have_key :protocol }
50
- # end
51
25
 
52
26
  context 'model name' do
53
27
  it 'is origined form archetype id' do
@@ -0,0 +1,146 @@
1
+ archetype (adl_version=1.4)
2
+ openEHR-EHR-CLUSTER.mml_name.v1
3
+
4
+ concept
5
+ [at0000] -- Mml name component
6
+ language
7
+ original_language = <[ISO_639-1::ja]>
8
+ translations = <
9
+ ["en"] = <
10
+ language = <[ISO_639-1::en]>
11
+ author = <
12
+ ["name"] = <"Shinji KOBAYASHI">
13
+ >
14
+ >
15
+ >
16
+ description
17
+ original_author = <
18
+ ["date"] = <"2014-01-28">
19
+ ["name"] = <"Shinji KOBAYASHI">
20
+ ["email"] = <"skoba@moss.or.jp">
21
+ >
22
+ details = <
23
+ ["en"] = <
24
+ language = <[ISO_639-1::en]>
25
+ purpose = <"To record personal name">
26
+ use = <"To describe personal name">
27
+ misuse = <"Not to use organization name">
28
+ copyright = <"MedXML consortium">
29
+ >
30
+ ["ja"] = <
31
+ language = <[ISO_639-1::ja]>
32
+ purpose = <"個人の名前を記録するため">
33
+ use = <"個人の名前を表現すること">
34
+ misuse = <"組織の名前には用いない">
35
+ copyright = <"MedXML consortium">
36
+ >
37
+ >
38
+ lifecycle_state = <"Initial">
39
+ other_contributors = <>
40
+ other_details = <
41
+ ["MD5-CAM-1.0.1"] = <"E37639D8A03C1B2E8FBEAC057D938B8C">
42
+ >
43
+
44
+ definition
45
+ CLUSTER[at0000] matches { -- Mml name component
46
+ items cardinality matches {2..*; unordered} matches {
47
+ ELEMENT[at0002] matches { -- mmlNm:family
48
+ value matches {
49
+ DV_TEXT matches {*}
50
+ }
51
+ }
52
+ ELEMENT[at0001] matches { -- mmlNm:given
53
+ value matches {
54
+ DV_TEXT matches {*}
55
+ }
56
+ }
57
+ ELEMENT[at0003] occurrences matches {0..1} matches { -- mmlNm:middle
58
+ value matches {
59
+ DV_TEXT matches {*}
60
+ }
61
+ }
62
+ ELEMENT[at0004] occurrences matches {0..1} matches { -- mmlNm:fullname
63
+ value matches {
64
+ DV_TEXT matches {*}
65
+ }
66
+ }
67
+ ELEMENT[at0005] occurrences matches {0..1} matches { -- mmlNm:prefix
68
+ value matches {
69
+ DV_TEXT matches {*}
70
+ }
71
+ }
72
+ ELEMENT[at0006] occurrences matches {0..1} matches { -- mmlNm:degree
73
+ value matches {
74
+ DV_TEXT matches {*}
75
+ }
76
+ }
77
+ }
78
+ }
79
+
80
+ ontology
81
+ term_definitions = <
82
+ ["en"] = <
83
+ items = <
84
+ ["at0000"] = <
85
+ text = <"Mml name component">
86
+ description = <"mmlNm:Name">
87
+ >
88
+ ["at0001"] = <
89
+ text = <"mmlNm:given">
90
+ description = <"Given name">
91
+ >
92
+ ["at0002"] = <
93
+ text = <"mmlNm:family">
94
+ description = <"Family name">
95
+ >
96
+ ["at0003"] = <
97
+ text = <"mmlNm:middle">
98
+ description = <"middle name of person">
99
+ >
100
+ ["at0004"] = <
101
+ text = <"mmlNm:fullname">
102
+ description = <"*">
103
+ >
104
+ ["at0005"] = <
105
+ text = <"mmlNm:prefix">
106
+ description = <"*">
107
+ >
108
+ ["at0006"] = <
109
+ text = <"mmlNm:degree">
110
+ description = <"*">
111
+ >
112
+ >
113
+ >
114
+ ["ja"] = <
115
+ items = <
116
+ ["at0000"] = <
117
+ text = <"Mml name">
118
+ description = <"unknown">
119
+ >
120
+ ["at0001"] = <
121
+ text = <"名">
122
+ description = <"名">
123
+ >
124
+ ["at0002"] = <
125
+ text = <"姓">
126
+ description = <"姓">
127
+ >
128
+ ["at0003"] = <
129
+ text = <"ミドルネーム">
130
+ description = <"ミドルネーム">
131
+ >
132
+ ["at0004"] = <
133
+ text = <"フルネーム">
134
+ description = <"フルネーム">
135
+ >
136
+ ["at0005"] = <
137
+ text = <"敬称">
138
+ description = <"敬称">
139
+ >
140
+ ["at0006"] = <
141
+ text = <"学位">
142
+ description = <"学位">
143
+ >
144
+ >
145
+ >
146
+ >
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openehr-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Shinji KOBAYASHI
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-08-20 00:00:00.000000000 Z
12
+ date: 2014-02-11 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: openehr
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - '>='
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - '>='
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rails
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: ckm_client
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - '>='
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - '>='
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: rake
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - '>='
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - '>='
67
76
  - !ruby/object:Gem::Version
@@ -69,6 +78,7 @@ dependencies:
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: ammeter
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - '>='
74
84
  - !ruby/object:Gem::Version
@@ -76,6 +86,7 @@ dependencies:
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - '>='
81
92
  - !ruby/object:Gem::Version
@@ -83,6 +94,7 @@ dependencies:
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: rspec
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - '>='
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - '>='
95
108
  - !ruby/object:Gem::Version
@@ -97,6 +110,7 @@ dependencies:
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: rspec-rails
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
115
  - - '>='
102
116
  - !ruby/object:Gem::Version
@@ -104,6 +118,7 @@ dependencies:
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
123
  - - '>='
109
124
  - !ruby/object:Gem::Version
@@ -111,6 +126,7 @@ dependencies:
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: simplecov
113
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
131
  - - '>='
116
132
  - !ruby/object:Gem::Version
@@ -118,6 +134,7 @@ dependencies:
118
134
  type: :development
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
121
138
  requirements:
122
139
  - - '>='
123
140
  - !ruby/object:Gem::Version
@@ -183,6 +200,7 @@ files:
183
200
  - spec/generators/openehr/migration/migration_generator_spec.rb
184
201
  - spec/generators/openehr/model/model_generator_spec.rb
185
202
  - spec/generators/openehr/scaffold/scaffold_generator_spec.rb
203
+ - spec/generators/templates/openEHR-EHR-CLUSTER.mml_name.v1.adl
186
204
  - spec/generators/templates/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl
187
205
  - spec/rcomponents/relement_spec.rb
188
206
  - spec/rcomponents/robservation_spec.rb
@@ -190,25 +208,32 @@ files:
190
208
  homepage: http://openehr.jp
191
209
  licenses:
192
210
  - Apache 2.0
193
- metadata: {}
194
211
  post_install_message:
195
212
  rdoc_options: []
196
213
  require_paths:
197
214
  - lib
198
215
  required_ruby_version: !ruby/object:Gem::Requirement
216
+ none: false
199
217
  requirements:
200
218
  - - '>='
201
219
  - !ruby/object:Gem::Version
202
220
  version: '0'
221
+ segments:
222
+ - 0
223
+ hash: -4360953249952883014
203
224
  required_rubygems_version: !ruby/object:Gem::Requirement
225
+ none: false
204
226
  requirements:
205
227
  - - '>='
206
228
  - !ruby/object:Gem::Version
207
229
  version: '0'
230
+ segments:
231
+ - 0
232
+ hash: -4360953249952883014
208
233
  requirements: []
209
234
  rubyforge_project:
210
- rubygems_version: 2.0.3
235
+ rubygems_version: 1.8.29
211
236
  signing_key:
212
- specification_version: 4
237
+ specification_version: 3
213
238
  summary: Rails extension for the openEHR archetypes
214
239
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 4bb8f39f18779c9cbf7e6b51c368e8b425775b54
4
- data.tar.gz: 4842726d2a22fd326416006b62833af4741e6197
5
- SHA512:
6
- metadata.gz: a6a3376bb756b9be11005933e5cbda70a8e24fa2734a0ff4b7b6bfe4ba4d684e13ec6e8b4903018b6bb1efec8e81c6d55ddaa151249a52b697a8259c2d762c06
7
- data.tar.gz: b32fef52388a61125670d970bd5b6ee26e4fc4c8956ea79321fb0fca1185ba8716f5df1471e6ecf23f96694fde9939fa40fe48517ee5fe43dc36657abb770869