open_ehr 0.6.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
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,379 @@
1
+ archetype (adl_version=1.4)
2
+ openEHR-EHR-CLUSTER.exam-chest.v1
3
+ specialize
4
+ openEHR-EHR-CLUSTER.exam.v1
5
+
6
+ concept
7
+ [at0000.1] -- Examination of the chest
8
+ language
9
+ original_language = <[ISO_639-1::en]>
10
+ description
11
+ original_author = <
12
+ ["name"] = <"Sam Heard">
13
+ ["organisation"] = <"Ocean Informatics">
14
+ ["date"] = <"9/04/2007">
15
+ ["email"] = <"Sam.Heard@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 chest">
21
+ use = <"">
22
+ keywords = <"examination", "physical", "chest", "thorax", "lungs">
23
+ misuse = <"">
24
+ >
25
+ >
26
+ lifecycle_state = <"Initial">
27
+ other_contributors = <>
28
+
29
+ definition
30
+ CLUSTER[at0000.1] matches { -- Examination of the chest
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.1] occurrences matches {0..1} matches { -- Chest wall
49
+ items cardinality matches {0..*; unordered} matches {
50
+ ELEMENT[at0.2] occurrences matches {0..1} matches { -- Description
51
+ value matches {
52
+ DV_CODED_TEXT matches {
53
+ defining_code matches {[local::]}
54
+ }
55
+ }
56
+ }
57
+ ELEMENT[at0.28] occurrences matches {0..1} matches { -- Shape
58
+ value matches {
59
+ DV_TEXT matches {*}
60
+ }
61
+ }
62
+ CLUSTER[at0.30] occurrences matches {0..1} matches { -- Heart - Apex beat
63
+ items cardinality matches {0..*; unordered} matches {
64
+ ELEMENT[at0.31] occurrences matches {0..1} matches { -- Visible
65
+ value matches {
66
+ DV_BOOLEAN matches {
67
+ value matches {True, False}
68
+ }
69
+ }
70
+ }
71
+ CLUSTER[at0.32] occurrences matches {0..1} matches { -- Palpation
72
+ items cardinality matches {0..*; unordered} matches {
73
+ ELEMENT[at0.33] occurrences matches {0..1} matches { -- Palpable
74
+ value matches {
75
+ DV_BOOLEAN matches {
76
+ value matches {True, False}
77
+ }
78
+ }
79
+ }
80
+ ELEMENT[at0.34] occurrences matches {0..1} matches { -- Maximal location
81
+ value matches {
82
+ DV_TEXT matches {*}
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ allow_archetype CLUSTER occurrences matches {0..1} matches {
90
+ include
91
+ archetype_id/value matches {/palpation\.v1draft/}
92
+ archetype_id/value matches {/inspection\.v1draft/}
93
+ archetype_id/value matches {/auscultation-chest\.v1/}
94
+ }
95
+ }
96
+ }
97
+ CLUSTER[at0.3] occurrences matches {0..1} matches { -- Respiratory system
98
+ items cardinality matches {0..*; unordered} matches {
99
+ ELEMENT[at0.4] occurrences matches {0..1} matches { -- Trachea
100
+ value matches {
101
+ DV_CODED_TEXT matches {
102
+ defining_code matches {
103
+ [local::
104
+ at0.5, -- Midline
105
+ at0.6, -- Deviated to the left
106
+ at0.7] -- Deviated to the right
107
+ }
108
+ }
109
+ }
110
+ }
111
+ CLUSTER[at0.8] occurrences matches {0..1} matches { -- Breathing
112
+ items cardinality matches {0..*; unordered} matches {
113
+ ELEMENT[at0.19] occurrences matches {0..1} matches { -- Description
114
+ value matches {
115
+ DV_TEXT matches {*}
116
+ }
117
+ }
118
+ ELEMENT[at0.9] occurrences matches {0..1} matches { -- Type
119
+ value matches {
120
+ DV_CODED_TEXT matches {
121
+ defining_code matches {
122
+ [local::
123
+ at0.10, -- Diaphragmatic breathing
124
+ at0.11] -- Thoracic breathing
125
+ }
126
+ }
127
+ }
128
+ }
129
+ ELEMENT[at0.12] occurrences matches {0..1} matches { -- Effort
130
+ value matches {
131
+ 5|[local::at0.13], -- Normal breathing effort
132
+ 6|[local::at0.14], -- Mild increase in effort
133
+ 8|[local::at0.15], -- Moderate increased effort
134
+ 10|[local::at0.16] -- Major increased effort
135
+ }
136
+ }
137
+ CLUSTER[at0.17] occurrences matches {0..1} matches { -- Signs of increased effort
138
+ items cardinality matches {0..*; unordered} matches {
139
+ ELEMENT[at0.18] occurrences matches {0..*} matches { -- Sign
140
+ value matches {
141
+ DV_CODED_TEXT matches {
142
+ defining_code matches {
143
+ [local::
144
+ at0.25, -- Using accessory muscles
145
+ at0.20, -- Intercostal recession
146
+ at0.24, -- Subcostal recession
147
+ at0.23, -- Suprasternal recession
148
+ at0.21, -- Sternal recession
149
+ at0.22] -- Rib retraction
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ ELEMENT[at0.26] occurrences matches {0..1} matches { -- Paradoxical movement (flail chest)
157
+ value matches {
158
+ DV_BOOLEAN matches {
159
+ value matches {True, False}
160
+ }
161
+ }
162
+ }
163
+ }
164
+ }
165
+ }
166
+ }
167
+ CLUSTER[at0003] occurrences matches {0..1} matches { -- Detail
168
+ items cardinality matches {0..*; unordered} matches {
169
+ allow_archetype CLUSTER occurrences matches {0..1} matches {
170
+ include
171
+ archetype_id/value matches {/exam-generic\.v1/}
172
+ archetype_id/value matches {/auscultation-chest\.v1/}
173
+ archetype_id/value matches {/palpation\.v1/}
174
+ archetype_id/value matches {/inspection\.v1draft/}
175
+ archetype_id/value matches {/percussion\.v1/}
176
+ }
177
+ }
178
+ }
179
+ }
180
+ }
181
+ CLUSTER[at0.27] occurrences matches {0..1} matches { -- Lymph nodes
182
+ items cardinality matches {0..*; unordered} matches {
183
+ allow_archetype CLUSTER occurrences matches {0..1} matches {
184
+ include
185
+ archetype_id/value matches {/exam-generic-lympnode\.v1/}
186
+ }
187
+ }
188
+ }
189
+ ELEMENT[at0006] occurrences matches {0..*} matches { -- Image
190
+ value matches {
191
+ DV_MULTIMEDIA matches {
192
+ media_type matches {
193
+ [openEHR::
194
+ 426,
195
+ 427,
196
+ 429]
197
+ }
198
+ }
199
+ }
200
+ }
201
+ }
202
+ }
203
+
204
+ ontology
205
+ term_definitions = <
206
+ ["en"] = <
207
+ items = <
208
+ ["at0.1"] = <
209
+ description = <"Findings about the chest wall">
210
+ text = <"Chest wall">
211
+ >
212
+ ["at0.10"] = <
213
+ description = <"Breathing using the diaphragm and not the chest wall">
214
+ text = <"Diaphragmatic breathing">
215
+ >
216
+ ["at0.11"] = <
217
+ description = <"Breathing using expansion of the chest wall">
218
+ text = <"Thoracic breathing">
219
+ >
220
+ ["at0.12"] = <
221
+ description = <"Effort required for breathing">
222
+ text = <"Effort">
223
+ >
224
+ ["at0.13"] = <
225
+ description = <"Diaphragmatic breathing as at rest">
226
+ text = <"Normal breathing effort">
227
+ >
228
+ ["at0.14"] = <
229
+ description = <"Breathing using obvious chest expansion">
230
+ text = <"Mild increase in effort">
231
+ >
232
+ ["at0.15"] = <
233
+ description = <"Breathing with signs of abnormal breathing">
234
+ text = <"Moderate increased effort">
235
+ >
236
+ ["at0.16"] = <
237
+ description = <"Many signs of increased breathing effort">
238
+ text = <"Major increased effort">
239
+ >
240
+ ["at0.17"] = <
241
+ description = <"Signs of increased respiratory effort">
242
+ text = <"Signs of increased effort">
243
+ >
244
+ ["at0.18"] = <
245
+ description = <"Use of accessory respiratory muscles">
246
+ text = <"Sign">
247
+ >
248
+ ["at0.19"] = <
249
+ description = <"Description of breathing">
250
+ text = <"Description">
251
+ >
252
+ ["at0.2"] = <
253
+ description = <"The contour of the chest wall">
254
+ text = <"Description">
255
+ >
256
+ ["at0.20"] = <
257
+ description = <"Drawing in between the ribs on inspiration">
258
+ text = <"Intercostal recession">
259
+ >
260
+ ["at0.21"] = <
261
+ description = <"Drawing in of the sternum on inspiration">
262
+ text = <"Sternal recession">
263
+ >
264
+ ["at0.22"] = <
265
+ description = <"Indrawing of the chest wall on inspiration">
266
+ text = <"Rib retraction">
267
+ >
268
+ ["at0.23"] = <
269
+ description = <"Indrawing above the sternum on inspiration">
270
+ text = <"Suprasternal recession">
271
+ >
272
+ ["at0.24"] = <
273
+ description = <"Indrawing of the subcostal abdominal wall ">
274
+ text = <"Subcostal recession">
275
+ >
276
+ ["at0.25"] = <
277
+ description = <"Use of accessory respiratory muscles during inspiration">
278
+ text = <"Using accessory muscles">
279
+ >
280
+ ["at0.26"] = <
281
+ description = <"Any paradoxical movement of the chest wall during respiration">
282
+ text = <"Paradoxical movement (flail chest)">
283
+ >
284
+ ["at0.27"] = <
285
+ description = <"Lymphnodes">
286
+ text = <"Lymph nodes">
287
+ >
288
+ ["at0.28"] = <
289
+ description = <"The shape of the chest">
290
+ text = <"Shape">
291
+ comment = <"ChestShape SNOMED query">
292
+ >
293
+ ["at0.29"] = <
294
+ description = <"Pidgeon chest, with prominent lower sternum">
295
+ text = <"Pectus carinatum">
296
+ >
297
+ ["at0.3"] = <
298
+ description = <"Respiratory findings">
299
+ text = <"Respiratory system">
300
+ >
301
+ ["at0.30"] = <
302
+ description = <"*">
303
+ text = <"Heart - Apex beat">
304
+ >
305
+ ["at0.31"] = <
306
+ description = <"Apex beat is visible">
307
+ text = <"Visible">
308
+ >
309
+ ["at0.32"] = <
310
+ description = <"*">
311
+ text = <"Palpation">
312
+ >
313
+ ["at0.33"] = <
314
+ description = <"Apex beat is palpable">
315
+ text = <"Palpable">
316
+ >
317
+ ["at0.34"] = <
318
+ description = <"Site of maximal location of apex beat">
319
+ text = <"Maximal location">
320
+ >
321
+ ["at0.4"] = <
322
+ description = <"The position of the trachea">
323
+ text = <"Trachea">
324
+ >
325
+ ["at0.5"] = <
326
+ description = <"The trachea is in the midline position">
327
+ text = <"Midline">
328
+ >
329
+ ["at0.6"] = <
330
+ description = <"The trachea is deviated to the left">
331
+ text = <"Deviated to the left">
332
+ >
333
+ ["at0.7"] = <
334
+ description = <"The trachea is deviated to the right">
335
+ text = <"Deviated to the right">
336
+ >
337
+ ["at0.8"] = <
338
+ description = <"Findings about breathing">
339
+ text = <"Breathing">
340
+ >
341
+ ["at0.9"] = <
342
+ description = <"Type of breathing">
343
+ text = <"Type">
344
+ >
345
+ ["at0000"] = <
346
+ description = <"Basic examination cluster for describing findings on physical examination when there is no named focus of examination">
347
+ text = <"Examination">
348
+ >
349
+ ["at0000.1"] = <
350
+ description = <"For recording findings on physical examination of the chest wall and lungs">
351
+ text = <"Examination of the chest">
352
+ >
353
+ ["at0002"] = <
354
+ description = <"Textural description of the part examined">
355
+ text = <"Clinical description">
356
+ >
357
+ ["at0003"] = <
358
+ description = <"More focused examination findings">
359
+ text = <"Detail">
360
+ >
361
+ ["at0004"] = <
362
+ description = <"A group of statements about the normality of the examination">
363
+ text = <"Normal statements">
364
+ >
365
+ ["at0005"] = <
366
+ description = <"A specific statement of normality">
367
+ text = <"Normal statement">
368
+ >
369
+ ["at0006"] = <
370
+ description = <"Drawing or image of the area examined">
371
+ text = <"Image">
372
+ >
373
+ ["at0008"] = <
374
+ description = <"Clinical findings">
375
+ text = <"Findings">
376
+ >
377
+ >
378
+ >
379
+ >