open_ehr 0.9.5 → 1.0.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 (98) hide show
  1. data/History.txt +3 -0
  2. data/README.rdoc +35 -25
  3. data/VERSION +1 -1
  4. data/lib/open_ehr.rb +2 -3
  5. data/lib/open_ehr/am.rb +1 -2
  6. data/lib/open_ehr/am/openehr_profile.rb +0 -1
  7. data/lib/open_ehr/am/openehr_profile/data_types.rb +2 -1
  8. data/lib/open_ehr/am/openehr_profile/data_types/basic.rb +88 -1
  9. data/lib/open_ehr/am/openehr_profile/data_types/quantity.rb +51 -2
  10. data/lib/open_ehr/am/openehr_profile/data_types/text.rb +2 -2
  11. data/lib/open_ehr/assumed_library_types.rb +5 -0
  12. data/lib/open_ehr/parser/adl.rb +5 -5
  13. data/lib/open_ehr/parser/adl_grammar.tt +13 -16
  14. data/lib/open_ehr/parser/adl_parser.rb +13 -5
  15. data/lib/open_ehr/parser/cadl_grammar.tt +247 -31
  16. data/lib/open_ehr/parser/cadl_node.rb +25 -0
  17. data/lib/open_ehr/parser/dadl_grammar.tt +6 -6
  18. data/lib/open_ehr/parser/shared_token_grammar.tt +14 -5
  19. data/lib/open_ehr/rm.rb +1 -2
  20. data/lib/open_ehr/rm/composition/content/entry.rb +8 -1
  21. data/lib/open_ehr/rm/data_types.rb +2 -2
  22. data/lib/open_ehr/rm/data_types/quantity.rb +1 -2
  23. data/lib/open_ehr/rm/data_types/quantity/date_time.rb +8 -5
  24. data/lib/open_ehr/rm/data_types/text.rb +7 -6
  25. data/lib/open_ehr/rm/support/identification.rb +13 -9
  26. data/open_ehr.gemspec +34 -4
  27. data/spec/lib/open_ehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb +34 -0
  28. data/spec/lib/open_ehr/am/openehr_profile/data_types/basic/non_terminal_state_spec.rb +36 -0
  29. data/spec/lib/open_ehr/am/openehr_profile/data_types/basic/state_machine_spec.rb +34 -0
  30. data/spec/lib/open_ehr/am/openehr_profile/data_types/basic/state_spec.rb +26 -0
  31. data/spec/lib/open_ehr/am/openehr_profile/data_types/basic/terminal_state_spec.rb +18 -0
  32. data/spec/lib/open_ehr/am/openehr_profile/data_types/basic/transition_spec.rb +62 -0
  33. data/spec/lib/open_ehr/am/openehr_profile/data_types/quantity/c_dv_ordinal_spec.rb +41 -0
  34. data/spec/lib/open_ehr/am/openehr_profile/data_types/quantity/c_dv_quantity_spec.rb +50 -0
  35. data/spec/lib/open_ehr/am/openehr_profile/data_types/quantity/c_quantity_item_spec.rb +46 -0
  36. data/spec/lib/open_ehr/am/openehr_profile/data_types/text/c_code_phrase_spec.rb +0 -1
  37. data/spec/lib/open_ehr/assumed_library_types/interval_spec.rb +5 -0
  38. data/spec/lib/open_ehr/parser/adl14/adl-test-composition.dv_coded_text.test.adl +1 -1
  39. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.archetype_desc_missing_purpose.test.adl +1 -1
  40. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.c_dv_ordinal.test.adl +1 -1
  41. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.c_dv_quantity_empty.test.adl +1 -1
  42. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.c_dv_quantity_full.test.adl +1 -1
  43. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.c_dv_quantity_full2.test.adl +1 -1
  44. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.c_dv_quantity_full3.test.adl +1 -1
  45. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.c_dv_quantity_item_units_only.test.adl +1 -1
  46. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.c_dv_quantity_list.test.adl +1 -1
  47. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.c_dv_quantity_property.test.adl +1 -1
  48. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.c_dv_quantity_reversed.test.adl +1 -1
  49. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.constraint_binding.test.adl +1 -1
  50. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.constraint_ref.test.adl +1 -1
  51. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.empty_other_contributors.test.adl +1 -1
  52. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.missing_language.test.adl +1 -1
  53. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.mixed_node_types.draft.adl +1 -1
  54. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.most_minimal.test.adl +1 -1
  55. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.multi_language.test.adl +1 -1
  56. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.special_string.test.adl +1 -1
  57. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.structure_test1.test.adl +1 -1
  58. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.structure_test2.test.adl +1 -1
  59. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.term_binding.test.adl +1 -1
  60. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.term_binding2.test.adl +1 -1
  61. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.unicode_BOM_support.test.adl +1 -1
  62. data/spec/lib/open_ehr/parser/adl14/adl-test-entry.unicode_support.test.adl +1 -1
  63. data/spec/lib/open_ehr/parser/adl_archetype_ontology_binding_spec.rb +3 -3
  64. data/spec/lib/open_ehr/parser/c_dv_quantity_any_allowed_spec.rb +34 -0
  65. data/spec/lib/open_ehr/parser/c_dv_quantity_shared_example_for_lacked_items_spec.rb +36 -0
  66. data/spec/lib/open_ehr/parser/c_dv_quantity_shared_example_spec.rb +146 -0
  67. data/spec/lib/open_ehr/parser/cdv_ordinal_parse_spec.rb +231 -0
  68. data/spec/lib/open_ehr/parser/code_phrase_spec.rb +7 -2
  69. data/spec/lib/open_ehr/parser/constraint_binding_spec.rb +26 -0
  70. data/spec/lib/open_ehr/parser/constraint_ref_spec.rb +32 -0
  71. data/spec/lib/open_ehr/parser/dv_coded_text_parse_spec.rb +27 -0
  72. data/spec/lib/open_ehr/parser/empty_other_contributors_spec.rb +19 -0
  73. data/spec/lib/open_ehr/parser/missing_language_spec.rb +20 -0
  74. data/spec/lib/open_ehr/parser/missing_purpose_spec.rb +23 -0
  75. data/spec/lib/open_ehr/parser/mixed_node_types_spec.rb +16 -0
  76. data/spec/lib/open_ehr/parser/most_minimal_adl_spec.rb +19 -0
  77. data/spec/lib/open_ehr/parser/multi_language_spec.rb +58 -0
  78. data/spec/lib/open_ehr/parser/path_based_terminology_binding_spec.rb +30 -0
  79. data/spec/lib/open_ehr/parser/special_string_spec.rb +20 -0
  80. data/spec/lib/open_ehr/parser/structure_comment_spec.rb +21 -0
  81. data/spec/lib/open_ehr/parser/structure_nested_comments_spec.rb +22 -0
  82. data/spec/lib/open_ehr/parser/structure_spec.rb +202 -0
  83. data/spec/lib/open_ehr/parser/term_binding_spec.rb +54 -0
  84. data/spec/lib/open_ehr/parser/unicode_bom_spec.rb +17 -0
  85. data/spec/lib/open_ehr/parser/unicode_support_spec.rb +46 -0
  86. data/spec/lib/open_ehr/rm/common/change_control/imported_version_spec.rb +0 -1
  87. data/spec/lib/open_ehr/rm/common/change_control/original_version_spec.rb +2 -2
  88. data/spec/lib/open_ehr/rm/common/change_control/version_spec.rb +0 -1
  89. data/spec/lib/open_ehr/rm/common/change_control/versioned_object_spec.rb +0 -1
  90. data/spec/lib/open_ehr/rm/common/generic/revision_history_item_spec.rb +3 -3
  91. data/spec/lib/open_ehr/rm/composition/content/entry/entry_spec.rb +12 -2
  92. data/spec/lib/open_ehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb +1 -0
  93. data/spec/lib/open_ehr/rm/data_types/quantity/date_time/{dv_tempral_spec.rb → dv_temporal_spec.rb} +1 -0
  94. data/spec/lib/open_ehr/rm/data_types/text/dv_text_spec.rb +25 -3
  95. data/spec/lib/open_ehr/rm/demographic/party_spec.rb +1 -3
  96. data/spec/lib/open_ehr/rm/support/identification/access_group_ref_spec.rb +2 -2
  97. data/spec/lib/open_ehr/rm/support/identification/object_version_id_spec.rb +3 -4
  98. metadata +69 -39
