fhir_client 1.6.10 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fhir_client.gemspec +1 -1
- data/lib/fhir_client/client.rb +8 -9
- data/lib/fhir_client/fhir_api_validation.json +6 -6
- 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: b1422a8f5a8fde728e4d0eff36ee916e27a5915c
|
4
|
+
data.tar.gz: 50ad100815d6349da9acd460c1ed7996ac0945d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c023874bcbec48a8d01fb0ccf5fc0dabc968a949a3b89dd386d044bcf7c03693d69b7f80e5d74291b8cdd2436fa8e07450e07b4ef95e870a23df31a562f9c46
|
7
|
+
data.tar.gz: 5ac8f2376cec84379adafe44f1a6eac60b57dec0650e3172ffd5b952053b439fa704ed6fffafce4d511e23efcefbf935260769fc210da02b8c3af4a7225bbda3
|
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.
|
25
|
+
spec.add_dependency 'fhir_models', '>= 1.8.0'
|
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
@@ -23,7 +23,7 @@ module FHIR
|
|
23
23
|
|
24
24
|
attr_accessor :default_format
|
25
25
|
|
26
|
-
attr_accessor :
|
26
|
+
attr_accessor :cached_capability_statement
|
27
27
|
|
28
28
|
# Call method to initialize FHIR client. This method must be invoked
|
29
29
|
# with a valid base server URL prior to using the client.
|
@@ -98,9 +98,9 @@ module FHIR
|
|
98
98
|
@client = client.client_credentials.get_token
|
99
99
|
end
|
100
100
|
|
101
|
-
# Get the OAuth2 server and endpoints from the
|
101
|
+
# Get the OAuth2 server and endpoints from the capability statement
|
102
102
|
# (the server should not require OAuth2 or other special security to access
|
103
|
-
# the
|
103
|
+
# the capability statement).
|
104
104
|
# <rest>
|
105
105
|
# <mode value="server"/>
|
106
106
|
# <documentation value="All the functionality defined in FHIR"/>
|
@@ -134,8 +134,7 @@ module FHIR
|
|
134
134
|
authorize_extension = 'authorize'
|
135
135
|
token_extension = 'token'
|
136
136
|
begin
|
137
|
-
|
138
|
-
conformance.rest.each do |rest|
|
137
|
+
capability_statement.rest.each do |rest|
|
139
138
|
rest.security.service.each do |service|
|
140
139
|
service.coding.each do |coding|
|
141
140
|
next unless coding.code == 'SMART-on-FHIR'
|
@@ -170,10 +169,10 @@ module FHIR
|
|
170
169
|
# Method returns a conformance statement for the system queried.
|
171
170
|
# @return
|
172
171
|
def conformance_statement(format = @default_format)
|
173
|
-
if @
|
172
|
+
if @cached_capability_statement.nil? || format != @default_format
|
174
173
|
try_conformance_formats(format)
|
175
174
|
end
|
176
|
-
@
|
175
|
+
@cached_capability_statement
|
177
176
|
end
|
178
177
|
|
179
178
|
def try_conformance_formats(default_format)
|
@@ -185,13 +184,13 @@ module FHIR
|
|
185
184
|
'application/json']
|
186
185
|
formats.insert(0, default_format)
|
187
186
|
|
188
|
-
@
|
187
|
+
@cached_capability_statement = nil
|
189
188
|
@default_format = nil
|
190
189
|
|
191
190
|
formats.each do |frmt|
|
192
191
|
reply = get 'metadata', fhir_headers(format: frmt)
|
193
192
|
next unless reply.code == 200
|
194
|
-
@
|
193
|
+
@cached_capability_statement = parse_reply(FHIR::CapabilityStatement, frmt, reply)
|
195
194
|
@default_format = frmt
|
196
195
|
break
|
197
196
|
end
|
@@ -127,7 +127,7 @@
|
|
127
127
|
"body": false
|
128
128
|
},
|
129
129
|
"response": {
|
130
|
-
"status": [200,
|
130
|
+
"status": [200,401],
|
131
131
|
"headers": {
|
132
132
|
"Content-Type": true,
|
133
133
|
"Location": false,
|
@@ -149,7 +149,7 @@
|
|
149
149
|
"body": "form data"
|
150
150
|
},
|
151
151
|
"response": {
|
152
|
-
"status": [200,
|
152
|
+
"status": [200,401],
|
153
153
|
"headers": {
|
154
154
|
"Content-Type": true,
|
155
155
|
"Location": false,
|
@@ -160,7 +160,7 @@
|
|
160
160
|
}
|
161
161
|
},{
|
162
162
|
"interaction": "search-all",
|
163
|
-
"path": ["
|
163
|
+
"path": ["?"],
|
164
164
|
"verb": "GET",
|
165
165
|
"request": {
|
166
166
|
"headers": {
|
@@ -171,7 +171,7 @@
|
|
171
171
|
"body": false
|
172
172
|
},
|
173
173
|
"response": {
|
174
|
-
"status": [200,
|
174
|
+
"status": [200,401],
|
175
175
|
"headers": {
|
176
176
|
"Content-Type": true,
|
177
177
|
"Location": false,
|
@@ -181,7 +181,7 @@
|
|
181
181
|
"body": { "types": ["Bundle"] }
|
182
182
|
}
|
183
183
|
},{
|
184
|
-
"interaction": "
|
184
|
+
"interaction": "capabilities",
|
185
185
|
"path": ["/","/metadata"],
|
186
186
|
"verb": ["GET","OPTIONS"],
|
187
187
|
"request": {
|
@@ -200,7 +200,7 @@
|
|
200
200
|
"ETag": false,
|
201
201
|
"Last-Modified": false
|
202
202
|
},
|
203
|
-
"body": { "types": ["
|
203
|
+
"body": { "types": ["CapabilityStatement"] }
|
204
204
|
}
|
205
205
|
},{
|
206
206
|
"interaction": "transaction",
|
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.
|
4
|
+
version: 1.8.0
|
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-
|
13
|
+
date: 2016-12-09 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.
|
49
|
+
version: 1.8.0
|
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.
|
56
|
+
version: 1.8.0
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: nokogiri
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|