Class: Renalware::Pathology::ObservationForPatientRequestDescriptionQuery
- Inherits:
-
Object
- Object
- Renalware::Pathology::ObservationForPatientRequestDescriptionQuery
- Defined in:
- app/models/renalware/pathology/observation_for_patient_request_description_query.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(patient, request_description) ⇒ ObservationForPatientRequestDescriptionQuery
constructor
A new instance of ObservationForPatientRequestDescriptionQuery.
Constructor Details
#initialize(patient, request_description) ⇒ ObservationForPatientRequestDescriptionQuery
Returns a new instance of ObservationForPatientRequestDescriptionQuery.
8 9 10 11 |
# File 'app/models/renalware/pathology/observation_for_patient_request_description_query.rb', line 8 def initialize(patient, request_description) @patient = patient @observation_description = request_description.required_observation_description end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/models/renalware/pathology/observation_for_patient_request_description_query.rb', line 13 def call @patient .observations .where(description: @observation_description) .order(observed_at: :desc) .first end |