fix up structure mapping tests

This commit is contained in:
Grahame Grieve 2024-02-28 12:21:15 +11:00
parent 3f5461346b
commit f22316d55f
3 changed files with 6 additions and 5 deletions

View File

@ -1720,10 +1720,9 @@ public class StructureMapUtilities {
Base dest = null;
if (tgt.hasContext()) {
dest = vars.get(VariableMode.OUTPUT, tgt.getContext());
if (dest == null)
throw new FHIRException("Rule \"" + rulePath + "\": target context not known: " + tgt.getContext());
if (!tgt.hasElement())
throw new FHIRException("Rule \"" + rulePath + "\": Not supported yet");
if (dest == null) {
throw new FHIRException("Rul \"" + rulePath + "\": target context not known: " + tgt.getContext());
}
}
Base v = null;
if (tgt.hasTransform()) {
@ -1742,8 +1741,10 @@ public class StructureMapUtilities {
v = dest.makeProperty(tgt.getElement().hashCode(), tgt.getElement());
sharedVars.add(VariableMode.SHARED, tgt.getListRuleId(), v);
}
} else {
} else if (tgt.hasElement()) {
v = dest.makeProperty(tgt.getElement().hashCode(), tgt.getElement());
} else {
v = dest;
}
}
if (tgt.hasVariable() && v != null)