diff --git a/modules/vaos/app/controllers/vaos/v2/appointments_controller.rb b/modules/vaos/app/controllers/vaos/v2/appointments_controller.rb index bf8f0db9b1f..14921a052c8 100644 --- a/modules/vaos/app/controllers/vaos/v2/appointments_controller.rb +++ b/modules/vaos/app/controllers/vaos/v2/appointments_controller.rb @@ -6,6 +6,13 @@ module VAOS module V2 class AppointmentsController < VAOS::BaseController STATSD_KEY = 'api.vaos.va_mobile.response.partial' + NPI_NOT_FOUND_MSG = "We're sorry, we can't display your provider's information right now." + PAP_COMPLIANCE_TELE = 'PAP COMPLIANCE/TELE' + PAP_COMPLIANCE_TELE_KEY = 'PAP COMPLIANCE/TELE Appointment Details' + FACILITY_ERROR_MSG = 'Error fetching facility details' + APPT_INDEX = 'Appointment Index' + APPT_SHOW = 'Appointment Show' + APPT_CREATE = 'Appointment Create' # cache utilized by the controller to store key/value pairs of provider name and npi # in order to prevent duplicate service call lookups during index/show/create @@ -24,6 +31,10 @@ def index _include&.include?('clinics') && merge_clinics(appointments[:data]) _include&.include?('facilities') && merge_facilities(appointments[:data]) + appointments[:data].each do |appt| + log_pap_compliance_appt_data(appt, APPT_INDEX) if appt&.[](:reason)&.include? PAP_COMPLIANCE_TELE + end + serializer = VAOS::V2::VAOSSerializer.new serialized = serializer.serialize(appointments[:data], 'appointments') @@ -51,6 +62,10 @@ def show appointment[:location] = get_facility(appointment[:location_id]) unless appointment[:location_id].nil? + if appointment&.[](:reason_code)&.[](:text)&.include? PAP_COMPLIANCE_TELE + log_pap_compliance_appt_data(appointment, APPT_SHOW) + end + serializer = VAOS::V2::VAOSSerializer.new serialized = serializer.serialize(appointment, 'appointments') render json: { data: serialized } @@ -72,6 +87,11 @@ def create unless new_appointment[:location_id].nil? new_appointment[:location] = get_facility(new_appointment[:location_id]) end + + if new_appointment&.[](:reason_code)&.[](:text)&.include? PAP_COMPLIANCE_TELE + log_pap_compliance_appt_data(new_appointment, APPT_CREATE) + end + serializer = VAOS::V2::VAOSSerializer.new serialized = serializer.serialize(new_appointment, 'appointments') render json: { data: serialized }, status: :created @@ -142,8 +162,6 @@ def updated_appointment # will cache at the class level the key value pair of npi and provider name to avoid # duplicate get_provider_with_cache calls - NPI_NOT_FOUND_MSG = "We're sorry, we can't display your provider's information right now." - def find_and_merge_provider_name(appt) found_npi = find_npi(appt) if found_npi @@ -225,8 +243,6 @@ def add_timezone_offset(date, tz) utc_date.change(offset: timezone_offset).to_datetime end - FACILITY_ERROR_MSG = 'Error fetching facility details' - # Returns the facility timezone id (eg. 'America/New_York') associated with facility id (location_id) def get_facility_timezone(facility_location_id) facility_info = get_facility(facility_location_id) @@ -294,6 +310,20 @@ def get_facility(location_id) FACILITY_ERROR_MSG end + def log_pap_compliance_appt_data(appt, appt_method) + pap_compliance_entry = { PAP_COMPLIANCE_TELE_KEY => pap_compliance_details(appt[:location_id], appt[:clinic], + appt_method) } + Rails.logger.info('Details for PAP COMPLIANCE/TELE appointment', pap_compliance_entry.to_json) + end + + def pap_compliance_details(location_id, clinic, appt_method) + { + endpoint_method: appt_method, + location_id:, + clinic: + } + end + def update_appt_id params.require(:id) end diff --git a/modules/vaos/spec/request/v2/appointments_request_spec.rb b/modules/vaos/spec/request/v2/appointments_request_spec.rb index 726a177b635..41d2274674a 100644 --- a/modules/vaos/spec/request/v2/appointments_request_spec.rb +++ b/modules/vaos/spec/request/v2/appointments_request_spec.rb @@ -106,6 +106,18 @@ expect(json_body_for(response)).to match_camelized_schema('vaos/v2/appointment', { strict: false }) end end + + it 'creates the va appointment and logs appointment details when there is a PAP COMPLIANCE comment' do + VCR.use_cassette('vaos/v2/appointments/post_appointments_va_booked_200_and_log_facility', + match_requests_on: %i[method path query]) do + allow(Rails.logger).to receive(:info).at_least(:once) + post '/vaos/v2/appointments', params: va_booked_request_body, headers: inflection_header + expect(response).to have_http_status(:created) + expect(json_body_for(response)).to match_camelized_schema('vaos/v2/appointment', { strict: false }) + expect(Rails.logger).to have_received(:info).with('Details for PAP COMPLIANCE/TELE appointment', + any_args).at_least(:once) + end + end end describe 'GET appointments' do @@ -177,6 +189,19 @@ end end + it 'returns va appointments and logs details when there is a PAP COMPLIANCE comment' do + VCR.use_cassette('vaos/v2/appointments/get_appointments_200_with_facilities_200_and_log_pap_comp', + match_requests_on: %i[method path query], allow_playback_repeats: true) do + allow(Rails.logger).to receive(:info).at_least(:once) + get '/vaos/v2/appointments', params:, headers: inflection_header + expect(response).to have_http_status(:ok) + expect(response.body).to be_a(String) + expect(Rails.logger).to have_received(:info).with('Details for PAP COMPLIANCE/TELE appointment', + any_args).at_least(:once) + expect(response).to match_camelized_response_schema('vaos/v2/appointments', { strict: false }) + end + end + it 'has access and returns a va appointments with no location id' do VCR.use_cassette('vaos/v2/appointments/get_appointments_200_no_location_id', match_requests_on: %i[method path query], allow_playback_repeats: true) do @@ -319,6 +344,23 @@ end end + it 'returns appointment and logs PAP COMPLIANCE details' do + VCR.use_cassette('vaos/v2/appointments/get_appointment_200_with_facility_200_and_log_pap_comp', + match_requests_on: %i[method path query]) do + allow(Rails.logger).to receive(:info).at_least(:once) + get '/vaos/v2/appointments/70060', headers: inflection_header + expect(response).to have_http_status(:ok) + expect(json_body_for(response)).to match_camelized_schema('vaos/v2/appointment', { strict: false }) + data = JSON.parse(response.body)['data'] + + expect(data['id']).to eq('70060') + expect(data['attributes']['kind']).to eq('clinic') + expect(data['attributes']['status']).to eq('proposed') + expect(Rails.logger).to have_received(:info).with('Details for PAP COMPLIANCE/TELE appointment', + any_args).at_least(:once) + end + end + # TODO: verify this cc request spec with NPI changes it 'has access and returns appointment - cc proposed' do VCR.use_cassette('vaos/v2/appointments/get_appointment_200_cc_proposed_with_facility_200', diff --git a/spec/support/vcr_cassettes/vaos/v2/appointments/get_appointment_200_with_facility_200_and_log_pap_comp.yml b/spec/support/vcr_cassettes/vaos/v2/appointments/get_appointment_200_with_facility_200_and_log_pap_comp.yml new file mode 100644 index 00000000000..6f63466c68c --- /dev/null +++ b/spec/support/vcr_cassettes/vaos/v2/appointments/get_appointment_200_with_facility_200_and_log_pap_comp.yml @@ -0,0 +1,153 @@ +--- +http_interactions: +- request: + method: get + uri: https://veteran.apps.va.gov/vaos/v1/patients/1012846043V576341/appointments/70060 + 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: + - Mon, 13 Dec 2021 23:28:26 GMT + Content-Type: + - application/json + Content-Length: + - '653' + Server: + - openresty + X-Vamf-Version: + - 1.14.1 + B3: + - 8c17e441da8d346f6934d442b0a0ac7c-e1581452019f7fc4-0 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - 20a82ca + X-Vamf-Timestamp: + - '2021-11-26T16:29:10+0000' + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET,OPTIONS + Access-Control-Max-Age: + - '3600' + X-Envoy-Upstream-Service-Time: + - '424' + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: '{"data":{"id":"70060","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/ars/id","value":"8a4890c47da65e2b017db59b20500000"}],"kind":"clinic","status":"proposed","serviceType":"socialWork","reasonCode":{"text":"PAP COMPLIANCE/TELE"},"patientIcn":"1012846043V576341","locationId":"983GB","created":"2021-12-13T14:03:02Z","requestedPeriods":[{"start":"2021-12-20T00:00:00Z","end":"2021-12-20T11:59:59.999Z"}],"contact":{"telecom":[{"type":"email","value":"C_Natalie.Yun@cerner.com"},{"type":"phone","value":"2566832029"}]},"preferredTimesForPhoneCall":["Morning"],"cancellationReason":{"code":"other"},"cancellable":true,"extension":{"ccLocation":{"address":{}}}}}' + recorded_at: Mon, 13 Dec 2021 23:28:26 GMT +- request: + method: get + uri: https://veteran.apps.va.gov/facilities/v2/facilities/983GB + 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: + - Mon, 09 Aug 2021 17:48:58 GMT + Content-Type: + - application/json + Content-Length: + - '1114' + Server: + - openresty + X-Vamf-Version: + - 2.8.0 + B3: + - 531af1d2054d758c-b79b44f980a35120-0 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - '6026315' + X-Vamf-Timestamp: + - '2021-07-06T17:59:37+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: |- + { + "id" : "983GB", + "vistaSite" : "983", + "vastParent" : "983", + "type" : "va_facilities", + "name" : "Cheyenne VA Medical Center", + "classification" : "VA Medical Center (VAMC)", + "timezone": { + "zoneId": "America/New_York", + "abbreviation": "EDT" + }, + "lat" : 39.744507, + "long" : -104.830956, + "website" : "https://www.denver.va.gov/locations/directions.asp", + "phone" : { + "main" : "307-778-7550", + "fax" : "307-778-7381", + "pharmacy" : "866-420-6337", + "afterHours" : "307-778-7550", + "patientAdvocate" : "307-778-7550 x7517", + "mentalHealthClinic" : "307-778-7349", + "enrollmentCoordinator" : "307-778-7550 x7579" + }, + "physicalAddress" : { + "type" : "physical", + "line" : [ "2360 East Pershing Boulevard" ], + "city" : "Cheyenne", + "state" : "WY", + "postalCode" : "82001-5356" + }, + "mobile" : false, + "healthService" : [ "Audiology", "Cardiology", "DentalServices", "EmergencyCare", "Gastroenterology", "Gynecology", "MentalHealthCare", "Nutrition", "Ophthalmology", "Optometry", "Orthopedics", "Podiatry", "PrimaryCare", "SpecialtyCare", "UrgentCare", "Urology", "WomensHealth" ], + "operatingStatus" : { + "code" : "NORMAL" + } + } + recorded_at: Mon, 09 Aug 2021 17:48:58 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/support/vcr_cassettes/vaos/v2/appointments/get_appointments_200_with_facilities_200_and_log_pap_comp.yml b/spec/support/vcr_cassettes/vaos/v2/appointments/get_appointments_200_with_facilities_200_and_log_pap_comp.yml new file mode 100644 index 00000000000..78067da8525 --- /dev/null +++ b/spec/support/vcr_cassettes/vaos/v2/appointments/get_appointments_200_with_facilities_200_and_log_pap_comp.yml @@ -0,0 +1,247 @@ +--- +http_interactions: +- request: + method: get + uri: https://veteran.apps.va.gov/vaos/v1/patients/1012846043V576341/appointments?end=2022-12-01T19:45:00Z&pageSize=0&start=2022-01-01T19:25:00Z + 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: + - Thu, 04 Nov 2021 19:56:46 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Server: + - openresty + X-Vamf-Version: + - 1.12.1 + B3: + - fb5e01cb7d2f4995-d9e83a83cc4e7326-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: '{"data":[{"id":"37060","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/vista/984/appointment/id","value":"3583;20210902.100000"}],"kind":"clinic","status":"cancelled","serviceType":"audiology","patientIcn":"1012845331V153043","locationId":"984","clinic":"3583","start":"2021-09-02T14:00:00Z","cancellationReason":{"code":"other"},"cancelationReason":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/appointment-cancellation-reason","code":"pat","display":"The + appointment was cancelled by the patient"}]},"cancellable":false},{"id":"32237","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/vista/983/appointment/id","value":"707;20210903.094500"}],"kind":"clinic","status":"cancelled","serviceType":"foodAndNutrition","patientIcn":"1012845331V153043","locationId":"983","clinic":"707","start":"2021-09-03T15:45:00Z","cancellationReason":{"code":"other"},"cancelationReason":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/appointment-cancellation-reason","code":"pat","display":"The + appointment was cancelled by the patient"}]},"cancellable":false},{"id":"50059","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/vista/983/appointment/id","value":"308;20210903.140000"}],"kind":"clinic","status":"cancelled","serviceType":"primaryCare","patientIcn":"1012845331V153043","locationId":"983","clinic":"308","start":"2021-09-03T20:00:00Z","cancellationReason":{"code":"other"},"cancelationReason":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/appointment-cancellation-reason","code":"pat","display":"The + appointment was cancelled by the patient"}]},"cancellable":false},{"id":"41121","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/vista/983/appointment/id","value":"923;20210906.100000"}],"kind":"clinic","status":"cancelled","patientIcn":"1012845331V153043","locationId":"983","clinic":"923","start":"2021-09-06T16:00:00Z","cancellationReason":{"code":"other"},"cancelationReason":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/appointment-cancellation-reason","code":"pat","display":"The + appointment was cancelled by the patient"}]},"cancellable":false},{"id":"50096","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/vista/983/appointment/id","value":"308;20210907.140000"}],"kind":"clinic","serviceType":"primaryCare","patientIcn":"1012845331V153043","locationId":"983","clinic":"308","start":"2021-09-07T20:00:00Z","end":"2021-09-07T20:20:00Z","minutesDuration":20,"slot":{"id":"3230323130393037323030303A323032313039303732303230","start":"2021-09-07T20:00:00Z","end":"2021-09-07T20:20:00Z"},"cancellationReason":{"code":"other"},"cancellable":true},{"id":"43956","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/vista/983/appointment/id","value":"848;20210915.080000"}],"kind":"clinic","status":"cancelled","serviceType":"primaryCare","patientIcn":"1012845331V153043","locationId":"983","clinic":"848","start":"2021-09-15T14:00:00Z","cancellationReason":{"code":"other"},"cancelationReason":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/appointment-cancellation-reason","code":"prov","display":"The + appointment was cancelled by the provider"}]},"cancellable":false},{"id":"50094","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/ars/id","value":"8a487fd67ba6a62d017bc0cc86d80002"}],"kind":"telehealth","status":"proposed","serviceType":"Primary + Care ","patientIcn":"1012845331V153043","locationId":"983","reason":"Test_SM + test (tele)","requestedPeriods":[{"start":"2021-09-08T12:00:00Z","end":"2021-09-08T23:59:59.999Z"}],"contact":{"telecom":[{"type":"phone","value":"9999999992"}]},"cancellationReason":{"code":"other"},"cancellable":true},{"id":"53351","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/ars/id","value":"8a48f8687be6a735017bea5ab97a0007"}],"kind":"clinic","status":"cancelled","serviceType":"primaryCare","patientIcn":"1012845331V153043","locationId":"983","reason":"Medication + Concern","requestedPeriods":[{"start":"2022-01-13T00:00:00Z","end":"2022-01-13T11:59:59.999Z"}],"contact":{"telecom":[{"type":"email","value":"Aarathi.poldass@va.gov"},{"type":"phone","value":"7175555555"}]},"preferredTimesForPhoneCall":["Morning"],"cancellationReason":{"code":"other"},"cancellable":false},{"id":"50962","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/ars/id","value":"8a48d8a47ba18356017bc5fb7d7d002c"}],"kind":"telehealth","status":"cancelled","serviceType":"audiology","patientIcn":"1012845331V153043","locationId":"983","reason":"PAP COMPLIANCE/TELE","requestedPeriods":[{"start":"2021-09-13T00:00:00Z","end":"2021-09-13T11:59:59.999Z"},{"start":"2021-09-13T12:00:00Z","end":"2021-09-13T23:59:59.999Z"}],"contact":{"telecom":[{"type":"email","value":"mightykc70@gmail.com"},{"type":"phone","value":"7175555555"}]},"preferredTimesForPhoneCall":["Afternoon"],"cancellationReason":{"code":"other"},"cancellable":false},{"id":"50077","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/ars/id","value":"8a48b4ef7ba184d5017ba77f4ab20017"}],"kind":"clinic","status":"cancelled","serviceType":"primaryCare","patientIcn":"1012845331V153043","locationId":"983","reason":"Routine + Follow-up","requestedPeriods":[{"start":"2021-09-07T00:00:00Z","end":"2021-09-07T11:59:59.999Z"}],"contact":{"telecom":[{"type":"email","value":"marcy.nadeau@va.gov"},{"type":"phone","value":"7175555555"}]},"preferredTimesForPhoneCall":["Morning"],"cancellationReason":{"code":"other"},"cancellable":false},{"id":"50093","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/ars/id","value":"8a487fd67ba6a62d017bc0c8f6730001"}],"kind":"clinic","status":"cancelled","serviceType":"primary + care","patientIcn":"1012845331V153043","locationId":"983","reason":"Test_SM + test","requestedPeriods":[{"start":"2021-09-07T12:00:00Z","end":"2021-09-07T23:59:59.999Z"}],"contact":{"telecom":[{"type":"phone","value":"9999999991"}]},"cancellationReason":{"code":"other"},"cancellable":false},{"id":"50960","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/ars/id","value":"8a48ebfe7ba184d4017bc5ffbb6e0033"}],"kind":"telehealth","status":"cancelled","serviceType":"audiology","patientIcn":"1012845331V153043","locationId":"983","reason":"Routine + Follow-up","requestedPeriods":[{"start":"2021-09-13T00:00:00Z","end":"2021-09-13T11:59:59.999Z"}],"contact":{"telecom":[{"type":"email","value":"marcy.nadeau@va.gov"},{"type":"phone","value":"7175555555"}]},"preferredTimesForPhoneCall":["Afternoon"],"cancellationReason":{"code":"other"},"cancellable":false},{"id":"50957","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/ars/id","value":"8a48ebfe7ba184d4017ba7e00d270026"}],"kind":"clinic","status":"cancelled","serviceType":"audiology","patientIcn":"1012845331V153043","locationId":"983","reason":"Routine + Follow-up","requestedPeriods":[{"start":"2021-09-22T00:00:00Z","end":"2021-09-22T11:59:59.999Z"}],"contact":{"telecom":[{"type":"email","value":"Aarathi.poldass@va.gov"},{"type":"phone","value":"7175555555"}]},"preferredTimesForPhoneCall":["Morning"],"cancellationReason":{"code":"other"},"cancellable":false},{"id":"50101","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/ars/id","value":"8a487fd67ba6a62d017bc101fd390007"}],"kind":"clinic","status":"cancelled","serviceType":"mental + health","patientIcn":"1012845331V153043","locationId":"983","reason":"Test///-SM(clinic_prop)","requestedPeriods":[{"start":"2021-09-07T12:00:00Z","end":"2021-09-07T23:59:59.999Z"}],"contact":{"telecom":[{"type":"phone","value":"9999999998"}]},"cancellationReason":{"code":"other"},"cancellable":false},{"id":"50066","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/ars/id","value":"8a487fcd7ba1835c017ba6bb1eaf0010"}],"kind":"phone","status":"cancelled","serviceType":"primaryCare","patientIcn":"1012845331V153043","locationId":"983","reason":"New + Issue","requestedPeriods":[{"start":"2021-09-13T00:00:00Z","end":"2021-09-13T11:59:59.999Z"}],"contact":{"telecom":[{"type":"email","value":"marcy.nadeau@va.gov"},{"type":"phone","value":"7175555555"}]},"preferredTimesForPhoneCall":["Afternoon"],"cancellationReason":{"code":"other"},"cancellable":false},{"id":"50067","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/ars/id","value":"8a48b4ef7ba184d5017ba68a3bd70010"}],"kind":"phone","status":"cancelled","serviceType":"primaryCare","patientIcn":"1012845331V153043","locationId":"983","reason":"New + Issue","requestedPeriods":[{"start":"2021-09-07T00:00:00Z","end":"2021-09-07T11:59:59.999Z"}],"contact":{"telecom":[{"type":"email","value":"marcy.nadeau@va.gov"},{"type":"phone","value":"7175555555"}]},"preferredTimesForPhoneCall":["Afternoon"],"cancellationReason":{"code":"other"},"cancellable":false}]}' + recorded_at: Thu, 04 Nov 2021 19:56:46 GMT +- request: + method: get + uri: https://veteran.apps.va.gov/facilities/v2/facilities/983 + 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: + - Mon, 09 Aug 2021 17:48:58 GMT + Content-Type: + - application/json + Content-Length: + - '1114' + Server: + - openresty + X-Vamf-Version: + - 2.8.0 + B3: + - 531af1d2054d758c-b79b44f980a35120-0 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - '6026315' + X-Vamf-Timestamp: + - '2021-07-06T17:59:37+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: |- + { + "id" : "983", + "vistaSite" : "983", + "vastParent" : "983", + "type" : "va_facilities", + "name" : "Cheyenne VA Medical Center", + "classification" : "VA Medical Center (VAMC)", + "timezone": { + "zoneId": "America/New_York", + "abbreviation": "EDT" + }, + "lat" : 39.744507, + "long" : -104.830956, + "website" : "https://www.denver.va.gov/locations/directions.asp", + "phone" : { + "main" : "307-778-7550", + "fax" : "307-778-7381", + "pharmacy" : "866-420-6337", + "afterHours" : "307-778-7550", + "patientAdvocate" : "307-778-7550 x7517", + "mentalHealthClinic" : "307-778-7349", + "enrollmentCoordinator" : "307-778-7550 x7579" + }, + "physicalAddress" : { + "type" : "physical", + "line" : [ "2360 East Pershing Boulevard" ], + "city" : "Cheyenne", + "state" : "WY", + "postalCode" : "82001-5356" + }, + "mobile" : false, + "healthService" : [ "Audiology", "Cardiology", "DentalServices", "EmergencyCare", "Gastroenterology", "Gynecology", "MentalHealthCare", "Nutrition", "Ophthalmology", "Optometry", "Orthopedics", "Podiatry", "PrimaryCare", "SpecialtyCare", "UrgentCare", "Urology", "WomensHealth" ], + "operatingStatus" : { + "code" : "NORMAL" + } + } + recorded_at: Mon, 09 Aug 2021 17:48:58 GMT +- request: + method: get + uri: https://veteran.apps.va.gov/facilities/v2/facilities/984 + 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: + - Mon, 09 Aug 2021 17:48:58 GMT + Content-Type: + - application/json + Content-Length: + - '1114' + Server: + - openresty + X-Vamf-Version: + - 2.8.0 + B3: + - 531af1d2054d758c-b79b44f980a35120-0 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - '6026315' + X-Vamf-Timestamp: + - '2021-07-06T17:59:37+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: |- + { + "id" : "984", + "vistaSite" : "984", + "vastParent" : "984", + "type" : "va_health_facility", + "name" : "Dayton VA Medical Center", + "classification" : "VA Medical Center (VAMC)", + "timezone": { + "zoneId": "America/New_York", + "abbreviation": "EDT" + }, + "website" : "https://www.dayton.va.gov/locations/directions.asp", + "phone" : { + "main" : "937-268-6511" + }, + "physicalAddress" : { + "type" : "physical", + "line" : [ "4100 West Third Street" ], + "city" : "Dayton", + "state" : "OH", + "postalCode" : "45428-9000" + }, + "healthService" : [ "Audiology", "Cardiology", "DentalServices", "Dermatology", "Gastroenterology", "Gynecology", "MentalHealthCare", "Nutrition", "Ophthalmology", "Optometry", "Orthopedics", "Podiatry", "PrimaryCare", "SpecialtyCare", "Urology", "WomensHealth" ] + } + recorded_at: Mon, 09 Aug 2021 17:48:58 GMT +recorded_with: VCR 6.0.0 diff --git a/spec/support/vcr_cassettes/vaos/v2/appointments/post_appointments_va_booked_200_and_log_facility.yml b/spec/support/vcr_cassettes/vaos/v2/appointments/post_appointments_va_booked_200_and_log_facility.yml new file mode 100644 index 00000000000..6a1d7846b0d --- /dev/null +++ b/spec/support/vcr_cassettes/vaos/v2/appointments/post_appointments_va_booked_200_and_log_facility.yml @@ -0,0 +1,62 @@ +--- +http_interactions: +- request: + method: post + uri: https://veteran.apps.va.gov/vaos/v1/patients/1012846043V576341/appointments + body: + encoding: UTF-8 + string: '{"kind":"clinic","status":"booked","locationId":"983","clinic":"999","slot":{"id":"3230323231313330323034353A323032323131333032313030"},"reasonCode":{"text":"testing","coding":[{"code":"Routine + Follow-up"}]},"extension":{"desiredDate":"2022-11-29T17:00:00-07:00"},"patientIcn":"1012846043V576341"}' + 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: + - 6abdafd2-d7e8-40e2-9485-aeadad4fde5f + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 20 Oct 2022 22:21:59 GMT + Content-Type: + - application/json + Content-Length: + - '616' + Server: + - openresty + X-Vamf-Version: + - 1.23.1 + B3: + - 9386e780c6e24ce819013350157327bc-3637f2cce7a14a9d-0 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - 31af686 + X-Vamf-Timestamp: + - '2022-10-20T16:55:11+0000' + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET,OPTIONS + Access-Control-Max-Age: + - '3600' + X-Envoy-Upstream-Service-Time: + - '1454' + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: '{"id":"139064","identifier":[{"system":"http://med.va.gov/fhir/urn/vaos/vista/983/appointment/id","value":"999;20221130.134500"}],"kind":"clinic","status":"booked","serviceType":"optometry","serviceCategory":[{"coding":[{"system":"http://www.va.gov/Terminology/VistADefinedTerms/409_1","code":"REGULAR","display":"REGULAR"}],"text":"REGULAR"}],"reasonCode":{"text":"PAP COMPLIANCE/TELE"},"patientIcn":"1012846043V576341","locationId":"983","clinic":"999","start":"2022-11-30T20:45:00Z","end":"2022-11-30T21:00:00Z","minutesDuration":15,"slot":{"id":"3230323231313330323034353A323032323131333032313030","start":"2022-11-30T20:45:00Z","end":"2022-11-30T21:00:00Z"},"comment":"PAP COMPLIANCE/TELE","cancellable":true,"extension":{"ccLocation":{"address":{}}}}' + recorded_at: Thu, 20 Oct 2022 22:21:59 GMT +recorded_with: VCR 6.1.0