Sha256: 0aebdb3c32b2d784ef93db2785d964f88f769a0e3d6fde1a8902a019dc4c1786

Contents?: true

Size: 452 Bytes

Versions: 11

Compression:

Stored size: 452 Bytes

Contents

module LifenFhir

  class Attachment < Base

    attribute :title, String
    attribute :path, String
    attribute :content_type, String

    def fhir_payload
      {
        contentAttachment: {
          data: base_64_encoded_content,
          title: title,
          contentType: "{#{content_type}}"
        }
      }
    end

    private

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

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
lifen_fhir-0.7.1 lib/lifen_fhir/attachment.rb
lifen_fhir-0.7.0 lib/lifen_fhir/attachment.rb
lifen_fhir-0.6.1 lib/lifen_fhir/attachment.rb
lifen_fhir-0.6.0 lib/lifen_fhir/attachment.rb
lifen_fhir-0.5.0 lib/lifen_fhir/attachment.rb
lifen_fhir-0.4.2 lib/lifen_fhir/attachment.rb
lifen_fhir-0.4.1 lib/lifen_fhir/attachment.rb
lifen_fhir-0.4.0 lib/lifen_fhir/attachment.rb
lifen_fhir-0.3.0 lib/lifen_fhir/attachment.rb
lifen_fhir-0.2.0 lib/lifen_fhir/attachment.rb
lifen_fhir-0.1.1 lib/lifen_fhir/attachment.rb