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