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

Add support for default version of registry resources #2356

Closed
JohnTimm opened this issue May 12, 2021 · 1 comment
Closed

Add support for default version of registry resources #2356

JohnTimm opened this issue May 12, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@JohnTimm
Copy link
Collaborator

JohnTimm commented May 12, 2021

FHIRRegistryResource.getResource(String url) currently parses the url parameter as a canonical url (<url>|<version>). If the version is not present, then it will look for all versions with the given url across all registry resource providers. It will then dedup/sort this list and return the "latest version". In addition to "latest version" there is a notion of "default version". The "default version" may be designated by an implementation (see TerminologyCapabilities.codeSystem.version.isDefault for an example of this).

We should make the following changes to support the idea of a "default version".

  • Add a defaultVersion field to the FHIRRegistryResource class along with constructor(s) that include defaultVersion as a parameter and an isDefaultVersion method
  • Add factory methods that create FHIRRegistryResource instances and allow for a defaultVersion to be specified
  • Add unit tests to test "default version" and "latest version" behavior
  • Update FHIRRegistry, PackageRegistryResourceProvider and ServerRegistryResourceProvider to use "default version" when a version is not specified

If no version is designated as the "default version", then the logic falls back to "latest version" based on sort order. If multiple versions are designated as the "default version" then the first one encountered will be used.

We also discussed the potential for supporting a defaultVersion field in the .index.json NPM package format we use to load resources for a PackageRegistryResourceProvider but decided it was lower priority.

We may want to consider an extension that allows a client to specify that a particular definitional resource (e.g CodeSystem, StructureDefinition, etc.) has a business version that is intended to be the default version. We could then update FHIRRegistryResource.from method to use that extension (if it exists).

@JohnTimm JohnTimm self-assigned this May 12, 2021
@JohnTimm JohnTimm added this to the Sprint 2021-06 milestone May 13, 2021
JohnTimm added a commit that referenced this issue May 13, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue May 13, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue May 13, 2021
…2360)

* Issue #2356 - add support for default version of registry resources

Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>

* Issue #2356 - update Capabilities.java

Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
@prb112 prb112 added the enhancement New feature or request label May 14, 2021
@tbieste
Copy link
Contributor

tbieste commented May 14, 2021

I verified in my dev workspace that if the FHIRRegistryResource.from method sets default to true for a CodeSystem version, then the <base>/metadata?mode=terminology API shows isDefault: true for that CodeSystem version. More complete QA of the functionality can be done when there is a way for a client to indicate the default version of definitional resource via an extension is implemented in the future.

@tbieste tbieste closed this as completed May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants