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.70 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.69 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.68 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.67 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.64 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.63 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.62 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.61 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.60 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.58 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.57 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.56 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.55 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.54 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.53 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.52 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.51 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.50 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.48 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.47 app/models/renalware/pathology/request_for_patient_request_description_query.rb