Sha256: ea87633ac9cca479269457676403481c99b1eebe1a826f69a980c4c8e6e7456c
Contents?: true
Size: 727 Bytes
Versions: 12
Compression:
Stored size: 727 Bytes
Contents
# frozen_string_literal: true module Renalware module HD # Find the lastest PrescriptionAdministration for a particular prescription - ie the last time # it was given. class PrescriptionLastAdministrationQuery pattr_initialize [:prescription!] delegate :patient, to: :prescription def call raise ArgumentError if prescription.blank? raise ArgumentError if patient.blank? hd_patient .prescription_administrations .where(prescription: prescription, administered: true) .order(recorded_on: :desc, created_at: :desc) .first end private def hd_patient HD.cast_patient(patient) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems