Class: Roqua::Healthy::Client

Inherits:
Object
  • Object
show all
Includes:
Support::Instrumentation
Defined in:
lib/roqua/healthy/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



9
10
11
12
13
# File 'lib/roqua/healthy/client.rb', line 9

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

Instance Attribute Details

#a19_endpointObject (readonly)

Returns the value of attribute a19_endpoint.



7
8
9
# File 'lib/roqua/healthy/client.rb', line 7

def a19_endpoint
  @a19_endpoint
end

#a19_passwordObject (readonly)

Returns the value of attribute a19_password.



7
8
9
# File 'lib/roqua/healthy/client.rb', line 7

def a19_password
  @a19_password
end

#a19_usernameObject (readonly)

Returns the value of attribute a19_username.



7
8
9
# File 'lib/roqua/healthy/client.rb', line 7

def a19_username
  @a19_username
end

Instance Method Details

#fetch_a19(patient_id) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/roqua/healthy/client.rb', line 19

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

#use_basic_auth?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/roqua/healthy/client.rb', line 15

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