Sha256: 3125eb67b141dc76ecc1ef70451e0c451213e709b6d82085e3111b1ad26c3070

Contents?: true

Size: 448 Bytes

Versions: 8

Compression:

Stored size: 448 Bytes

Contents

require_dependency "renalware/pathology"

module Renalware
  module Pathology
    class CreateObservations
      def call(params)
        observation_params = params.fetch(:observation_request)
        patient = find_patient(params.fetch(:patient_id))

        patient.observation_requests.create!(observation_params)
      end

      private

      def find_patient(id)
        ::Renalware::Pathology::Patient.find(id)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta11 app/models/renalware/pathology/create_observations.rb
renalware-core-2.0.0.pre.beta10 app/models/renalware/pathology/create_observations.rb
renalware-core-2.0.0.pre.beta9 app/models/renalware/pathology/create_observations.rb
renalware-core-2.0.0.pre.beta8 app/models/renalware/pathology/create_observations.rb
renalware-core-2.0.0.pre.beta7 app/models/renalware/pathology/create_observations.rb
renalware-core-2.0.0.pre.beta6 app/models/renalware/pathology/create_observations.rb
renalware-core-2.0.0.pre.beta5 app/models/renalware/pathology/create_observations.rb
renalware-core-2.0.0.pre.beta4 app/models/renalware/pathology/create_observations.rb