@@ -0,0 +1,62 @@
1
+ # ticket 197
2
+ require File.dirname(__FILE__) + '/../../../../../../spec_helper'
3
+ require 'open_ehr/am/openehr_profile/data_types/basic'
4
+ include ::OpenEHR::AM::OpenEHRProfile::DataTypes::Basic
5
+
6
+ describe Transition do
7
+ before(:each) do
8
+ next_state = State.new(:name => 'IN_EXECUTION')
9
+ @transition = Transition.new(:event => 'start',
10
+ :guard => 'PROPOSED',
11
+ :action => 'order',
12
+ :next_state => next_state)
13
+ end
14
+
15
+ it 'is an instance of TerminalState' do
16
+ @transition.should be_an_instance_of Transition
17
+ end
18
+
19
+ it 'event start' do
20
+ @transition.event.should == 'start'
21
+ end
22
+
23
+ it 'guard is PROPOSED' do
24
+ @transition.guard.should == 'PROPOSED'
25
+ end
26
+
27
+ it 'action is order' do
28
+ @transition.action.should == 'order'
29
+ end
30
+
31
+ it 'next state is named IN_EXECUTION' do
32
+ @transition.next_state.name.should == 'IN_EXECUTION'
33
+ end
34
+
35
+ it 'raise error if event is nil' do
36
+ expect {@transition.event = nil}.to raise_error
37
+ end
38
+
39
+ it 'raise error if event is empty' do
40
+ expect {@transition.event = ''}.to raise_error
41
+ end
42
+
43
+ it 'does not raise error if guard is nil' do
44
+ expect {@transition.guard = nil}.to_not raise_error
45
+ end
46
+
47
+ it 'raise error if action is empty' do
48
+ expect {@transition.guard = ''}.to raise_error
49
+ end
50
+
51
+ it 'does not raise error if action is nil' do
52
+ expect {@transition.action = nil}.to_not raise_error
53
+ end
54
+
55
+ it 'raise error if action is empty' do
56
+ expect {@transition.action = ''}.to raise_error
57
+ end
58
+
59
+ it 'raise error if next_state is nil' do
60
+ expect {@transition.next_state = nil}.to raise_error
61
+ end
62
+ end
@@ -0,0 +1,41 @@
1
+ require File.dirname(__FILE__) + '/../../../../../../spec_helper'
2
+ require 'open_ehr/am/openehr_profile/data_types/quantity'
3
+ include ::OpenEHR::AM::OpenEHRProfile::DataTypes::Quantity
4
+ require 'open_ehr/rm/data_types/quantity'
5
+ include ::OpenEHR::RM::DataTypes::Quantity
6
+ include ::OpenEHR::RM::DataTypes::Text
7
+ include OpenEHR::AssumedLibraryTypes
8
+
9
+ describe CDvOrdinal do
10
+ before(:each) do
11
+ occurrences = Interval.new(:upper => 1, :lower => 1)
12
+ symbol = stub(DvCodedText, :code_string => 'AML')
13
+ list = [DvOrdinal.new(:value => 1,:symbol => symbol)]
14
+ @c_dv_ordinal = CDvOrdinal.new(:list => list,
15
+ :path => 'value/ordinal',
16
+ :occurrences => occurrences,
17
+ :rm_type_name => 'DvOrdinal')
18
+
19
+ end
20
+
21
+ it 'is an instance of CDvOrdinal' do
22
+ @c_dv_ordinal.should be_an_instance_of CDvOrdinal
23
+ end
24
+
25
+ it 'inherits DvDomain class, path is value/ordinal' do
26
+ @c_dv_ordinal.path.should == 'value/ordinal'
27
+ end
28
+
29
+ it '1st of list valie is 1' do
30
+ @c_dv_ordinal.list[0].value.should == 1
31
+ end
32
+
33
+ it 'symbol code string is AML' do
34
+ @c_dv_ordinal.list[0].symbol.code_string.should == 'AML'
35
+ end
36
+
37
+ it 'list is empty then any_allowed is true' do
38
+ @c_dv_ordinal.list = nil
39
+ @c_dv_ordinal.should be_any_allowed
40
+ end
41
+ end
@@ -0,0 +1,50 @@
1
+ # ticket 199
2
+ require File.dirname(__FILE__) + '/../../../../../../spec_helper'
3
+ include ::OpenEHR::AM::OpenEHRProfile::DataTypes::Quantity
4
+ include ::OpenEHR::RM::DataTypes::Text
5
+ include OpenEHR::AssumedLibraryTypes
6
+
7
+ describe CDvQuantity do
8
+ before(:each) do
9
+ occurrences = Interval.new(:upper => 1, :lower => 1)
10
+ property = stub(CodePhrase, :code_string => 'AML')
11
+ list = [CQuantityItem.new(:magnitude => 10, :units => 'mg')]
12
+ @c_dv_quantity = CDvQuantity.new(:list => list,
13
+ :path => 'value/quantity',
14
+ :property => property,
15
+ :occurrences => occurrences,
16
+ :rm_type_name => 'DvQuantity')
17
+
18
+ end
19
+
20
+ it 'is an instance of CDvQuantity' do
21
+ @c_dv_quantity.should be_an_instance_of CDvQuantity
22
+ end
23
+
24
+ it 'path is value/quantity' do
25
+ @c_dv_quantity.path.should == 'value/quantity'
26
+ end
27
+
28
+ it 'property code string is AML' do
29
+ @c_dv_quantity.property.code_string.should == 'AML'
30
+ end
31
+
32
+ it 'first item of list is 10mg' do
33
+ @c_dv_quantity.list[0].magnitude.should be 10
34
+ end
35
+
36
+ it 'is not any allowed' do
37
+ @c_dv_quantity.should_not be_any_allowed
38
+ end
39
+
40
+ context 'list and property are not assigned' do
41
+ before(:each) do
42
+ @c_dv_quantity.list = nil
43
+ @c_dv_quantity.property = nil
44
+ end
45
+
46
+ it 'is any allowed' do
47
+ @c_dv_quantity.should be_any_allowed
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,46 @@
1
+ # ticket 203
2
+ include OpenEHR::AssumedLibraryTypes
3
+ include OpenEHR::AM::OpenEHRProfile::DataTypes::Quantity
4
+
5
+ describe CQuantityItem do
6
+ before(:each) do
7
+ magnitude = Interval.new(:upper => 100, :lower => 0)
8
+ precision = Interval.new(:upper => 10, :lower => 2)
9
+ @c_quantity_item = CQuantityItem.new(:units => 'mg',
10
+ :magnitude => magnitude,
11
+ :precision => precision)
12
+ end
13
+
14
+ it 'is an instance of CQuantityItem' do
15
+ @c_quantity_item.should be_an_instance_of CQuantityItem
16
+ end
17
+
18
+ it 'magnitude upper is 100' do
19
+ @c_quantity_item.magnitude.upper.should be 100
20
+ end
21
+
22
+ it 'precision lower is -2' do
23
+ @c_quantity_item.precision.lower.should be 2
24
+ end
25
+
26
+ it 'units is not nil' do
27
+ expect {@c_quantity_item.units = nil}.to raise_error
28
+ end
29
+
30
+ it 'units is not be empty' do
31
+ expect {@c_quantity_item.units = ''}.to raise_error
32
+ end
33
+
34
+ it 'is not precision unconstrained' do
35
+ @c_quantity_item.should_not be_precision_unconstrained
36
+ end
37
+ context 'precision unconstrained' do
38
+ before(:each) do
39
+ @c_quantity_item.precision = Interval.new(:upper => -1, :lower => -1)
40
+ end
41
+
42
+ it 'precision unconstrained is true' do
43
+ @c_quantity_item.should be_precision_unconstrained
44
+ end
45
+ end
46
+ end
@@ -1,5 +1,4 @@
1
1
  require File.dirname(__FILE__) + '/../../../../../../spec_helper'
