lifen 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,74 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://develop.lifen.fr/fhir/CommunicationRequest
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"resourceType":"CommunicationRequest","sender":[{"reference":"valid_sender_uuid"}],"recipient":[{"reference":"valid_recipient_uuid"}],"contained":[{"id":"valid_recipient_uuid","resourceType":"Practitioner","address":[{"id":"valid_channel_uuid"}]},{"id":"patient","resourceType":"Patient","name":[{"family":["Dupond"],"given":["Jean"]}],"birthDate":"2000-01-01"}],"category":[{"coding":[{"system":"http://honestica.com/fhir/communication/category","code":"MEDICAL_REPORT"}]}],"payload":[{"contentReference":{"reference":"Binary/valid_binary_id"}}],"subject":[{"reference":"patient"}]}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.11.0
12
+ Authorization:
13
+ - Bearer valid_application_access_token
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Server:
26
+ - nginx/1.6.2
27
+ Date:
28
+ - Wed, 05 Apr 2017 12:59:53 GMT
29
+ Content-Type:
30
+ - application/json+fhir;charset=UTF-8
31
+ Location:
32
+ - http://develop.lifen.fr/fhir/OperationOutcome/5be5ff4e-d110-4206-97ff-bcc059dd82f4
33
+ Transfer-Encoding:
34
+ - chunked
35
+ Connection:
36
+ - keep-alive
37
+ X-B3-Sampled:
38
+ - '1'
39
+ X-B3-Spanid:
40
+ - 3ce39e55c4819d06
41
+ X-B3-Traceid:
42
+ - 3ce39e55c4819d06
43
+ X-Content-Type-Options:
44
+ - nosniff
45
+ X-Xss-Protection:
46
+ - 1; mode=block
47
+ Cache-Control:
48
+ - no-cache, no-store, max-age=0, must-revalidate
49
+ Pragma:
50
+ - no-cache
51
+ Expires:
52
+ - '0'
53
+ X-Powered-By:
54
+ - HAPI FHIR 2.2 REST Server (FHIR Server; FHIR 1.0.2/DSTU2)
55
+ Content-Location:
56
+ - http://develop.lifen.fr:2129/fhir/OperationOutcome/5be5ff4e-d110-4206-97ff-bcc059dd82f4
57
+ Access-Control-Allow-Credentials:
58
+ - 'true'
59
+ body:
60
+ encoding: UTF-8
61
+ string: |-
62
+ {
63
+ "resourceType": "OperationOutcome",
64
+ "id": "5be5ff4e-d110-4206-97ff-bcc059dd82f4",
65
+ "issue": [
66
+ {
67
+ "severity": "information",
68
+ "diagnostics": "CommunicationRequest accepted"
69
+ }
70
+ ]
71
+ }
72
+ http_version:
73
+ recorded_at: Wed, 05 Apr 2017 12:59:53 GMT
74
+ recorded_with: VCR 3.0.3
@@ -11,8 +11,10 @@ describe Lifen::Communication do
11
11
 
12
12
  let(:patient) { Lifen::Patient.new(first_name: "Jean", last_name: "Dupond", birthdate: Date.new(2000,1,1)) }
13
13
 
14
+ let(:binary) { Lifen::Binary.new(uuid: "valid_binary_id") }
14
15
 
15
- describe ':send' do
16
+
17
+ describe ':send with an Attachment' do
16
18
 
17
19
  let(:communication) { Lifen::Communication.new(sender: sender, recipient: recipient, channel: channel, attachment: attachment, patient: patient) }
18
20
 
@@ -38,6 +40,21 @@ describe Lifen::Communication do
38
40
 
39
41
  end
40
42
 
43
+ describe ':send with a Binary' do
44
+
45
+ let(:communication) { Lifen::Communication.new(sender: sender, recipient: recipient, channel: channel, binary: binary, patient: patient) }
46
+
47
+ it 'works' do
48
+
49
+ VCR.use_cassette "communication/send/binary_valid_attributes" do
50
+ communication.send
51
+ end
52
+
53
+ expect(communication.uuid).to_not be_nil
54
+ end
55
+
56
+ end
57
+
41
58
  describe ':find' do
42
59
 
43
60
  it 'works' do
@@ -70,4 +87,4 @@ describe Lifen::Communication do
70
87
 
71
88
  end
72
89
 
73
- end
90
+ end
@@ -21,4 +21,4 @@ RSpec.configure do |c|
21
21
  config.application_access_token = "valid_application_access_token"
22
22
  end
23
23
  end
24
- end
24
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lifen
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Etienne Depaulis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-29 00:00:00.000000000 Z
11
+ date: 2017-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -156,6 +156,7 @@ files:
156
156
  - lib/lifen/app_authenticated_client.rb
157
157
  - lib/lifen/attachment.rb
158
158
  - lib/lifen/base.rb
159
+ - lib/lifen/binary.rb
159
160
  - lib/lifen/category.rb
160
161
  - lib/lifen/channel.rb
161
162
  - lib/lifen/client.rb
@@ -173,8 +174,12 @@ files:
173
174
  - lib/lifen/user_authenticated_client.rb
174
175
  - lib/lifen/version.rb
175
176
  - lifen.gemspec
177
+ - spec/binary_spec.rb
178
+ - spec/cassettes/binary/download/invalid.yml
179
+ - spec/cassettes/binary/download/valid.yml
176
180
  - spec/cassettes/communication/find/invalid_uuid.yml
177
181
  - spec/cassettes/communication/find/valid_uuid.yml
182
+ - spec/cassettes/communication/send/binary_valid_attributes.yml
178
183
  - spec/cassettes/communication/send/valid_attributes.yml
179
184
  - spec/cassettes/flows/attach_users/invalid_flow_uuid.yml
180
185
  - spec/cassettes/flows/attach_users/invalid_user_uuid.yml
@@ -243,8 +248,12 @@ signing_key:
243
248
  specification_version: 4
244
249
  summary: Lifen JSON API ruby client
245
250
  test_files:
251
+ - spec/binary_spec.rb
252
+ - spec/cassettes/binary/download/invalid.yml
253
+ - spec/cassettes/binary/download/valid.yml
246
254
  - spec/cassettes/communication/find/invalid_uuid.yml
247
255
  - spec/cassettes/communication/find/valid_uuid.yml
256
+ - spec/cassettes/communication/send/binary_valid_attributes.yml
248
257
  - spec/cassettes/communication/send/valid_attributes.yml
249
258
  - spec/cassettes/flows/attach_users/invalid_flow_uuid.yml
250
259
  - spec/cassettes/flows/attach_users/invalid_user_uuid.yml