source: ruby/trunk/lib/adl_parser/test/parser_test.rb@ 317

Last change on this file since 317 was 317, checked in by Tatsukawa, Akimichi, 15 years ago

created remote_adl_test.rb

File size: 10.1 KB
RevLine 
[257]1require File.dirname(__FILE__) + '/test_helper.rb'
[4]2
3class ADLParserTest < Test::Unit::TestCase
4 def setup
[307]5 @parser = ::OpenEhr::ADL::Parser.new
[4]6 end
7
[316]8 must "assert parser instance" do
9 assert_instance_of ::OpenEhr::ADL::Parser,@parser
10 end
[4]11
[316]12 must "openEHR-EHR-SECTION.summary.v1.adl be properly parsed" do
13 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.summary.v1.adl")
14 assert_nothing_raised do
15 ast = @parser.parse(file, 'openEHR-EHR-SECTION.summary.v1')
16 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
17 end
18 end
[257]19
[20]20
[317]21 must "openEHR-EHR-ACTION.referral.v1.adl be properly parsed" do
22 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ACTION.referral.v1.adl")
23 assert_nothing_raised do
24 ast = @parser.parse(file, 'openEHR-EHR-ACTION.referral.v1')
25 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
26 end
27 end
[20]28
[317]29 must "openEHR-EHR-CLUSTER.auscultation-chest.v1.adl be properly parsed" do
30 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.auscultation-chest.v1.adl")
31 assert_nothing_raised do
32 ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.auscultation-chest.v1')
33 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
34 end
35 end
[20]36
[317]37 must "openEHR-EHR-CLUSTER.auscultation.v1.adl be properly parsed" do
38 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.auscultation.v1.adl")
39 assert_nothing_raised do
40 ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.auscultation.v1')
41 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
42 end
43 end
[20]44
45
[317]46 must "openEHR-EHR-CLUSTER.exam-abdomen.v1.adl be properly parsed" do
47 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-abdomen.v1.adl")
48 assert_nothing_raised do
49 ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-abdomen.v1')
50 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
51 end
52 end
[20]53
[317]54 must "openEHR-EHR-CLUSTER.exam-chest.v1.adl be properly parsed" do
55 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-chest.v1.adl")
56 assert_nothing_raised do
57 ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-chest.v1')
58 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
59 end
60 end
[20]61
[317]62 must "openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl be properly parsed" do
63 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl")
64 assert_nothing_raised do
65 ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic-joint.v1')
66 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
67 end
68 end
[20]69
[317]70 must "openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl be properly parsed" do
71 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl")
72 assert_nothing_raised do
73 ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1')
74 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
75 end
76 end
[257]77
[317]78 must "openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl be properly parsed" do
79 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl")
80 assert_nothing_raised do
81 ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic-mass.v1')
82 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
83 end
84 end
[4]85
[317]86 must "openEHR-EHR-CLUSTER.exam-generic.v1.adl be properly parsed" do
87 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic.v1.adl")
88 assert_nothing_raised do
89 ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic.v1')
90 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
91 end
92 end
[258]93
[317]94 must "openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl be properly parsed" do
95 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl")
96 assert_nothing_raised do
97 ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-nervous_system.v1')
98 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
99 end
100 end
[258]101
[317]102 must "openEHR-EHR-COMPOSITION.discharge.v1draft.adl be properly parsed" do
103 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-COMPOSITION.discharge.v1draft.adl")
104 assert_nothing_raised do
105 ast = @parser.parse(file, 'openEHR-EHR-COMPOSITION.discharge.v1draft')
106 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
107 end
108 end
[258]109
[317]110 must "openEHR-EHR-COMPOSITION.encounter.v1draft.adl be properly parsed" do
111 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-COMPOSITION.encounter.v1draft.adl")
112 assert_nothing_raised do
113 ast = @parser.parse(file, 'openEHR-EHR-COMPOSITION.encounter.v1draft')
114 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
115 end
116 end
[258]117
[317]118 must "openEHR-EHR-INSTRUCTION.medication.v1.adl be properly parsed" do
119 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-INSTRUCTION.medication.v1.adl")
120 assert_nothing_raised do
121 ast = @parser.parse(file, 'openEHR-EHR-INSTRUCTION.medication.v1')
122 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
123 end
124 end
[258]125
[317]126 must "openEHR-EHR-INSTRUCTION.referral.v1.adl be properly parsed" do
127 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-INSTRUCTION.referral.v1.adl")
128 assert_nothing_raised do
129 ast = @parser.parse(file, 'openEHR-EHR-INSTRUCTION.referral.v1')
130 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
131 end
132 end
[258]133
[317]134 must "openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl be properly parsed" do
135 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl")
136 assert_nothing_raised do
137 ast = @parser.parse(file, 'openEHR-EHR-ITEM_TREE.Laboratory_request.v1')
138 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
139 end
140 end
[258]141
[283]142
[317]143 must "openEHR-EHR-OBSERVATION.apgar.v1.adl be properly parsed" do
144 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-OBSERVATION.apgar.v1.adl")
145 assert_nothing_raised do
146 ast = @parser.parse(file, 'openEHR-EHR-OBSERVATION.apgar.v1')
147 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
148 end
149 end
[20]150
[317]151 must "openEHR-EHR-SECTION.findings.v1.adl be properly parsed" do
152 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.findings.v1.adl")
153 assert_nothing_raised do
154 ast = @parser.parse(file, 'openEHR-EHR-SECTION.findings.v1')
155 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
156 end
157 end
[20]158
[317]159 must "openEHR-EHR-SECTION.reason_for_encounter.v1.adl be properly parsed" do
160 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.reason_for_encounter.v1.adl")
161 assert_nothing_raised do
162 ast = @parser.parse(file, 'openEHR-EHR-SECTION.reason_for_encounter.v1')
163 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
164 end
165 end
[20]166
[258]167
[317]168 must "openEHR-EHR-SECTION.vital_signs.v1.adl be properly parsed" do
169 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.vital_signs.v1.adl")
170 assert_nothing_raised do
171 ast = @parser.parse(file, 'openEHR-EHR-SECTION.vital_signs.v1')
172 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
173 end
174 end
[258]175
176
[317]177# C_DV_QUANTITY parse error
178 must "openEHR-EHR-EVALUATION.adverse.v1.adl be properly parsed" do
179 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-EVALUATION.adverse.v1.adl")
180 assert_nothing_raised do
181 ast = @parser.parse(file, 'openEHR-EHR-EVALUATION.adverse.v1')
182 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
183 end
184 end
[4]185
[317]186 must "openEHR-EHR-CLUSTER.dimensions-circumference.v1.adl be properly parsed" do
187 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.dimensions-circumference.v1.adl")
188 assert_nothing_raised do
189 ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.dimensions-circumference.v1')
190 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
191 end
192 end
[20]193
[317]194 must "openEHR-EHR-CLUSTER.dimensions.v1.adl be properly parsed" do
195 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.dimensions.v1.adl")
196 assert_nothing_raised do
197 ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.dimensions.v1')
198 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
199 end
200 end
[4]201
[317]202 must "openEHR-EHR-CLUSTER.exam-fetus.v1.adl be properly parsed" do
203 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-fetus.v1.adl")
204 assert_nothing_raised do
205 ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-fetus.v1')
206 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
207 end
208 end
[20]209
[317]210 must "openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl be properly parsed" do
211 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl")
212 assert_nothing_raised do
213 ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-uterine_cervix.v1')
214 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
215 end
216 end
[315]217
[317]218 must "openEHR-EHR-OBSERVATION.body_mass_index.v1.adl be properly parsed" do
219 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-OBSERVATION.body_mass_index.v1.adl")
220 assert_nothing_raised do
221 ast = @parser.parse(file, 'openEHR-EHR-OBSERVATION.body_mass_index.v1')
222 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
223 end
224 end
[283]225
[317]226 must "openEHR-EHR-ACTION.imaging.v1.adl be properly parsed" do
227 file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ACTION.imaging.v1.adl")
228 assert_nothing_raised do
229 ast = @parser.parse(file, 'openEHR-EHR-ACTION.imaging.v1')
230 assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
231 end
232 end
[283]233
[4]234end
Note: See TracBrowser for help on using the repository browser.