improve extension representation

This commit is contained in:
Grahame Grieve 2023-03-12 21:53:38 +11:00
parent 2860a7186f
commit 43253e8d10
2 changed files with 12 additions and 1 deletions

View File

@ -3906,5 +3906,13 @@ public class ProfileUtilities extends TranslatingUtilities {
this.allowUnknownProfile = allowUnknownProfile; this.allowUnknownProfile = allowUnknownProfile;
} }
public static boolean isSimpleExtension(StructureDefinition sd) {
if (!isExtensionDefinition(sd)) {
return false;
}
ElementDefinition value = sd.getSnapshot().getElementByPath("Extension.value");
return value != null && !value.isProhibited();
}
} }

View File

@ -1234,8 +1234,11 @@ public class StructureDefinition extends CanonicalResource {
// added from java-adornments.txt: // added from java-adornments.txt:
public ElementDefinition getElementByPath(String path) { public ElementDefinition getElementByPath(String path) {
if (path == null) {
return null;
}
for (ElementDefinition ed : getElement()) { for (ElementDefinition ed : getElement()) {
if (path.equals(ed.getPath())) { if (path.equals(ed.getPath()) || (path+"[x]").equals(ed.getPath())) {
return ed; return ed;
} }
} }