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