Sha256: 388c0ab52106c82983c6fe66a3c86e246313e5e63daa79ab01452f462e23bfeb

Contents?: true

Size: 693 Bytes

Versions: 95

Compression:

Stored size: 693 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
          .joins(: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

95 entries across 95 versions & 1 rubygems

Version Path
renalware-core-2.0.111 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.110 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.109 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.108 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.106 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.105 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.104 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.103 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.102 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.101 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.100 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.99 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.98 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.97 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.96 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.95 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.94 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.93 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.92 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.91 app/models/renalware/pathology/request_for_patient_request_description_query.rb