fix bug raising error when processing bundles

This commit is contained in:
Grahame Grieve 2020-11-05 14:10:23 +11:00
parent 6e4bbe60fe
commit 2c22d8fa23
1 changed files with 4 additions and 4 deletions

View File

@ -75,15 +75,15 @@ public class Element extends Base {
CONTAINED, BUNDLE_ENTRY, BUNDLE_OUTCOME, PARAMETER;
public static SpecialElement fromProperty(Property property) {
if (property.getStructure().getIdElement().getIdPart().equals("Parameters"))
if (property.getStructure().getType().equals("Parameters"))
return PARAMETER;
if (property.getStructure().getIdElement().getIdPart().equals("Bundle") && property.getName().equals("resource"))
if (property.getStructure().getType().equals("Bundle") && property.getName().equals("resource"))
return BUNDLE_ENTRY;
if (property.getStructure().getIdElement().getIdPart().equals("Bundle") && property.getName().equals("outcome"))
if (property.getStructure().getType().equals("Bundle") && property.getName().equals("outcome"))
return BUNDLE_OUTCOME;
if (property.getName().equals("contained"))
return CONTAINED;
throw new Error("Unknown resource containing a native resource: "+property.getDefinition().getId());
throw new FHIRException("Unknown resource containing a native resource: "+property.getDefinition().getId());
}
}