Sha256: 8a8840885ffb57b53c8871c1c228b79e1d88183f1d124a53bec9158307b76ae1

Contents?: true

Size: 730 Bytes

Versions: 43

Compression:

Stored size: 730 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 = request_description
      end

      def call
        @patient
          .requests
          .includes(request_descriptions: :required_observation_description)
          .where(
            pathology_request_descriptions_requests_requests: {
              request_description_id: @request_description.id
            }
          )
          .order(created_at: :desc)
          .limit(1)
          .pluck(:created_at)
          .first
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.1.0 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.167 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.166 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.165 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.164 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.163 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.162 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.161 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.160 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.159 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.158 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.157 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.156 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.155 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.153 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.152 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.151 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.149 app/models/renalware/pathology/request_for_patient_request_description_query.rb
renalware-core-2.0.148 app/models/renalware/pathology/request_for_patient_request_description_query.rb