lifen 2.2.0 → 2.3.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: 9744f1c183ea2b2f7af34597c53b1e8d86dbe106
4
- data.tar.gz: b2fe45fe9b107d4358f25360b0fbeaa3b4efc2e7
3
+ metadata.gz: bdf996b1b369517305a6d0f55e0d39c472865bf8
4
+ data.tar.gz: b88053a0efbfda43d4d3e17c0b6107ee23d85dfd
5
5
  SHA512:
6
- metadata.gz: b4eee3796c0d49e723fd48b91b332fc587064d3ec97e9dbcab2aa70172c0a4069b80f39b9673dd5ce27a16112b6c5a14ee58adc87595b08d5fb5c34fb9ab5be3
7
- data.tar.gz: 5fb6307d47a768e99df42e865129ee503fe101d6d6550be6aa4d8dc1a8dbf3219fb057a2a52330cf8629eee1d397be5c8a8faf4fa027dc8e8ffcd949969e95dd
6
+ metadata.gz: b24f4fc247bf01b59fb2633206ef3703c0a2399cbb646a7ecf669af56740c4f4b9546e24c60248d405e096a61bd18e1916308608c1bc8252d2fbdb047fa2ccab
7
+ data.tar.gz: 5ddb23a6d2e6ae0a2369e3a0913da7eae7e211fbde985402781480bd6d339db051dc75e0b334860d197f259bc23460b91891ccace5d6e4bb5bd614ec5ef7384b
@@ -1,3 +1,9 @@
1
+ 2.3.0
2
+ -----
3
+
4
+ - Add ContentString object
5
+ - A Communication can be sent with a Binary and an optional ContentString object
6
+
1
7
  2.2.0
2
8
  -----
3
9
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lifen (2.2.0)
4
+ lifen (2.3.0)
5
5
  faraday (>= 0.9)
6
6
  inflecto
7
7
  virtus (>= 1.0)
