Ignore:
Timestamp:
Sep 27, 2009, 9:24:19 PM (15 years ago)
Author:
Tatsukawa, Akimichi
Message:

ADL parser is roughly coupled with open_ehr model classes

Location:
ruby/trunk/lib/adl_parser/test
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/adl_parser/test/parser_test.rb

    r291 r307  
    33class ADLParserTest < Test::Unit::TestCase
    44  def setup
    5     @parser = ::OpenEHR::ADL::Parser.new
     5    @parser = ::OpenEhr::ADL::Parser.new
    66  end
    77
    88  must "assert parser instance" do
    9     assert_instance_of ::OpenEHR::ADL::Parser,@parser
    10   end
    11 
    12   must "test_archetype_id.adl be properly parsed" do
    13     file =  File.read("#{TEST_ROOT_DIR}/adl/test_archetype_id.adl")
     9    assert_instance_of ::OpenEhr::ADL::Parser,@parser
     10  end
     11
     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")
    1414    assert_nothing_raised do
    1515      ast = @parser.parse(file, 'openEHR-EHR-SECTION.summary.v1')
    16       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     16      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    1717    end
    1818  end
     
    2222    assert_nothing_raised do
    2323      ast = @parser.parse(file, 'openEHR-EHR-ACTION.imaging.v1')
    24       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     24      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    2525    end
    2626  end
     
    3030    assert_nothing_raised do
    3131      ast = @parser.parse(file, 'openEHR-EHR-ACTION.referral.v1')
    32       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     32      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    3333    end
    3434  end
     
    3838    assert_nothing_raised do
    3939      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.auscultation-chest.v1')
    40       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     40      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    4141    end
    4242  end
     
    4646    assert_nothing_raised do
    4747      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.auscultation.v1')
    48       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     48      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    4949    end
    5050  end
     
    5555    assert_nothing_raised do
    5656      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-abdomen.v1')
    57       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     57      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    5858    end
    5959  end
     
    6363    assert_nothing_raised do
    6464      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-chest.v1')
    65       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     65      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    6666    end
    6767  end
     
    7171    assert_nothing_raised do
    7272      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic-joint.v1')
    73       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     73      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    7474    end
    7575  end
     
    7979    assert_nothing_raised do
    8080      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1')
    81       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     81      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    8282    end
    8383  end
     
    8787    assert_nothing_raised do
    8888      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic-mass.v1')
    89       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     89      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    9090    end
    9191  end
     
    9595    assert_nothing_raised do
    9696      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-generic.v1')
    97       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     97      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    9898    end
    9999  end
     
    103103    assert_nothing_raised do
    104104      ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-nervous_system.v1')
    105       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     105      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    106106    end
    107107  end
     
    111111    assert_nothing_raised do
    112112      ast = @parser.parse(file, 'openEHR-EHR-COMPOSITION.discharge.v1draft')
    113       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     113      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    114114    end
    115115  end
     
    119119    assert_nothing_raised do
    120120      ast = @parser.parse(file, 'openEHR-EHR-COMPOSITION.encounter.v1draft')
    121       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     121      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    122122    end
    123123  end
     
    127127    assert_nothing_raised do
    128128      ast = @parser.parse(file, 'openEHR-EHR-INSTRUCTION.medication.v1')
    129       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     129      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    130130    end
    131131  end
     
    135135    assert_nothing_raised do
    136136      ast = @parser.parse(file, 'openEHR-EHR-INSTRUCTION.referral.v1')
    137       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     137      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    138138    end
    139139  end
     
    143143    assert_nothing_raised do
    144144      ast = @parser.parse(file, 'openEHR-EHR-ITEM_TREE.Laboratory_request.v1')
    145       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     145      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    146146    end
    147147  end
     
    152152    assert_nothing_raised do
    153153      ast = @parser.parse(file, 'openEHR-EHR-OBSERVATION.apgar.v1')
    154       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     154      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    155155    end
    156156  end
     
    160160    assert_nothing_raised do
    161161      ast = @parser.parse(file, 'openEHR-EHR-SECTION.findings.v1')
    162       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     162      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    163163    end
    164164  end
     
    168168    assert_nothing_raised do
    169169      ast = @parser.parse(file, 'openEHR-EHR-SECTION.reason_for_encounter.v1')
    170       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     170      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    171171    end
    172172  end
     
    177177    assert_nothing_raised do
    178178      ast = @parser.parse(file, 'openEHR-EHR-SECTION.vital_signs.v1')
    179       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     179      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    180180    end
    181181  end
     
    187187#     assert_nothing_raised do
    188188#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.dimensions-circumference.v1')
    189 #       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     189#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    190190#     end
    191191#   end
     
    195195#     assert_nothing_raised do
    196196#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.dimensions.v1')
    197 #       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     197#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    198198#     end
    199199#   end
     
    203203#     assert_nothing_raised do
    204204#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-fetus.v1')
    205 #       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     205#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    206206#     end
    207207#   end
     
    211211#     assert_nothing_raised do
    212212#       ast = @parser.parse(file, 'openEHR-EHR-CLUSTER.exam-uterine_cervix.v1')
    213 #       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     213#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    214214#     end
    215215#   end
     
    219219#     assert_nothing_raised do
    220220#       ast = @parser.parse(file, 'openEHR-EHR-EVALUATION.adverse.v1')
    221 #       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     221#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    222222#     end
    223223#   end
     
    226226#     assert_nothing_raised do
    227227#       ast = @parser.parse(file, 'openEHR-EHR-OBSERVATION.body_mass_index.v1')
    228 #       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
     228#       assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID, ast.archetype_id
    229229#     end
    230230#   end
  • ruby/trunk/lib/adl_parser/test/scanner_test.rb

    r291 r307  
    33class ADLScannerTest < Test::Unit::TestCase
    44  def setup
    5     @scanner = OpenEHR::ADL::Scanner::ADLScanner.new([:adl], "filename")
     5    @scanner = OpenEhr::ADL::Scanner::ADLScanner.new([:adl], "filename")
    66  end
    77
    8   must "assert OpenEHR::ADL::Scanner::ADLScanner scanner instance" do
    9     assert_instance_of OpenEHR::ADL::Scanner::ADLScanner, @scanner
     8  must "assert OpenEhr::ADL::Scanner::ADLScanner scanner instance" do
     9    assert_instance_of OpenEhr::ADL::Scanner::ADLScanner, @scanner
    1010  end
    1111
     
    2020    @scanner.scan("openEHR-EHR-OBSERVATION.body_mass_index.v1") do |sym, val|
    2121      assert_equal :V_ARCHETYPE_ID,sym
    22       assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID,val
     22      assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeID,val
    2323    end
    2424  end
     
    4040class CADLScannerTest < Test::Unit::TestCase
    4141  def setup
    42     @scanner = OpenEHR::ADL::Scanner::CADLScanner.new([:cadl], "filename")
     42    @scanner = OpenEhr::ADL::Scanner::CADLScanner.new([:cadl], "filename")
    4343  end
    4444
    45   must "assert OpenEHR::ADL::Scanner::CADLScanner scanner instance" do
    46     assert_instance_of OpenEHR::ADL::Scanner::CADLScanner, @scanner
     45  must "assert OpenEhr::ADL::Scanner::CADLScanner scanner instance" do
     46    assert_instance_of OpenEhr::ADL::Scanner::CADLScanner, @scanner
    4747  end
    4848
     
    8080class DADLScannerTest < Test::Unit::TestCase
    8181  def setup
    82     @scanner = OpenEHR::ADL::Scanner::DADLScanner.new([:dadl], "filename")
     82    @scanner = OpenEhr::ADL::Scanner::DADLScanner.new([:dadl], "filename")
    8383  end
    8484
  • ruby/trunk/lib/adl_parser/test/shell_test.rb

    r291 r307  
    33class ShellADLValidatorTest < Test::Unit::TestCase
    44  def setup
    5     @adl_validator = ::OpenEHR::Application::ADLValidator.new(::OpenEHR::ADL::Validator.new(::OpenEHR::ADL::Parser.new))
     5    @adl_validator = ::OpenEhr::Application::ADLValidator.new(::OpenEhr::ADL::Validator.new(::OpenEhr::ADL::Parser.new))
    66  end
    77
    88  must "assert application validator instance" do
    9     assert_instance_of ::OpenEHR::Application::ADLValidator,@adl_validator
     9    assert_instance_of ::OpenEhr::Application::ADLValidator,@adl_validator
    1010  end
    1111
  • ruby/trunk/lib/adl_parser/test/test_helper.rb

    r261 r307  
    55require "rubygems"
    66require 'adl_parser.rb'
    7 require 'adl_scanner.rb'
    8 require 'rm.rb'
    9 require 'am.rb'
     7#require 'adl_scanner.rb'
     8#require 'open_ehr'
     9#require 'rm.rb'
     10#require 'am.rb'
    1011
    1112
  • ruby/trunk/lib/adl_parser/test/validator_test.rb

    r291 r307  
    44class ADLValidatorTest < Test::Unit::TestCase
    55  def setup
    6     @validator = ::OpenEHR::ADL::Validator.new(::OpenEHR::ADL::Parser.new)
     6    @validator = ::OpenEhr::ADL::Validator.new(::OpenEhr::ADL::Parser.new)
    77  end
    88
    99  must "assert adl validator instance" do
    10     assert_instance_of ::OpenEHR::ADL::Validator,@validator
     10    assert_instance_of ::OpenEhr::ADL::Validator,@validator
    1111  end
    1212
Note: See TracChangeset for help on using the changeset viewer.