Sha256: 7a3f688553fe7ef8136c3a39f63f6dfb39c34c2437f03d2db6a9409372a6afff

Contents?: true

Size: 720 Bytes

Versions: 6

Compression:

Stored size: 720 Bytes

Contents

module Medivo
  class LabsController < ActionController::Base

    def lab_data
      lab_data = Medivo::Lab.data_for_zip(params[:zip_code])
      render :json=> lab_data
    end

    def appointment_data
      data = Medivo::Appointment.find(params[:lab_code], params[:date], params[:am_pm])
      render :json=> data
    rescue RestClient::RequestTimeout, RestClient::InternalServerError => te
      render :status=> te.http_code, :json=> {:message=>"Could be lab_code is wrong, or labcorp server is down"}
    rescue RestClient::Exception => br
      render :status=> br.http_code, :json=> {:message=>br.response}
    rescue Exception => e
      render :status=> 500, :json=> {:message=>e.message}
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
medivo-0.2.7 app/controllers/medivo/labs_controller.rb
medivo-0.2.6 app/controllers/medivo/labs_controller.rb
medivo-0.2.5 app/controllers/medivo/labs_controller.rb
medivo-0.2.3 app/controllers/medivo/labs_controller.rb
medivo-0.2.2 app/controllers/medivo/labs_controller.rb
medivo-0.2.1 app/controllers/medivo/labs_controller.rb