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

fix(practitioner-role-code): create migrations for unifying role format #7995

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

makelicious
Copy link
Collaborator

@makelicious makelicious commented Nov 15, 2024

TL:DR; Our format for "coding" PractitionerRole has changed during the years. Ensure both PractitionerRole and PractitionerRole_history follow the latest format.

Example:

// Code is a 2-tuple
{
  "code": [
    {
      "coding": [
        {
          "system": "http://opencrvs.org/specs/roles",
          "code": "LOCAL_REGISTRAR"
        }
      ]
    },
    {
      "coding": [
        {
          "system": "http://opencrvs.org/specs/types",
           // "code": "LOCAL_REGISTRAR" <-- Initial format
           // "code": "Local Registrar" <-- Second format
          "code": "[{ label: \"Local Registrar\", lang: \"en\" },{ label: \"Registraire local\", lang: \"fr\" }]" //  Current format, allows localization
        }
      ]
    }
  ]
}

The previous migration (20230127063226-update-practitioner-role) has been changed along with the format. However, it might not work for all migrations paths.

Solution:

  • Write migrations to ensure the format is unified, independent from which version we are migrating from
  • Run migrations on both PractitionerRole and PractitionerRole_history

Fixes:

  • Potential error during declaration download, caused by mismatch in format.

Relevant previous changes:

@makelicious makelicious added this to the v1.6.1 milestone Nov 15, 2024
Copy link

Oops! Looks like you forgot to update the changelog. When updating CHANGELOG.md, please consider the following:

  • Changelog is read by country implementors who might not always be familiar with all technical details of OpenCRVS. Keep language high-level, user friendly and avoid technical references to internals.
  • Answer "What's new?", "Why was the change made?" and "Why should I care?" for each change.
  • If it's a breaking change, include a migration guide answering "What do I need to do to upgrade?".

@makelicious makelicious added the 🚀 Ready to deploy Deployment automation should pick this PR up and start auto-deploying it label Nov 15, 2024
@github-actions github-actions bot deployed to fixpractitioner-role-code November 15, 2024 08:47 Active
@ocrvs-bot
Copy link
Collaborator

Your environment is deployed to https://fixpractitioner-role-code.opencrvs.dev

@makelicious makelicious merged commit 0132f2e into develop Nov 15, 2024
64 of 65 checks passed
makelicious added a commit that referenced this pull request Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Ready to deploy Deployment automation should pick this PR up and start auto-deploying it 💅 Waiting For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants