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.90 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.89 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.88 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.87 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.86 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.85 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.84 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.83 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.82 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.81 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.80 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.79 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.78 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.77 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.76 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.75 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.74 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.73 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.72 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.71 app/models/renalware/pathology/request_for_patient_request_description_query.rb