2
-
3
2
  include ::OpenEHR::RM::DataTypes::Text
4
3
  include ::OpenEHR::AssumedLibraryTypes
5
4
  include ::OpenEHR::RM::Support::Identification
@@ -51,6 +51,11 @@ describe Interval do
51
51
  @interval.has?(1).should_not be_true
52
52
  end
53
53
 
54
+ it 'should be equal lower and upper is same' do
55
+ interval = Interval.new(:upper => 10, :lower => 1)
56
+ @interval.should == interval
57
+ end
58
+
54
59
  describe Interval, 'when lower included' do
55
60
  before do
56
61
  @interval.lower_included = true
@@ -1,5 +1,5 @@
1
1
  archetype (adl_version=1.4)
2
- openEHR-EHR-COMPOSITION.dv_coded_text.test
2
+ openEHR-EHR-COMPOSITION.dv_coded_text.v1
3
3
 
4
4
  concept
5
5
  [at0000] -- Problem list
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.archetype_description_missing_purpose.draft
2
+ adl-test-ENTRY.archetype_description_missing_purpose.v1
3
3
 
4
4
  concept
5
5
  [at0000] -- test
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.c_dv_ordinal.test
2
+ adl-test-ENTRY.c_dv_ordinal.v1
3
3
 
4
4
  concept
