Skip to content

Add F_ZEIR_ID to duplicate ids fix#902

Open
ekigamba wants to merge 8 commits intov5from
fix-duplicates-tunisia
Open

Add F_ZEIR_ID to duplicate ids fix#902
ekigamba wants to merge 8 commits intov5from
fix-duplicates-tunisia

Conversation

@ekigamba
Copy link
Copy Markdown
Contributor

No description provided.

@ekigamba ekigamba marked this pull request as ready for review January 13, 2023 14:11
"WITH duplicates AS ( " +
" WITH clients AS ( " +
" SELECT baseEntityId, COALESCE(json_extract(json, '$.identifiers.ZEIR_ID'), json_extract(json, '$.identifiers.M_ZEIR_ID'), json_extract(json, '$.identifiers.zeir_id'), json_extract(json, '$.identifiers.ANC_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'), '-', '')) zeir_id " +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add opensrp_id which is in use in the chw apps

String DUPLICATES_SQL = "WITH duplicates AS ( " +
" WITH clients AS ( " +
" SELECT baseEntityId, COALESCE(json_extract(json, '$.identifiers.ZEIR_ID'), json_extract(json, '$.identifiers.M_ZEIR_ID'), json_extract(json, '$.identifiers.zeir_id'), json_extract(json, '$.identifiers.ANC_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'), '-', '')) zeir_id " +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add opensrp_id which is in use in the chw apps

hilpitome
hilpitome previously approved these changes Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants