Class: Lifen::Communication::Channel

Inherits:
Base
  • Object
show all
Defined in:
lib/lifen/communication/channel.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_json(json, type = nil) ⇒ Object



21
22
23
# File 'lib/lifen/communication/channel.rb', line 21

def self.from_json(json, type = nil)
  new(uuid: json["id"], type: type, value: json["value"] || "#{json["line"][0]}, #{json["postalCode"]} #{json["city"]}")
end

Instance Method Details

#fhir_payload(user) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/lifen/communication/channel.rb', line 9

def fhir_payload(user)
  {
    id: user.uuid,
    resourceType: "Practitioner",
    type => [
      {
        id: uuid
      }
    ]
  }
end