5
5
  [at0000]
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.c_dv_quantity_empty.test
2
+ adl-test-ENTRY.c_dv_quantity_empty.v1
3
3
 
4
4
  concept
5
5
  [at0000]
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.c_dv_quantity.test
2
+ adl-test-ENTRY.c_dv_quantity.v1
3
3
 
4
4
  concept
5
5
  [at0000]
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.c_dv_quantity.test
2
+ adl-test-ENTRY.c_dv_quantity.v1
3
3
 
4
4
  concept
5
5
  [at0000]
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.c_dv_quantity.test
2
+ adl-test-ENTRY.c_dv_quantity.v1
3
3
 
4
4
  concept
5
5
  [at0000]
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.c_dv_quantity.test
2
+ adl-test-ENTRY.c_dv_quantity.v1
3
3
 
4
4
  concept
5
5
  [at0000]
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.c_dv_quantity.test
2
+ adl-test-ENTRY.c_dv_quantity.v1
3
3
 
4
4
  concept
5
5
  [at0000]
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.c_dv_quantity.test
2
+ adl-test-ENTRY.c_dv_quantity.v1
3
3
 
4
4
  concept
5
5
  [at0000]
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.c_dv_quantity.test
2
+ adl-test-ENTRY.c_dv_quantity.v1
3
3
 
