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
Copy file name to clipboardExpand all lines: rwb/src/main/resources/select_inactive_users_id.sql
+40-17
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,45 @@
1
-
WITH impacted_users as (
2
-
WITH open_work_orders as (selecti.id open_wo_id, i.address_id
3
-
from individual i
4
-
left join encounter e oni.id=e.individual_id
5
-
wherei.is_voided= false
6
-
andi.subject_type_id= (select id from subject_type where name ='Work Order'and organisation_id = (select id from organisation where db_user ='rwbniti') and not subject_type.is_voided)
7
-
ande.encounter_type_id=
8
-
(select id from encounter_type where name ='Work order endline'and organisation_id = (select id from organisation where db_user ='rwbniti') and not encounter_type.is_voided)
9
-
and (e.is_voided is nullore.is_voided= false)
10
-
andi.organisation_id= (select id from organisation where db_user ='rwbniti')
11
-
group by1
12
-
havingcount(e.id) =1) -- Use = 1 for testing, < 1 for prod
0 commit comments