Skip to content

Commit

Permalink
Merge pull request #236 from njorocs/bug-fix-contacts
Browse files Browse the repository at this point in the history
Revised query to fetch DOB from demographics table after birth_date c…
  • Loading branch information
makombe authored Sep 20, 2024
2 parents afe17a6 + de8332c commit 6959716
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public EvaluatedCohort evaluate(CohortDefinition cohortDefinition, EvaluationCon
+ " group by patient_id) d on d.patient_id = fup.patient_id\n"
+ " where fup.visit_date <= date(:endDate)\n"
+ " and p.gender = 'F'\n"
+ " and timestampdiff(YEAR, date(p.dob), date(:endDate)) between 15 and 49 -- and timestampdiff(YEAR, date(c.birth_date), date(:endDate)) < 15\n"
+ " and timestampdiff(YEAR, date(p.dob), date(:endDate)) between 15 and 49\n"
+ " group by patient_id\n"
+ " having (started_on_drugs is not null and started_on_drugs <> '')\n"
+ " and contact_id is null\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public EvaluatedPersonData evaluate(PersonDataDefinition definition, EvaluationC
+ " where date(hts.visit_date) <= date(:endDate)) hts\n"
+ " on c.patient_id = hts.patient_id\n"
+ " where c.relationship_type = 3\n"
+ " and timestampdiff(YEAR, date(c.birth_date), date(:endDate)) < 15\n"
+ " and timestampdiff(YEAR, date(d.DOB), date(:endDate)) < 15\n"
+ " and c.voided = 0) c on d.patient_id = c.idx_patient_id\n"
+ "group by d.patient_id;";

Expand Down

0 comments on commit 6959716

Please sign in to comment.