ckm_client 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28e62a00ab82106b8f358d630adfcb194675f93a
4
- data.tar.gz: bf7aa2d96bbe2dd3a6eb22f23dcee50df85e37a4
3
+ metadata.gz: 745d3473ee48d8d26b78481b893ca5ac5cd20cca
4
+ data.tar.gz: cb136fa63ca8e598952b1bce03434e6c88638137
5
5
  SHA512:
6
- metadata.gz: 4f01086564fca26456d3fa9b30762f0e34c32c0102f59b852481b25392d1bc11e5f8e4aef71707bc92680603d6266675a78e00db2127100bf675c0ec0c7863ab
7
- data.tar.gz: e22f0926e382620faaff4dc9974f32285def22361fe2239e3e794f380c746982718f58232454fa2467e3c410684b8097f1db6025eb63a811570988e82f0e6898
6
+ metadata.gz: 8acfbf1d3c71825070b974afdd50638131ed08bdea990ecb19153fa563f0e7b448136cf7c87e3d20144f2ac6ec6c4755ca8be27bfe7490d26f994a32f936b11d
7
+ data.tar.gz: 468211419f4e14f1b5d030688a8e7fc7229e790f32c4ffa5e4a2ca7c6de4ed31053eea893e5f18c1ad61ed534a505c0b462527ea5bac199ef6bf7c58746b08cf
data/.travis.yml CHANGED
@@ -1,3 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.0.0
3
4
  - 1.9.3
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ckm_client (0.0.2)
4
+ ckm_client (0.0.3)
5
5
  soap4r-ruby1.9
6
6
  thor
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- builder (3.2.0)
11
+ builder (3.0.4)
12
12
  childprocess (0.3.9)
13
13
  ffi (~> 1.0, >= 1.0.11)
14
14
  coderay (1.0.9)
@@ -18,7 +18,7 @@ GEM
18
18
  gherkin (~> 2.11.6)
19
19
  multi_json (~> 1.3)
20
20
  diff-lcs (1.2.1)
21
- ffi (1.4.0)
21
+ ffi (1.5.0)
22
22
  gherkin (2.11.6)
23
23
  json (>= 1.7.6)
24
24
  guard (1.6.2)
@@ -30,7 +30,7 @@ GEM
30
30
  guard-cucumber (1.3.2)
31
31
  cucumber (>= 1.2.0)
32
32
  guard (>= 1.1.0)
33
- guard-rspec (2.4.1)
33
+ guard-rspec (2.5.1)
34
34
  guard (>= 1.1)
35
35
  rspec (~> 2.11)
36
36
  guard-spork (1.5.0)
@@ -41,7 +41,7 @@ GEM
41
41
  libnotify (0.8.0)
42
42
  ffi (>= 1.0.11)
43
43
  listen (0.6.0)
44
- lumberjack (1.0.2)
44
+ lumberjack (1.0.3)
45
45
  method_source (0.8.1)
46
46
  multi_json (1.7.1)
47
47
  pry (0.9.12)
@@ -73,11 +73,11 @@ DEPENDENCIES
73
73
  cucumber
74
74
  guard
75
75
  guard-cucumber
76
- guard-rspec (~> 2.4.0)
76
+ guard-rspec
77
77
  guard-spork
78
78
  libnotify
79
79
  listen (= 0.6)
80
80
  rake
81
81
  rb-kqueue
82
82
  rspec
83
- spork (~> 1.0.0.rc)
83
+ spork (~> 1.0rc)
data/Guardfile CHANGED
@@ -11,7 +11,7 @@ guard 'cucumber', cli: '--format progress --no-profile --drb' do
11
11
  watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
12
12
  end
13
13
 
14
- guard 'rspec', :version => 2, cli: '--drb' do
14
+ guard 'rspec', cli: '--drb --color' do
15
15
  watch(%r{^spec/.+_spec\.rb$})
16
16
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
17
17
  watch('spec/spec_helper.rb') { "spec" }
data/README.md CHANGED
@@ -5,7 +5,14 @@ A client module for the openEHR clincal knowledge manager
5
5
 
6
6
  Usage
7
7
  ----------
8
- ckmc <command> <args>
8
+ Usage:
9
+ ckmc <command> [<args>]
10
+
11
+ Commands supported:
12
+ get Retrieve archetype by archetype_id
13
+ search query archetype by keyword
14
+ help show this help
15
+
9
16
 
10
17
  Commands supported:
11
18
  fetch Retrieve archetype by archetype_id
