-
Notifications
You must be signed in to change notification settings - Fork 66
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
adding merge functionality for eps to regular appointments #19754
base: master
Are you sure you want to change the base?
Conversation
adding merge functionality for eps to regular appointments
rubocop fixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that this is a draft so just providing general feedback. There are other changes that would be needed to make sure the merged appointments are used in the rest of the controller method. Please add tests as well so it's easier to understand the changes and the desired effect.
modules/vaos/app/controllers/vaos/v2/appointments_controller.rb
Outdated
Show resolved
Hide resolved
@@ -21,14 +21,16 @@ class AppointmentsController < VAOS::BaseController | |||
COMMENT = 'comment' | |||
|
|||
def index | |||
appointments[:data].each do |appt| | |||
merged_appointments = appointments_service.merge_appointments(eps_appointments, appointments) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest putting these changes behind a feature flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lee-delarm6 did we end up putting these behind a feature flag? do we need to? I'm thinking that when FE adds the code to include eps
param, we might still want to control when we merge or not merge the appointments
normalized_new = new_appointments[:appointments].map { |appt| normalize_eps_appointment(appt) } | ||
basic_data = basic_appointments[:data].is_a?(Array) ? basic_appointments[:data] : [basic_appointments[:data]] | ||
existing_ids = basic_data.to_set { |a| a[:referralId] } | ||
merged_data = basic_data + normalized_new.reject { |a| existing_ids.include?(a[:referralId]) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we deduping by referralId?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just marking this as a confirmation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please see if the vaos appointment data have referralId
& is available under referralId
key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been updated, we're using referral_number, a few data points have been changed. We are also using start
because referral_number is not purely unique, but it is when combined with a time
modules/vaos/app/controllers/vaos/v2/appointments_controller.rb
Outdated
Show resolved
Hide resolved
modules/vaos/app/controllers/vaos/v2/appointments_controller.rb
Outdated
Show resolved
Hide resolved
revert controller, move logic to service
update test
moved controller logic to service
dropping and fixing a few items with test and removing patient_id
removing unused function
update to master
Moved status to serialize step, altered status method slightly
Co-authored-by: Gaurav Gupta <randomsync@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with some minor feedback
referral_details = params[:referral] | ||
|
||
@id = params[:id]&.to_s | ||
@status = appointment_details[:status], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest removing the comma from here
@lee-delarm6 can you put this PR in a draft state until the lint/test warnings/failures are resolved? |
I'm updating to master branch, my tests should still be passing, I believe it's most likely due to not being updated to master |
rubocop fix
…artment-of-veterans-affairs/vets-api into 96412_merge_eps_appointments
Fixed! It was mine :D |
@lee-delarm6 there is still a failing test |
It was my test, I fixed it. I totally forgot I updated another file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lee-delarm6 the EpsAppointment class and corresponding spec should be moved under the model/vaos/v2
folder
Sorry I didn't notice that sooner
Summary
Testing done
What areas of the site does it impact?
Appointment retrieval and display
Configuration settings
Appointment service layer
Acceptance criteria