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

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

Instance Method Summary collapse

Instance Method Details

#hgb_highObject



65
66
67
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 65

def hgb_high
  where("cast(values->'HGB'->>'result' as float) > 130.0")
end

#hgb_lowObject



61
62
63
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 61

def hgb_low
  where("cast(values->'HGB'->>'result' as float) < 100.0")
end

#noneObject



40
41
42
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 40

def none
  self # NOOP
end

#on_worryboardObject



49
50
51
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 49

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

#supportive_careObject



44
45
46
47
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 44

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

#tx_candidatesObject



53
54
55
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 53

def tx_candidates
  self
end

#ureaObject



57
58
59
# File 'app/models/renalware/low_clearance/mdm_patients_query.rb', line 57

def urea
  where("cast(values->'URE'->>'result' as float) >= 30.0")
end