Sha256: 99b77538ed923c862611fddc9c132994d64b90f3b43983168b0e549e39a50a2c

Contents?: true

Size: 1.82 KB

Versions: 7

Compression:

Stored size: 1.82 KB

Contents

module AthenaHealth
  module Endpoints
    module Encounters
      def find_encounter(practice_id:, encounter_id:)
        response = @api.call(
          endpoint: "#{practice_id}/chart/encounter/#{encounter_id}",
          method: :get
        )

        Encounter.new(response.first)
      end

      def encounter_orders(practice_id:, encounter_id:)
        response = @api.call(
          endpoint: "#{practice_id}/chart/encounter/#{encounter_id}/orders",
          method: :get
        )
        orders_collection = []
        response.each {|x| orders_collection << OrderCollection.new(x)}

        orders_collection
      end

      def encounter_order(practice_id:, encounter_id:, order_id:)
        response = @api.call(
          endpoint: "#{practice_id}/chart/encounter/#{encounter_id}/orders/#{order_id}",
          method: :get
        )

        Order.new(response)
      end

      def encounter_summary(practice_id:, encounter_id:)
        response = @api.call(
          endpoint:  "#{practice_id}/chart/encounters/#{encounter_id}/summary",
          method: :get
        )
        EncounterSummary.new(response)
      end

      def create_encounter_order_lab(practice_id:, encounter_id:, body: {})
        @api.call(
          endpoint: "#{practice_id}/chart/encounter/#{encounter_id}/orders/lab",
          method: :post,
          body: body
        )
      end

      def create_order_group(practice_id:, patient_id:, body: {})
        @api.call(
          endpoint: "#{practice_id}/chart/#{patient_id}/ordergroups",
          method: :post,
          body: body
        )
      end

      def create_encounter_diagnoses(practice_id:, encounter_id:, body: {})
        @api.call(
          endpoint: "#{practice_id}/chart/encounter/#{encounter_id}/diagnoses",
          method: :post,
          body: body
        )
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
athena_health-2.0.3 lib/athena_health/endpoints/encounters.rb
athena_health-2.0.2 lib/athena_health/endpoints/encounters.rb
athena_health-2.0.1 lib/athena_health/endpoints/encounters.rb
athena_health-2.0.0 lib/athena_health/endpoints/encounters.rb
athena_health-1.0.51 lib/athena_health/endpoints/encounters.rb
athena_health-1.0.50 lib/athena_health/endpoints/encounters.rb
athena_health-1.0.49 lib/athena_health/endpoints/encounters.rb