lifen 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b54be9ec354925f88b9d21c7eb320dd4aa06b6e
4
- data.tar.gz: 0a3157507f3d483a808dcfba919c0868f3fa3886
3
+ metadata.gz: 7f8ad711f52a3c7ea7051e1165ba4ec557fc8b6a
4
+ data.tar.gz: 0b824bd0e7b250b28b8982a2b395f38eee594088
5
5
  SHA512:
6
- metadata.gz: 658df2cd0871c76cf89a8d3261f36222ee57454bc992a2f0eef92a36df46867bd77aaeb221c50f6343290bac8a74d0a9b32daba1ffd8e441adabe36fab92484e
7
- data.tar.gz: 6121e4c4902657d1720b65b8a7d4a24ad43132bb6ed237c8fadc27f01d2fc53d458488f0fc2e5590f46baa19037891584bc59219787593fdc6c322e2a5104654
6
+ metadata.gz: a6f5aa4da5f5e42b8f46a395490ed7592a0ebb448d4eb6c9a1c5181b6f92dcabbaaef5d8d7a56e94767c74f93c729dd95dfa3ffa116a946f37ce38d8c53c96e6
7
+ data.tar.gz: a5cad04cfa04a73d0d2296ef97fd1fea70eb1b77e0ab438685a7f76c595104eb36eda38030a119124744b3e6f3682c719798172b0bac5f0c4807664564a51e08
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 1.6.3
2
+ -----
3
+
4
+ - Content type can now be set on an Attachment
5
+
1
6
  1.6.2
2
7
  -----
3
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lifen (1.6.2)
4
+ lifen (1.6.3)
5
5
  faraday (>= 0.9)
6
6
  inflecto
7
7
  virtus (>= 1.0)
@@ -15,6 +15,12 @@ module Lifen
15
15
  raise UserAlreadyExistingError, "Error 403, User already existing, #{response_error(response, params)}"
16
16
  when 404
17
17
  raise Error, "Error 404, Page not found, #{response_error(response, params)}"
18
+ when 422
19
+ json = JSON.parse response.body
20
+
21
+ diagnostic = json["issue"][0]["diagnostics"]
22
+
23
+ raise Error, "Error 422, Unprocessable Entity, Diagnostic: '#{diagnostic}', #{response_error(response, params)}"
18
24
  end
19
25
 
20
26
  end
@@ -4,12 +4,14 @@ module Lifen
4
4
 
5
5
  attribute :title, String
6
6
  attribute :path, String
7
+ attribute :content_type, String
7
8
 
8
9
  def fhir_payload
9
10
  {
10
11
  contentAttachment: {
11
12
  data: base_64_encoded_content,
12
- title: title
13
+ title: title,
14
+ contentType: "{#{content_type}}"
13
15
  }
14
16
  }
15
17
  end
@@ -15,8 +15,6 @@ module Lifen
15
15
 
16
16
  self.uuid = json["id"]
17
17
 
18
- raise "Communication request failed" if json["issue"].first["diagnostics"] != "CommunicationRequest accepted"
19
-
20
18
  self
21
19
  end
22
20
 
data/lib/lifen/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lifen
2
- VERSION = "1.6.2"
2
+ VERSION = "1.6.3"
3
3
  end
@@ -8,7 +8,7 @@ describe Lifen::Communication::Request do
8
8
  let(:sender) { Lifen::User.new(uuid: "valid_sender_uuid") }
9
9
  let(:recipient) { Lifen::User.new(uuid: "valid_recipient_uuid") }
10
10
 
11
- let(:attachment) { Lifen::Communication::Attachment.new(title: "Master Plan", path: File.dirname(__FILE__) + "/support/master_plan.pdf") }
11
+ let(:attachment) { Lifen::Communication::Attachment.new(title: "Master Plan", path: File.dirname(__FILE__) + "/support/master_plan.pdf", content_type: "application/pdf") }
12
12
 
13
13
  describe ':send' do
14
14
 
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: 1.6.2
4
+ version: 1.6.3
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-01 00:00:00.000000000 Z
11
+ date: 2017-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  version: '0'
230
230
  requirements: []
231
231
  rubyforge_project:
232
- rubygems_version: 2.5.2
232
+ rubygems_version: 2.6.8
233
233
  signing_key:
234
234
  specification_version: 4
235
235
  summary: Lifen JSON API ruby client