diff --git a/modules/mobile/spec/request/facility_eligibility_request_spec.rb b/modules/mobile/spec/request/facility_eligibility_request_spec.rb index 1e4de631c1f..61d1690ab85 100644 --- a/modules/mobile/spec/request/facility_eligibility_request_spec.rb +++ b/modules/mobile/spec/request/facility_eligibility_request_spec.rb @@ -22,9 +22,9 @@ end before do - VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_facility_102', + VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_102', match_requests_on: %i[method uri]) do - VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_facility_103', + VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_103', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments/facility/eligibility', params:, headers: sis_headers end @@ -54,11 +54,11 @@ end before do - VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_facility_100', + VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_100', match_requests_on: %i[method uri]) do - VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_facility_101', + VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_101', match_requests_on: %i[method uri]) do - VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_facility_102', + VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_102', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments/facility/eligibility', params:, headers: sis_headers end @@ -109,7 +109,7 @@ end before do - VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_bad_facility', + VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_vpg_bad_facility', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments/facility/eligibility', params:, headers: sis_headers end diff --git a/modules/vaos/app/services/vaos/v2/patients_service.rb b/modules/vaos/app/services/vaos/v2/patients_service.rb index 370e6a1926b..e12fdc29755 100644 --- a/modules/vaos/app/services/vaos/v2/patients_service.rb +++ b/modules/vaos/app/services/vaos/v2/patients_service.rb @@ -8,22 +8,38 @@ module VAOS module V2 class PatientsService < VAOS::SessionService def get_patient_appointment_metadata(clinic_service_id, facility_id, type) + with_monitoring do + response = if Flipper.enabled?(:va_online_scheduling_use_vpg) && + Flipper.enabled?(:va_online_scheduling_enable_OH_eligibility) + get_patient_appointment_metadata_vpg(clinic_service_id, facility_id, type) + else + get_patient_appointment_metadata_vaos(clinic_service_id, facility_id, type) + end + + OpenStruct.new(response.body.merge(id: SecureRandom.hex(2))) + end + end + + private + + def get_patient_appointment_metadata_vaos(clinic_service_id, facility_id, type) params = { clinicalServiceId: clinic_service_id, facilityId: facility_id, type: } - with_monitoring do - response = perform(:get, url, params, headers) - OpenStruct.new(response.body.merge(id: SecureRandom.hex(2))) - end + perform(:get, "/vaos/v1/patients/#{user.icn}/eligibility", params, headers) end - private + def get_patient_appointment_metadata_vpg(clinic_service_id, facility_id, type) + params = { + clinicalService: clinic_service_id, + location: facility_id, + type: + } - def url - "/vaos/v1/patients/#{user.icn}/eligibility" + perform(:get, "/vpg/v1/patients/#{user.icn}/eligibility", params, headers) end end end diff --git a/modules/vaos/spec/request/v2/patients_request_spec.rb b/modules/vaos/spec/request/v2/patients_request_spec.rb index 882c7fd1002..530554fe90d 100644 --- a/modules/vaos/spec/request/v2/patients_request_spec.rb +++ b/modules/vaos/spec/request/v2/patients_request_spec.rb @@ -19,15 +19,42 @@ describe 'GET patient' do let(:params) { { clinical_service_id: 'primaryCare', facility_id: '100', type: 'direct' } } - context 'patient appointment meta data' do - it 'successfully returns patient appointment metadata' do - VCR.use_cassette('vaos/v2/patients/get_patient_appointment_metadata', - match_requests_on: %i[method path query]) do - get '/vaos/v2/eligibility', params:, headers: inflection_header - expect(response).to have_http_status(:ok) - attributes = JSON.parse(response.body)['data']['attributes'] - expect(attributes['eligible']).to be(false) - expect(response.body).to match_camelized_schema('vaos/v2/patient_appointment_metadata', { strict: false }) + context 'using VAOS' do + before do + Flipper.disable(:va_online_scheduling_use_vpg) + Flipper.disable(:va_online_scheduling_enable_OH_eligibility) + end + + context 'patient appointment meta data' do + it 'successfully returns patient appointment metadata' do + VCR.use_cassette('vaos/v2/patients/get_patient_appointment_metadata_vaos', + match_requests_on: %i[method path query]) do + get '/vaos/v2/eligibility', params:, headers: inflection_header + expect(response).to have_http_status(:ok) + attributes = JSON.parse(response.body)['data']['attributes'] + expect(attributes['eligible']).to be(false) + expect(response.body).to match_camelized_schema('vaos/v2/patient_appointment_metadata', { strict: false }) + end + end + end + end + + context 'using VPG' do + before do + Flipper.enable(:va_online_scheduling_use_vpg) + Flipper.enable(:va_online_scheduling_enable_OH_eligibility) + end + + context 'patient appointment meta data' do + it 'successfully returns patient appointment metadata' do + VCR.use_cassette('vaos/v2/patients/get_patient_appointment_metadata_vpg', + match_requests_on: %i[method path query]) do + get '/vaos/v2/eligibility', params:, headers: inflection_header + expect(response).to have_http_status(:ok) + attributes = JSON.parse(response.body)['data']['attributes'] + expect(attributes['eligible']).to be(false) + expect(response.body).to match_camelized_schema('vaos/v2/patient_appointment_metadata', { strict: false }) + end end end end diff --git a/modules/vaos/spec/services/v2/patients_service_spec.rb b/modules/vaos/spec/services/v2/patients_service_spec.rb index f312e54b57b..d7b41a839b5 100644 --- a/modules/vaos/spec/services/v2/patients_service_spec.rb +++ b/modules/vaos/spec/services/v2/patients_service_spec.rb @@ -11,24 +11,71 @@ describe '#index' do context 'with an patient' do - it 'returns a patient' do - VCR.use_cassette('vaos/v2/patients/get_patient_appointment_metadata', - match_requests_on: %i[method path query]) do - response = subject.get_patient_appointment_metadata('primaryCare', '100', 'direct') - expect(response[:eligible]).to eq(false) + context 'using VAOS' do + before do + Flipper.disable(:va_online_scheduling_use_vpg) + Flipper.disable(:va_online_scheduling_enable_OH_eligibility) + end + + it 'returns a patient' do + VCR.use_cassette('vaos/v2/patients/get_patient_appointment_metadata_vaos', + match_requests_on: %i[method path query]) do + response = subject.get_patient_appointment_metadata('primaryCare', '100', 'direct') + expect(response[:eligible]).to eq(false) + + expect(response[:ineligibility_reasons][0][:coding][0][:code]).to eq('facility-cs-direct-disabled') + end + end + end + + context 'using VPG' do + before do + Flipper.enable(:va_online_scheduling_use_vpg) + Flipper.enable(:va_online_scheduling_enable_OH_eligibility) + end + + it 'returns a patient' do + VCR.use_cassette('vaos/v2/patients/get_patient_appointment_metadata_vpg', + match_requests_on: %i[method path query]) do + response = subject.get_patient_appointment_metadata('primaryCare', '100', 'direct') + expect(response[:eligible]).to eq(false) - expect(response[:ineligibility_reasons][0][:coding][0][:code]).to eq('facility-cs-direct-disabled') + expect(response[:ineligibility_reasons][0][:coding][0][:code]).to eq('facility-cs-direct-disabled') + end end end end context 'when the upstream server returns a 500' do - it 'raises a backend exception' do - VCR.use_cassette('vaos/v2/patients/get_patient_appointment_metadata_500', - match_requests_on: %i[method path query]) do - expect { subject.get_patient_appointment_metadata('primaryCare', '100', 'direct') }.to raise_error( - Common::Exceptions::BackendServiceException - ) + context 'using VAOS' do + before do + Flipper.disable(:va_online_scheduling_use_vpg) + Flipper.disable(:va_online_scheduling_enable_OH_eligibility) + end + + it 'raises a backend exception' do + VCR.use_cassette('vaos/v2/patients/get_patient_appointment_metadata_500_vaos', + match_requests_on: %i[method path query]) do + expect { subject.get_patient_appointment_metadata('primaryCare', '100', 'direct') }.to raise_error( + Common::Exceptions::BackendServiceException + ) + end + end + end + + context 'using VPG' do + before do + Flipper.enable(:va_online_scheduling_use_vpg) + Flipper.enable(:va_online_scheduling_enable_OH_eligibility) + end + + it 'raises a backend exception' do + VCR.use_cassette('vaos/v2/patients/get_patient_appointment_metadata_500_vpg', + match_requests_on: %i[method path query]) do + expect { subject.get_patient_appointment_metadata('primaryCare', '100', 'direct') }.to raise_error( + Common::Exceptions::BackendServiceException + ) + end end end end diff --git a/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_bad_facility.yml b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_bad_facility.yml new file mode 100644 index 00000000000..cb1116f8e54 --- /dev/null +++ b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_bad_facility.yml @@ -0,0 +1,75 @@ +--- +http_interactions: +- request: + method: get + uri: https://veteran.apps.va.gov/vpg/v1/patients/9000682/eligibility?clinicalService=primaryCare&location=1234567&type=request + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Vets.gov Agent + Referer: + - https://review-instance.va.gov + X-Vamf-Jwt: + - stubbed_token + X-Request-Id: + - '' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 12 Nov 2021 20:14:06 GMT + Content-Type: + - application/json + Content-Length: + - '270' + Server: + - openresty + X-Vamf-Version: + - 1.12.1 + B3: + - ef2ecbc4a5835d75-7b9d963a62e1db59-1 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - 661c259 + X-Vamf-Timestamp: + - '2021-11-01T15:35:46+0000' + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET,OPTIONS + Access-Control-Max-Age: + - '3600' + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "decisionDate": "2021-11-12T20:14:06.982635Z", + "clinicalServiceId": "primaryCare", + "type": "request", + "eligible": false, + "ineligibilityReasons": [ + { + "coding": [ + { + "code": "disabled", + "display": "appointment requests are disabled for the clinical service at the facility" + } + ] + } + ] + } + recorded_at: Fri, 12 Nov 2021 20:14:06 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_100.yml b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_100.yml new file mode 100644 index 00000000000..bc268e5f1f2 --- /dev/null +++ b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_100.yml @@ -0,0 +1,75 @@ +--- +http_interactions: +- request: + method: get + uri: https://veteran.apps.va.gov/vpg/v1/patients/9000682/eligibility?clinicalService=primaryCare&location=100&type=request + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Vets.gov Agent + Referer: + - https://review-instance.va.gov + X-Vamf-Jwt: + - stubbed_token + X-Request-Id: + - '' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 12 Nov 2021 20:14:06 GMT + Content-Type: + - application/json + Content-Length: + - '270' + Server: + - openresty + X-Vamf-Version: + - 1.12.1 + B3: + - ef2ecbc4a5835d75-7b9d963a62e1db59-1 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - 661c259 + X-Vamf-Timestamp: + - '2021-11-01T15:35:46+0000' + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET,OPTIONS + Access-Control-Max-Age: + - '3600' + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "decisionDate": "2021-11-12T20:14:06.982635Z", + "clinicalServiceId": "primaryCare", + "type": "request", + "eligible": false, + "ineligibilityReasons": [ + { + "coding": [ + { + "code": "facility-request-limit-exceeded", + "display": "the maximum number of pending appointment requests at the facility has been reached" + } + ] + } + ] + } + recorded_at: Fri, 12 Nov 2021 20:14:06 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_101.yml b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_101.yml new file mode 100644 index 00000000000..b485130a7c4 --- /dev/null +++ b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_101.yml @@ -0,0 +1,75 @@ +--- +http_interactions: +- request: + method: get + uri: https://veteran.apps.va.gov/vpg/v1/patients/9000682/eligibility?clinicalService=primaryCare&location=101&type=request + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Vets.gov Agent + Referer: + - https://review-instance.va.gov + X-Vamf-Jwt: + - stubbed_token + X-Request-Id: + - '' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 12 Nov 2021 20:14:06 GMT + Content-Type: + - application/json + Content-Length: + - '270' + Server: + - openresty + X-Vamf-Version: + - 1.12.1 + B3: + - ef2ecbc4a5835d75-7b9d963a62e1db59-1 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - 661c259 + X-Vamf-Timestamp: + - '2021-11-01T15:35:46+0000' + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET,OPTIONS + Access-Control-Max-Age: + - '3600' + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "decisionDate": "2021-11-12T20:14:06.982635Z", + "clinicalServiceId": "primaryCare", + "type": "request", + "eligible": false, + "ineligibilityReasons": [ + { + "coding": [ + { + "code": "Non-primary", + "display": "Non-primary facility with no visit within 12-24 months" + } + ] + } + ] + } + recorded_at: Fri, 12 Nov 2021 20:14:06 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_102.yml b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_102.yml new file mode 100644 index 00000000000..fdab24e6531 --- /dev/null +++ b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_102.yml @@ -0,0 +1,75 @@ +--- +http_interactions: +- request: + method: get + uri: https://veteran.apps.va.gov/vpg/v1/patients/9000682/eligibility?clinicalService=primaryCare&location=102&type=request + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Vets.gov Agent + Referer: + - https://review-instance.va.gov + X-Vamf-Jwt: + - stubbed_token + X-Request-Id: + - '' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 12 Nov 2021 20:14:06 GMT + Content-Type: + - application/json + Content-Length: + - '270' + Server: + - openresty + X-Vamf-Version: + - 1.12.1 + B3: + - ef2ecbc4a5835d75-7b9d963a62e1db59-1 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - 661c259 + X-Vamf-Timestamp: + - '2021-11-01T15:35:46+0000' + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET,OPTIONS + Access-Control-Max-Age: + - '3600' + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "decisionDate": "2021-11-12T20:14:06.982635Z", + "clinicalServiceId": "primaryCare", + "type": "request", + "eligible": false, + "ineligibilityReasons": [ + { + "coding": [ + { + "code": "Non-primary", + "display": "Non-primary facility with no visit within 12-24 months" + } + ] + } + ] + } + recorded_at: Fri, 12 Nov 2021 20:14:06 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_103.yml b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_103.yml new file mode 100644 index 00000000000..6a7afd3c77a --- /dev/null +++ b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_vpg_facility_103.yml @@ -0,0 +1,66 @@ +--- +http_interactions: +- request: + method: get + uri: https://veteran.apps.va.gov/vpg/v1/patients/9000682/eligibility?clinicalService=primaryCare&location=103&type=request + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Vets.gov Agent + Referer: + - https://review-instance.va.gov + X-Vamf-Jwt: + - stubbed_token + X-Request-Id: + - '' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 12 Nov 2021 20:14:06 GMT + Content-Type: + - application/json + Content-Length: + - '270' + Server: + - openresty + X-Vamf-Version: + - 1.12.1 + B3: + - ef2ecbc4a5835d75-7b9d963a62e1db59-1 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - 661c259 + X-Vamf-Timestamp: + - '2021-11-01T15:35:46+0000' + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET,OPTIONS + Access-Control-Max-Age: + - '3600' + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "decisionDate": "2021-11-12T20:14:06.982635Z", + "clinicalServiceId": "primaryCare", + "type": "request", + "eligible": true, + "ineligibilityReasons": [] + } + recorded_at: Fri, 12 Nov 2021 20:14:06 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata_500.yml b/spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata_500_vaos.yml similarity index 100% rename from spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata_500.yml rename to spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata_500_vaos.yml diff --git a/spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata_500_vpg.yml b/spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata_500_vpg.yml new file mode 100644 index 00000000000..d4b3fe3de49 --- /dev/null +++ b/spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata_500_vpg.yml @@ -0,0 +1,50 @@ +--- +http_interactions: + - request: + method: get + uri: https://veteran.apps.va.gov/vpg/v1/patients/1012845331V153043/eligibility?clinicalService=primaryCare&location=100&type=direct + body: + encoding: US-ASCII + string: "" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Vets.gov Agent + Referer: + - https://review-instance.va.gov + X-Vamf-Jwt: + - stubbed_token + X-Request-Id: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 500 + message: Internal Server Error + headers: + Date: + - Fri, 30 Apr 2021 18:20:59 GMT + Content-Type: + - text/html; charset=UTF-8 + Content-Length: + - "1293" + Connection: + - keep-alive + Etag: + - '"5fa5087d-3d6"' + Set-Cookie: + - TS016f4012=01c8917e48a6ff5d6388745eba38598b953d4407daed4ccd11489fd27f706ab9121de9a03381e2bd807e1b3a5b8dfaf1336e3ec2f1; + Max-Age=900; Path=/ + - vamfjwtv3=eyJ6aXAiOiJERUYiLCJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.Z0CRvAbt_2adWSz9Z6HzoJ5JMIhL0iZfyU6O-cqpKqICLl8h6SBirspZdfTUakLilQnj9MKnzw6WIymIWes98Qs28SNjs9HeECoxZ_h9oNWvb0fExtS5anjDQXHi3-lplcMxHbSBvc_vIsRwkChLEsxZn1dXzVCSTJj02ryXRwupjWAYuSCJ5QkoiT41RbnO8z_1ig6VQnieDdqgOq_FAnea5k7TWSq24aaaaUx2mMX6ld6ydNSNCvPi8zcdoJFcV84yp2_3xvTMY7okKe95GBS8mshFJIIiF-svEXfgFcP2Yg2JM-MAATdoPygBc6-Luyo1mzfePnjocmnbkINQlA.TDeHVCdAf0nuazbHgqtnNw.HRrp6qHwa7TGArRyby3WIwmif6ti9ierz76UjiqXSv5h93OmJ-Ha8xXFFSJVgsEfSs_3RZDbuv5KfpNMHKf27NEA0TSxA3B7KxYknGRZP3IFxWKOb2ImooRqRHHI9MuTkhswX2pa4_4yPc8bDhkHauJaHDtV5WSZ8CBNuUP6LT7CM3bsnv11jltcClUM7u-QUp-t-tYkS5wvnq1f1O2CtmqOAg_TGVkHNpeZru5aUuLEP0zzbaeg-jXQFfuZLFQhGMZOFwZtP2H1iXTjKxHR5gJNqXdCAaujcwcvLiYStNU1u3AkU73Xq8YLSXERg-4-h0cy7o6ROkdc-tqzNCDChDTpu9RYJ44cpNy3lmTwXK6duhuQPGBGn0M4k3Eoj1g_WC3wX3VhYh6weYceNDPYYofngVqMAhpJFpxF3gVcFzw9I-cSnKldTfmeQoo3hRuVbYJmgqsK6_23wu70H0ES2PMCvcg2zvuxCapWp2SY70O_HbUyy0LALrmaQoVnf2nHLLItHD7wjc_YhYBOnmKQaYifh34lyt1mlYzYLW1riT9U0pZ2YzhbNtsJLrV5KdAzpNVCj8TcMNAlePaJD1_YpMKQl9eNda79r_f76jUy-Avr8GcrV80MKz3HGLeTndUoEs6pkRDZ-qDqVe9G8g2zR4vQdy0OyVC4Hb2_YJNmCcL24zFy84Iflw9v0TvJZ6IBu32nuIjhupoK58xMxxIMPw.RQdBeAPwAyVwP5j1OpFSOqOdemos5-R931QYOK0tzmU; + path=/; SameSite=Lax; HttpOnly + - vamftimeoutv1=1619807759; SameSite=Lax; path=/ + body: + encoding: UTF-8 + string: '\r\n500 Internal Server Error\r\n\r\n

