Sha256: fa7272638fb971ad7ebc0c329a324aaf2a8dff6bba186df3ae6514a57a4beafc

Contents?: true

Size: 690 Bytes

Versions: 43

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/pathology"

module Renalware
  module Pathology
    class ObservationForPatientObservationDescriptionUsingSetQuery
      pattr_initialize :patient, :observation_description_code

      # 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" }
      def call
        return {} unless patient.current_observation_set

        patient.current_observation_set.values.fetch(observation_description_code, {})
      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/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.1.0 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.167 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.166 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.165 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.164 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.163 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.162 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.161 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.160 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.159 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.158 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.157 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.156 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.155 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.153 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.152 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.151 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.149 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb
renalware-core-2.0.148 app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb