minor fixes for extension rendering

This commit is contained in:
Grahame Grieve 2023-02-03 18:42:05 +11:00
parent 2628f6fac1
commit e4925ea762
2 changed files with 18 additions and 2 deletions

View File

@ -3864,5 +3864,9 @@ public class ProfileUtilities extends TranslatingUtilities {
return null; return null;
} }
public static boolean isExtensionDefinition(StructureDefinition sd) {
return sd.getDerivation() == TypeDerivationRule.CONSTRAINT && sd.getType().equals("Extension");
}
} }

View File

@ -136,12 +136,24 @@ public class ContextUtilities implements ProfileKnowledgeProvider {
* @return a list of the resource and type names defined for this version * @return a list of the resource and type names defined for this version
*/ */
public List<String> getTypeNames() { public List<String> getTypeNames() {
List<String> result = new ArrayList<String>(); Set<String> result = new HashSet<String>();
for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) {
if (sd.getKind() != StructureDefinitionKind.LOGICAL && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION)
result.add(sd.getName());
}
return Utilities.sorted(result);
}
/**
* @return a set of the resource and type names defined for this version
*/
public Set<String> getTypeNameSet() {
Set<String> result = new HashSet<String>();
for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) { for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) {
if (sd.getKind() != StructureDefinitionKind.LOGICAL && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION) if (sd.getKind() != StructureDefinitionKind.LOGICAL && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION)
result.add(sd.getName()); result.add(sd.getName());
} }
Collections.sort(result);
return result; return result;
} }