snowstorm icon indicating copy to clipboard operation
snowstorm copied to clipboard

Error when creating new Code system version

Open eirikconteir opened this issue 3 years ago • 2 comments

After upgrading to 7.4.5 in my local test environment, I'm not able to create a new version of a code system.

Using the endpoint POST /codesystems/{shortName}/versions returns error:

"Recursion limit reached calculating MDRS in {branch} for module 51000202101"

eirikconteir avatar Dec 28 '21 14:12 eirikconteir

Hi @pgwilliams, do you think this is a bug or a content issue? How do we tell?

kaicode avatar Jan 04 '22 10:01 kaicode

Well it's a bug in the sense that the Module Dependency Reference Set generation should not "blow up" to the extent that it blocks the user from moving forward. At the time I wrote this code I thought that it was important that we know if the MDRS was invalid, but I'm now of the opinion that most users can probably live with an incorrect MDRS.

It's related to content in that the code uses a number of approaches to try to determine a hierarchy of modules - most obviously which modules the other module were defined in. So if module 2 is defined within module 1, then module 2 is considered to be a child of module 1. If these approaches leaves us with an indeterminate hierarchy then we might end up in an infinite loop which is detected and broken out of with the message seen above. Most recently we've encountered modules that are - deliberately - mutually dependent and we've just added code to detect and allow for this.

Something that could be easily fixed is that the code behaves very differently for the International Edition as for an extension, and it's also affected by whether we're targeting an Edition or an Extension Package. It's the presence of the "dependantVersionEffectiveTime" item in the CodeSystem metadata item that tells the code if it's the International Edition or not (value present means not International) and "dependencyPackage" in the branch metadata that tells it if it's an Edition or an Extension (value present means it's an Extension). If these values are not present when they're expected to be, then we might see "CHECK LOGIC: <moduleId> thought to be both International and an Extension Module" in the logs.

Apologies for the delay responding to this ticket @eirikconteir This code continues to evolve and most recently there's a discussion in issue #383 that may be relevant. It might be that I need to add in a configuration option to allow users to turn off this functionality altogether. Are you still seeing this issue with the most recent version of the code and could you check your codeSystem and branch metadata for these two values - dependantVersionEffectiveTime and dependencyPackage? Thanks!

pgwilliams avatar Apr 21 '22 14:04 pgwilliams