-
Notifications
You must be signed in to change notification settings - Fork 1.4k
removed the option to be able to install embedded resources using the PackageInstallerSvcImpl #7298
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
base: master
Are you sure you want to change the base?
removed the option to be able to install embedded resources using the PackageInstallerSvcImpl #7298
Conversation
|
Formatting check succeeded! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7298 +/- ##
============================================
+ Coverage 83.41% 83.79% +0.37%
- Complexity 29193 30128 +935
============================================
Files 1843 1833 -10
Lines 113422 116456 +3034
Branches 14251 14762 +511
============================================
+ Hits 94608 97580 +2972
+ Misses 12730 12585 -145
- Partials 6084 6291 +207 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| private final List<String> embeddedCodeSystems = List.of( | ||
| CommonCodeSystemsTerminologyService.LANGUAGES_CODESYSTEM_URL, | ||
| CommonCodeSystemsTerminologyService.MIMETYPES_CODESYSTEM_URL, | ||
| CommonCodeSystemsTerminologyService.CURRENCIES_CODESYSTEM_URL, | ||
| CommonCodeSystemsTerminologyService.COUNTRIES_CODESYSTEM_URL, | ||
| CommonCodeSystemsTerminologyService.UCUM_CODESYSTEM_URL, | ||
| CommonCodeSystemsTerminologyService.USPS_CODESYSTEM_URL); | ||
|
|
||
| private final List<String> embeddedValueSets = List.of( | ||
| CommonCodeSystemsTerminologyService.LANGUAGES_VALUESET_URL, | ||
| CommonCodeSystemsTerminologyService.MIMETYPES_VALUESET_URL, | ||
| CommonCodeSystemsTerminologyService.CURRENCIES_VALUESET_URL, | ||
| CommonCodeSystemsTerminologyService.UCUM_VALUESET_URL, | ||
| CommonCodeSystemsTerminologyService.ALL_LANGUAGES_VALUESET_URL, | ||
| CommonCodeSystemsTerminologyService.USPS_VALUESET_URL); | ||
|
|
||
| private boolean isEmbeddedValueSet(IBaseResource theResource) { | ||
| org.hl7.fhir.r4.model.ValueSet valueSet = myVersionCanonicalizer.valueSetToCanonical(theResource); | ||
| if (!valueSet.hasUrl()) return false; | ||
| return embeddedValueSets.contains(valueSet.getUrl()); | ||
| } | ||
|
|
||
| private boolean isEmbeddedCodeSystem(IBaseResource theResource) { | ||
| org.hl7.fhir.r4.model.CodeSystem codeSystem = myVersionCanonicalizer.codeSystemToCanonical(theResource); | ||
| if (!codeSystem.hasUrl()) return false; | ||
| return embeddedCodeSystems.contains(codeSystem.getUrl()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CommonCodeSystemsTerminologyService already contains the methods isCodeSystemSupported(theValidationSupportContext, theSystem), isValueSetSupported(theValidationSupportContext, theValueSetUrl), getValueSetUrl(theFhirContext, theValueSet) and getCodeSystemUrl(theFhirContext, theCodeSystem); they could be used to avoid duplicating code and risking desynchronizing embeddedCodeSystems and embeddedValueSets with CommonCodeSystemsTerminologyService
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch ... I'll rework it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed with 3b878ff
This PR introduces a safety check when installing implementation guides that contains already existing embedded terminology as listed on https://hapifhir.io/hapi-fhir/docs/validation/validation_support_modules.html#commoncodesystemsterminologyservice as shadowing existing embedded terminology may lead to unintended behaviour. For instance, when repackaging implementation guides it can easily go wrong if e.g. bcp is referenced and included as a CodeSystem with
not-present(which would be default from https://terminology.hl7.org/CodeSystem-v3-ietf3066.html )