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

Logic for new institutions #504

Open
ctueck opened this issue Mar 27, 2024 · 0 comments
Open

Logic for new institutions #504

ctueck opened this issue Mar 27, 2024 · 0 comments

Comments

@ctueck
Copy link
Member

ctueck commented Mar 27, 2024

It turns out that OrgReg from time to time adds new institutions that are already in DEQAR. In those cases, they usually add the existing DEQARINST ID in their records.

Our current logic however leads to duplicates in this case, and we've had some cases with whole countries added where this was a major issue. So a suggestion to change below.

Current logic

  • Try to find DEQAR record with given OrgReg ID
    • If found: update
    • If not: create new one
  • If DEQARINST ID in OrgReg differs from DEQAR record with the given OrgReg ID, emit warning/error

What happens now: OrgReg ID is unknown in DEQAR, new record is created, then it turns out that the DEQARINST IDs mismatch.

Proposed logic

  • Try to find DEQAR record with given OrgReg ID
    • If found: update
    • If not: does OrgReg record has a valid DEQARINST ID?
      • If yes: check that DEQAR record's OrgReg ID field
        • If empty: add OrgReg ID to that record, and update
        • If set (but to another OrgReg ID): emit error message
      • If no: create new record
  • If DEQARINST ID in OrgReg differs from DEQAR record with the given OrgReg ID, emit warning/error

This should result in new additions to OrgReg being linked up correctly, provided OrgReg add the existing DEQARINST IDs when adding new records.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant