Module: Renalware::LowClearance::MDMPatientsQuery::NamedFilterScopes

Defined in:
app/models/renalware/low_clearance/mdm_patients_query.rb

Overview

rubocop:enable Metrics/MethodLength

Instance Method Summary collapse

Instance Method Details

#hgb_highObject



67
68
69
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 67

def hgb_high
  where("convert_to_float(values->'HGB'->>'result') > 130.0")
end

#hgb_lowObject



63
64
65
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 63

def hgb_low
  where("convert_to_float(values->'HGB'->>'result') < 100.0")
end

#noneObject



42
43
44
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 42

def none
  self # NOOP
end

#on_worryboardObject



51
52
53
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 51

def on_worryboard
  joins("RIGHT OUTER JOIN patient_worries ON patient_worries.patient_id = patients.id")
end

#supportive_careObject



46
47
48
49
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 46

def supportive_care
  joins(:profile)
  .where("low_clearance_profiles.document ->> 'dialysis_plan' LIKE 'not_for_dial%'")
end

#tx_candidatesObject



55
56
57
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 55

def tx_candidates
  where("transplant_registration_status_descriptions.code not ilike '%permanent'")
end

#ureaObject



59
60
61
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 59

def urea
  where("convert_to_float(values->'URE'->>'result') >= 30.0")
end