4
4
  concept
5
5
  [at0000]
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.constraint_binding.draft
2
+ adl-test-ENTRY.constraint_binding.v1
3
3
  concept
4
4
  [at0000] -- empty definition test
5
5
 
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.c_code_phrase.test
2
+ adl-test-ENTRY.c_code_phrase.v1
3
3
 
4
4
  concept
5
5
  [at0000]
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.empty_other_contributors.draft
2
+ adl-test-ENTRY.empty_other_contributors.v1
3
3
 
4
4
  concept
5
5
  [at0000] -- test
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.missing_language.draft
2
+ adl-test-ENTRY.missing_language.v1
3
3
 
4
4
  concept
5
5
  [at0000] -- testing missing language compatibility
@@ -1,5 +1,5 @@
1
1
  archetype (adl_version=1.4)
2
- adl-test-OUTER.mixed_types.draft
2
+ adl-test-OUTER.mixed_types.v1
3
3
 
4
4
  concept
5
5
  [at0000] -- outer object
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.most_minimal.draft
2
+ adl-test-ENTRY.most_minimal.v1
3
3
 
4
4
  concept
5
5
  [at0000] -- empty definition test
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.multi-language.draft
2
+ adl-test-ENTRY.multi-language.v1
3
3
  concept
4
4
  [at0000] -- empty definition test
