Skip to content

Commit

Permalink
Bug fix on getting previous next encounter
Browse files Browse the repository at this point in the history
  • Loading branch information
steliomo committed Dec 30, 2019
1 parent 65502cf commit 2581a36
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class QUERY {
+ "WHERE p.voided = 0 AND e.voided = 0 AND o.voided = 0 AND o.concept_id = 1410 "
+ "AND e.encounter_type IN (6,9) AND e.encounter_datetime < :encounterDate AND e.location_id = :location AND p.patient_id = :patientId "
+ "GROUP BY p.patient_id)max_encounter INNER JOIN obs o ON max_encounter.patient_id = o.person_id "
+ "AND o.concept_id = 1410 AND o.voided = 0 AND max_encounter.encounter_datetime = o.obs_datetime ";
+ "AND o.concept_id = 1410 AND o.voided = 0 AND max_encounter.encounter_datetime = o.obs_datetime "
+ "AND o.value_datetime IS NOT NULL;";
}
}

0 comments on commit 2581a36

Please sign in to comment.