Skip to content

Commit

Permalink
Support opensrp_id used in CHW apps
Browse files Browse the repository at this point in the history
  • Loading branch information
ekigamba committed Feb 28, 2023
1 parent 00635e8 commit bb826b3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ZeirIdCleanupRepository extends BaseRepository {
private static final String DUPLICATES_SQL =
"WITH duplicates AS ( " +
" WITH clients AS ( " +
" SELECT baseEntityId, COALESCE(json_extract(json, '$.identifiers.ZEIR_ID'), REPLACE(json_extract(json, '$.identifiers.M_ZEIR_ID'), '-', ''), json_extract(json, '$.identifiers.zeir_id'), json_extract(json, '$.identifiers.ANC_ID'), REPLACE(json_extract(json, '$.identifiers.F_ZEIR_ID'), '-', '')) zeir_id " +
" SELECT baseEntityId, COALESCE(json_extract(json, '$.identifiers.ZEIR_ID'), REPLACE(json_extract(json, '$.identifiers.M_ZEIR_ID'), '-', ''), json_extract(json, '$.identifiers.zeir_id'), json_extract(json, '$.identifiers.ANC_ID'), REPLACE(json_extract(json, '$.identifiers.F_ZEIR_ID'), '-', ''), REPLACE(json_extract(json, '$.identifiers.opensrp_id'), '-', '')) zeir_id " +
" FROM client " +
" ) " +
" SELECT b.* FROM (SELECT baseEntityId, zeir_id FROM clients GROUP BY zeir_id HAVING count(zeir_id) > 1) a " +
Expand Down

0 comments on commit bb826b3

Please sign in to comment.