5
5
 
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.test.draft
2
+ adl-test-ENTRY.test.v1
3
3
 
4
4
  concept
5
5
  [at0000] -- basic data types test 1
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.structure_test1.draft
2
+ adl-test-ENTRY.structure_test1.v1
3
3
  concept
4
4
  [at0000] -- structure test 1
5
5
  language
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.structure_test1.draft
2
+ adl-test-ENTRY.structure_test1.v1
3
3
  concept
4
4
  [at0000] -- structure test 1
5
5
  language
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.term_binding.draft
2
+ adl-test-ENTRY.term_binding.v1
3
3
  concept
4
4
  [at0000] -- empty definition test
5
5
  language
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.term_binding.draft
2
+ adl-test-ENTRY.term_binding.v1
3
3
  concept
4
4
  [at0000] -- path-based binding test
5
5
  language
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.unicode_BOM_support.draft
2
+ adl-test-ENTRY.unicode_BOM_support.v1
3
3
  concept
4
4
  [at0000] -- empty definition test
5
5
  language
@@ -1,5 +1,5 @@
1
1
  archetype
2
- adl-test-ENTRY.unicode_support.draft
2
+ adl-test-ENTRY.unicode_support.v1
3
3
  concept
4
4
  [at0000] -- empty definition test
5
5
  language
@@ -78,11 +78,11 @@ describe ADLParser do
78
78
  end
79
79
 
80
80
  it 'terminology id is SNOMED-CT' do
81
- @term.terminology_id.value.should == 'SNOMED-CT'
81
+ @term[0].terminology_id.value.should == 'SNOMED-CT'
82
82
  end
83
83
 
84
84
  it 'code_string is 123456' do
85
- @term.code_string.should == '123456'
85
+ @term[0].code_string.should == '123456'
86
86
  end
87
87
  end
88
88
  end
@@ -90,7 +90,7 @@ describe ADLParser do
90
90
  context 'constraint bindings' do
91
91
  it 'terminology SNOMED-CT, constraint code is ac0001' do
92
92
  @ontology.constraint_binding(:terminology => 'SNOMED-CT',
93
- :code => 'ac0001').should ==
93
+ :code => 'ac0001').value.should ==
94
94
  'http://openEHR.org/testconstraintbinding'
95
95
  end
96
96
  end
@@ -0,0 +1,34 @@
1
+ # ticket 174
2
+ require File.dirname(__FILE__) + '/../../../spec_helper'
3
+ require File.dirname(__FILE__) + '/parser_spec_helper'
4
+ require 'open_ehr/am/openehr_profile/data_types/quantity'
5
+ include ::OpenEHR::AM::OpenEHRProfile::DataTypes::Quantity
6
+ require 'open_ehr/rm/data_types/quantity'
7
+ include ::OpenEHR::RM::DataTypes::Quantity
8
+
9
+ describe 'CDvQuantity empty' do
10
+ before(:all) do
11
+ archetype = adl14_archetype('adl-test-entry.c_dv_quantity_empty.test.adl')
12
+ @c_dv_quantity = archetype.definition.attributes[0].children[0].attributes[0].children[0].attributes[0].children[0]
13
+ end
14
+
15
+ it 'is an instance of CDvQuantity' do
16
+ @c_dv_quantity.should be_an_instance_of CDvQuantity
17
+ end
18
+
19
+ it 'list is nil' do
20
+ @c_dv_quantity.list.should be_nil
21
+ end
22
+
23
+ it 'property is nil' do
24
+ @c_dv_quantity.property.should be_nil
25
+ end
26
+
27
+ it 'assumed value is nil' do
28
+ @c_dv_quantity.assumed_value.should be_nil
29
+ end
30
+
31
+ it 'is any allowed' do
32
+ @c_dv_quantity.should be_any_allowed
33
+ end
34
+ end