data/ckm_client.gemspec CHANGED
@@ -30,11 +30,12 @@ Gem::Specification.new do |gem|
30
30
  gem.add_development_dependency('cucumber')
31
31
  gem.add_development_dependency('guard')
32
32
  gem.add_development_dependency('guard-spork')
33
- gem.add_development_dependency('spork', '~> 1.0.0.rc')
34
- gem.add_development_dependency('guard-rspec', '~> 2.4.0')
33
+ gem.add_development_dependency('spork', '~> 1.0rc')
34
+ gem.add_development_dependency('guard-rspec')
35
35
  gem.add_development_dependency('guard-cucumber')
36
36
  gem.add_development_dependency('listen', '0.6')
37
37
  gem.add_development_dependency('rb-kqueue')
38
+ # gem.add_development_dependency('ammeter', '0.2.8')
38
39
  gem.add_development_dependency('libnotify')
39
40
  end
40
41
 
@@ -29,11 +29,11 @@ end
29
29
 
30
30
  When /^I fetch adl file by archetype ID$/ do
31
31
  si = OpenEHR::CKMClient::SOAPInterface.new
32
- @adl_file = si.fetch(@archetype_id)
32
+ @adl = si.fetch(@archetype_id)
33
33
  end
34
34
 
35
35
  Then /^ID matched archetype should be retrieved$/ do
36
- @adl_file.should match /#{@ardchetype_id}/
36
+ @adl.should match /#{@ardchetype_id}/
37
37
  end
38
38
 
39
39
  Given /^partial archetype ID$/ do
@@ -4,16 +4,19 @@ require 'openehr/ckm_client/soap_interface'
4
4
  module OpenEHR
5
5
  module CKMClient
6
6
  class CLI < Thor
7
- desc 'fetch', 'Retrieve archetype by archetype_id'
8
- def get(archtype_id)
9
- puts OpenEHR::CKMClient::SOAPInterface.new.fetch(archtype_id)
7
+ include Thor::Actions
8
+
9
+ desc 'get', 'Retrieve archetype by archetype_id'
10
+ def get(archetype_id)
11
+ create_file archetype_id+'.adl', soap_interface.fetch(archetype_id)
10
12
  end
11
13
 
14
+ desc 'fetch', 'alias of get'
12
15
  alias fetch get
13
16
 
14
17
  desc 'search', 'Query archetype by partial id'
15
18
  def search(part_id)
16
- puts OpenEHR::CKMClient::SOAPInterface.new.search(part_id)
19
+ puts soap_interface.new.search(part_id)
17
20
  end
18
21
 
19
22
  desc 'help', 'Show this help'
@@ -28,6 +31,12 @@ Commands supported:
28
31
  help show this help
29
32
  USAGE
30
33
  end
34
+
35
+ private
36
+
37
+ def soap_interface
38
+ OpenEHR::CKMClient::SOAPInterface.new
39
+ end
31
40
  end
32
41
  end
33
42
  end
@@ -11,11 +11,16 @@ module OpenEHR
11
11
  end
12
12
 
13
13
  def fetch(id)
14
- SOAPDriver.new(@repository).get_adl_by_id(id)
14
+ soap_driver(@repository).get_adl_by_id(id)
15
15
  end
16
16
 
17
17
  def search(partial_id)
18
- SOAPDriver.new(@repository).get_archetypes_by_partial_id(partial_id)
18
+ soap_driver(@repository).get_archetypes_by_partial_id(partial_id)
19
+ end
20
+
21
+ private
22
+ def soap_driver(repository)
23
+ SOAPDriver.new(repository)
19
24
  end
20
25
  end
21
26
 
@@ -28,7 +33,7 @@ module OpenEHR
28
33
  @driver.getArchetypeInADL(archetypeId: id).m_return
29
34
  end
30
35
 
31
- def get_archetypes_by_partial_id(id)
36
+ def get_archetypes_by_partial_id(id)
32
37
  @driver.getArchetypeIdsFromPartialId(archetypeIdPart: id).m_return
33
38
  end
34
39
  end
@@ -1,5 +1,5 @@
1
1
  module OpenEHR
2
2
  module CKMClient
3
- VERSION = '0.0.3'
3
+ VERSION = '0.1.0'
4
4
  end
5
5
  end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe OpenEHR::CKMClient::CLI do
