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

Issue with updating DependantVersionEffectiveTime in CodeSystem Version #603

Open
marinaivnv opened this issue Jun 26, 2024 · 4 comments
Open
Assignees
Labels

Comments

@marinaivnv
Copy link

The problem arose with updating the value of dependantVersionEffectiveTime in the code system version. The sequence was as follows:

  1. CodeSystem.dependantVersionEffectiveTime was set to 20240201.
  2. Imported the international edition MAIN/2024-04-01.
  3. Then imported the EE edition MAIN/SNOMEDCT-EE/2024-05-30.
  4. Updated CodeSystem.dependantVersionEffectiveTime to 20240401, but the dependantVersionEffectiveTime of the latest EE edition remained 20240201.

No possibilities of updating dependantVersionEffectiveTime CodeSystem version were found.

Screenshot 2024-06-26 at 15 46 16
@kaicode
Copy link
Member

kaicode commented Jun 26, 2024

The steps should be:

  • Importing new International Edition release package
  • Upgrade the extension codesystem (SNOMEDCT-EE) using POST /codesystems/{shortName}/upgrade
    • This should automatically change the dependant effective time
  • Import the new extension release package
    • This will create the new extension version within Snowstorm with the correct dependant version

@kaicode kaicode self-assigned this Jun 26, 2024
@kaicode
Copy link
Member

kaicode commented Jun 26, 2024

It's not possible to manually set or override the dependant effective time. This is calculated by the Snowstorm version control system.

Technical explanation..

Each child branch points to a specific commit on the timeline of the parent branch, this is called the base timepoint. The dependant effective time is taken from the codesystem version of the parent code system that matches the base timepoint.

It is essential to upgrade an extension codesystem before importing the new extension release package, this ensures good referential integrity of the internal semantic index. If the release package is imported first it's possible that new concepts may point to International concepts that the extension branch can not see yet.

@marinaivnv
Copy link
Author

@kaicode Thank you for the answer! Unfortunately, it is not possible to delete the code system version after it has been imported, nor is it possible to directly fix the incorrect dependant effective time field. What should be the next steps to fix this incorrect import?

@kaicode
Copy link
Member

kaicode commented Jun 27, 2024

I recommend reverting one or two commits on the extension branch. This will automatically delete the codesystem version and reset the content ready for the upgrade step.

Follow these steps to rollback the correct number of commits on the codesystem branch to the point of the previous release:

  • Get the previous release branch to check the branch state

    • Use GET /branches/{branch}. For example GET /branches/MAIN/SNOMEDCT-EE/2023-11-30.
    • In the response the branch state is shown.
  • The state of the previous release branch is dependant on the content of the codesystem branch.

    • The codesystem branch in this example is MAIN/SNOMEDCT-EE
  • If the previous release branch state is UP_TO_DATE that means the codesystem branch does not contain any changes since the latest release import and there is no need to rollback.

  • If the previous release branch state is BEHIND that means the codesystem branch contains changes since the latest release import that should be rolled back before importing a new release.

  • Rollback one commit on the codesystem branch:

    • Get the codesystem branch using GET /branches/{branch}. For example GET /branches/MAIN/SNOMEDCT-EE.
      • Make a note of the headTimestamp. For example 1701321893134.
    • Use the admin rollback function to revert the head commit of the codesystem branch
      • Use POST /admin/{branch}/actions/rollback-commit, supplying the codesystem branch and the head timestamp.
    • Get the previous release branch. If the status is BEHIND that means the codesystem branch needs rolling back further. Follow these steps again to rollback another commit. Repeat as many times as needed.

You should only need to rollback a few commits. Once the previous release branch state is UP_TO_DATE the codesystem is ready for upgrade. After upgrading import the new extension release package.

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

No branches or pull requests

2 participants