Sha256: 47bfd7384771638289069159fef0a286e7458ab40dbfe539d78183d0fc8d8a33

Contents?: true

Size: 698 Bytes

Versions: 11

Compression:

Stored size: 698 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/pathology"

module Renalware
  module Pathology
    class RequestForPatientRequestDescriptionQuery
      def initialize(patient, request_description)
        @patient = patient
        @request_description = Renalware::Pathology::RequestDescription.find(request_description.id)
      end

      def call
        @patient
          .requests
          .eager_load(:request_descriptions)
          .where(
            pathology_request_descriptions_requests_requests: {
              request_description_id: @request_description.id
            }
          )
          .order(created_at: :desc)
          .first
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
renalware-core-2.0.124 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.123 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.121 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.120 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.119 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.118 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.117 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.116 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.115 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.113 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.112 app/models/renalware/pathology/request_for_patient_request_description_query.rb