use of org.hl7.fhir.utilities.graphql.ObjectValue in project org.hl7.fhir.core by hapifhir.
the class GraphQLEngine method processSearchSingle.
private void processSearchSingle(ObjectValue target, Field field, boolean inheritedList, String suffix) throws EGraphQLException, FHIRException {
if (services == null)
throw new EGraphQLException("Resource Referencing services not provided");
String id = "";
for (Argument arg : field.getArguments()) if ((arg.getName().equals("id")))
id = getSingleValue(arg);
else
throw new EGraphQLException("Unknown/invalid parameter " + arg.getName());
if (Utilities.noString(id))
throw new EGraphQLException("No id found");
Resource res = (Resource) services.lookup(appInfo, field.getName(), id);
if (res == null)
throw new EGraphQLException("Resource " + field.getName() + "/" + id + " not found");
Argument arg = target.addField(field.getAlias() + suffix, listStatus(field, false));
ObjectValue obj = new ObjectValue();
arg.addValue(obj);
processObject(res, res, obj, field.getSelectionSet(), inheritedList, suffix);
}
Aggregations