[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 |
|
---|
[321] | 8 | must "assert parser instance" do
|
---|
| 9 | assert_instance_of ::OpenEhr::ADL::Parser,@parser
|
---|
| 10 | end
|
---|
[4] | 11 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
[321] | 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 |
|
---|
| 169 |
|
---|
| 170 |
|
---|
[321] | 171 | # C_DV_QUANTITY parse error
|
---|
| 172 | must "openEHR-EHR-EVALUATION.adverse.v1.adl be properly parsed" do
|
---|
| 173 | file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-EVALUATION.adverse.v1.adl")
|
---|
| 174 | assert_nothing_raised do
|
---|
| 175 | ast = @parser.parse(file, 'openEHR-EHR-EVALUATION.adverse.v1')
|
---|
| 176 | assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
|
---|
| 177 | end
|
---|
| 178 | end
|
---|
[4] | 179 |
|
---|
[321] | 180 | must "openEHR-EHR-CLUSTER.dimensions-circumference.v1.adl be properly parsed" do
|
---|
| 181 | file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.dimensions-circumference.v1.adl")
|
---|
| 182 | assert_nothing_raised do
|
---|
| 183 | ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.dimensions-circumference.v1')
|
---|
| 184 | assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
|
---|
| 185 | end
|
---|
| 186 | end
|
---|
[20] | 187 |
|
---|
[321] | 188 | must "openEHR-EHR-CLUSTER.dimensions.v1.adl be properly parsed" do
|
---|
| 189 | file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.dimensions.v1.adl")
|
---|
| 190 | assert_nothing_raised do
|
---|
| 191 | ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.dimensions.v1')
|
---|
| 192 | assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
|
---|
| 193 | end
|
---|
| 194 | end
|
---|
[4] | 195 |
|
---|
[321] | 196 | must "openEHR-EHR-CLUSTER.exam-fetus.v1.adl be properly parsed" do
|
---|
| 197 | file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-fetus.v1.adl")
|
---|
| 198 | assert_nothing_raised do
|
---|
| 199 | ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-fetus.v1')
|
---|
| 200 | assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
|
---|
| 201 | end
|
---|
| 202 | end
|
---|
[20] | 203 |
|
---|
[321] | 204 | must "openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl be properly parsed" do
|
---|
| 205 | file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl")
|
---|
| 206 | assert_nothing_raised do
|
---|
| 207 | ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-uterine_cervix.v1')
|
---|
| 208 | assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
|
---|
| 209 | end
|
---|
| 210 | end
|
---|
[315] | 211 |
|
---|
[321] | 212 | must "openEHR-EHR-OBSERVATION.body_mass_index.v1.adl be properly parsed" do
|
---|
| 213 | file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-OBSERVATION.body_mass_index.v1.adl")
|
---|
| 214 | assert_nothing_raised do
|
---|
| 215 | ast = @parser.parse(file, 'openEHR-EHR-OBSERVATION.body_mass_index.v1')
|
---|
| 216 | assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
|
---|
| 217 | end
|
---|
| 218 | end
|
---|
[283] | 219 |
|
---|
[321] | 220 | must "openEHR-EHR-ACTION.imaging.v1.adl be properly parsed" do
|
---|
| 221 | file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ACTION.imaging.v1.adl")
|
---|
| 222 | assert_nothing_raised do
|
---|
| 223 | ast = @parser.parse(file, 'openEHR-EHR-ACTION.imaging.v1')
|
---|
| 224 | assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
|
---|
| 225 | end
|
---|
| 226 | end
|
---|
[283] | 227 |
|
---|
[321] | 228 | must "openEHR-EHR-COMPOSITION.encounter.v1draft.adl be properly parsed" do
|
---|
| 229 | file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-COMPOSITION.encounter.v1draft.adl")
|
---|
| 230 | assert_nothing_raised do
|
---|
| 231 | ast = @parser.parse(file, 'openEHR-EHR-COMPOSITION.encounter.v1draft')
|
---|
| 232 | assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
|
---|
| 233 | end
|
---|
| 234 | end
|
---|
[318] | 235 |
|
---|
[321] | 236 | must "openEHR-EHR-ITEM_TREE.follow_up.v1draft.adl be properly parsed" do
|
---|
| 237 | file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.follow_up.v1draft.adl")
|
---|
| 238 | assert_nothing_raised do
|
---|
| 239 | ast = @parser.parse(file, 'openEHR-EHR-ITEM_TREE.follow_up.v1draft')
|
---|
| 240 | assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
|
---|
| 241 | end
|
---|
| 242 | end
|
---|
[318] | 243 |
|
---|
[321] | 244 | must "openEHR-EHR-SECTION.vital_signs.v1.adl be properly parsed" do
|
---|
| 245 | file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.vital_signs.v1.adl")
|
---|
| 246 | assert_nothing_raised do
|
---|
| 247 | ast = @parser.parse(file, 'openEHR-EHR-SECTION.vital_signs.v1')
|
---|
| 248 | assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
|
---|
| 249 | end
|
---|
| 250 | end
|
---|
[319] | 251 |
|
---|
[321] | 252 | must "openEHR-EHR-ITEM_TREE.medication-formulation.v1.adl be properly parsed" do
|
---|
| 253 | file = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.medication-formulation.v1.adl")
|
---|
| 254 | assert_nothing_raised do
|
---|
| 255 | ast = @parser.parse(file, 'openEHR-EHR-ITEM_TREE.medication-formulation.v1')
|
---|
| 256 | assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
|
---|
| 257 | end
|
---|
| 258 | end
|
---|
| 259 |
|
---|
| 260 | must "adl-test-ENTRY.basic_types.v1.adl be properly parsed" do
|
---|
| 261 | file = File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.basic_types.v1.adl")
|
---|
| 262 | assert_nothing_raised do
|
---|
| 263 | ast = @parser.parse(file, 'adl-test-ENTRY.basic_types.v1')
|
---|
| 264 | assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
|
---|
| 265 | end
|
---|
| 266 | end
|
---|
| 267 |
|
---|
| 268 |
|
---|
[319] | 269 | must "adl-test-ENTRY.assumed_types.v1.adl be properly parsed" do
|
---|
| 270 | file = File.read("#{TEST_ROOT_DIR}/adl/adl-test-ENTRY.assumed_types.v1.adl")
|
---|
[318] | 271 | assert_nothing_raised do
|
---|
[319] | 272 | ast = @parser.parse(file, 'adl-test-ENTRY.assumed_types.v1')
|
---|
[318] | 273 | assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
|
---|
| 274 | end
|
---|
| 275 | end
|
---|
| 276 |
|
---|
[4] | 277 | end
|
---|