Sha256: 57ca83b2331e08257d228b0b34a57085d3f6c06162da6a0d5984fca35f826835

Contents?: true

Size: 434 Bytes

Versions: 3

Compression:

Stored size: 434 Bytes

Contents

module Lifen
  module Communication
    class Attachment < Lifen::Base

      attribute :title, String
      attribute :path, String

      def fhir_payload
        {
          contentAttachment: {
            data: base_64_encoded_content,
            title: title
          }
        }
      end

      private

        def base_64_encoded_content
          Base64.encode64(File.open(path, "rb").read)
        end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lifen-1.6.2 lib/lifen/communication/attachment.rb
lifen-1.6.1 lib/lifen/communication/attachment.rb
lifen-1.6.0 lib/lifen/communication/attachment.rb