[416] | 1 | require File.dirname(__FILE__) + '/../../../spec_helper'
|
---|
| 2 |
|
---|
| 3 | describe 'OpenEHRTerminology' do
|
---|
| 4 | before(:each) do
|
---|
| 5 | @term = OpenEHR::Terminology::OpenEHRTerminology.new
|
---|
| 6 | end
|
---|
| 7 |
|
---|
| 8 | it 'should parse and return languages' do
|
---|
| 9 | @term.languages[0].should == {'code' => 'af', 'Description' => 'Afrikaans'}
|
---|
| 10 | end
|
---|
| 11 |
|
---|
| 12 | it 'should parse and return primary rubrics' do
|
---|
| 13 | @term.primary_rubrics[0].should == {'Id' => '0', 'Language' => 'en'}
|
---|
| 14 | end
|
---|
| 15 |
|
---|
| 16 | it 'should parse and return concepts' do
|
---|
| 17 | @term.concepts[0].should == {'Rubric' => 'self', 'Language' => 'en',
|
---|
| 18 | 'ConceptID' => '0'}
|
---|
| 19 | end
|
---|
| 20 |
|
---|
| 21 | it 'should parse and return groupers' do
|
---|
| 22 | @term.groupers[0].should == {'id' => '0', 'ConceptID' => '154'}
|
---|
| 23 | end
|
---|
| 24 |
|
---|
| 25 | it 'should parse and return grouped_concepts' do
|
---|
| 26 | @term.grouped_concepts[0].should == {'ChildID' => '0', 'GrouperID' => '1'}
|
---|
| 27 | end
|
---|
| 28 |
|
---|
| 29 | it 'should parse and return terminology identifiers' do
|
---|
| 30 | @term.terminology_identifiers[0].should ==
|
---|
| 31 | {'VSAB' => 'AIR93', 'Authority' => 'UMLS2003AA',
|
---|
| 32 | 'SourceName' => 'AI/RHEUM,1993'}
|
---|
| 33 | end
|
---|
| 34 |
|
---|
| 35 | it 'should parse and return territory' do
|
---|
| 36 | @term.territories[0].should ==
|
---|
| 37 | {'Text' => 'Afghanistan', 'ThreeLetter'=>'AFG',
|
---|
| 38 | 'NumericCode' => '004', 'TwoLetter' => 'AF'}
|
---|
| 39 | end
|
---|
| 40 | end
|
---|