4
+ let(:ckmc) { OpenEHR::CKMClient::CLI.new }
5
+ let(:archetype_id) { 'openEHR-EHR-OBSERVATION.blood_match' }
6
+ let(:target_file) { archetype_id + '.adl' }
7
+
8
+ describe "#get" do
9
+ it 'should get archetype from repository' do
10
+ ckmc.get archetype_id
11
+ expect { File.exists?(target_file)}.to be_true
12
+ end
13
+
14
+ after do
15
+ File.delete target_file
16
+ end
17
+ end
18
+
19
+ describe '#help' do
20
+ it 'call help' do
21
+
22
+ end
23
+ end
24
+ end
25
+
@@ -1,37 +1,33 @@
1
1
  require 'spec_helper'
2
2
 
3
- REPOSITORY = 'http://www.openehr.org/'
4
- OPENEHR_REPOSITORY = 'http://openehr.org/ckm/services/ArchetypeFinderBean?wsdl'
5
- ARCHETYPE_ID = 'openEHR-EHR-OBSERVATION.blood_pressure.v1'
3
+ describe OpenEHR::CKMClient::SOAPInterface do
4
+ let(:repository) { 'http://www.openehr.org/' }
5
+ let(:openehr_repository) { 'http://openehr.org/ckm/services/ArchetypeFinderBean?wsdl' }
6
+ let(:archetype_id){ 'openEHR-EHR-OBSERVATION.blood_pressure.v1' }
6
7
 
7
- module OpenEHR
8
- module CKMClient
9
- describe SOAPInterface do
10
- describe "#initialize" do
11
- context 'repository is assigned as constructor parameter' do
12
- let(:si) { OpenEHR::CKMClient::SOAPInterface.new(REPOSITORY) }
13
-
14
- it 'respoistory is REPOSITORY' do
15
- si.repository.should == REPOSITORY
16
- end
17
- end
8
+ describe "#initialize" do
9
+ context 'repository is assigned as constructor parameter' do
10
+ let(:si) { OpenEHR::CKMClient::SOAPInterface.new(repository) }
18
11
 
19
- context 'Default repository is openEHR CKM repository' do
20
- let(:si) { OpenEHR::CKMClient::SOAPInterface.new }
21
-
22
- it 'default repository is openEHR ckm repository' do
23
- si.repository.should == OPENEHR_REPOSITORY
24
- end
25
- end
12
+ it 'respoistory is repository' do
13
+ si.repository.should == repository
26
14
  end
15
+ end
27
16
 
28
- describe "#fetch" do
29
- let(:si) { OpenEHR::CKMClient::SOAPInterface.new }
17
+ context 'Default repository is openEHR CKM repository' do
18
+ let(:si) { OpenEHR::CKMClient::SOAPInterface.new }
30
19
 
31
- it 'fetch archetype by id' do
32
- si.fetch(ARCHETYPE_ID).should match /#{ARCHETYPE_ID}/
33
- end
20
+ it 'default repository is openEHR ckm repository' do
21
+ si.repository.should == openehr_repository
34
22
  end
35
23
  end
36
24
  end
25
+
26
+ describe "#fetch" do
27
+ let(:si) { OpenEHR::CKMClient::SOAPInterface.new }
28
+
29
+ it 'fetch archetype by id' do
30
+ si.fetch(archetype_id).should match /#{archetype_id}/
31
+ end
32
+ end
37
33
  end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'rubygems'
2
1
  require 'spork'
3
2
  require 'rspec'
4
3
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ckm_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinji KOBAYASHI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-19 00:00:00.000000000 Z
11
+ date: 2013-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -114,28 +114,28 @@ dependencies:
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 1.0.0.rc
117
+ version: 1.0rc
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ~>
123
123
  - !ruby/object:Gem::Version
124
- version: 1.0.0.rc
124
+ version: 1.0rc
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: guard-rspec
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
- version: 2.4.0
131
+ version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ~>
136
+ - - '>='
137
137
  - !ruby/object:Gem::Version
138
- version: 2.4.0
138
+ version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: guard-cucumber
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -213,13 +213,14 @@ files:
213
213
  - bin/ckmc
214
214
  - ckm_client.gemspec
215
215
  - features/soap_interface.feature
216
- - features/step_definitions/soap_interface.steps.rb
216
+ - features/step_definitions/soap_interface_steps.rb
217
217
  - features/support/env.rb
218
218
  - lib/openehr.rb
219
219
  - lib/openehr/ckm_client.rb
220
220
  - lib/openehr/ckm_client/cli.rb
221
221
  - lib/openehr/ckm_client/soap_interface.rb
222
222
  - lib/openehr/ckm_client/version.rb
223
+ - spec/openehr/ckm_client/cli_spec.rb
223
224
  - spec/openehr/ckm_client/soap_interface_spec.rb
224
225
  - spec/spec_helper.rb
225
226
  homepage: http://openehr.jp