@Operation(name = JpaConstants.OPERATION_SUGGEST_KEYWORDS, idempotent = true) public Parameters suggestKeywords( @OperationParam(name = "context", min = 1, max = 1) String theContext, @OperationParam(name = "searchParam", min = 1, max = 1) String theSearchParam, @OperationParam(name = "text", min = 1, max = 1) String theText ) { JpaSystemProviderDstu3.validateFulltextSearchEnabled(mySearchDao); if (isBlank(theContext)) { throw new InvalidRequestException("Parameter 'context' must be provided"); } if (isBlank(theSearchParam)) { throw new InvalidRequestException("Parameter 'searchParam' must be provided"); } if (isBlank(theText)) { throw new InvalidRequestException("Parameter 'text' must be provided"); } List<Suggestion> keywords = mySearchDao.suggestKeywords(theContext, theSearchParam, theText); Parameters retVal = new Parameters(); for (Suggestion next : keywords) { retVal.addParameter() .addPart(new Parameter().setName("keyword").setValue(new StringDt(next.getTerm()))) .addPart(new Parameter().setName("score").setValue(new DecimalDt(next.getScore()))); } return retVal; }
/** * Adds and returns a new value for <b>part</b> () * * <p> * <b>Definition:</b> * A named part of a parameter. In many implementation context, a set of named parts is known as a \"Tuple\" * </p> */ public Parameter addPart() { Parameter newType = new Parameter(); getPart().add(newType); return newType; }
/** * Adds and returns a new value for <b>parameter</b> () * * <p> * <b>Definition:</b> * A parameter passed to or received from the operation * </p> */ public Parameter addParameter() { Parameter newType = new Parameter(); getParameter().add(newType); return newType; }
@Operation(name = JpaConstants.OPERATION_SUGGEST_KEYWORDS, idempotent = true) public Parameters suggestKeywords( @OperationParam(name = "context", min = 1, max = 1) String theContext, @OperationParam(name = "searchParam", min = 1, max = 1) String theSearchParam, @OperationParam(name = "text", min = 1, max = 1) String theText ) { JpaSystemProviderDstu3.validateFulltextSearchEnabled(mySearchDao); if (isBlank(theContext)) { throw new InvalidRequestException("Parameter 'context' must be provided"); } if (isBlank(theSearchParam)) { throw new InvalidRequestException("Parameter 'searchParam' must be provided"); } if (isBlank(theText)) { throw new InvalidRequestException("Parameter 'text' must be provided"); } List<Suggestion> keywords = mySearchDao.suggestKeywords(theContext, theSearchParam, theText); Parameters retVal = new Parameters(); for (Suggestion next : keywords) { retVal.addParameter() .addPart(new Parameter().setName("keyword").setValue(new StringDt(next.getTerm()))) .addPart(new Parameter().setName("score").setValue(new DecimalDt(next.getScore()))); } return retVal; }
public static Parameters toExpungeResponse(org.hl7.fhir.r4.model.Parameters theRetVal) { Integer count = ((IntegerType) theRetVal.getParameterFirstRep().getValue()).getValue(); return new Parameters() .addParameter(new Parameter().setName("count").setValue(new IntegerDt(count))); }
public static Parameters toExpungeResponse(org.hl7.fhir.r4.model.Parameters theRetVal) { Integer count = ((IntegerType) theRetVal.getParameterFirstRep().getValue()).getValue(); return new Parameters() .addParameter(new Parameter().setName("count").setValue(new IntegerDt(count))); }