Class: LifenFhir::Binary

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

Instance Method Summary collapse

Methods inherited from Element

#fhir_payload_as_reference, #reference

Instance Method Details

#attributes_from_json(json) ⇒ Object



16
17
18
# File 'lib/lifen_fhir/binary.rb', line 16

def attributes_from_json(json)
  super(json["contentReference"])
end

#downloadObject



12
13
14
# File 'lib/lifen_fhir/binary.rb', line 12

def download
  application_client.get("fhir/#{reference}", { accept: "application/pdf" })
end

#fhir_payloadObject



4
5
6
7
8
9
10
# File 'lib/lifen_fhir/binary.rb', line 4

def fhir_payload
  {
    contentReference: {
      reference: reference
    }
  }
end