Skip to content

Commit

Permalink
Add diagnostics for VAOS modality error (#20243)
Browse files Browse the repository at this point in the history
* Add diagnostics for VAOS modality error

* Fix lint
  • Loading branch information
JunTaoLuo authored Jan 14, 2025
1 parent 2d0762e commit b6830c5
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions modules/vaos/app/services/vaos/v2/appointments_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -774,11 +774,27 @@ def set_modality(appointment)
modality = 'communityCare'
end

Rails.logger.info("VAOS appointment id #{appointment[:id]} modality cannot be determined.") if modality.nil?

log_modality_failure(appointment) if modality.nil?
appointment[:modality] = modality
end

def log_modality_failure(appointment)
Rails.logger.info("VAOS appointment id #{appointment[:id]} modality cannot be determined.")
if Random.new.rand(10).zero?
Rails.logger.info(
"VAOS appointment id #{appointment[:id]} modality details.",
{
service_type: appointment[:service_type],
service_category_text: appointment.dig(:service_category, 0, :text),
kind: appointment[:kind],
atlas: appointment.dig(:telehealth, :atlas),
vvs_kind: appointment.dig(:telehealth, :vvs_kind),
gfe: appointment.dig(:extension, :patient_has_mobile_gfe)
}.to_json
)
end
end

def telehealth_modality(appointment)
if !appointment.dig(:telehealth, :atlas).nil?
'vaVideoCareAtAnAtlasLocation'
Expand Down

0 comments on commit b6830c5

Please sign in to comment.