data/README.md CHANGED
@@ -182,6 +182,17 @@ channel = recipient.create_address(type: "address", lines: ["39 rue Aboukir"], c
182
182
  channel = recipient.create_telecom(type: "telecom", system: "fax", value: "+33102030405")
183
183
  ```
184
184
 
185
+ ## Deploying to Rubygems
186
+
187
+ Once the new version is validated, the deployment follows those steps :
188
+
189
+ 1. update `lib/lifen/version.rb`
190
+ 2. run `bundle install` to update `Gemfile.lock`
191
+ 3. update `CHANGELOG.md` with the additional features of the new version
192
+ 4. commit changes to Github
193
+ 5. build the gem using `gem build lifen.gemspec`
194
+ 6. publish the gem using `gem publish lifen-X.X.X.gem`
195
+ 7. run `bundle update lifen` in related projects :)
185
196
 
186
197
  ## Contributing
187
198
 
@@ -27,6 +27,7 @@ module Lifen
27
27
  require 'lifen/binary'
28
28
  require 'lifen/channel'
29
29
  require 'lifen/patient'
30
+ require 'lifen/content_string'
30
31
  require 'lifen/communication'
31
32
 
32
33
  Virtus.finalize
@@ -11,6 +11,7 @@ module Lifen
11
11
  attribute :patient, Lifen::Patient
12
12
  attribute :attachment, Lifen::Attachment
13
13
  attribute :binary, Lifen::Binary
14
+ attribute :content_string, Lifen::ContentString
14
15
 
15
16
  attribute :status, String
16
17
  attribute :sent_at, DateTime
@@ -64,6 +65,10 @@ module Lifen
64
65
  ]
65
66
  end
66
67
 
68
+ if content_string
69
+ payload[:payload] << content_string.fhir_payload
70
+ end
71
+
67
72
  payload
68
73
  end
69
74
 
@@ -0,0 +1,15 @@
1
+ module Lifen
2
+
3
+ class ContentString < Base
4
+
5
+ attribute :text, String
6
+
7
+ def fhir_payload
8
+ {
9
+ contentString: text
10
+
11
+ }
12
+ end
13
+
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Lifen
2
- VERSION = "2.2.0"
2
+ VERSION = "2.3.0"
3
3
  end
@@ -0,0 +1,75 @@
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":"11e5b841-4ff8-2dbb-9643-eabb809fa654","resourceType":"Practitioner","address":[{"id":"valid_channel_uuid"}]}],"category":[{"coding":[{"system":"http://honestica.com/fhir/communication/category","code":"MEDICAL_REPORT"}]}],"payload":[{"contentReference":{"reference":"Binary/valid_binary_id"}},{"contentString":"Cher
9
+ Dr Coeur, je viens de voir votre patiente Mme Paulette Michu"}]}'
10
+ headers:
11
+ User-Agent:
12
+ - Faraday v0.11.0
13
+ Authorization:
14
+ - Bearer valid_application_access_token
15
+ Accept:
16
+ - application/json
17
+ Content-Type:
18
+ - application/json
19
+ Accept-Encoding:
20
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
21
+ response:
22
+ status:
23
+ code: 201
24
+ message: Created
25
+ headers:
26
+ Server:
27
+ - nginx/1.6.2
28
+ Date:
29
+ - Mon, 24 Apr 2017 07:36:03 GMT
30
+ Content-Type:
31
+ - application/json+fhir;charset=UTF-8
32
+ Location:
33
+ - http://develop.lifen.fr/fhir/OperationOutcome/f585aaf9-a024-4b40-bc30-727e9fa034e8
34
+ Transfer-Encoding:
35
+ - chunked
36
+ Connection:
37
+ - keep-alive
38
+ X-B3-Sampled:
39
+ - '1'
40
+ X-B3-Spanid:
41
+ - 18020f441c973c54
42
+ X-B3-Traceid:
43
+ - 18020f441c973c54
44
+ X-Content-Type-Options:
45
+ - nosniff
46
+ X-Xss-Protection:
47
+ - 1; mode=block
48
+ Cache-Control:
49
+ - no-cache, no-store, max-age=0, must-revalidate
50
+ Pragma:
51
+ - no-cache
52
+ Expires:
53
+ - '0'
54
+ X-Powered-By:
55
+ - HAPI FHIR 2.2 REST Server (FHIR Server; FHIR 1.0.2/DSTU2)
56
+ Content-Location:
57
+ - http://develop.lifen.fr/fhir/OperationOutcome/f585aaf9-a024-4b40-bc30-727e9fa034e8
58
+ Access-Control-Allow-Credentials:
59
+ - 'true'
60
+ body:
61
+ encoding: UTF-8
62
+ string: |-
63
+ {
64
+ "resourceType": "OperationOutcome",
65
+ "id": "f585aaf9-a024-4b40-bc30-727e9fa034e8",
66
+ "issue": [
67
+ {
68
+ "severity": "information",
69
+ "diagnostics": "CommunicationRequest accepted"
70
+ }
71
+ ]
72
+ }
73
+ http_version:
74
+ recorded_at: Mon, 24 Apr 2017 07:36:04 GMT
75
+ recorded_with: VCR 3.0.3
@@ -43,6 +43,7 @@ describe Lifen::Communication do
43
43
  describe ':send with a Binary' do
44
44
 
45
45
  let(:communication) { Lifen::Communication.new(sender: sender, recipient: recipient, channel: channel, binary: binary, patient: patient) }
46
+ let(:contentString) { Lifen::ContentString.new(text: "Cher Dr Coeur, je viens de voir votre patiente Mme Paulette Michu")}
46
47
 
47
48
  it 'works' do
48
49
 
@@ -53,6 +54,15 @@ describe Lifen::Communication do
53
54
  expect(communication.uuid).to_not be_nil
54
55
  end
55
56
 
57
+ it 'works with contentString' do
58
+ communication.content_string = contentString
59
+ VCR.use_cassette "communication/send/binary_and_content_string" do
60
+ communication.send
61
+ end
62
+
63
+ expect(communication.uuid).to_not be_nil
64
+ end
65
+
56
66
  end
57
67
 
58
68
  describe ':find' do
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.2.0
4
+ version: 2.3.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-04-06 00:00:00.000000000 Z
11
+ date: 2017-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -162,6 +162,7 @@ files:
162
162
  - lib/lifen/client.rb
163
163
  - lib/lifen/communication.rb
164
164
  - lib/lifen/configuration.rb
165
+ - lib/lifen/content_string.rb
165
166
  - lib/lifen/error.rb
166
167
  - lib/lifen/flow.rb
167
168
  - lib/lifen/flows.rb
@@ -179,6 +180,7 @@ files:
179
180
  - spec/cassettes/binary/download/valid.yml
180
181
  - spec/cassettes/communication/find/invalid_uuid.yml
181
182
  - spec/cassettes/communication/find/valid_uuid.yml
183
+ - spec/cassettes/communication/send/binary_and_content_string.yml
182
184
  - spec/cassettes/communication/send/binary_valid_attributes.yml
183
185
  - spec/cassettes/communication/send/valid_attributes.yml
184
186
  - spec/cassettes/flows/attach_users/invalid_flow_uuid.yml
@@ -253,6 +255,7 @@ test_files:
253
255
  - spec/cassettes/binary/download/valid.yml
254
256
  - spec/cassettes/communication/find/invalid_uuid.yml
255
257
  - spec/cassettes/communication/find/valid_uuid.yml
258
+ - spec/cassettes/communication/send/binary_and_content_string.yml
256
259
  - spec/cassettes/communication/send/binary_valid_attributes.yml
257
260
  - spec/cassettes/communication/send/valid_attributes.yml
258
261
  - spec/cassettes/flows/attach_users/invalid_flow_uuid.yml