Sha256: 9b05fc7e4bcb83010d76f541a7b3c851bfc4fdb82b3ba2d7217d50816f18339f

Contents?: true

Size: 1.55 KB

Versions: 1

Compression:

Stored size: 1.55 KB

Contents

# frozen_string_literal: true
require 'spec_helper'

describe 'Fetching A19 from EPIC' do
  describe 'the patient Jan Fictief' do
    before { load_fixture 'epic_test_client', '7767853' }
    subject { Roqua::Healthy::A19.fetch("7767853") }

    it { expect(subject[:status]).to       eq('SUCCESS') }
    it { expect(subject[:error]).to        be_nil }
    it { expect(subject[:source]).to       eq('CLOVDMZA') }
    it { expect(subject[:identities]).to   eq([{ident: '7767853', authority: 'PI'}]) }
    it { expect(subject[:firstname]).to    eq('Jan') }
    it { expect(subject[:initials]).to     eq('J A B C') }
    it { expect(subject[:lastname]).to     eq('Fictief') }
    it { expect(subject[:display_name]).to be_nil }
    it { expect(subject[:nickname]).to     eq('Jan') }
    it { expect(subject[:email]).to        be_nil }
    it { expect(subject[:address_type]).to eq('P') }
    it { expect(subject[:street]).to       eq('HANZEPLEIN 1') }
    it { expect(subject[:city]).to         eq('GRONINGEN') }
    it { expect(subject[:zipcode]).to      eq('9713GZ') }
    it { expect(subject[:country]).to      eq('NLD') }
    it { expect(subject[:birthdate]).to    eq('19800101') }
    it { expect(subject[:gender]).to       eq('M') }
    it { expect(subject[:phone_cell]).to   eq('0667895432') }
  end

  describe 'patient not found' do
    before { load_fixture 'epic_not_found', '1234unknown' }
    subject { Roqua::Healthy::A19.fetch("1234unknown") }

    it 'raises PatientNotFound' do
      expect { subject }.to raise_error(Roqua::Healthy::PatientNotFound)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
roqua-healthy-1.5.4 spec/integration/epic_spec.rb