Class: Renalware::Pathology::ObservationForPatientObservationDescriptionUsingSetQuery

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

Instance Method Summary collapse

Instance Method Details

#callObject

Fetches the patient’s most recent observation for the supplied observation_description.code (eg ‘HGB’) using the patient’s current_observation_set jsonb hash and returnd something like { “result” => “123”, “observed_on” => “2019-01-01” }



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

def call
  return {} unless patient.current_observation_set

  patient.current_observation_set.values.fetch(observation_description_code, {})
end