Merge pull request #1103 from hapifhir/gg-202302-resource-names
Gg 202302 resource names
This commit is contained in:
commit
2792b941a2
|
@ -37,9 +37,11 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
|
@ -560,13 +562,12 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getResourceNames() {
|
public List<String> getResourceNames() {
|
||||||
List<String> result = new ArrayList<String>();
|
Set<String> result = new HashSet<String>();
|
||||||
for (StructureDefinition sd : listStructures()) {
|
for (StructureDefinition sd : listStructures()) {
|
||||||
if (sd.getKind() == StructureDefinitionKind.RESOURCE && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION)
|
if (sd.getKind() == StructureDefinitionKind.RESOURCE && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION)
|
||||||
result.add(sd.getName());
|
result.add(sd.getName());
|
||||||
}
|
}
|
||||||
Collections.sort(result);
|
return Utilities.sorted(result);
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1297,7 +1297,7 @@ public class Utilities {
|
||||||
return id.matches("[A-Za-z0-9\\-\\.]{1,64}");
|
return id.matches("[A-Za-z0-9\\-\\.]{1,64}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<String> sorted(Set<String> set) {
|
public static List<String> sorted(Collection<String> set) {
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
list.addAll(set);
|
list.addAll(set);
|
||||||
Collections.sort(list);
|
Collections.sort(list);
|
||||||
|
|
Loading…
Reference in New Issue