Sha256: 1e9ade5ddaaf655a4d64d1c5a51efba8aa37ce85a035ebd61db345c186537432

Contents?: true

Size: 1.12 KB

Versions: 16

Compression:

Stored size: 1.12 KB

Contents

module PathologySpecHelper
  def create_descriptions(names)
    names.map { |name| create_observation_description(name) }
  end

  def create_observations(patient,
                          descriptions,
                          observed_at: Time.zone.now,
                          result: 1)
    descriptions.map do |description|
      request = create(:pathology_observation_request, patient: patient)
      create(:pathology_observation,
             request: request,
             description: description,
             observed_at: observed_at,
             result: result)
    end
  end

  # name and code will be the same
  def create_observation_description(name)
    create(:pathology_observation_description, name: name, code: name)
  end

  def create_patient
    patient = create(:patient)
    Renalware::Pathology.cast_patient(patient)
  end

  def add_descriptions_not_observed_for_patient(*description_names)
    description_names.map { |name| create_observation_description(name) }
  end

  def filter_targeted_descriptions(descriptions)
    descriptions.select { |description| description.name.start_with?("target-") }
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc11 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.rc10 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.rc9 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.rc8 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.rc7 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.rc6 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.rc5 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.rc4 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.rc3 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.rc1 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.beta12 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.beta11 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.beta10 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.beta9 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.beta8 spec/support/pathology_spec_helper.rb
renalware-core-2.0.0.pre.beta7 spec/support/pathology_spec_helper.rb