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.46 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.45 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.44 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.43 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.42 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.41 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.40 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.39 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.38 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.37 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.36 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.35 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.34 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.33 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.32 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.31 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.30 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.28 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.27 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.26 app/models/renalware/pathology/request_for_patient_request_description_query.rb