* ignore canonical resources found in the examples package
This commit is contained in:
parent
66ab13dba7
commit
939b377fe2
|
@ -312,7 +312,9 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
|
|||
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));
|
||||
}
|
||||
|
||||
String url = r.getUrl();
|
||||
if (!allowLoadingDuplicates && hasResource(r.getType(), url)) {
|
||||
|
@ -382,6 +384,8 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
|
|||
}
|
||||
if ((packageInfo == null || !packageInfo.isExamplesPackage()) || !map.containsKey(r.getId())) {
|
||||
map.put(r.getId(), new ResourceProxy(r));
|
||||
} else {
|
||||
System.out.println("Ingore "+r.fhirType()+"/"+r.getId()+" from package "+packageInfo.toString());
|
||||
}
|
||||
|
||||
if (r instanceof CodeSystem || r instanceof NamingSystem) {
|
||||
|
|
|
@ -236,7 +236,7 @@ public class CanonicalResourceManager<T extends CanonicalResource> {
|
|||
}
|
||||
}
|
||||
CachedCanonicalResource<T> existing = cr.hasVersion() ? map.get(cr.getUrl()+"|"+cr.getVersion()) : map.get(cr.getUrl()+"|#0");
|
||||
if (existing != null && (cr.getPackageInfo() != null && cr.getPackageInfo().isExamplesPackage())) {
|
||||
if (map.get(cr.getUrl()) != null && (cr.getPackageInfo() != null && cr.getPackageInfo().isExamplesPackage())) {
|
||||
return;
|
||||
}
|
||||
if (existing != null) {
|
||||
|
@ -245,6 +245,7 @@ public class CanonicalResourceManager<T extends CanonicalResource> {
|
|||
|
||||
list.add(cr);
|
||||
map.put(cr.getId(), cr); // we do this so we can drop by id
|
||||
map.put(cr.getUrl(), cr);
|
||||
|
||||
if (cr.getUrl() != null) {
|
||||
// first, this is the correct reosurce for this version (if it has a version)
|
||||
|
|
|
@ -171,8 +171,14 @@ public interface IWorkerContext {
|
|||
return version;
|
||||
}
|
||||
public boolean isExamplesPackage() {
|
||||
return !(id.startsWith("hl7.fhir.") && id.endsWith(".example"));
|
||||
boolean b = id.startsWith("hl7.fhir.") && id.endsWith(".examples");
|
||||
return b;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return id+"#"+version;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class PackageDetails extends PackageVersion {
|
||||
|
|
Loading…
Reference in New Issue