Skip to content

Instantly share code, notes, and snippets.

@mikeymckay
Created October 7, 2008 17:52
Show Gist options
  • Save mikeymckay/15326 to your computer and use it in GitHub Desktop.
Save mikeymckay/15326 to your computer and use it in GitHub Desktop.
@cohort_patient_ids[:all] = PatientRegistrationDate.find(:all,
# :joins => 'LEFT JOIN patient_identifier ON
# patient_identifier.patient_id = patient_registration_dates.patient_id
# AND identifier_type = 18 AND voided = 0',
:conditions => ["DATE(registration_date) >= ? AND DATE(registration_date) <= ?",
@quarter_start, @quarter_end]
# :order => 'CONVERT(RIGHT(identifier, LENGTH(identifier)-3), UNSIGNED)').map(&:patient_id)
).map(&:patient_id)
# @cohort_patient_ids[:start_reasons] = start_reasons[1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment