stability fixes

This commit is contained in:
Grahame Grieve 2022-03-29 11:17:01 +11:00
parent ba85674ff9
commit 4735d99114
2 changed files with 25 additions and 19 deletions

View File

@ -10290,9 +10290,9 @@ The primary difference between a medication statement and a medication administr
return FHIRVersion._4_0_1; return FHIRVersion._4_0_1;
if ("4.1.0".equals(codeString)) if ("4.1.0".equals(codeString))
return FHIRVersion._4_1_0; return FHIRVersion._4_1_0;
if ("4.3.0-snapshot1".equals(codeString)) if ("4.3.0-snapshot1".equalsIgnoreCase(codeString))
return FHIRVersion._4_3_0_SNAPSHOT1; return FHIRVersion._4_3_0_SNAPSHOT1;
if ("4.3.0-cibuild".equals(codeString)) if ("4.3.0-cibuild".equalsIgnoreCase(codeString))
return FHIRVersion._4_3_0_CIBUILD; return FHIRVersion._4_3_0_CIBUILD;
throw new IllegalArgumentException("Unknown FHIRVersion code '"+codeString+"'"); throw new IllegalArgumentException("Unknown FHIRVersion code '"+codeString+"'");
} }

View File

@ -309,14 +309,17 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
public void registerResourceFromPackage(CanonicalResourceProxy r, PackageVersion packageInfo) throws FHIRException { public void registerResourceFromPackage(CanonicalResourceProxy r, PackageVersion packageInfo) throws FHIRException {
synchronized (lock) { synchronized (lock) {
Map<String, ResourceProxy> map = allResourcesById.get(r.getType()); if (r.getId() != null) {
if (map == null) { Map<String, ResourceProxy> map = allResourcesById.get(r.getType());
map = new HashMap<String, ResourceProxy>(); if (map == null) {
allResourcesById.put(r.getType(), map); map = new HashMap<String, ResourceProxy>();
} allResourcesById.put(r.getType(), map);
if ((packageInfo == null || !packageInfo.isExamplesPackage()) || !map.containsKey(r.getId())) { }
map.put(r.getId(), new ResourceProxy(r)); if ((packageInfo == null || !packageInfo.isExamplesPackage()) || !map.containsKey(r.getId())) {
map.put(r.getId(), new ResourceProxy(r));
}
} }
String url = r.getUrl(); String url = r.getUrl();
@ -379,16 +382,19 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
} }
public void cacheResourceFromPackage(Resource r, PackageVersion packageInfo) throws FHIRException { public void cacheResourceFromPackage(Resource r, PackageVersion packageInfo) throws FHIRException {
synchronized (lock) {
Map<String, ResourceProxy> map = allResourcesById.get(r.fhirType()); synchronized (lock) {
if (map == null) { if (r.getId() != null) {
map = new HashMap<String, ResourceProxy>(); Map<String, ResourceProxy> map = allResourcesById.get(r.fhirType());
allResourcesById.put(r.fhirType(), map); if (map == null) {
} map = new HashMap<String, ResourceProxy>();
if ((packageInfo == null || !packageInfo.isExamplesPackage()) || !map.containsKey(r.getId())) { allResourcesById.put(r.fhirType(), map);
map.put(r.getId(), new ResourceProxy(r)); }
} else { if ((packageInfo == null || !packageInfo.isExamplesPackage()) || !map.containsKey(r.getId())) {
logger.logDebugMessage(LogCategory.PROGRESS,"Ignore "+r.fhirType()+"/"+r.getId()+" from package "+packageInfo.toString()); map.put(r.getId(), new ResourceProxy(r));
} else {
logger.logDebugMessage(LogCategory.PROGRESS,"Ignore "+r.fhirType()+"/"+r.getId()+" from package "+packageInfo.toString());
}
} }
if (r instanceof CodeSystem || r instanceof NamingSystem) { if (r instanceof CodeSystem || r instanceof NamingSystem) {