500 Internal Server Error/html>\r\n' + http_version: + recorded_at: Fri, 30 Apr 2021 18:21:00 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata.yml b/spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata_vaos.yml similarity index 100% rename from spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata.yml rename to spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata_vaos.yml diff --git a/spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata_vpg.yml b/spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata_vpg.yml new file mode 100644 index 00000000000..65f119fda82 --- /dev/null +++ b/spec/support/vcr_cassettes/vaos/v2/patients/get_patient_appointment_metadata_vpg.yml @@ -0,0 +1,75 @@ +--- +http_interactions: +- request: + method: get + uri: https://veteran.apps.va.gov/vpg/v1/patients/1012845331V153043/eligibility?clinicalService=primaryCare&location=100&type=direct + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Vets.gov Agent + Referer: + - https://review-instance.va.gov + X-Vamf-Jwt: + - stubbed_token + X-Request-Id: + - '' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 12 Nov 2021 20:14:06 GMT + Content-Type: + - application/json + Content-Length: + - '270' + Server: + - openresty + X-Vamf-Version: + - 1.12.1 + B3: + - ef2ecbc4a5835d75-7b9d963a62e1db59-1 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - 661c259 + X-Vamf-Timestamp: + - '2021-11-01T15:35:46+0000' + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET,OPTIONS + Access-Control-Max-Age: + - '3600' + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "decisionDate": "2021-11-12T20:14:06.982635Z", + "clinicalServiceId": "primaryCare", + "type": "direct", + "eligible": false, + "ineligibilityReasons": [ + { + "coding": [ + { + "code": "facility-cs-direct-disabled", + "display": "direct booking is disabled for the clinical service at the facility" + } + ] + } + ] + } + recorded_at: Fri, 12 Nov 2021 20:14:06 GMT +recorded_with: VCR 6.0.0