fhir_client 1.6.7 → 1.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -0
- data/fhir_client.gemspec +1 -1
- data/lib/fhir_client/client.rb +6 -1
- data/lib/fhir_client/ext/model.rb +13 -13
- data/lib/fhir_client/sections/crud.rb +3 -2
- data/lib/fhir_client/tasks/tasks.rake +2 -0
- data/lib/fhir_client/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12367a6e525d762523753593264ba095cd3ba579
|
4
|
+
data.tar.gz: 693ef7d5a3c56d599d38fb1c1f28fc848a4e1d7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0291e7fd065516d8c9ec4d139c1728b3c808b8a17ea92b7c0a315c80fe6dac0ddb20a1933c68da97a47ee6d0b0300ff2d8fdb55ee5b637b9fc9231de2444df05
|
7
|
+
data.tar.gz: d41df661d9eef8b2462ba43e9648d4b29845f989e63fae4f6afe01b00833e26245b4e3df0e9d9c3fd43b497cba8ea38c0919f1c5301147decec9e3a586eb949b
|
data/Gemfile
CHANGED
data/fhir_client.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_dependency 'activesupport', '>= 3'
|
24
24
|
spec.add_dependency 'addressable', '>= 2.3'
|
25
|
-
spec.add_dependency 'fhir_models', '>= 1.6.
|
25
|
+
spec.add_dependency 'fhir_models', '>= 1.6.8'
|
26
26
|
spec.add_dependency 'nokogiri'
|
27
27
|
spec.add_dependency 'oauth2', '~> 1.1'
|
28
28
|
spec.add_dependency 'rack', '>= 1.5'
|
data/lib/fhir_client/client.rb
CHANGED
@@ -162,9 +162,14 @@ module FHIR
|
|
162
162
|
options
|
163
163
|
end
|
164
164
|
|
165
|
+
# Method returns a capability statement for the system queried.
|
166
|
+
def capability_statement(format = @default_format)
|
167
|
+
conformance_statement(format)
|
168
|
+
end
|
169
|
+
|
165
170
|
# Method returns a conformance statement for the system queried.
|
166
171
|
# @return
|
167
|
-
def conformance_statement(format =
|
172
|
+
def conformance_statement(format = @default_format)
|
168
173
|
if @cached_conformance.nil? || format != @default_format
|
169
174
|
try_conformance_formats(format)
|
170
175
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module FHIR
|
2
2
|
class Model
|
3
3
|
class << self
|
4
|
-
cattr_accessor :client
|
4
|
+
cattr_accessor :client, instance_accessor: false
|
5
5
|
end
|
6
6
|
|
7
7
|
def client
|
8
|
-
|
8
|
+
@@client
|
9
9
|
end
|
10
10
|
|
11
11
|
def client=(client)
|
12
|
-
|
12
|
+
@@client = client
|
13
13
|
|
14
14
|
# Ensure the client-setting cascades to all child models
|
15
15
|
instance_values.each do |_key, values|
|
@@ -21,44 +21,44 @@ module FHIR
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def self.read(id, client =
|
24
|
+
def self.read(id, client = @@client)
|
25
25
|
handle_response client.read(self, id)
|
26
26
|
end
|
27
27
|
|
28
|
-
def self.read_with_summary(id, summary, client =
|
28
|
+
def self.read_with_summary(id, summary, client = @@client)
|
29
29
|
handle_response client.read(self, id, client.default_format, summary)
|
30
30
|
end
|
31
31
|
|
32
|
-
def self.vread(id, version_id, client =
|
32
|
+
def self.vread(id, version_id, client = @@client)
|
33
33
|
handle_response client.vread(self, id, version_id)
|
34
34
|
end
|
35
35
|
|
36
|
-
def self.resource_history(client =
|
36
|
+
def self.resource_history(client = @@client)
|
37
37
|
handle_response client.resource_history(self)
|
38
38
|
end
|
39
39
|
|
40
|
-
def self.resource_history_as_of(last_update)
|
40
|
+
def self.resource_history_as_of(last_update, client = @@client)
|
41
41
|
handle_response client.resource_history_as_of(self, last_update)
|
42
42
|
end
|
43
43
|
|
44
|
-
def self.resource_instance_history(id, client =
|
44
|
+
def self.resource_instance_history(id, client = @@client)
|
45
45
|
handle_response client.resource_instance_history(self, id)
|
46
46
|
end
|
47
47
|
|
48
|
-
def self.resource_instance_history_as_of(id, last_update, client =
|
48
|
+
def self.resource_instance_history_as_of(id, last_update, client = @@client)
|
49
49
|
handle_response client.resource_instance_history_as_of(self, id, last_update)
|
50
50
|
end
|
51
51
|
|
52
|
-
def self.search(params = {}, client =
|
52
|
+
def self.search(params = {}, client = @@client)
|
53
53
|
handle_response client.search(self, search: { parameters: params })
|
54
54
|
end
|
55
55
|
|
56
|
-
def self.create(model, client =
|
56
|
+
def self.create(model, client = @@client)
|
57
57
|
model = new(model) unless model.is_a?(self)
|
58
58
|
handle_response client.create(model)
|
59
59
|
end
|
60
60
|
|
61
|
-
def self.conditional_create(model, params, client =
|
61
|
+
def self.conditional_create(model, params, client = @@client)
|
62
62
|
model = new(model) unless model.is_a?(self)
|
63
63
|
handle_response client.conditional_create(model, params)
|
64
64
|
end
|
@@ -154,12 +154,13 @@ module FHIR
|
|
154
154
|
else
|
155
155
|
resource # just send back the submitted resource
|
156
156
|
end
|
157
|
+
resource.id = FHIR::ResourceAddress.pull_out_id(resource.class.name.demodulize, reply.self_link)
|
157
158
|
else
|
158
|
-
resource.id = FHIR::ResourceAddress.pull_out_id(resource.class.name.demodulize, reply.
|
159
|
+
resource.id = FHIR::ResourceAddress.pull_out_id(resource.class.name.demodulize, reply.self_link)
|
159
160
|
reply.resource = resource # don't know the content type, so return the resource provided
|
160
161
|
end
|
161
162
|
else
|
162
|
-
resource.id = FHIR::ResourceAddress.pull_out_id(resource.class.name.demodulize, reply.
|
163
|
+
resource.id = FHIR::ResourceAddress.pull_out_id(resource.class.name.demodulize, reply.self_link)
|
163
164
|
reply.resource = resource # just send back the submitted resource
|
164
165
|
end
|
165
166
|
reply.resource.client = self
|
@@ -40,6 +40,7 @@ namespace :fhir do
|
|
40
40
|
desc 'count all resources for a given server'
|
41
41
|
task :count, [:url, :display_zero] do |_t, args|
|
42
42
|
client = FHIR::Client.new(args.url)
|
43
|
+
client.try_conformance_formats(FHIR::Formats::ResourceFormat::RESOURCE_JSON)
|
43
44
|
display_zero = (args.display_zero == 'true')
|
44
45
|
counts = {}
|
45
46
|
fhir_resources.each do |klass|
|
@@ -59,6 +60,7 @@ namespace :fhir do
|
|
59
60
|
desc 'delete all resources for a given server'
|
60
61
|
task :clean, [:url] do |_t, args|
|
61
62
|
client = FHIR::Client.new(args.url)
|
63
|
+
client.try_conformance_formats(FHIR::Formats::ResourceFormat::RESOURCE_JSON)
|
62
64
|
fhir_resources.each do |klass|
|
63
65
|
puts "Reading #{klass.name.demodulize}..."
|
64
66
|
skipped = []
|
data/lib/fhir_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fhir_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andre Quina
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-10-
|
13
|
+
date: 2016-10-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -46,14 +46,14 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 1.6.
|
49
|
+
version: 1.6.8
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 1.6.
|
56
|
+
version: 1.6.8
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: nokogiri
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|