Fix NPE processing code system supplements

This commit is contained in:
Grahame Grieve 2025-01-09 23:20:43 +11:00
parent 9506a93056
commit 502a90263f
2 changed files with 11 additions and 3 deletions

View File

@ -5,6 +5,7 @@
* Make sure all validation messages have a message id * Make sure all validation messages have a message id
* Validator enforce version-set-specific value for Extension and Extension context * Validator enforce version-set-specific value for Extension and Extension context
* Specific Error when ValueSet.compose.include.system refers to a ValueSet * Specific Error when ValueSet.compose.include.system refers to a ValueSet
* Fix NPE processing code system supplements
## Other code changes ## Other code changes

View File

@ -1966,20 +1966,27 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
cache = checkAddToParams(tc, pin, cs) || cache; cache = checkAddToParams(tc, pin, cs) || cache;
} }
for (CodeSystem supp : codeSystems.getSupplements(cs)) { for (CodeSystem supp : codeSystems.getSupplements(cs)) {
opCtxt.seeSupplement(supp); if (opCtxt != null) {
opCtxt.seeSupplement(supp);
}
cache = checkAddToParams(tc, pin, supp) || cache; cache = checkAddToParams(tc, pin, supp) || cache;
} }
if (sys != null) { if (sys != null) {
// we also have to look at this by version because the resource might not be versioned or we might not have a copy // we also have to look at this by version because the resource might not be versioned or we might not have a copy
for (CodeSystem supp : codeSystems.getSupplements(sys)) { for (CodeSystem supp : codeSystems.getSupplements(sys)) {
opCtxt.seeSupplement(supp);
if (opCtxt != null) {
opCtxt.seeSupplement(supp);
}
cache = checkAddToParams(tc, pin, supp) || cache; cache = checkAddToParams(tc, pin, supp) || cache;
} }
if (!sys.contains("!")) { if (!sys.contains("!")) {
sys = getFixedVersion(sys, pin); sys = getFixedVersion(sys, pin);
if (sys != null) { if (sys != null) {
for (CodeSystem supp : codeSystems.getSupplements(sys)) { for (CodeSystem supp : codeSystems.getSupplements(sys)) {
opCtxt.seeSupplement(supp); if (opCtxt != null) {
opCtxt.seeSupplement(supp);
}
cache = checkAddToParams(tc, pin, supp) || cache; cache = checkAddToParams(tc, pin, supp) || cache;
} }
} }