Skip to content

Commit

Permalink
57009: temporarily remove rx logging (#12503)
Browse files Browse the repository at this point in the history
* 57009: temporarily remove rx logging

* lint
  • Loading branch information
kpethtel authored Apr 27, 2023
1 parent f8c3f99 commit 882dd03
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@ module V0
class PrescriptionsController < ApplicationController
before_action { authorize :mhv_prescriptions, :access? }

# rubocop:disable Metrics/MethodLength
def index
begin
resource = client.get_history_rxs

# Temporary logging for prescription bug investigation
resource.attributes.each do |p|
Rails.logger.info('MHV Prescription Response',
user: @current_user.uuid,
params:, id: p[:prescription_id],
prescription: p)
end
# resource.attributes.each do |p|
# Rails.logger.info('MHV Prescription Response',
# user: @current_user.uuid,
# params:, id: p[:prescription_id],
# prescription: p)
# end
rescue => e
Rails.logger.error(
'Mobile Prescription Upstream Index Error',
Expand All @@ -34,19 +33,18 @@ def index
serialized_prescription = Mobile::V0::PrescriptionsSerializer.new(page_resource, page_meta_data)

# Temporary logging for prescription bug investigation
serialized_prescription.to_hash[:data].each do |p|
Rails.logger.info('Mobile Prescription Response', user: @current_user.uuid, id: p[:id], prescription: p)
end
# serialized_prescription.to_hash[:data].each do |p|
# Rails.logger.info('Mobile Prescription Response', user: @current_user.uuid, id: p[:id], prescription: p)
# end

render json: serialized_prescription
end
# rubocop:enable Metrics/MethodLength

def refill
resource = client.post_refill_rxs(ids)

# Temporary logging for prescription bug investigation
Rails.logger.info('MHV Prescription Refill Response', user: @current_user.uuid, ids:, response: resource)
# Rails.logger.info('MHV Prescription Refill Response', user: @current_user.uuid, ids:, response: resource)

render json: Mobile::V0::PrescriptionsRefillsSerializer.new(@current_user.uuid, resource.body)
rescue => e
Expand All @@ -61,8 +59,8 @@ def tracking
resource = client.get_tracking_history_rx(params[:id])

# Temporary logging for prescription bug investigation
Rails.logger.info('MHV Prescription Tracking Response', user: @current_user.uuid, id: params[:id],
response: resource)
# Rails.logger.info('MHV Prescription Tracking Response', user: @current_user.uuid, id: params[:id],
# response: resource)

render json: Mobile::V0::PrescriptionTrackingSerializer.new(resource.data)
rescue => e
Expand Down

0 comments on commit 882dd03

Please sign in to comment.