Sha256: c823f61a9da61065b3f3553a2f2ba21c27f18a1a9f203f9165df22b6616e6817

Contents?: true

Size: 1.58 KB

Versions: 27

Compression:

Stored size: 1.58 KB

Contents

# frozen_string_literal: true

title "Patient age can be used in scores"

panel do
end

score :tot, label: "Totaalscore",
      schema: [{key: :value, export_key: :tot, label: 'Score'},
               {key: :interpretation, export_key: :tot_i, label: 'Interpretatie'}] do
  tot = 10
  if gender != :unknown && age
    if gender == :male
      if (7..12).include? age
        if tot >= 66
          tot_interpretation = "Risico"
        elsif tot >= 60
          tot_interpretation = "Verhoogd"
        elsif tot >= 19
          tot_interpretation = "Normaal"
        else
          tot_interpretation = "Laag"
        end
      elsif (13..19).include? age
        if tot >= 50
          tot_interpretation = "Risico"
        elsif tot >= 48
          tot_interpretation = "Verhoogd"
        elsif tot >= 13
          tot_interpretation = "Normaal"
        else
          tot_interpretation = "Laag"
        end
      end
    elsif gender == :female
      if (7..12).include? age
        if tot >= 76
          tot_interpretation = "Risico"
        elsif tot >= 70
          tot_interpretation = "Verhoogd"
        elsif tot >= 28
          tot_interpretation = "Normaal"
        else
          tot_interpretation = "Laag"
        end
      elsif (13..19).include? age
        if tot >= 62
          tot_interpretation = "Risico"
        elsif tot >= 60
          tot_interpretation = "Verhoogd"
        elsif tot >= 23
          tot_interpretation = "Normaal"
        else
          tot_interpretation = "Laag"
        end
      end
    end
  end

  {
      value: tot,
      interpretation: tot_interpretation
  }
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
quby-5.4.0 spec/fixtures/aged_score_interpretations.rb
quby-5.3.1 spec/fixtures/aged_score_interpretations.rb
quby-5.3.0 spec/fixtures/aged_score_interpretations.rb
quby-5.2.0 spec/fixtures/aged_score_interpretations.rb
quby-5.1.3 spec/fixtures/aged_score_interpretations.rb
quby-5.1.2 spec/fixtures/aged_score_interpretations.rb
quby-5.1.1 spec/fixtures/aged_score_interpretations.rb
quby-5.1.0 spec/fixtures/aged_score_interpretations.rb
quby-5.0.5 spec/fixtures/aged_score_interpretations.rb
quby-5.0.4 spec/fixtures/aged_score_interpretations.rb
quby-5.0.3 spec/fixtures/aged_score_interpretations.rb
quby-5.0.2 spec/fixtures/aged_score_interpretations.rb
quby-5.0.1 spec/fixtures/aged_score_interpretations.rb
quby-5.0.0 spec/fixtures/aged_score_interpretations.rb
quby-4.0.4 spec/fixtures/aged_score_interpretations.rb
quby-5.0.0.pre4 spec/fixtures/aged_score_interpretations.rb
quby-5.0.0.pre3 spec/fixtures/aged_score_interpretations.rb
quby-5.0.0.pre2 spec/fixtures/aged_score_interpretations.rb
quby-5.0.0.pre1 spec/fixtures/aged_score_interpretations.rb
quby-4.0.3 spec/fixtures/aged_score_interpretations.rb