open_ehr 0.6.1 → 0.9.0

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.
Files changed (115) hide show
  1. data/Gemfile +10 -2
  2. data/Gemfile.lock +58 -18
  3. data/Guardfile +2 -1
  4. data/History.txt +10 -3
  5. data/Manifest.txt +3 -5
  6. data/README.rdoc +36 -32
  7. data/Rakefile +1 -1
  8. data/VERSION +1 -1
  9. data/bin/adl_validator.rb +84 -0
  10. data/lib/open_ehr/am/archetype/constraint_model/primitive.rb +11 -7
  11. data/lib/open_ehr/am/archetype/constraint_model.rb +4 -16
  12. data/lib/open_ehr/am/archetype/ontology.rb +37 -6
  13. data/lib/open_ehr/am/archetype.rb +6 -7
  14. data/lib/open_ehr/am/open_ehr_profile/data_types/text.rb +5 -2
  15. data/lib/open_ehr/parser/adl.rb +19 -0
  16. data/lib/open_ehr/parser/adl_grammar.tt +155 -0
  17. data/lib/open_ehr/parser/adl_parser.rb +48 -0
  18. data/lib/open_ehr/parser/cadl_grammar.tt +803 -0
  19. data/lib/open_ehr/parser/dadl.rb +13 -0
  20. data/lib/open_ehr/parser/dadl_grammar.tt +358 -0
  21. data/lib/open_ehr/parser/exception.rb +68 -0
  22. data/lib/open_ehr/parser/scanner/adl_scanner.rb +819 -0
  23. data/lib/open_ehr/parser/shared_token_grammar.tt +1200 -0
  24. data/lib/open_ehr/parser/validator.rb +20 -0
  25. data/lib/open_ehr/parser.rb +16 -12
  26. data/lib/open_ehr.rb +1 -0
  27. data/open_ehr.gemspec +364 -0
  28. data/spec/lib/open_ehr/am/archetype/archetype_spec.rb +7 -2
  29. data/spec/lib/open_ehr/am/archetype/constraint_model/c_multiple_attribute_spec.rb +0 -6
  30. data/spec/lib/open_ehr/am/archetype/constraint_model/c_object_spec.rb +10 -10
  31. data/spec/lib/open_ehr/am/archetype/constraint_model/c_single_attribute_spec.rb +0 -6
  32. data/spec/lib/open_ehr/am/archetype/constraint_model/primitive/c_boolean_spec.rb +5 -0
  33. data/spec/lib/open_ehr/am/archetype/constraint_model/primitive/c_date_time_spec.rb +5 -0
  34. data/spec/lib/open_ehr/am/archetype/constraint_model/primitive/c_duration_spec.rb +5 -0
  35. data/spec/lib/open_ehr/am/archetype/constraint_model/primitive/c_integer_spec.rb +5 -0
  36. data/spec/lib/open_ehr/am/archetype/constraint_model/primitive/c_primitive_spec.rb +8 -6
  37. data/spec/lib/open_ehr/am/archetype/constraint_model/primitive/c_real_spec.rb +7 -2
  38. data/spec/lib/open_ehr/am/archetype/constraint_model/primitive/c_string_spec.rb +5 -0
  39. data/spec/lib/open_ehr/am/archetype/constraint_model/primitive/c_time_spec.rb +5 -0
  40. data/spec/lib/open_ehr/am/archetype/ontology/archetype_ontology_spec.rb +27 -7
  41. data/spec/lib/open_ehr/am/archetype/ontology/archetype_term_spec.rb +3 -3
  42. data/spec/lib/open_ehr/parser/adl/adl-test-ENTRY.assumed_types.v1.adl +88 -0
  43. data/spec/lib/open_ehr/parser/adl/adl-test-ENTRY.basic_types.v1.adl +143 -0
  44. data/spec/lib/open_ehr/parser/adl/adl-test-ENTRY.basic_types_fail.v1.adl +50 -0
  45. data/spec/lib/open_ehr/parser/adl/adl-test-ENTRY.most_minimal.v1.adl +27 -0
  46. data/spec/lib/open_ehr/parser/adl/adl-test-ENTRY.structure_test1.v1.adl +46 -0
  47. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-ACTION.imaging.v1.adl +275 -0
  48. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-ACTION.referral.v1.adl +351 -0
  49. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.auscultation-chest.v1.adl +765 -0
  50. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.auscultation.v1.adl +217 -0
  51. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.dimensions-circumference.v1.adl +134 -0
  52. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.dimensions.v1.adl +241 -0
  53. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.exam-abdomen.v1.adl +321 -0
  54. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.exam-chest.v1.adl +379 -0
  55. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.exam-fetus.v1.adl +577 -0
  56. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl +146 -0
  57. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl +176 -0
  58. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl +221 -0
  59. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.exam-generic.v1.adl +139 -0
  60. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl +116 -0
  61. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl +420 -0
  62. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-CLUSTER.exam-uterus.v1.adl +293 -0
  63. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-COMPOSITION.discharge.v1draft.adl +53 -0
  64. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-COMPOSITION.encounter.v1draft.adl +45 -0
  65. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-EVALUATION.adverse.v1.adl +411 -0
  66. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-INSTRUCTION.medication.v1.adl +88 -0
  67. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-INSTRUCTION.referral.v1.adl +84 -0
  68. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl +492 -0
  69. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-ITEM_TREE.follow_up.v1draft.adl +94 -0
  70. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-ITEM_TREE.imaging.v1.adl +127 -0
  71. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-ITEM_TREE.medication-formulation.v1.adl +457 -0
  72. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-ITEM_TREE.medication.v1.adl +869 -0
  73. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-ITEM_TREE.referral.v1.adl +494 -0
  74. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-OBSERVATION.apgar.v1.adl +545 -0
  75. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl +673 -0
  76. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-OBSERVATION.body_mass_index.v1.adl +166 -0
  77. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-SECTION.findings.v1.adl +47 -0
  78. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-SECTION.reason_for_encounter.v1.adl +51 -0
  79. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-SECTION.summary.v1.adl +52 -0
  80. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-SECTION.vital_signs.v1.adl +54 -0
  81. data/spec/lib/open_ehr/parser/adl/openEHR-EHR-cadl_sample.v1.adl +9 -0
  82. data/spec/lib/open_ehr/parser/adl_parser_spec.rb +210 -0
  83. data/spec/lib/open_ehr/parser/base_spec.rb +19 -0
  84. data/spec/spec.opts +2 -1
  85. data/spec/spec_helper.rb +3 -0
  86. metadata +166 -52
  87. data/doc/README_rdoc.html +0 -148
  88. data/doc/created.rid +0 -2
  89. data/doc/images/brick.png +0 -0
  90. data/doc/images/brick_link.png +0 -0
  91. data/doc/images/bug.png +0 -0
  92. data/doc/images/bullet_black.png +0 -0
  93. data/doc/images/bullet_toggle_minus.png +0 -0
  94. data/doc/images/bullet_toggle_plus.png +0 -0
  95. data/doc/images/date.png +0 -0
  96. data/doc/images/find.png +0 -0
  97. data/doc/images/loadingAnimation.gif +0 -0
  98. data/doc/images/macFFBgHack.png +0 -0
  99. data/doc/images/package.png +0 -0
  100. data/doc/images/page_green.png +0 -0
  101. data/doc/images/page_white_text.png +0 -0
  102. data/doc/images/page_white_width.png +0 -0
  103. data/doc/images/plugin.png +0 -0
  104. data/doc/images/ruby.png +0 -0
  105. data/doc/images/tag_green.png +0 -0
  106. data/doc/images/wrench.png +0 -0
  107. data/doc/images/wrench_orange.png +0 -0
  108. data/doc/images/zoom.png +0 -0
  109. data/doc/index.html +0 -54
  110. data/doc/js/darkfish.js +0 -116
  111. data/doc/js/jquery.js +0 -32
  112. data/doc/js/quicksearch.js +0 -114
  113. data/doc/js/thickbox-compressed.js +0 -10
  114. data/doc/rdoc.css +0 -706
  115. data/lib/#open_ehr.rb# +0 -11
