lifen 1.6.6 → 1.6.7
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +2 -2
- data/lib/lifen/communication/channel.rb +6 -0
- data/lib/lifen/version.rb +1 -1
- data/spec/requests_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ef7f0cd7300aab6ce5b30cabfc8bd2a11f1e6f7
|
4
|
+
data.tar.gz: 4605d9d608326d65ccfd759b5a8ec36a35fc9298
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 160bb1480b9388ad9da7144588f3520ea7e336a7e8f701b371361544e0470fe1722ca4e5a19f3f518350d6cb6a359d557ec226678586e8cdb3be46a9b3d4637a
|
7
|
+
data.tar.gz: 8321d68e992844d939870638aaa3393c25adb7f853f37431398c6360add472aa0f4ee2edc1bb1db07c8a053098bd45443905784095550bbd92425979196ed5c6
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -7,6 +7,8 @@ module Lifen
|
|
7
7
|
attribute :value, String
|
8
8
|
|
9
9
|
def fhir_payload(user)
|
10
|
+
raise Lifen::Error, "Invalid channel: an UUID is required" if !valid?
|
11
|
+
|
10
12
|
{
|
11
13
|
id: user.uuid,
|
12
14
|
resourceType: "Practitioner",
|
@@ -18,6 +20,10 @@ module Lifen
|
|
18
20
|
}
|
19
21
|
end
|
20
22
|
|
23
|
+
def valid?
|
24
|
+
uuid and uuid.length != 0
|
25
|
+
end
|
26
|
+
|
21
27
|
def self.from_json(json, type = nil)
|
22
28
|
new(uuid: json["id"], type: type, value: json["value"] || "#{json["line"].join(", ")}, #{json["postalCode"]} #{json["city"]}")
|
23
29
|
end
|
data/lib/lifen/version.rb
CHANGED
data/spec/requests_spec.rb
CHANGED
@@ -24,6 +24,18 @@ describe Lifen::Communication::Request do
|
|
24
24
|
expect(request.uuid).to_not be_nil
|
25
25
|
end
|
26
26
|
|
27
|
+
context 'invalid channel' do
|
28
|
+
|
29
|
+
let(:channel) { Lifen::Communication::Channel.new(uuid: nil) }
|
30
|
+
|
31
|
+
it 'raises an error' do
|
32
|
+
expect{
|
33
|
+
request.send
|
34
|
+
}.to raise_error Lifen::Error, "Invalid channel: an UUID is required"
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
27
39
|
end
|
28
40
|
|
29
41
|
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: 1.6.
|
4
|
+
version: 1.6.7
|
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-
|
11
|
+
date: 2017-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|