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