You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
select en.patient_id
from
(select * from encounter e where e.encounter_type in (6, 9) and e.encounter_datetime =(select max(en.encounter_datetime) from encounter en where en.patient_id = e.patient_id and e.encounter_type in (6, 9))) as en
where TIMESTAMPDIFF(MONTH, en.encounter_datetime, now()) >= 6 AND (select count(o.obs_id) from obs o where o.person_id = en.patient_id AND o.obs_datetime between (en.encounter_datetime and now()) AND o.concept_id IN (5497, 730, 1695) and o.voided = 0) = 0;
The text was updated successfully, but these errors were encountered:
ynurmahomed
changed the title
[Clinic] Alert for missing CD4 after 6 months is not writen properly
Alert for missing CD4 after 6 months is not writen properly
Jun 1, 2018
Actual Results
The query is not finding the patients that are more than or equal to 6 months without CD4 result.
Expected results
The query should return a cohort for those without CD4 results in the current date >= 6 months after the last CD4
Steps to reproduce
http://test.esaude.org/openmrs/module/patientflags/findFlaggedPatients.form?flagId=5
Screenshot/Attachment (Optional)
A visual description of the unexpected behaviour.
The text was updated successfully, but these errors were encountered: