Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for alternate vaos-service route #18755

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions modules/vaos/app/services/vaos/base_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,13 @@ def referrer
'https://review-instance.va.gov' # VAMF rejects Referer that is not valid; such as those of review instances
end
end

def base_vaos_route
if Flipper.enabled?(:va_online_scheduling_vaos_alternate_route, user)
'vaos-alt/v1'
else
'vaos/v1'
end
end
end
end
6 changes: 3 additions & 3 deletions modules/vaos/app/services/vaos/v2/appointments_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ def log_partial_errors(response)
end

def appointments_base_path_vaos
"/vaos/v1/patients/#{user.icn}/appointments"
"/#{base_vaos_route}/patients/#{user.icn}/appointments"
end

def appointments_base_path_vpg
Expand All @@ -742,7 +742,7 @@ def get_appointment_base_path(appointment_id)
if Flipper.enabled?(APPOINTMENTS_USE_VPG, user)
"/vpg/v1/patients/#{user.icn}/appointments/#{appointment_id}"
else
"/vaos/v1/patients/#{user.icn}/appointments/#{appointment_id}"
"/#{base_vaos_route}/patients/#{user.icn}/appointments/#{appointment_id}"
end
end

Expand Down Expand Up @@ -773,7 +773,7 @@ def update_appointment_vpg(appt_id, status)
end

def update_appointment_vaos(appt_id, status)
url_path = "/vaos/v1/patients/#{user.icn}/appointments/#{appt_id}"
url_path = "/#{base_vaos_route}/patients/#{user.icn}/appointments/#{appt_id}"
params = VAOS::V2::UpdateAppointmentForm.new(status:).params
perform(:put, url_path, params, headers)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def page_params(pagination_params)
end

def clinic_url(station_id)
"/vaos/v1/locations/#{station_id}/clinics"
"/#{base_vaos_route}/locations/#{station_id}/clinics"
end

def scheduling_url
Expand Down
2 changes: 1 addition & 1 deletion modules/vaos/app/services/vaos/v2/patients_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_patient_appointment_metadata_vaos(clinic_service_id, facility_id, type)
type:
}

perform(:get, "/vaos/v1/patients/#{user.icn}/eligibility", params, headers)
perform(:get, "/#{base_vaos_route}/patients/#{user.icn}/eligibility", params, headers)
end

def get_patient_appointment_metadata_vpg(clinic_service_id, facility_id, type)
Expand Down
4 changes: 2 additions & 2 deletions modules/vaos/app/services/vaos/v2/systems_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def get_facility_clinics(location_id:,
page_number: nil)
with_monitoring do
page_size = 0 if page_size.nil? # 0 is the default for the VAOS service which means return all clinics
url = "/vaos/v1/locations/#{location_id}/clinics"
url = "/#{base_vaos_route}/locations/#{location_id}/clinics"
url_params = {
'patientIcn' => get_icn(clinical_service),
'clinicIds' => get_clinic_ids(clinic_ids),
Expand Down Expand Up @@ -57,7 +57,7 @@ def get_clinic_ids(ids)
end

def get_slots_vaos(location_id:, clinic_id:, start_dt:, end_dt:)
url_path = "/vaos/v1/locations/#{location_id}/clinics/#{clinic_id}/slots"
url_path = "/#{base_vaos_route}/locations/#{location_id}/clinics/#{clinic_id}/slots"
url_params = {
'start' => start_dt,
'end' => end_dt
Expand Down
Loading