Skip to content

Commit e226c9a

Browse files
RyanrmRyanRMeyer
andauthored
[CDRIS-5462] patient eligibility info to provider delta page (#19)
Co-authored-by: Ryan Meyer <[email protected]>
1 parent e634456 commit e226c9a

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

lib/neutrino/gateway/patient_document.rb

+9
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,15 @@ def get_provider_payer_delta_for_patient(params, options = {})
237237
request(path, options).to_hash
238238
end
239239

240+
# Gets eligibility information about a patient, including self pay information
241+
# @param [Hash] params must specify `:patient_root` and `:patient_extension`
242+
# @param [Hash] options specify query values
243+
# @return array of hashes with eligibility and self pay information
244+
def get_provider_patient_eligibility(params, options = {})
245+
path = "#{api}/governor/patient_eligibility/#{URI.escape(params[:patient_root])}/#{URI.escape(params[:patient_extension])}"
246+
request(path, options).to_hash
247+
end
248+
240249
# Gets a list of a hl7 document ids
241250
#
242251
# @param [Hash] params specify which documents to get, must specify `:root`

spec/neutrino/gateway/patient_document_spec.rb

+34
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,40 @@
599599

600600
end
601601

602+
describe 'self.get_provider_patient_eligibility' do
603+
604+
let(:eligibility_response) { [
605+
{
606+
'patient_root' => 'EPIC.MRN.OID',
607+
'patient_extension' => '111',
608+
'admit_date' => '2019-12-20',
609+
'discharge_date' => '2020-12-30'
610+
},
611+
{
612+
'patient_root' => 'EPIC.MRN.OID',
613+
'patient_extension' => '111',
614+
'start_date' => '2019-12-20',
615+
'end_date' => '2020-12-30'
616+
}
617+
] }
618+
619+
let(:patient_root) { 'some_patient_root' }
620+
let(:patient_extension) { 'some_patient_extension' }
621+
let(:params) { { patient_root: patient_root, patient_extension: patient_extension } }
622+
623+
before(:each) do
624+
WebMock.stub_request(
625+
:get,
626+
'http://testhost:4242/api/v1/governor/patient_eligibility/some_patient_root/some_patient_extension?user%5Bextension%5D=spameggs&user%5Broot%5D=foobar')
627+
.to_return(body: eligibility_response.to_json)
628+
end
629+
630+
it 'returns the expected result' do
631+
expect(described_class.get_provider_patient_eligibility(params)).to eq(eligibility_response)
632+
end
633+
634+
end
635+
602636
describe 'self.base_uri' do
603637

604638
context 'when id, root and extension are not given' do

0 commit comments

Comments
 (0)