Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETL naming consistency #1143

Open
Tracked by #93 ...
mahalakshme opened this issue Feb 28, 2024 · 0 comments
Open
Tracked by #93 ...

ETL naming consistency #1143

mahalakshme opened this issue Feb 28, 2024 · 0 comments

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented Feb 28, 2024

Need:

Several times, ETL fail and comes as ticket and then we resolve similar table name issues. Instead we should put some checks on webapp/ETL to avoid same table names getting generated in ETL

Context:

https://avni.readme.io/docs/recreate-etl-schema-for-an-implementation#subject-type-program-and-encounter-type-names

Acceptance criteria:

Change 20 to 17 for the appended last entity names and append the last 3 digits of form mapping id
--- reduced from 5 to 3 - since a org might not have more than 1000 forms and remembering alphanumeric difficult than just nos - so this will simplify it.
--- same as system generated constraint names
Approach 2: append hash code like done for column names

Technical analysis:

Making sure first 6 characters of below are not the same involves handling many cases and is complex and hence the above solution:

  • two encounter types within same program - add check at applicable places( when saving encounter type or program or form mapping)
  • two encounter types within same subject type - add check at applicable places
  • two programs inside the same subject type - add check at applicable places
  • name of general encounter type and program not same - add check at applicable places
  • When we show error that first 6 characters should not be same for self managing implementations it might become confusing.

Cons:

Concerns:

  • cons: random: will not know what table to query,
    ----- since the no of such cases are less will not be an issue, now also when truncated not readable
    ---- similar to autogenerated constraint names
  • regenerating -
  • shortname for ETL purpose - cons: conflicts
  • form mapping table - full table name - RQG?
    ---- the amount of configuration for implementors will increase - so adopting convention over configuration will help in minimizing this - and also makes it easy to scale.
    ---- also with time they might rename the forms and keeping the short names inline might become difficult
  • not change existing names - backward compatibility
    ---- how many such cases will happen - thats fine, its only table names and not column names - so should be fine
    ---- its better to make this fix sooner than later, since once we scale it will cause more issues
@mahalakshme mahalakshme converted this from a draft issue Feb 28, 2024
@mahalakshme mahalakshme moved this from In Analysis to In Analysis Review in Avni Product Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Analysis Review
Development

No branches or pull requests

1 participant