fix bug listing types when old versions are loaded

This commit is contained in:
Grahame Grieve 2023-03-13 13:52:31 +11:00
parent 07a3962ac2
commit 753a90b463
2 changed files with 2 additions and 1 deletions

View File

@ -112,6 +112,7 @@ public abstract class BaseLoaderR5 implements IContextResourceLoader {
// and we only patch URLs to support version transforms
// so we just patch sd/od -> vs -> cs
protected void doPatchUrls(Resource resource) {
resource.setUserData("old.load.mode", true);
if (resource instanceof CanonicalResource) {
CanonicalResource cr = (CanonicalResource) resource;
cr.setUrl(patchUrl(cr.getUrl(), cr.fhirType()));

View File

@ -570,7 +570,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
public List<String> getResourceNames() {
Set<String> result = new HashSet<String>();
for (StructureDefinition sd : listStructures()) {
if (sd.getKind() == StructureDefinitionKind.RESOURCE && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION)
if (sd.getKind() == StructureDefinitionKind.RESOURCE && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION && !sd.hasUserData("old.load.mode"))
result.add(sd.getName());
}
return Utilities.sorted(result);