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

Leave references untouched #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Leave references untouched #1

wants to merge 1 commit into from

Conversation

cdejonge
Copy link
Owner

@cdejonge cdejonge commented Nov 7, 2023

IG-Publisher manipulates found references, which exist in npm-packages.
These references are replaced by the Simplifier.resolve() function, except for some exceptions, as can be seen here

We as Philips want our (canonical) url's to be left untouched.
We have information about the npm-package available in which license is an optional element.

license - optional. Follow the [spdx naming convention]

Maybe it is an option to use this information, if available.

Another option can be to check if the npm-package is available on Simplifier and add a PackageType (representing npm-package not on Simplifier).

@cdejonge cdejonge self-assigned this Nov 7, 2023
@cdejonge cdejonge changed the title Add switch on lowest level Leave references untouched Nov 7, 2023
@@ -183,7 +183,11 @@ public String getPath(String url, String def, String rt, String id) throws FHIRE
}
if (special != null) {
switch (special) {
case Simplifier: return "https://simplifier.net/resolve?scope="+pi.name()+"@"+pi.version()+"&canonical="+url;
case Simplifier: if (url.contains("fhir.philips.com")) {
Copy link
Collaborator

@david-simons david-simons Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pi.license() is available at this point, as a String (check for not-open-source)

Copy link
Collaborator

@david-simons david-simons Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better deal with this on line 428... (before Simplifier):

} else if (pi.license().equals(anObject:"not-open-source") ) {
      res.special = SpecialPackageType.NotOpenSource;
    }

plus a case

case NotOpenSource: return url;

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that is option 1. We should in this case probably choose a license from https://spdx.org/licenses/ ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we do in our sushi-config: not-open-source

license: not-open-source # https://www.hl7.org/fhir/valueset-spdx-license.html

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the package.json (what publisher uses) the documentation states:
license - optional. Follow the [spdx naming convention]

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -183,7 +183,11 @@ public String getPath(String url, String def, String rt, String id) throws FHIRE
}
if (special != null) {
switch (special) {
case Simplifier: return "https://simplifier.net/resolve?scope="+pi.name()+"@"+pi.version()+"&canonical="+url;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also still like the idea to see if Simplifier can acually resolve the said query, and if not fall back to the plain url.

Perhaps this can be tested as part of the line 428 - when deciding whether to assign special=Simplifier, or fall back to special=null.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self - this is primarily for urls from dependent packages, not the current IG package.

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

Successfully merging this pull request may close these issues.

2 participants