Class: Renalware::Pathology::ObservationForPatientObservationDescriptionQuery

Inherits:
Object
  • Object
show all
Defined in:
app/models/renalware/pathology/observation_for_patient_observation_description_query.rb

Instance Method Summary collapse

Constructor Details

#initialize(patient, observation_description) ⇒ ObservationForPatientObservationDescriptionQuery

Returns a new instance of ObservationForPatientObservationDescriptionQuery.



8
9
10
11
# File 'app/models/renalware/pathology/observation_for_patient_observation_description_query.rb', line 8

def initialize(patient, observation_description)
  @patient = patient
  @observation_description = observation_description
end

Instance Method Details

#callObject



13
14
15
16
17
18
19
# File 'app/models/renalware/pathology/observation_for_patient_observation_description_query.rb', line 13

def call
  @patient
    .observations
    .where(description: @observation_description)
    .order(observed_at: :desc)
    .first
end