<commit_before>module AthenaHealth
  module Endpoints
    module Appointments
      def all_appointment_types(practice_id:, params: {})
        response = @api.call(
          endpoint: "#{practice_id}/appointmenttypes",
          method: :get,
          params: params
        )

        AppointmentTypeCollection.new(response)
      end

      def open_appointment_slots(practice_id:, department_id:, appointment_type_id:, params: {})
        response = @api.call(
          endpoint: "#{practice_id}/appointments/open",
          method: :get,
          params: params.merge(departmentid: department_id, appointmenttypeid: appointment_type_id)
        )

        AppointmentCollection.new(response)
      end
    end
  end
end<commit_msg>Add booking appointments<commit_after>module AthenaHealth
  module Endpoints
    module Appointments
      def all_appointment_types(practice_id:, params: {})
        response = @api.call(
          endpoint: "#{practice_id}/appointmenttypes",
          method: :get,
          params: params
        )

        AppointmentTypeCollection.new(response)
      end

      def open_appointment_slots(practice_id:, department_id:, appointment_type_id:, params: {})
        response = @api.call(
          endpoint: "#{practice_id}/appointments/open",
          method: :get,
          params: params.merge(departmentid: department_id, appointmenttypeid: appointment_type_id)
        )

        AppointmentCollection.new(response)
      end

      def book_appointment(practice_id:, appointment_id:, patient_id:, params: {})
        response = @api.call(
          endpoint: "#{practice_id}/appointments/#{appointment_id}",
          method: :put,
          params: params.merge(patientid: patient_id)
        )

        Appointment.new(response.first)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09696969696969697, 'fraction_numerical': 0.0, 'mean_word_length': 2.661290322580645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6603067', 'n_tokens_mistral': 544, 'n_tokens_neox': 515, 'n_words': 97}