Class: Roqua::Healthy::Client
- Inherits:
-
Object
- Object
- Roqua::Healthy::Client
- Includes:
- Support::Instrumentation
- Defined in:
- lib/roqua/healthy/client.rb
Instance Attribute Summary collapse
-
#a19_endpoint ⇒ Object
readonly
Returns the value of attribute a19_endpoint.
-
#a19_password ⇒ Object
readonly
Returns the value of attribute a19_password.
-
#a19_username ⇒ Object
readonly
Returns the value of attribute a19_username.
Instance Method Summary collapse
- #fetch_a19(patient_id) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #use_basic_auth? ⇒ Boolean
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( = {}) @a19_endpoint = [:a19_endpoint] || Roqua::Healthy.a19_endpoint @a19_username = [:a19_username] @a19_password = [:a19_password] end |
Instance Attribute Details
#a19_endpoint ⇒ Object (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_password ⇒ Object (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_username ⇒ Object (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 = A19::Fetcher.new(patient_id, self).fetch patient = A19::Transformer.new().to_patient patient end end |
#use_basic_auth? ⇒ Boolean
15 16 17 |
# File 'lib/roqua/healthy/client.rb', line 15 def use_basic_auth? @a19_username.present? || @a19_password.present? end |