Class: LifenFhir::Address

Inherits:
Element show all
Defined in:
lib/lifen_fhir/address.rb

Instance Method Summary collapse

Methods inherited from Element

#fhir_payload_as_reference, #reference

Instance Method Details

#attributes_from_json(json) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/lifen_fhir/address.rb', line 9

def attributes_from_json(json)
  self.lines = Array(json.fetch("line"))

  self.postal_code = json.fetch("postalCode")

  self.city = json.fetch("city")

  self
end

#fhir_payloadObject



19
20
21
22
23
24
25
26
# File 'lib/lifen_fhir/address.rb', line 19

def fhir_payload
  {
    "line": lines,
    "city": city,
    "postalCode": postal_code,
    "country": country
  }
end