open_ehr 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/README.rdoc +6 -8
- data/VERSION +1 -1
- data/lib/open_ehr/am/archetype/constraint_model/primitive.rb +2 -2
- data/lib/open_ehr/am/archetype/ontology.rb +23 -28
- data/lib/open_ehr/am/archetype.rb +1 -1
- data/lib/open_ehr/parser/adl.rb +42 -4
- data/lib/open_ehr/parser/adl_grammar.tt +67 -42
- data/lib/open_ehr/parser/adl_parser.rb +1 -1
- data/lib/open_ehr/parser/cadl_grammar.tt +227 -61
- data/lib/open_ehr/parser/cadl_node.rb +1 -0
- data/lib/open_ehr/parser/dadl_grammar.tt +10 -10
- data/lib/open_ehr/parser/shared_token_grammar.tt +13 -13
- data/open_ehr.gemspec +14 -4
- data/spec/lib/open_ehr/am/archetype/archetype_spec.rb +1 -1
- data/spec/lib/open_ehr/am/archetype/ontology/archetype_ontology_spec.rb +22 -13
- data/spec/lib/open_ehr/parser/adl14/adl-test-SOME_TYPE.generic_type_use_node.draft.adl +1 -1
- data/spec/lib/open_ehr/parser/adl14/adl-test-entry.archetype_bindings.test.adl +1 -1
- data/spec/lib/open_ehr/parser/adl14/adl-test-entry.archetype_internal_ref.test.adl +1 -1
- data/spec/lib/open_ehr/parser/adl14/adl-test-entry.archetype_internal_ref2.test.adl +1 -1
- data/spec/lib/open_ehr/parser/adl14/adl-test-entry.archetype_language.test.adl +1 -1
- data/spec/lib/open_ehr/parser/adl14/adl-test-entry.archetype_language_no_accreditation.test.adl +1 -1
- data/spec/lib/open_ehr/parser/adl14/adl-test-entry.archetype_language_order_of_translation_details.test.adl +1 -1
- data/spec/lib/open_ehr/parser/adl14/adl-test-entry.archetype_ontology.test.adl +1 -1
- data/spec/lib/open_ehr/parser/adl14/adl-test-entry.translations_author_language.test.adl +1 -1
- data/spec/lib/open_ehr/parser/adl14/adl-test-entry.translations_language_author.test.adl +1 -1
- data/spec/lib/open_ehr/parser/adl_archetype_internal_ref2_spec.rb +42 -0
- data/spec/lib/open_ehr/parser/adl_archetype_internal_ref_spec.rb +125 -0
- data/spec/lib/open_ehr/parser/adl_archetype_internal_ref_with_generics_spec.rb +258 -0
- data/spec/lib/open_ehr/parser/adl_archetype_ontology_binding_spec.rb +98 -0
- data/spec/lib/open_ehr/parser/adl_archetype_ontology_spec.rb +42 -0
- data/spec/lib/open_ehr/parser/adl_description_spec.rb +13 -2
- data/spec/lib/open_ehr/parser/adl_language_no_accreditation_spec.rb +66 -0
- data/spec/lib/open_ehr/parser/adl_language_order_spec.rb +68 -0
- data/spec/lib/open_ehr/parser/adl_language_spec.rb +119 -0
- data/spec/lib/open_ehr/parser/adl_language_translation_author_language_spec.rb +50 -0
- data/spec/lib/open_ehr/parser/adl_language_translation_language_author_spec.rb +46 -0
- data/spec/lib/open_ehr/parser/adl_parser_spec.rb +2 -2
- data/spec/lib/open_ehr/parser/parser_spec_helper.rb +7 -0
- data/spec/lib/open_ehr/rm/common/resource/translation_details_spec.rb +4 -4
- metadata +49 -39
- data/Gemfile.lock +0 -85
@@ -28,10 +28,10 @@ module OpenEHR
|
|
28
28
|
args[:occurrences] ||= OpenEHR::AssumedLibraryTypes::Interval.new(
|
29
29
|
:lower => 1, :upper => 1)
|
30
30
|
node.id = args[:node_id]
|
31
|
-
if node.root?
|
32
|
-
args[:path] =
|
31
|
+
if node.root? or node.id.nil?
|
32
|
+
args[:path] = node.path
|
33
33
|
else
|
34
|
-
args[:path] = node.path + '[' +
|
34
|
+
args[:path] = node.path + '[' + node.id + ']'
|
35
35
|
end
|
36
36
|
args.update body.value(node)
|
37
37
|
OpenEHR::AM::Archetype::ConstraintModel::CComplexObject.new(args)
|
@@ -42,13 +42,8 @@ module OpenEHR
|
|
42
42
|
args = c_complex_object_head.value
|
43
43
|
args[:occurrences] ||= OpenEHR::AssumedLibraryTypes::Interval.new(
|
44
44
|
:lower => 1, :upper => 1)
|
45
|
-
|
46
|
-
|
47
|
-
else
|
48
|
-
node.id = args[:node_id]
|
49
|
-
p args[:rm_type_name]
|
50
|
-
node.path += '[' + args[:node_id] + ']'
|
51
|
-
end
|
45
|
+
node.id = args[:node_id]
|
46
|
+
args[:path] = node.path
|
52
47
|
OpenEHR::AM::Archetype::ConstraintModel::CComplexObject.new(args)
|
53
48
|
end
|
54
49
|
}
|
@@ -57,7 +52,7 @@ p args[:rm_type_name]
|
|
57
52
|
rule c_complex_object_head
|
58
53
|
c_complex_object_id c_occurrences {
|
59
54
|
def value
|
60
|
-
c_complex_object_id.value
|
55
|
+
c_complex_object_id.value[:occurrences] = c_occurrences.value
|
61
56
|
c_complex_object_id.value
|
62
57
|
end
|
63
58
|
}
|
@@ -85,31 +80,25 @@ p args[:rm_type_name]
|
|
85
80
|
rule c_complex_object_body
|
86
81
|
c_any '' {
|
87
82
|
def value(node)
|
88
|
-
|
83
|
+
Hash[:attributes => c_any.value(node)]
|
89
84
|
end
|
90
85
|
}
|
91
86
|
/ c_attributes '' {
|
92
|
-
def value(node
|
93
|
-
|
94
|
-
:any_allowed? => false}
|
87
|
+
def value(node)
|
88
|
+
Hash[:attributes => c_attributes.value(node)]
|
95
89
|
end
|
96
90
|
}
|
97
91
|
end
|
98
92
|
|
99
93
|
rule c_object
|
100
|
-
|
94
|
+
c_primitive_object '' {
|
101
95
|
def value(node)
|
102
|
-
|
96
|
+
c_primitive_object.value
|
103
97
|
end
|
104
98
|
}
|
105
|
-
/
|
99
|
+
/ c_complex_object '' {
|
106
100
|
def value(node)
|
107
|
-
|
108
|
-
end
|
109
|
-
}
|
110
|
-
/ archetype_internal_ref '' {
|
111
|
-
def value(node = nil)
|
112
|
-
archetype_internal_ref.value(node)
|
101
|
+
c_complex_object.value(node)
|
113
102
|
end
|
114
103
|
}
|
115
104
|
/ constraint_ref '' {
|
@@ -117,9 +106,14 @@ p args[:rm_type_name]
|
|
117
106
|
constraint_ref.value
|
118
107
|
end
|
119
108
|
}
|
120
|
-
/
|
109
|
+
/ archetype_slot '' {
|
110
|
+
def value(node)
|
111
|
+
archetype_slot.value(node)
|
112
|
+
end
|
113
|
+
}
|
114
|
+
/ archetype_internal_ref '' {
|
121
115
|
def value(node = nil)
|
122
|
-
|
116
|
+
archetype_internal_ref.value(node)
|
123
117
|
end
|
124
118
|
}
|
125
119
|
/ V_C_DOMAIN_TYPE '' {
|
@@ -261,7 +255,14 @@ p args[:rm_type_name]
|
|
261
255
|
end
|
262
256
|
|
263
257
|
rule c_any
|
264
|
-
'*' space
|
258
|
+
'*' space {
|
259
|
+
def value(node)
|
260
|
+
OpenEHR::AM::Archetype::ConstraintModel::CAttribute.new(
|
261
|
+
:path => node.path, :rm_attribute_name => node.id,
|
262
|
+
:exsitence => OpenEHR::AssumedLibraryTypes::Interval.new(
|
263
|
+
:lower => 1, :upper => 1))
|
264
|
+
end
|
265
|
+
}
|
265
266
|
end
|
266
267
|
|
267
268
|
rule c_attributes
|
@@ -291,7 +292,13 @@ p args[:rm_type_name]
|
|
291
292
|
rule c_attr_head
|
292
293
|
id:(V_ATTRIBUTE_IDENTIFIER) white_space c_existence c_cardinality {
|
293
294
|
def value(node)
|
294
|
-
|
295
|
+
if node.root?
|
296
|
+
path = node.path + id.value
|
297
|
+
elsif node.id
|
298
|
+
path = node.path + "[#{node.id}]/" + id.value
|
299
|
+
elsif
|
300
|
+
path = node.path + '/' + id.value
|
301
|
+
end
|
295
302
|
OpenEHR::AM::Archetype::ConstraintModel::CMultipleAttribute.new(
|
296
303
|
:rm_attribute_name => id.value,
|
297
304
|
:path => path,
|
@@ -301,7 +308,13 @@ p args[:rm_type_name]
|
|
301
308
|
}
|
302
309
|
/ id:V_ATTRIBUTE_IDENTIFIER white_space c_existence {
|
303
310
|
def value(node)
|
304
|
-
|
311
|
+
if node.root?
|
312
|
+
path = node.path + id.value
|
313
|
+
elsif node.id
|
314
|
+
path = node.path + "[#{node.id}]/" + id.value
|
315
|
+
elsif
|
316
|
+
path = node.path + '/' + id.value
|
317
|
+
end
|
305
318
|
OpenEHR::AM::Archetype::ConstraintModel::CSingleAttribute.new(
|
306
319
|
:rm_attribute_name => id.value,
|
307
320
|
:path => path,
|
@@ -310,7 +323,13 @@ p args[:rm_type_name]
|
|
310
323
|
}
|
311
324
|
/ id:(V_ATTRIBUTE_IDENTIFIER) white_space c_cardinality {
|
312
325
|
def value(node)
|
313
|
-
|
326
|
+
if node.root?
|
327
|
+
path = node.path + id.value
|
328
|
+
elsif node.id
|
329
|
+
path = node.path + "[#{node.id}]/" + id.value
|
330
|
+
elsif
|
331
|
+
path = node.path + '/' + id.value
|
332
|
+
end
|
314
333
|
OpenEHR::AM::Archetype::ConstraintModel::CMultipleAttribute.new(
|
315
334
|
:rm_attribute_name => id.value,
|
316
335
|
:path => path,
|
@@ -319,7 +338,13 @@ p args[:rm_type_name]
|
|
319
338
|
}
|
320
339
|
/ id:(V_ATTRIBUTE_IDENTIFIER) white_space {
|
321
340
|
def value(node)
|
322
|
-
|
341
|
+
if node.root?
|
342
|
+
path = node.path + id.value
|
343
|
+
elsif node.id
|
344
|
+
path = node.path + "[#{node.id}]/" + id.value
|
345
|
+
elsif
|
346
|
+
path = node.path + '/' + id.value
|
347
|
+
end
|
323
348
|
OpenEHR::AM::Archetype::ConstraintModel::CSingleAttribute.new(
|
324
349
|
:rm_attribute_name => id.value, :path => path)
|
325
350
|
end
|
@@ -512,7 +537,7 @@ p args[:rm_type_name]
|
|
512
537
|
integer_interval_value.value
|
513
538
|
end
|
514
539
|
}
|
515
|
-
/ occurrence_spec {
|
540
|
+
/ occurrence_spec '' {
|
516
541
|
def value
|
517
542
|
occurrence_spec.value
|
518
543
|
end
|
@@ -520,62 +545,184 @@ p args[:rm_type_name]
|
|
520
545
|
end
|
521
546
|
|
522
547
|
rule c_integer
|
523
|
-
c_integer_spec
|
548
|
+
c_integer_spec '' {
|
549
|
+
def value
|
550
|
+
c_integer_spec.value
|
551
|
+
end
|
552
|
+
}
|
553
|
+
/ c_integer_spec ';' integer_value {
|
554
|
+
def value
|
555
|
+
c_integer_spec.value
|
556
|
+
end
|
557
|
+
}
|
524
558
|
end
|
525
559
|
|
526
560
|
rule c_real_spec
|
527
|
-
real_value
|
528
|
-
|
529
|
-
|
561
|
+
real_value '' {
|
562
|
+
def value
|
563
|
+
real_value.value
|
564
|
+
end
|
565
|
+
}
|
566
|
+
/ real_list_value '' {
|
567
|
+
def value
|
568
|
+
real_list_value.value
|
569
|
+
end
|
570
|
+
}
|
571
|
+
/ real_interval_value '' {
|
572
|
+
def value
|
573
|
+
real_interval_value.value
|
574
|
+
end
|
575
|
+
}
|
530
576
|
end
|
531
577
|
|
532
578
|
rule c_real
|
533
|
-
c_real_spec
|
579
|
+
c_real_spec '' {
|
580
|
+
def value
|
581
|
+
c_real_spec.value
|
582
|
+
end
|
583
|
+
}
|
584
|
+
/ c_real_spec ';' real_value {
|
585
|
+
def value
|
586
|
+
c_real_spec.assumed_value = real_value.value
|
587
|
+
end
|
588
|
+
}
|
534
589
|
end
|
535
590
|
|
536
591
|
rule c_date_constraint
|
537
|
-
V_ISO8601_DATE_CONSTRAINT_PATTERN
|
538
|
-
|
539
|
-
|
592
|
+
V_ISO8601_DATE_CONSTRAINT_PATTERN '' {
|
593
|
+
def value
|
594
|
+
V_ISO8601_DATE_CONSTRAINT_PATTERN.value
|
595
|
+
end
|
596
|
+
}
|
597
|
+
/ date_value '' {
|
598
|
+
def value
|
599
|
+
date_value.value
|
600
|
+
end
|
601
|
+
}
|
602
|
+
/ date_interval_value '' {
|
603
|
+
def value
|
604
|
+
date_interval_value.value
|
605
|
+
end
|
606
|
+
}
|
540
607
|
end
|
541
608
|
|
542
609
|
rule c_date
|
543
|
-
c_date_constraint
|
610
|
+
c_date_constraint '' {
|
611
|
+
def value
|
612
|
+
c_date_constraint.value
|
613
|
+
end
|
614
|
+
}
|
615
|
+
/ c_date_constraint ';' date_value {
|
616
|
+
def value
|
617
|
+
c_date_constraint.value
|
618
|
+
end
|
619
|
+
}
|
544
620
|
end
|
545
621
|
|
546
622
|
rule c_time_constraint
|
547
|
-
V_ISO8601_TIME_CONSTRAINT_PATTERN
|
548
|
-
|
549
|
-
|
623
|
+
V_ISO8601_TIME_CONSTRAINT_PATTERN '' {
|
624
|
+
def value
|
625
|
+
V_ISO8601_TIME_CONSTRAINT_PATTERN.value
|
626
|
+
end
|
627
|
+
}
|
628
|
+
/ time_value '' {
|
629
|
+
def value
|
630
|
+
time_value.value
|
631
|
+
end
|
632
|
+
}
|
633
|
+
/ time_interval_value {
|
634
|
+
def value
|
635
|
+
time_interval_value.value
|
636
|
+
end
|
637
|
+
}
|
550
638
|
end
|
551
639
|
|
552
640
|
rule c_time
|
553
|
-
c_time_constraint
|
641
|
+
c_time_constraint '' {
|
642
|
+
def value
|
643
|
+
c_time_constraint.value
|
644
|
+
end
|
645
|
+
}
|
646
|
+
/ c_time_constraint ';' time_value {
|
647
|
+
def value
|
648
|
+
c_time_constraint.value
|
649
|
+
end
|
650
|
+
}
|
554
651
|
end
|
555
652
|
|
556
653
|
rule c_date_time_constraint
|
557
|
-
V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN
|
558
|
-
|
559
|
-
|
654
|
+
V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN '' {
|
655
|
+
def value
|
656
|
+
V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN.value
|
657
|
+
end
|
658
|
+
}
|
659
|
+
/ date_time_value '' {
|
660
|
+
def value
|
661
|
+
date_time_value.value
|
662
|
+
end
|
663
|
+
}
|
664
|
+
/ date_time_interval_value '' {
|
665
|
+
def value
|
666
|
+
date_time_interval_value.value
|
667
|
+
end
|
668
|
+
}
|
560
669
|
end
|
561
670
|
|
562
671
|
rule c_date_time
|
563
|
-
c_date_time_constraint
|
564
|
-
|
672
|
+
c_date_time_constraint '' {
|
673
|
+
def value
|
674
|
+
c_date_time_constraint.value
|
675
|
+
end
|
676
|
+
}
|
677
|
+
/ c_date_time_constraint ';' date_time_value {
|
678
|
+
def value
|
679
|
+
c_date_time_constraint.value
|
680
|
+
end
|
681
|
+
}
|
565
682
|
end
|
566
683
|
|
567
684
|
rule c_duration_constraint
|
568
|
-
duration_pattern
|
569
|
-
|
570
|
-
|
685
|
+
duration_pattern '' {
|
686
|
+
def value
|
687
|
+
duration_pattern.value
|
688
|
+
end
|
689
|
+
}
|
690
|
+
/ duration_pattern '/' duration_interval_pattern {
|
691
|
+
def value
|
692
|
+
duration_interval_patternl.value
|
693
|
+
end
|
694
|
+
}
|
695
|
+
/ duration_value {
|
696
|
+
def value
|
697
|
+
duration_value.value
|
698
|
+
end
|
699
|
+
}
|
700
|
+
/ duration_interval_value {
|
701
|
+
def value
|
702
|
+
duration_interval_value.value
|
703
|
+
end
|
704
|
+
}
|
571
705
|
end
|
572
706
|
|
573
707
|
rule duration_pattern
|
574
|
-
V_ISO8601_TIME_CONSTRAINT_PATTERN
|
708
|
+
V_ISO8601_TIME_CONSTRAINT_PATTERN '' {
|
709
|
+
def value
|
710
|
+
V_ISO8601_TIME_CONSTRAINT_PATTERN.value
|
711
|
+
end
|
712
|
+
}
|
575
713
|
end
|
576
714
|
|
577
715
|
rule c_duration
|
578
|
-
c_duration_constraint
|
716
|
+
c_duration_constraint '' {
|
717
|
+
def value
|
718
|
+
c_duration_constraint.value
|
719
|
+
end
|
720
|
+
}
|
721
|
+
/ c_duration_constraint ';' duration_value {
|
722
|
+
def value
|
723
|
+
c_duration_constraint.value
|
724
|
+
end
|
725
|
+
}
|
579
726
|
end
|
580
727
|
|
581
728
|
rule c_string_spec
|
@@ -614,20 +761,40 @@ p args[:rm_type_name]
|
|
614
761
|
end
|
615
762
|
|
616
763
|
rule c_boolean_spec
|
617
|
-
SYM_TRUE
|
764
|
+
SYM_TRUE '' {
|
765
|
+
def value
|
766
|
+
{:true_valid => true, :false_valid => false}
|
767
|
+
end
|
768
|
+
}
|
769
|
+
/ SYM_TRUE ',' SYM_FALSE {
|
770
|
+
def value
|
771
|
+
{:true_valid => true, :false_valid => true}
|
772
|
+
end
|
773
|
+
}
|
774
|
+
/ SYM_FALSE '' {
|
775
|
+
def value
|
776
|
+
{:true_valid => false, :false_valid => true}
|
777
|
+
end
|
778
|
+
}
|
779
|
+
/ SYM_FALSE ',' SYM_TRUE {
|
780
|
+
def value
|
781
|
+
{:true_valid => true, :false_valid => true}
|
782
|
+
end
|
618
783
|
}
|
619
|
-
/ SYM_FALSE (',' SYM_TRUE)?
|
620
784
|
end
|
621
785
|
|
622
786
|
rule c_boolean
|
623
787
|
c_boolean_spec ';' boolean_value {
|
624
788
|
def value
|
625
|
-
c_boolean_spec.value
|
789
|
+
c_boolean_spec.value[:assumed_value] = boolean_value.value
|
790
|
+
OpenEHR::AM::Archetype::ConstraintModel::Primitive::CBoolean.new(
|
791
|
+
c_boolean_spec.value)
|
626
792
|
end
|
627
793
|
}
|
628
794
|
/ c_boolean_spec '' {
|
629
795
|
def value
|
630
|
-
|
796
|
+
OpenEHR::AM::Archetype::ConstraintModel::Primitive::CBoolean.new(
|
797
|
+
c_boolean_spec.value)
|
631
798
|
end
|
632
799
|
}
|
633
800
|
end
|
@@ -717,8 +884,7 @@ p args[:rm_type_name]
|
|
717
884
|
boolean_leaf.value
|
718
885
|
end
|
719
886
|
}
|
720
|
-
/ arithmetic_expression (SYM_EQ / SYM_NE / SYM_LT / SYM_GT / SYM_LE / SYM_GE) arithmetic_expression {
|
721
|
-
def value
|
887
|
+
/ arithmetic_expression (SYM_EQ / SYM_NE / SYM_LT / SYM_GT / SYM_LE / SYM_GE) arithmetic_expression { def value
|
722
888
|
p elements
|
723
889
|
end
|
724
890
|
}
|
@@ -35,7 +35,7 @@ module OpenEHR
|
|
35
35
|
rule attr_val
|
36
36
|
attr_id SYM_EQ object_block {
|
37
37
|
def value
|
38
|
-
{attr_id.value
|
38
|
+
{attr_id.value => object_block.value}
|
39
39
|
end
|
40
40
|
}
|
41
41
|
end
|
@@ -105,7 +105,7 @@ module OpenEHR
|
|
105
105
|
rule keyed_object
|
106
106
|
object_key SYM_EQ object_block {
|
107
107
|
def value
|
108
|
-
{object_key.value
|
108
|
+
{object_key.value => object_block.value}
|
109
109
|
end
|
110
110
|
}
|
111
111
|
end
|
@@ -203,9 +203,9 @@ module OpenEHR
|
|
203
203
|
boolean_value.value
|
204
204
|
end
|
205
205
|
}
|
206
|
-
/
|
206
|
+
/ uri_value '' {
|
207
207
|
def value
|
208
|
-
|
208
|
+
uri_value.value
|
209
209
|
end
|
210
210
|
}
|
211
211
|
/ date_value '' {
|
@@ -228,14 +228,14 @@ module OpenEHR
|
|
228
228
|
duration_value.value
|
229
229
|
end
|
230
230
|
}
|
231
|
-
/
|
231
|
+
/ string_value '' {
|
232
232
|
def value
|
233
|
-
|
233
|
+
string_value.value
|
234
234
|
end
|
235
235
|
}
|
236
|
-
/
|
236
|
+
/ character_value '' {
|
237
237
|
def value
|
238
|
-
|
238
|
+
character_value.value
|
239
239
|
end
|
240
240
|
}
|
241
241
|
end
|
@@ -347,9 +347,9 @@ module OpenEHR
|
|
347
347
|
end
|
348
348
|
|
349
349
|
rule uri_value
|
350
|
-
V_URI '' {
|
350
|
+
uri:V_URI '' {
|
351
351
|
def value
|
352
|
-
|
352
|
+
uri.value
|
353
353
|
end
|
354
354
|
}
|
355
355
|
end
|
@@ -18,22 +18,22 @@ module OpenEHR
|
|
18
18
|
end
|
19
19
|
|
20
20
|
rule type_identifier
|
21
|
-
'(' id:
|
21
|
+
'(' id:V_GENERIC_TYPE_IDENTIFIER ')' white_space {
|
22
22
|
def value
|
23
23
|
id.value
|
24
24
|
end
|
25
25
|
}
|
26
|
-
/
|
26
|
+
/ id:V_GENERIC_TYPE_IDENTIFIER white_space {
|
27
27
|
def value
|
28
28
|
id.value
|
29
29
|
end
|
30
30
|
}
|
31
|
-
/ id:V_TYPE_IDENTIFIER white_space {
|
31
|
+
/ '(' id:V_TYPE_IDENTIFIER ')' white_space {
|
32
32
|
def value
|
33
33
|
id.value
|
34
34
|
end
|
35
35
|
}
|
36
|
-
/ id:
|
36
|
+
/ id:V_TYPE_IDENTIFIER white_space {
|
37
37
|
def value
|
38
38
|
id.value
|
39
39
|
end
|
@@ -172,7 +172,7 @@ module OpenEHR
|
|
172
172
|
end
|
173
173
|
|
174
174
|
rule real_value
|
175
|
-
('+' / '-') V_REAL {
|
175
|
+
('+' / '-')? V_REAL {
|
176
176
|
def value
|
177
177
|
text_value.to_f
|
178
178
|
end
|
@@ -253,10 +253,10 @@ module OpenEHR
|
|
253
253
|
:lower_included => false)
|
254
254
|
end
|
255
255
|
}
|
256
|
-
/ SYM_INTERVAL_DELIM SYM_GE real_value SYM_INTERVAL_DELIM {
|
256
|
+
/ SYM_INTERVAL_DELIM SYM_GE lo:real_value SYM_INTERVAL_DELIM {
|
257
257
|
def value
|
258
258
|
OpenEHR::AssumedLibraryTypes::Interval.new(
|
259
|
-
:lower =>
|
259
|
+
:lower => lo.value,
|
260
260
|
:upper_unbounded => true,
|
261
261
|
:lower_included => true)
|
262
262
|
end
|
@@ -839,19 +839,19 @@ module OpenEHR
|
|
839
839
|
end
|
840
840
|
|
841
841
|
rule SYM_GE
|
842
|
-
'=>'
|
842
|
+
'=>' / '>=' white_space
|
843
843
|
end
|
844
844
|
|
845
845
|
rule SYM_LE
|
846
|
-
'<='
|
846
|
+
'<=' / '=>' white_space
|
847
847
|
end
|
848
848
|
|
849
849
|
rule SYM_LT
|
850
|
-
'<'
|
850
|
+
'<' white_space
|
851
851
|
end
|
852
852
|
|
853
853
|
rule SYM_GT
|
854
|
-
'>'
|
854
|
+
'>' white_space
|
855
855
|
end
|
856
856
|
|
857
857
|
rule SYM_START_DBLOCK
|
@@ -1059,7 +1059,7 @@ module OpenEHR
|
|
1059
1059
|
end
|
1060
1060
|
|
1061
1061
|
rule V_URI
|
1062
|
-
[a-z]+ '://' [^<>|\\{}^~"\[\] ]* {
|
1062
|
+
[a-z]+ '://' [^<>|\\{}^~"\[\] ]* {
|
1063
1063
|
def value
|
1064
1064
|
text_value
|
1065
1065
|
end
|
@@ -1139,7 +1139,7 @@ module OpenEHR
|
|
1139
1139
|
end
|
1140
1140
|
|
1141
1141
|
rule V_GENERIC_TYPE_IDENTIFIER
|
1142
|
-
[A-Z] IDCHAR* '<' [a-zA-Z0-9,_
|
1142
|
+
[A-Z] IDCHAR* '<' [a-zA-Z0-9,_]+ '>' { # <>
|
1143
1143
|
def value
|
1144
1144
|
text_value
|
1145
1145
|
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.4"
|
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-22"
|
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 = [
|
@@ -18,7 +18,6 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.files = [
|
19
19
|
".document",
|
20
20
|
"Gemfile",
|
21
|
-
"Gemfile.lock",
|
22
21
|
"Guardfile",
|
23
22
|
"History.txt",
|
24
23
|
"PostInstall.txt",
|
@@ -223,11 +222,22 @@ Gem::Specification.new do |s|
|
|
223
222
|
"spec/lib/open_ehr/parser/adl14/openEHR-EHR-SECTION.reason_for_encounter.v1.adl",
|
224
223
|
"spec/lib/open_ehr/parser/adl14/openEHR-EHR-SECTION.summary.v1.adl",
|
225
224
|
"spec/lib/open_ehr/parser/adl14/openEHR-EHR-SECTION.vital_signs.v1.adl",
|
225
|
+
"spec/lib/open_ehr/parser/adl_archetype_internal_ref2_spec.rb",
|
226
|
+
"spec/lib/open_ehr/parser/adl_archetype_internal_ref_spec.rb",
|
227
|
+
"spec/lib/open_ehr/parser/adl_archetype_internal_ref_with_generics_spec.rb",
|
228
|
+
"spec/lib/open_ehr/parser/adl_archetype_ontology_binding_spec.rb",
|
229
|
+
"spec/lib/open_ehr/parser/adl_archetype_ontology_spec.rb",
|
226
230
|
"spec/lib/open_ehr/parser/adl_description_spec.rb",
|
227
231
|
"spec/lib/open_ehr/parser/adl_identification_spec.rb",
|
232
|
+
"spec/lib/open_ehr/parser/adl_language_no_accreditation_spec.rb",
|
233
|
+
"spec/lib/open_ehr/parser/adl_language_order_spec.rb",
|
234
|
+
"spec/lib/open_ehr/parser/adl_language_spec.rb",
|
235
|
+
"spec/lib/open_ehr/parser/adl_language_translation_author_language_spec.rb",
|
236
|
+
"spec/lib/open_ehr/parser/adl_language_translation_language_author_spec.rb",
|
228
237
|
"spec/lib/open_ehr/parser/adl_parser_spec.rb",
|
229
238
|
"spec/lib/open_ehr/parser/adl_path_spec.rb",
|
230
239
|
"spec/lib/open_ehr/parser/base_spec.rb",
|
240
|
+
"spec/lib/open_ehr/parser/parser_spec_helper.rb",
|
231
241
|
"spec/lib/open_ehr/rm/common/archetyped/archetyped_spec.rb",
|
232
242
|
"spec/lib/open_ehr/rm/common/archetyped/feeder_audit_details_spec.rb",
|
233
243
|
"spec/lib/open_ehr/rm/common/archetyped/feeder_audit_spec.rb",
|
@@ -348,7 +358,7 @@ Gem::Specification.new do |s|
|
|
348
358
|
s.homepage = "http://github.com/skoba/ruby-impl-openehr"
|
349
359
|
s.licenses = ["The openEHR Open Source Software license(mozilla tri-license)"]
|
350
360
|
s.require_paths = ["lib"]
|
351
|
-
s.rubygems_version = "1.8.
|
361
|
+
s.rubygems_version = "1.8.11"
|
352
362
|
s.summary = "Ruby implementation of the openEHR specification"
|
353
363
|
|
354
364
|
if s.respond_to? :specification_version then
|
@@ -14,7 +14,7 @@ describe Archetype do
|
|
14
14
|
definition = stub(CComplexObject, :rm_type_name => 'SECTION')
|
15
15
|
items = {:text => 'Physical examination'}
|
16
16
|
term1 = ArchetypeTerm.new(:code => 'at0000', :items => items)
|
17
|
-
ontology = ArchetypeOntology.new(:specialisation_depth => 1, :term_definitions => {'ja' =>
|
17
|
+
ontology = ArchetypeOntology.new(:specialisation_depth => 1, :term_definitions => {'ja' => {'at0000' =>term1}})
|
18
18
|
uid = HierObjectID.new(:value => 'ABCD::1')
|
19
19
|
parent_archetype_id = ArchetypeID.new(:value => 'openEHR-EHR-SECTION.physical_examination.v1')
|
20
20
|
invariants = stub(Set, :size => 2)
|