Class: PHRMgr::Client
- Inherits:
-
Common::Client::Base
- Object
- Common::Client::Base
- PHRMgr::Client
- Defined in:
- lib/medical_records/phr_mgr/client.rb
Overview
Core class responsible for PHR Manager API interface operations
Instance Method Summary collapse
-
#get_military_service(edipi) ⇒ Object
Get military service record.
-
#get_phrmgr_status ⇒ Hash
Run a PHR Manager refresh on the patient.
-
#initialize(icn) ⇒ Client
constructor
Initialize the client.
-
#post_phrmgr_refresh ⇒ Fixnum
Run a PHR Manager refresh on the patient.
Methods inherited from Common::Client::Base
#config, configuration, #connection, #delete, #get, #perform, #post, #put, #raise_backend_exception, #raise_not_authenticated, #request, #sanitize_headers!, #service_name
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata
Constructor Details
#initialize(icn) ⇒ Client
Initialize the client
18 19 20 21 22 23 |
# File 'lib/medical_records/phr_mgr/client.rb', line 18 def initialize(icn) super() raise Common::Exceptions::ParameterMissing, 'ICN' if icn.blank? @icn = icn end |
Instance Method Details
#get_military_service(edipi) ⇒ Object
Get military service record
51 52 53 54 55 |
# File 'lib/medical_records/phr_mgr/client.rb', line 51 def get_military_service(edipi) headers = self.class.configuration.x_auth_key_headers.merge({ 'Accept' => 'text/plain' }) response = perform(:get, "dod/vaprofile/#{edipi}", nil, headers) response.body end |
#get_phrmgr_status ⇒ Hash
Run a PHR Manager refresh on the patient.
41 42 43 44 |
# File 'lib/medical_records/phr_mgr/client.rb', line 41 def get_phrmgr_status response = perform(:get, "status/#{@icn}", nil, self.class.configuration.x_auth_key_headers) response.body end |
#post_phrmgr_refresh ⇒ Fixnum
Run a PHR Manager refresh on the patient.
30 31 32 33 34 |
# File 'lib/medical_records/phr_mgr/client.rb', line 30 def post_phrmgr_refresh response = perform(:post, "refresh/#{@icn}", nil, self.class.configuration.x_auth_key_headers) # response_hash = JSON.parse(response.body) response&.status end |