Sha256: 7c58258a88c2a71661f432d06ebb8e1dc8d0ea8ad163d45cd87889327ebdc3d7

Contents?: true

Size: 803 Bytes

Versions: 11

Compression:

Stored size: 803 Bytes

Contents

# frozen_string_literal: true
module Roqua
  module Healthy
    class Client
      include ::Roqua::Support::Instrumentation

      attr_reader :a19_endpoint, :a19_username, :a19_password

      def initialize(options = {})
        @a19_endpoint = options[:a19_endpoint] || Roqua::Healthy.a19_endpoint
        @a19_username = options[:a19_username]
        @a19_password = options[:a19_password]
      end

      def use_basic_auth?
        @a19_username.present? || @a19_password.present?
      end

      def fetch_a19(patient_id)
        with_instrumentation 'hl7.a19', patient_id: patient_id do
          message = A19::Fetcher.new(patient_id, self).fetch
          patient = A19::Transformer.new(message).to_patient
          patient
        end
      end
    end
  end
end

require_relative 'a19'

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
roqua-healthy-1.6.0 lib/roqua/healthy/client.rb
roqua-healthy-1.5.13 lib/roqua/healthy/client.rb
roqua-healthy-1.5.12 lib/roqua/healthy/client.rb
roqua-healthy-1.5.11 lib/roqua/healthy/client.rb
roqua-healthy-1.5.10 lib/roqua/healthy/client.rb
roqua-healthy-1.5.9 lib/roqua/healthy/client.rb
roqua-healthy-1.5.8 lib/roqua/healthy/client.rb
roqua-healthy-1.5.7 lib/roqua/healthy/client.rb
roqua-healthy-1.5.6 lib/roqua/healthy/client.rb
roqua-healthy-1.5.5 lib/roqua/healthy/client.rb
roqua-healthy-1.5.4 lib/roqua/healthy/client.rb