@@ -0,0 +1,321 @@
1
+ archetype (adl_version=1.4)
2
+ openEHR-EHR-CLUSTER.exam-abdomen.v1
3
+ specialize
4
+ openEHR-EHR-CLUSTER.exam.v1
5
+
6
+ concept
7
+ [at0000.1] -- Examination of the abdomen
8
+ language
9
+ original_language = <[ISO_639-1::en]>
10
+ description
11
+ original_author = <
12
+ ["name"] = <"Heather Leslie">
13
+ ["organisation"] = <"Ocean Informatics">
14
+ ["date"] = <"11/04/2007">
15
+ ["email"] = <"heather.leslie@oceaninformatics.biz">
16
+ >
17
+ details = <
18
+ ["en"] = <
19
+ language = <[ISO_639-1::en]>
20
+ purpose = <"A cluster for recording findings on physical examination of the abdomen">
21
+ use = <"">
22
+ keywords = <"examination", "physical">
23
+ misuse = <"">
24
+ >
25
+ >
26
+ lifecycle_state = <"Initial">
27
+ other_contributors = <>
28
+
29
+ definition
30
+ CLUSTER[at0000.1] matches { -- Examination of the abdomen
31
+ items cardinality matches {0..*; unordered} matches {
32
+ CLUSTER[at0004] occurrences matches {0..1} matches { -- Normal statements
33
+ items cardinality matches {0..*; unordered} matches {
34
+ ELEMENT[at0005] occurrences matches {0..*} matches { -- Normal statement
35
+ value matches {
36
+ DV_TEXT matches {*}
37
+ }
38
+ }
39
+ }
40
+ }
41
+ ELEMENT[at0002] occurrences matches {0..1} matches { -- Clinical description
42
+ value matches {
43
+ DV_TEXT matches {*}
44
+ }
45
+ }
46
+ CLUSTER[at0008] occurrences matches {0..1} matches { -- Findings
47
+ items cardinality matches {0..*; unordered} matches {
48
+ CLUSTER[at0.2] occurrences matches {0..1} matches { -- Abdominal wall
49
+ items cardinality matches {0..*; unordered} matches {
50
+ ELEMENT[at0.3] occurrences matches {0..1} matches { -- Description
51
+ value matches {
52
+ DV_CODED_TEXT matches {
53
+ defining_code matches {[local::]}
54
+ }
55
+ }
56
+ }
57
+ allow_archetype CLUSTER occurrences matches {0..1} matches {
58
+ include
59
+ archetype_id/value matches {/inspection\.v1draft/}
60
+ archetype_id/value matches {/exam-generic-mass\.v1/}
61
+ archetype_id/value matches {/palpation\.v1/}
62
+ archetype_id/value matches {/inspection-skin\.v1draft/}
63
+ archetype_id/value matches {/exam-generic-lymphnode\.v1/}
64
+ }
65
+ }
66
+ }
67
+ CLUSTER[at0.9] occurrences matches {0..1} matches { -- Abdominal Region
68
+ items cardinality matches {0..*; unordered} matches {
69
+ ELEMENT[at0.10] occurrences matches {0..1} matches { -- Region
70
+ value matches {
71
+ DV_CODED_TEXT matches {
72
+ defining_code matches {
73
+ [local::
74
+ at0.11, -- Left upper quadrant
75
+ at0.12, -- Epigastrium
76
+ at0.16, -- Left upper quadrant
77
+ at0.17, -- Right loin
78
+ at0.18, -- Central/peri-umbilical
79
+ at0.19, -- Left loin
80
+ at0.20, -- Right iliac fossa
81
+ at0.21] -- Left iliac fossa
82
+ }
83
+ }
84
+ }
85
+ }
86
+ allow_archetype CLUSTER occurrences matches {0..1} matches {
87
+ include
88
+ archetype_id/value matches {/palpation\.v1/}
89
+ archetype_id/value matches {/percussion\.v1/}
90
+ }
91
+ use_node ELEMENT /items[at0008]/items[at0.2]/items[at0.3]
92
+ }
93
+ }
94
+ CLUSTER[at0.5] occurrences matches {0..1} matches { -- Abdomen Contents
95
+ items cardinality matches {0..*; unordered} matches {
96
+ allow_archetype CLUSTER occurrences matches {0..1} matches {
97
+ include
98
+ archetype_id/value matches {/exam-generic-mass\.v1/}
99
+ archetype_id/value matches {/exam-generic-lympnode\.v1/}
100
+ archetype_id/value matches {/exam-generic\.v1/}
101
+ archetype_id/value matches {/exam\.v1/}
102
+ archetype_id/value matches {/auscultation\.v1/}
103
+ }
104
+ CLUSTER[at0.13] occurrences matches {0..1} matches { -- Organs
105
+ items cardinality matches {0..*; unordered} matches {
106
+ CLUSTER[at0.14] occurrences matches {0..1} matches { -- Liver
107
+ items cardinality matches {0..*; unordered} matches {
108
+ allow_archetype CLUSTER occurrences matches {0..1} matches {
109
+ include
110
+ archetype_id/value matches {/palpation\.v1/}
111
+ archetype_id/value matches {/percussion\.v1/}
112
+ archetype_id/value matches {/dimensions\.v1/}
113
+ archetype_id/value matches {/relative_position_abdomen\.v1draft/}
114
+ archetype_id/value matches {/size\.v1/}
115
+ archetype_id/value matches {/exam-generic-mass\.v1/}
116
+ }
117
+ use_node ELEMENT /items[at0008]/items[at0.2]/items[at0.3]
118
+ }
119
+ }
120
+ CLUSTER[at0.7] occurrences matches {0..1} matches { -- Spleen
121
+ items cardinality matches {0..*; unordered} matches {
122
+ allow_archetype CLUSTER occurrences matches {0..1} matches {
123
+ include
124
+ archetype_id/value matches {/dimensions\.v1/}
125
+ archetype_id/value matches {/exam-generic-mass\.v1/}
126
+ archetype_id/value matches {/exam-generic\.v1/}
127
+ archetype_id/value matches {/exam\.v1/}
128
+ archetype_id/value matches {/palpation\.v1/}
129
+ archetype_id/value matches {/percussion\.v1/}
130
+ archetype_id/value matches {/relative_position_abdomen\.v1draft/}
131
+ archetype_id/value matches {/size\.v1/}
132
+ }
133
+ use_node ELEMENT /items[at0008]/items[at0.2]/items[at0.3]
134
+ }
135
+ }
136
+ CLUSTER[at0.8] occurrences matches {0..1} matches { -- Kidney
137
+ items cardinality matches {0..*; unordered} matches {
138
+ allow_archetype CLUSTER occurrences matches {0..1} matches {
139
+ include
140
+ archetype_id/value matches {/dimensions\.v1/}
141
+ archetype_id/value matches {/exam-generic-mass\.v1/}
142
+ archetype_id/value matches {/exam-generic\.v1/}
143
+ archetype_id/value matches {/exam\.v1/}
144
+ archetype_id/value matches {/palpation\.v1/}
145
+ archetype_id/value matches {/percussion\.v1/}
146
+ archetype_id/value matches {/relative_position_abdomen\.v1draft/}
147
+ }
148
+ use_node ELEMENT /items[at0008]/items[at0.2]/items[at0.3]
149
+ }
150
+ }
151
+ CLUSTER[at0.15] occurrences matches {0..1} matches { -- Bowel
152
+ items cardinality matches {0..*; unordered} matches {
153
+ allow_archetype CLUSTER occurrences matches {0..1} matches {
154
+ include
155
+ archetype_id/value matches {/palpation\.v1/}
156
+ archetype_id/value matches {/exam-generic-mass\.v1/}
157
+ archetype_id/value matches {/exam-generic\.v1/}
158
+ archetype_id/value matches {/exam\.v1/}
159
+ archetype_id/value matches {/percussion\.v1/}
160
+ archetype_id/value matches {/relative_position_abdomen\.v1draft/}
161
+ }
162
+ use_node ELEMENT /items[at0008]/items[at0.2]/items[at0.3]
163
+ }
164
+ }
165
+ }
166
+ }
167
+ use_node ELEMENT /items[at0008]/items[at0.2]/items[at0.3]
168
+ }
169
+ }
170
+ CLUSTER[at0003] occurrences matches {0..1} matches { -- Detail
171
+ items cardinality matches {0..*; unordered} matches {
172
+ allow_archetype CLUSTER occurrences matches {0..1} matches {
173
+ include
174
+ archetype_id/value matches {/exam-generic\.v1/}
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ ELEMENT[at0006] occurrences matches {0..*} matches { -- Image
181
+ value matches {
182
+ DV_MULTIMEDIA matches {
183
+ media_type matches {
184
+ [openEHR::
185
+ 426,
186
+ 427,
187
+ 429]
188
+ }
189
+ }
190
+ }
191
+ }
192
+ }
193
+ }
194
+
195
+ ontology
196
+ term_definitions = <
197
+ ["en"] = <
198
+ items = <
199
+ ["at0.10"] = <
200
+ description = <"*">
201
+ text = <"Region">
202
+ >
203
+ ["at0.11"] = <
204
+ description = <"*">
205
+ text = <"Left upper quadrant">
206
+ >
207
+ ["at0.12"] = <
208
+ description = <"*">
209
+ text = <"Epigastrium">
210
+ >
211
+ ["at0.13"] = <
212
+ description = <"*">
213
+ text = <"Organs">
214
+ >
215
+ ["at0.14"] = <
216
+ description = <"*">
217
+ text = <"Liver">
218
+ >
219
+ ["at0.15"] = <
220
+ description = <"*">
221
+ text = <"Bowel">
222
+ >
223
+ ["at0.16"] = <
224
+ description = <"*">
225
+ text = <"Left upper quadrant">
226
+ >
227
+ ["at0.17"] = <
228
+ description = <"*">
229
+ text = <"Right loin">
230
+ >
231
+ ["at0.18"] = <
232
+ description = <"*">
233
+ text = <"Central/peri-umbilical">
234
+ >
235
+ ["at0.19"] = <
236
+ description = <"*">
237
+ text = <"Left loin">
238
+ >
239
+ ["at0.2"] = <
240
+ description = <"*">
241
+ text = <"Abdominal wall">
242
+ >
243
+ ["at0.20"] = <
244
+ description = <"*">
245
+ text = <"Right iliac fossa">
246
+ >
247
+ ["at0.21"] = <
248
+ description = <"*">
249
+ text = <"Left iliac fossa">
250
+ >
251
+ ["at0.22"] = <
252
+ description = <"*">
253
+ text = <"New element">
254
+ >
255
+ ["at0.23"] = <
256
+ description = <"Clinical description of finding">
257
+ text = <"Description">
258
+ >
259
+ ["at0.3"] = <
260
+ description = <"Clincial description of findings">
261
+ text = <"Description">
262
+ >
263
+ ["at0.4"] = <
264
+ description = <"Shape of abdomen">
265
+ text = <"Shape">
266
+ >
267
+ ["at0.5"] = <
268
+ description = <"*">
269
+ text = <"Abdomen Contents">
270
+ >
271
+ ["at0.6"] = <
272
+ description = <"Clinical description">
273
+ text = <"Description">
274
+ >
275
+ ["at0.7"] = <
276
+ description = <"*">
277
+ text = <"Spleen">
278
+ >
279
+ ["at0.8"] = <
280
+ description = <"*">
281
+ text = <"Kidney">
282
+ >
283
+ ["at0.9"] = <
284
+ description = <"*">
285
+ text = <"Abdominal Region">
286
+ >
287
+ ["at0000"] = <
288
+ description = <"Basic examination cluster for describing findings on physical examination when there is no named focus of examination">
289
+ text = <"Examination">
290
+ >
291
+ ["at0000.1"] = <
292
+ description = <"For recording findings on physical examination of the abdomen">
293
+ text = <"Examination of the abdomen">
294
+ >
295
+ ["at0002"] = <
296
+ description = <"Textural description of the part examined">
297
+ text = <"Clinical description">
298
+ >
299
+ ["at0003"] = <
300
+ description = <"More focused examination findings">
301
+ text = <"Detail">
302
+ >
303
+ ["at0004"] = <
304
+ description = <"A group of statements about the normality of the examination">
305
+ text = <"Normal statements">
306
+ >
307
+ ["at0005"] = <
308
+ description = <"A specific statement of normality">
309
+ text = <"Normal statement">
310
+ >
311
+ ["at0006"] = <
312
+ description = <"Drawing or image of the area examined">
313
+ text = <"Image">
314
+ >
315
+ ["at0008"] = <
316
+ description = <"Clinical findings">
317
+ text = <"Findings">
318
+ >
319
+ >
320
+ >
321
+ >