diff --git a/components/camel-fhir/camel-fhir-api/src/main/java/org/apache/camel/component/fhir/api/FhirSearch.java b/components/camel-fhir/camel-fhir-api/src/main/java/org/apache/camel/component/fhir/api/FhirSearch.java index 72195343eb3df..fc5b7dd60625f 100644 --- a/components/camel-fhir/camel-fhir-api/src/main/java/org/apache/camel/component/fhir/api/FhirSearch.java +++ b/components/camel-fhir/camel-fhir-api/src/main/java/org/apache/camel/component/fhir/api/FhirSearch.java @@ -16,8 +16,11 @@ */ package org.apache.camel.component.fhir.api; +import java.util.List; import java.util.Map; +import java.util.Objects; +import ca.uhn.fhir.rest.api.SearchStyleEnum; import ca.uhn.fhir.rest.client.api.IGenericClient; import ca.uhn.fhir.rest.gclient.IQuery; import org.hl7.fhir.instance.model.api.IBaseBundle; @@ -51,4 +54,25 @@ public IBaseBundle searchByUrl(String url, Map extraPar return query.execute(); } + /** + * Perform a search by resource name. + * + * @param resourceName The resource to search for. + * @param searchParameters A set of search parameters to the query. + * @param searchStyle Forces the query to perform the search using the given method (allowable methods are + * described in the FHIR Search + * Specification). The default search style is HTTP POST. + * @param extraParameters see {@link ExtraParameters} for a full list of parameters that can be passed, may be + * NULL + * @return the {@link IBaseBundle} + */ + public IBaseBundle searchByResource( + String resourceName, Map> searchParameters, SearchStyleEnum searchStyle, + Map extraParameters) { + IQuery query = client.search().forResource(resourceName); + query.whereMap(Objects.requireNonNullElse(searchParameters, Map.of())); + query.usingStyle(Objects.requireNonNullElse(searchStyle, SearchStyleEnum.POST)); + ExtraParameters.process(extraParameters, query); + return query.execute(); + } } diff --git a/components/camel-fhir/camel-fhir-component/pom.xml b/components/camel-fhir/camel-fhir-component/pom.xml index 71dd5db541c70..5e28583f2824c 100644 --- a/components/camel-fhir/camel-fhir-component/pom.xml +++ b/components/camel-fhir/camel-fhir-component/pom.xml @@ -284,6 +284,8 @@ org.apache.camel.component.fhir.api.FhirSearch + searchParameters + searchStyle extraParameters diff --git a/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/FhirEndpointUriFactory.java b/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/FhirEndpointUriFactory.java index afb0b239d256e..b4603a9ba2ea3 100644 --- a/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/FhirEndpointUriFactory.java +++ b/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/FhirEndpointUriFactory.java @@ -23,7 +23,7 @@ public class FhirEndpointUriFactory extends org.apache.camel.support.component.E private static final Set SECRET_PROPERTY_NAMES; private static final Set MULTI_VALUE_PREFIXES; static { - Set props = new HashSet<>(81); + Set props = new HashSet<>(84); props.add("accessToken"); props.add("apiName"); props.add("asynchronous"); @@ -77,6 +77,7 @@ public class FhirEndpointUriFactory extends org.apache.camel.support.component.E props.add("resource"); props.add("resourceAsString"); props.add("resourceClass"); + props.add("resourceName"); props.add("resourceType"); props.add("resources"); props.add("respondToUri"); @@ -88,6 +89,8 @@ public class FhirEndpointUriFactory extends org.apache.camel.support.component.E props.add("scheduledExecutorService"); props.add("scheduler"); props.add("schedulerProperties"); + props.add("searchParameters"); + props.add("searchStyle"); props.add("sendEmptyMessageWhenIdle"); props.add("serverUrl"); props.add("sessionCookie"); diff --git a/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/FhirSearchEndpointConfiguration.java b/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/FhirSearchEndpointConfiguration.java index d813456ecc3d3..17ffac5c8e130 100644 --- a/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/FhirSearchEndpointConfiguration.java +++ b/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/FhirSearchEndpointConfiguration.java @@ -15,14 +15,23 @@ */ @ApiParams(apiName = "search", description = "API to search for resources matching a given set of criteria", - apiMethods = {@ApiMethod(methodName = "searchByUrl", description="Perform a search directly by URL", signatures={"org.hl7.fhir.instance.model.api.IBaseBundle searchByUrl(String url, java.util.Map extraParameters)"})}, aliases = {}) + apiMethods = {@ApiMethod(methodName = "searchByResource", description="Perform a search by resource name", signatures={"org.hl7.fhir.instance.model.api.IBaseBundle searchByResource(String resourceName, java.util.Map> searchParameters, ca.uhn.fhir.rest.api.SearchStyleEnum searchStyle, java.util.Map extraParameters)"}), @ApiMethod(methodName = "searchByUrl", description="Perform a search directly by URL", signatures={"org.hl7.fhir.instance.model.api.IBaseBundle searchByUrl(String url, java.util.Map extraParameters)"})}, aliases = {}) @UriParams @Configurer(extended = true) public final class FhirSearchEndpointConfiguration extends FhirConfiguration { @UriParam - @ApiParam(optional = true, apiMethods = {@ApiMethod(methodName = "searchByUrl", description="See ExtraParameters for a full list of parameters that can be passed, may be NULL")}) + @ApiParam(optional = true, apiMethods = {@ApiMethod(methodName = "searchByResource", description="See ExtraParameters for a full list of parameters that can be passed, may be NULL"), @ApiMethod(methodName = "searchByUrl", description="See ExtraParameters for a full list of parameters that can be passed, may be NULL")}) private java.util.Map extraParameters; @UriParam + @ApiParam(optional = false, apiMethods = {@ApiMethod(methodName = "searchByResource", description="The resource to search for")}) + private String resourceName; + @UriParam + @ApiParam(optional = true, apiMethods = {@ApiMethod(methodName = "searchByResource", description="A set of search parameters to the query")}) + private java.util.Map> searchParameters; + @UriParam + @ApiParam(optional = true, apiMethods = {@ApiMethod(methodName = "searchByResource", description="Forces the query to perform the search using the given method (allowable methods are described in the FHIR Search Specification). The default search style is HTTP POST.")}) + private ca.uhn.fhir.rest.api.SearchStyleEnum searchStyle; + @UriParam @ApiParam(optional = false, apiMethods = {@ApiMethod(methodName = "searchByUrl", description="The URL to search for. Note that this URL may be complete (e.g. http://example.com/base/Patientname=foo) in which case the client's base URL will be ignored. Or it can be relative (e.g. Patientname=foo) in which case the client's base URL will be used.")}) private String url; @@ -34,6 +43,30 @@ public void setExtraParameters(java.util.Map> getSearchParameters() { + return searchParameters; + } + + public void setSearchParameters(java.util.Map> searchParameters) { + this.searchParameters = searchParameters; + } + + public ca.uhn.fhir.rest.api.SearchStyleEnum getSearchStyle() { + return searchStyle; + } + + public void setSearchStyle(ca.uhn.fhir.rest.api.SearchStyleEnum searchStyle) { + this.searchStyle = searchStyle; + } + public String getUrl() { return url; } diff --git a/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/FhirSearchEndpointConfigurationConfigurer.java b/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/FhirSearchEndpointConfigurationConfigurer.java index f4614cfecf9ff..c892af6c84b12 100644 --- a/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/FhirSearchEndpointConfigurationConfigurer.java +++ b/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/FhirSearchEndpointConfigurationConfigurer.java @@ -42,6 +42,9 @@ public class FhirSearchEndpointConfigurationConfigurer extends org.apache.camel. map.put("ProxyPassword", java.lang.String.class); map.put("ProxyPort", java.lang.Integer.class); map.put("ProxyUser", java.lang.String.class); + map.put("ResourceName", java.lang.String.class); + map.put("SearchParameters", java.util.Map.class); + map.put("SearchStyle", ca.uhn.fhir.rest.api.SearchStyleEnum.class); map.put("ServerUrl", java.lang.String.class); map.put("SessionCookie", java.lang.String.class); map.put("SocketTimeout", java.lang.Integer.class); @@ -91,6 +94,12 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj case "proxyPort": target.setProxyPort(property(camelContext, java.lang.Integer.class, value)); return true; case "proxyuser": case "proxyUser": target.setProxyUser(property(camelContext, java.lang.String.class, value)); return true; + case "resourcename": + case "resourceName": target.setResourceName(property(camelContext, java.lang.String.class, value)); return true; + case "searchparameters": + case "searchParameters": target.setSearchParameters(property(camelContext, java.util.Map.class, value)); return true; + case "searchstyle": + case "searchStyle": target.setSearchStyle(property(camelContext, ca.uhn.fhir.rest.api.SearchStyleEnum.class, value)); return true; case "serverurl": case "serverUrl": target.setServerUrl(property(camelContext, java.lang.String.class, value)); return true; case "sessioncookie": @@ -149,6 +158,12 @@ public Class getOptionType(String name, boolean ignoreCase) { case "proxyPort": return java.lang.Integer.class; case "proxyuser": case "proxyUser": return java.lang.String.class; + case "resourcename": + case "resourceName": return java.lang.String.class; + case "searchparameters": + case "searchParameters": return java.util.Map.class; + case "searchstyle": + case "searchStyle": return ca.uhn.fhir.rest.api.SearchStyleEnum.class; case "serverurl": case "serverUrl": return java.lang.String.class; case "sessioncookie": @@ -203,6 +218,12 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) { case "proxyPort": return target.getProxyPort(); case "proxyuser": case "proxyUser": return target.getProxyUser(); + case "resourcename": + case "resourceName": return target.getResourceName(); + case "searchparameters": + case "searchParameters": return target.getSearchParameters(); + case "searchstyle": + case "searchStyle": return target.getSearchStyle(); case "serverurl": case "serverUrl": return target.getServerUrl(); case "sessioncookie": @@ -223,6 +244,8 @@ public Object getCollectionValueType(Object target, String name, boolean ignoreC switch (ignoreCase ? name.toLowerCase() : name) { case "extraparameters": case "extraParameters": return java.lang.Object.class; + case "searchparameters": + case "searchParameters": return java.util.List.class; default: return null; } } diff --git a/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/internal/FhirApiCollection.java b/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/internal/FhirApiCollection.java index c57462a24e64a..75918c582e0c6 100644 --- a/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/internal/FhirApiCollection.java +++ b/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/internal/FhirApiCollection.java @@ -86,7 +86,7 @@ private FhirApiCollection() { apiMethods.put(FhirReadApiMethod.class, FhirApiName.READ); aliases.clear(); - nullableArgs = Arrays.asList("extraParameters"); + nullableArgs = Arrays.asList("searchParameters", "searchStyle", "extraParameters"); apiHelpers.put(FhirApiName.SEARCH, new ApiMethodHelper<>(FhirSearchApiMethod.class, aliases, nullableArgs)); apiMethods.put(FhirSearchApiMethod.class, FhirApiName.SEARCH); diff --git a/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/internal/FhirSearchApiMethod.java b/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/internal/FhirSearchApiMethod.java index 8442c6e78630c..057542881ce00 100644 --- a/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/internal/FhirSearchApiMethod.java +++ b/components/camel-fhir/camel-fhir-component/src/generated/java/org/apache/camel/component/fhir/internal/FhirSearchApiMethod.java @@ -19,6 +19,14 @@ */ public enum FhirSearchApiMethod implements ApiMethod { + SEARCH_BY_RESOURCE( + org.hl7.fhir.instance.model.api.IBaseBundle.class, + "searchByResource", + arg("resourceName", String.class), + arg("searchParameters", java.util.Map.class), + arg("searchStyle", ca.uhn.fhir.rest.api.SearchStyleEnum.class), + arg("extraParameters", java.util.Map.class)), + SEARCH_BY_URL( org.hl7.fhir.instance.model.api.IBaseBundle.class, "searchByUrl", diff --git a/components/camel-fhir/camel-fhir-component/src/generated/resources/META-INF/org/apache/camel/component/fhir/fhir.json b/components/camel-fhir/camel-fhir-component/src/generated/resources/META-INF/org/apache/camel/component/fhir/fhir.json index f126f94585de7..c123c747f670e 100644 --- a/components/camel-fhir/camel-fhir-component/src/generated/resources/META-INF/org/apache/camel/component/fhir/fhir.json +++ b/components/camel-fhir/camel-fhir-component/src/generated/resources/META-INF/org/apache/camel/component/fhir/fhir.json @@ -111,7 +111,7 @@ "operation": { "consumerOnly": false, "producerOnly": false, "description": "API for extended FHIR operations", "methods": { "onInstance": { "description": "Perform the operation across all versions of a specific resource (by ID and type) on the server", "signatures": [ "org.hl7.fhir.instance.model.api.IBaseResource onInstance(org.hl7.fhir.instance.model.api.IIdType id, String name, org.hl7.fhir.instance.model.api.IBaseParameters parameters, Class outputParameterType, boolean useHttpGet, Class returnType, java.util.Map extraParameters)" ] }, "onInstanceVersion": { "description": "This operation operates on a specific version of a resource", "signatures": [ "org.hl7.fhir.instance.model.api.IBaseResource onInstanceVersion(org.hl7.fhir.instance.model.api.IIdType id, String name, org.hl7.fhir.instance.model.api.IBaseParameters parameters, Class outputParameterType, boolean useHttpGet, Class returnType, java.util.Map extraParameters)" ] }, "onServer": { "description": "Perform the operation across all versions of all resources of all types on the server", "signatures": [ "org.hl7.fhir.instance.model.api.IBaseResource onServer(String name, org.hl7.fhir.instance.model.api.IBaseParameters parameters, Class outputParameterType, boolean useHttpGet, Class returnType, java.util.Map extraParameters)" ] }, "onType": { "description": "Perform the operation across all versions of all resources of the given type on the server", "signatures": [ "org.hl7.fhir.instance.model.api.IBaseResource onType(Class resourceType, String name, org.hl7.fhir.instance.model.api.IBaseParameters parameters, Class outputParameterType, boolean useHttpGet, Class returnType, java.util.Map extraParameters)" ] }, "processMessage": { "description": "This operation is called $process-message as defined by the FHIR specification", "signatures": [ "org.hl7.fhir.instance.model.api.IBaseBundle processMessage(String respondToUri, org.hl7.fhir.instance.model.api.IBaseBundle msgBundle, boolean asynchronous, Class responseClass, java.util.Map extraParameters)" ] } } }, "patch": { "consumerOnly": false, "producerOnly": false, "description": "API for the patch operation, which performs a logical patch on a server resource", "methods": { "patchById": { "description": "Applies the patch to the given resource ID", "signatures": [ "ca.uhn.fhir.rest.api.MethodOutcome patchById(String patchBody, String stringId, ca.uhn.fhir.rest.api.PreferReturnEnum preferReturn, java.util.Map extraParameters)", "ca.uhn.fhir.rest.api.MethodOutcome patchById(String patchBody, org.hl7.fhir.instance.model.api.IIdType id, ca.uhn.fhir.rest.api.PreferReturnEnum preferReturn, java.util.Map extraParameters)" ] }, "patchByUrl": { "description": "Specifies that the update should be performed as a conditional create against a given search URL", "signatures": [ "ca.uhn.fhir.rest.api.MethodOutcome patchByUrl(String patchBody, String url, ca.uhn.fhir.rest.api.PreferReturnEnum preferReturn, java.util.Map extraParameters)" ] } } }, "read": { "consumerOnly": false, "producerOnly": false, "description": "API method for read operations", "methods": { "resourceById": { "description": "Reads a IBaseResource on the server by id", "signatures": [ "org.hl7.fhir.instance.model.api.IBaseResource resourceById(Class resource, Long longId, String ifVersionMatches, Boolean returnNull, org.hl7.fhir.instance.model.api.IBaseResource returnResource, Boolean throwError, java.util.Map extraParameters)", "org.hl7.fhir.instance.model.api.IBaseResource resourceById(Class resource, String stringId, String version, String ifVersionMatches, Boolean returnNull, org.hl7.fhir.instance.model.api.IBaseResource returnResource, Boolean throwError, java.util.Map extraParameters)", "org.hl7.fhir.instance.model.api.IBaseResource resourceById(Class resource, org.hl7.fhir.instance.model.api.IIdType id, String ifVersionMatches, Boolean returnNull, org.hl7.fhir.instance.model.api.IBaseResource returnResource, Boolean throwError, java.util.Map extraParameters)", "org.hl7.fhir.instance.model.api.IBaseResource resourceById(String resourceClass, Long longId, String ifVersionMatches, Boolean returnNull, org.hl7.fhir.instance.model.api.IBaseResource returnResource, Boolean throwError, java.util.Map extraParameters)", "org.hl7.fhir.instance.model.api.IBaseResource resourceById(String resourceClass, String stringId, String ifVersionMatches, String version, Boolean returnNull, org.hl7.fhir.instance.model.api.IBaseResource returnResource, Boolean throwError, java.util.Map extraParameters)", "org.hl7.fhir.instance.model.api.IBaseResource resourceById(String resourceClass, org.hl7.fhir.instance.model.api.IIdType id, String ifVersionMatches, Boolean returnNull, org.hl7.fhir.instance.model.api.IBaseResource returnResource, Boolean throwError, java.util.Map extraParameters)" ] }, "resourceByUrl": { "description": "Reads a IBaseResource on the server by url", "signatures": [ "org.hl7.fhir.instance.model.api.IBaseResource resourceByUrl(Class resource, String url, String ifVersionMatches, Boolean returnNull, org.hl7.fhir.instance.model.api.IBaseResource returnResource, Boolean throwError, java.util.Map extraParameters)", "org.hl7.fhir.instance.model.api.IBaseResource resourceByUrl(Class resource, org.hl7.fhir.instance.model.api.IIdType iUrl, String ifVersionMatches, Boolean returnNull, org.hl7.fhir.instance.model.api.IBaseResource returnResource, Boolean throwError, java.util.Map extraParameters)", "org.hl7.fhir.instance.model.api.IBaseResource resourceByUrl(String resourceClass, String url, String ifVersionMatches, Boolean returnNull, org.hl7.fhir.instance.model.api.IBaseResource returnResource, Boolean throwError, java.util.Map extraParameters)", "org.hl7.fhir.instance.model.api.IBaseResource resourceByUrl(String resourceClass, org.hl7.fhir.instance.model.api.IIdType iUrl, String ifVersionMatches, Boolean returnNull, org.hl7.fhir.instance.model.api.IBaseResource returnResource, Boolean throwError, java.util.Map extraParameters)" ] } } }, - "search": { "consumerOnly": false, "producerOnly": false, "description": "API to search for resources matching a given set of criteria", "methods": { "searchByUrl": { "description": "Perform a search directly by URL", "signatures": [ "org.hl7.fhir.instance.model.api.IBaseBundle searchByUrl(String url, java.util.Map extraParameters)" ] } } }, + "search": { "consumerOnly": false, "producerOnly": false, "description": "API to search for resources matching a given set of criteria", "methods": { "searchByResource": { "description": "Perform a search by resource name", "signatures": [ "org.hl7.fhir.instance.model.api.IBaseBundle searchByResource(String resourceName, java.util.Map> searchParameters, ca.uhn.fhir.rest.api.SearchStyleEnum searchStyle, java.util.Map extraParameters)" ] }, "searchByUrl": { "description": "Perform a search directly by URL", "signatures": [ "org.hl7.fhir.instance.model.api.IBaseBundle searchByUrl(String url, java.util.Map extraParameters)" ] } } }, "transaction": { "consumerOnly": false, "producerOnly": false, "description": "API for sending a transaction (collection of resources) to the server to be executed as a single unit", "methods": { "withBundle": { "description": "Use the given raw text (should be a Bundle resource) as the transaction input", "signatures": [ "String withBundle(String stringBundle, java.util.Map extraParameters)", "org.hl7.fhir.instance.model.api.IBaseBundle withBundle(org.hl7.fhir.instance.model.api.IBaseBundle bundle, java.util.Map extraParameters)" ] }, "withResources": { "description": "Use a list of resources as the transaction input", "signatures": [ "java.util.List withResources(java.util.List resources, java.util.Map extraParameters)" ] } } }, "update": { "consumerOnly": false, "producerOnly": false, "description": "API for the update operation, which performs a logical delete on a server resource", "methods": { "resource": { "description": "Updates a IBaseResource on the server by id", "signatures": [ "ca.uhn.fhir.rest.api.MethodOutcome resource(String resourceAsString, String stringId, ca.uhn.fhir.rest.api.PreferReturnEnum preferReturn, java.util.Map extraParameters)", "ca.uhn.fhir.rest.api.MethodOutcome resource(String resourceAsString, org.hl7.fhir.instance.model.api.IIdType id, ca.uhn.fhir.rest.api.PreferReturnEnum preferReturn, java.util.Map extraParameters)", "ca.uhn.fhir.rest.api.MethodOutcome resource(org.hl7.fhir.instance.model.api.IBaseResource resource, String stringId, ca.uhn.fhir.rest.api.PreferReturnEnum preferReturn, java.util.Map extraParameters)", "ca.uhn.fhir.rest.api.MethodOutcome resource(org.hl7.fhir.instance.model.api.IBaseResource resource, org.hl7.fhir.instance.model.api.IIdType id, ca.uhn.fhir.rest.api.PreferReturnEnum preferReturn, java.util.Map extraParameters)" ] }, "resourceBySearchUrl": { "description": "Updates a IBaseResource on the server by search url", "signatures": [ "ca.uhn.fhir.rest.api.MethodOutcome resourceBySearchUrl(String resourceAsString, String url, ca.uhn.fhir.rest.api.PreferReturnEnum preferReturn, java.util.Map extraParameters)", "ca.uhn.fhir.rest.api.MethodOutcome resourceBySearchUrl(org.hl7.fhir.instance.model.api.IBaseResource resource, String url, ca.uhn.fhir.rest.api.PreferReturnEnum preferReturn, java.util.Map extraParameters)" ] } } }, "validate": { "consumerOnly": false, "producerOnly": false, "description": "API for validating resources", "methods": { "resource": { "description": "Validates the resource", "signatures": [ "ca.uhn.fhir.rest.api.MethodOutcome resource(String resourceAsString, java.util.Map extraParameters)", "ca.uhn.fhir.rest.api.MethodOutcome resource(org.hl7.fhir.instance.model.api.IBaseResource resource, java.util.Map extraParameters)" ] } } } @@ -126,7 +126,7 @@ "operation": { "methods": { "onInstance": { "properties": { "extraParameters": { "index": 0, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "id": { "index": 1, "kind": "parameter", "displayName": "Id", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IIdType", "deprecated": false, "autowired": false, "secret": false, "description": "Resource (version will be stripped)", "optional": false }, "name": { "index": 2, "kind": "parameter", "displayName": "Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Operation name", "optional": false }, "outputParameterType": { "index": 3, "kind": "parameter", "displayName": "Output Parameter Type", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.Class", "deprecated": false, "autowired": false, "secret": false, "description": "The type to use for the output parameters (this should be set to Parameters.class drawn from the version of the FHIR structures you are using), may be NULL", "optional": true }, "parameters": { "index": 4, "kind": "parameter", "displayName": "Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IBaseParameters", "deprecated": false, "autowired": false, "secret": false, "description": "The parameters to use as input. May also be null if the operation does not require any input parameters.", "optional": true }, "returnType": { "index": 5, "kind": "parameter", "displayName": "Return Type", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.Class", "deprecated": false, "autowired": false, "secret": false, "description": "If this operation returns a single resource body as its return type instead of a Parameters resource, use this method to specify that resource type. This is useful for certain operations (e.g. Patient\/NNN\/$everything) which return a bundle instead of a Parameters resource, may be NULL", "optional": true }, "useHttpGet": { "index": 6, "kind": "parameter", "displayName": "Use Http Get", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Use HTTP GET verb", "optional": false } } }, "onInstanceVersion": { "properties": { "extraParameters": { "index": 0, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "id": { "index": 1, "kind": "parameter", "displayName": "Id", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IIdType", "deprecated": false, "autowired": false, "secret": false, "description": "Resource version", "optional": false }, "name": { "index": 2, "kind": "parameter", "displayName": "Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Operation name", "optional": false }, "outputParameterType": { "index": 3, "kind": "parameter", "displayName": "Output Parameter Type", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.Class", "deprecated": false, "autowired": false, "secret": false, "description": "The type to use for the output parameters (this should be set to Parameters.class drawn from the version of the FHIR structures you are using), may be NULL", "optional": true }, "parameters": { "index": 4, "kind": "parameter", "displayName": "Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IBaseParameters", "deprecated": false, "autowired": false, "secret": false, "description": "The parameters to use as input. May also be null if the operation does not require any input parameters.", "optional": true }, "returnType": { "index": 5, "kind": "parameter", "displayName": "Return Type", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.Class", "deprecated": false, "autowired": false, "secret": false, "description": "If this operation returns a single resource body as its return type instead of a Parameters resource, use this method to specify that resource type. This is useful for certain operations (e.g. Patient\/NNN\/$everything) which return a bundle instead of a Parameters resource, may be NULL", "optional": true }, "useHttpGet": { "index": 6, "kind": "parameter", "displayName": "Use Http Get", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Use HTTP GET verb", "optional": false } } }, "onServer": { "properties": { "extraParameters": { "index": 0, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "name": { "index": 1, "kind": "parameter", "displayName": "Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Operation name", "optional": false }, "outputParameterType": { "index": 2, "kind": "parameter", "displayName": "Output Parameter Type", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.Class", "deprecated": false, "autowired": false, "secret": false, "description": "The type to use for the output parameters (this should be set to Parameters.class drawn from the version of the FHIR structures you are using), may be NULL", "optional": true }, "parameters": { "index": 3, "kind": "parameter", "displayName": "Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IBaseParameters", "deprecated": false, "autowired": false, "secret": false, "description": "The parameters to use as input. May also be null if the operation does not require any input parameters.", "optional": true }, "returnType": { "index": 4, "kind": "parameter", "displayName": "Return Type", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.Class", "deprecated": false, "autowired": false, "secret": false, "description": "If this operation returns a single resource body as its return type instead of a Parameters resource, use this method to specify that resource type. This is useful for certain operations (e.g. Patient\/NNN\/$everything) which return a bundle instead of a Parameters resource, may be NULL", "optional": true }, "useHttpGet": { "index": 5, "kind": "parameter", "displayName": "Use Http Get", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Use HTTP GET verb", "optional": false } } }, "onType": { "properties": { "extraParameters": { "index": 0, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "name": { "index": 1, "kind": "parameter", "displayName": "Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Operation name", "optional": false }, "outputParameterType": { "index": 2, "kind": "parameter", "displayName": "Output Parameter Type", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.Class", "deprecated": false, "autowired": false, "secret": false, "description": "The type to use for the output parameters (this should be set to Parameters.class drawn from the version of the FHIR structures you are using), may be NULL", "optional": true }, "parameters": { "index": 3, "kind": "parameter", "displayName": "Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IBaseParameters", "deprecated": false, "autowired": false, "secret": false, "description": "The parameters to use as input. May also be null if the operation does not require any input parameters.", "optional": true }, "resourceType": { "index": 4, "kind": "parameter", "displayName": "Resource Type", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.Class", "deprecated": false, "autowired": false, "secret": false, "description": "The resource type to operate on", "optional": false }, "returnType": { "index": 5, "kind": "parameter", "displayName": "Return Type", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.Class", "deprecated": false, "autowired": false, "secret": false, "description": "If this operation returns a single resource body as its return type instead of a Parameters resource, use this method to specify that resource type. This is useful for certain operations (e.g. Patient\/NNN\/$everything) which return a bundle instead of a Parameters resource, may be NULL", "optional": true }, "useHttpGet": { "index": 6, "kind": "parameter", "displayName": "Use Http Get", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Use HTTP GET verb", "optional": false } } }, "processMessage": { "properties": { "asynchronous": { "index": 0, "kind": "parameter", "displayName": "Asynchronous", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Whether to process the message asynchronously or synchronously, defaults to synchronous.", "optional": false }, "extraParameters": { "index": 1, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "msgBundle": { "index": 2, "kind": "parameter", "displayName": "Msg Bundle", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IBaseBundle", "deprecated": false, "autowired": false, "secret": false, "description": "Set the Message Bundle to POST to the messaging server", "optional": false }, "respondToUri": { "index": 3, "kind": "parameter", "displayName": "Respond To Uri", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "An optional query parameter indicating that responses from the receiving server should be sent to this URI, may be NULL", "optional": true }, "responseClass": { "index": 4, "kind": "parameter", "displayName": "Response Class", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.Class", "deprecated": false, "autowired": false, "secret": false, "description": "The response class", "optional": false } } } } }, "patch": { "methods": { "patchById": { "properties": { "extraParameters": { "index": 1, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "id": { "index": 2, "kind": "parameter", "displayName": "Id", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IIdType", "deprecated": false, "autowired": false, "secret": false, "description": "The resource ID to patch", "optional": false }, "patchBody": { "index": 4, "kind": "parameter", "displayName": "Patch Body", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The body of the patch document serialized in either XML or JSON which conforms to http:\/\/jsonpatch.com\/ or http:\/\/tools.ietf.org\/html\/rfc5261", "optional": false }, "preferReturn": { "index": 6, "kind": "parameter", "displayName": "Prefer Return", "group": "common", "label": "", "required": false, "type": "object", "javaType": "ca.uhn.fhir.rest.api.PreferReturnEnum", "enum": [ "REPRESENTATION", "MINIMAL", "OPERATION_OUTCOME" ], "deprecated": false, "autowired": false, "secret": false, "description": "Add a Prefer header to the request, which requests that the server include or suppress the resource body as a part of the result. If a resource is returned by the server it will be parsed an accessible to the client via MethodOutcome#getResource()", "optional": true }, "stringId": { "index": 7, "kind": "parameter", "displayName": "String Id", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The resource ID to patch", "optional": false } } }, "patchByUrl": { "properties": { "extraParameters": { "index": 0, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "patchBody": { "index": 1, "kind": "parameter", "displayName": "Patch Body", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The body of the patch document serialized in either XML or JSON which conforms to http:\/\/jsonpatch.com\/ or http:\/\/tools.ietf.org\/html\/rfc5261", "optional": false }, "preferReturn": { "index": 2, "kind": "parameter", "displayName": "Prefer Return", "group": "common", "label": "", "required": false, "type": "object", "javaType": "ca.uhn.fhir.rest.api.PreferReturnEnum", "enum": [ "REPRESENTATION", "MINIMAL", "OPERATION_OUTCOME" ], "deprecated": false, "autowired": false, "secret": false, "description": "Add a Prefer header to the request, which requests that the server include or suppress the resource body as a part of the result. If a resource is returned by the server it will be parsed an accessible to the client via MethodOutcome#getResource()", "optional": true }, "url": { "index": 3, "kind": "parameter", "displayName": "Url", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The search URL to use. The format of this URL should be of the form ResourceTypeParameters, for example: Patientname=Smith&identifier=13.2.4.11.4%7C847366", "optional": false } } } } }, "read": { "methods": { "resourceById": { "properties": { "extraParameters": { "index": 5, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "id": { "index": 6, "kind": "parameter", "displayName": "Id", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IIdType", "deprecated": false, "autowired": false, "secret": false, "description": "The IIdType referencing the resource", "optional": false }, "ifVersionMatches": { "index": 12, "kind": "parameter", "displayName": "If Version Matches", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "A version to match against the newest version on the server", "optional": true }, "longId": { "index": 13, "kind": "parameter", "displayName": "Long Id", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "The resource ID", "optional": false }, "resource": { "index": 14, "kind": "parameter", "displayName": "Resource", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.Class", "deprecated": false, "autowired": false, "secret": false, "description": "The resource to read (e.g. Patient)", "optional": false }, "resourceClass": { "index": 15, "kind": "parameter", "displayName": "Resource Class", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The resource to read (e.g. Patient)", "optional": false }, "returnNull": { "index": 21, "kind": "parameter", "displayName": "Return Null", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Return null if version matches", "optional": true }, "returnResource": { "index": 27, "kind": "parameter", "displayName": "Return Resource", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IBaseResource", "deprecated": false, "autowired": false, "secret": false, "description": "Return the resource if version matches", "optional": true }, "stringId": { "index": 28, "kind": "parameter", "displayName": "String Id", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The resource ID", "optional": false }, "throwError": { "index": 34, "kind": "parameter", "displayName": "Throw Error", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Throw error if the version matches", "optional": true }, "version": { "index": 35, "kind": "parameter", "displayName": "Version", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The resource version", "optional": true } } }, "resourceByUrl": { "properties": { "extraParameters": { "index": 3, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "iUrl": { "index": 4, "kind": "parameter", "displayName": "IUrl", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IIdType", "deprecated": false, "autowired": false, "secret": false, "description": "The IIdType referencing the resource by absolute url", "optional": false }, "ifVersionMatches": { "index": 8, "kind": "parameter", "displayName": "If Version Matches", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "A version to match against the newest version on the server", "optional": true }, "resource": { "index": 9, "kind": "parameter", "displayName": "Resource", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.Class", "deprecated": false, "autowired": false, "secret": false, "description": "The resource to read (e.g. Patient)", "optional": false }, "resourceClass": { "index": 10, "kind": "parameter", "displayName": "Resource Class", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The resource to read (e.g. Patient.class)", "optional": false }, "returnNull": { "index": 14, "kind": "parameter", "displayName": "Return Null", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Return null if version matches", "optional": true }, "returnResource": { "index": 18, "kind": "parameter", "displayName": "Return Resource", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IBaseResource", "deprecated": false, "autowired": false, "secret": false, "description": "Return the resource if version matches", "optional": true }, "throwError": { "index": 22, "kind": "parameter", "displayName": "Throw Error", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Throw error if the version matches", "optional": true }, "url": { "index": 23, "kind": "parameter", "displayName": "Url", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Referencing the resource by absolute url", "optional": false } } } } }, - "search": { "methods": { "searchByUrl": { "properties": { "extraParameters": { "index": 0, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "url": { "index": 1, "kind": "parameter", "displayName": "Url", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The URL to search for. Note that this URL may be complete (e.g. http:\/\/example.com\/base\/Patientname=foo) in which case the client's base URL will be ignored. Or it can be relative (e.g. Patientname=foo) in which case the client's base URL will be used.", "optional": false } } } } }, + "search": { "methods": { "searchByResource": { "properties": { "extraParameters": { "index": 0, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "resourceName": { "index": 1, "kind": "parameter", "displayName": "Resource Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The resource to search for", "optional": false }, "searchParameters": { "index": 2, "kind": "parameter", "displayName": "Search Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map>", "deprecated": false, "autowired": false, "secret": false, "description": "A set of search parameters to the query", "optional": true }, "searchStyle": { "index": 3, "kind": "parameter", "displayName": "Search Style", "group": "common", "label": "", "required": false, "type": "object", "javaType": "ca.uhn.fhir.rest.api.SearchStyleEnum", "enum": [ "GET", "GET_WITH_SEARCH", "POST" ], "deprecated": false, "autowired": false, "secret": false, "description": "Forces the query to perform the search using the given method (allowable methods are described in the FHIR Search Specification). The default search style is HTTP POST.", "optional": true } } }, "searchByUrl": { "properties": { "extraParameters": { "index": 0, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "url": { "index": 1, "kind": "parameter", "displayName": "Url", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The URL to search for. Note that this URL may be complete (e.g. http:\/\/example.com\/base\/Patientname=foo) in which case the client's base URL will be ignored. Or it can be relative (e.g. Patientname=foo) in which case the client's base URL will be used.", "optional": false } } } } }, "transaction": { "methods": { "withBundle": { "properties": { "bundle": { "index": 0, "kind": "parameter", "displayName": "Bundle", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IBaseBundle", "deprecated": false, "autowired": false, "secret": false, "description": "Bundle to use in the transaction", "optional": false }, "extraParameters": { "index": 2, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "stringBundle": { "index": 3, "kind": "parameter", "displayName": "String Bundle", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Bundle to use in the transaction", "optional": false } } }, "withResources": { "properties": { "extraParameters": { "index": 0, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "resources": { "index": 1, "kind": "parameter", "displayName": "Resources", "group": "common", "label": "", "required": false, "type": "array", "javaType": "java.util.List", "deprecated": false, "autowired": false, "secret": false, "description": "Resources to use in the transaction", "optional": false } } } } }, "update": { "methods": { "resource": { "properties": { "extraParameters": { "index": 3, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "id": { "index": 4, "kind": "parameter", "displayName": "Id", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IIdType", "deprecated": false, "autowired": false, "secret": false, "description": "The IIdType referencing the resource", "optional": true }, "preferReturn": { "index": 8, "kind": "parameter", "displayName": "Prefer Return", "group": "common", "label": "", "required": false, "type": "object", "javaType": "ca.uhn.fhir.rest.api.PreferReturnEnum", "enum": [ "REPRESENTATION", "MINIMAL", "OPERATION_OUTCOME" ], "deprecated": false, "autowired": false, "secret": false, "description": "Whether the server include or suppress the resource body as a part of the result", "optional": true }, "resource": { "index": 9, "kind": "parameter", "displayName": "Resource", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IBaseResource", "deprecated": false, "autowired": false, "secret": false, "description": "The resource to update (e.g. Patient)", "optional": false }, "resourceAsString": { "index": 10, "kind": "parameter", "displayName": "Resource As String", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The resource body to update", "optional": false }, "stringId": { "index": 11, "kind": "parameter", "displayName": "String Id", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The ID referencing the resource", "optional": true } } }, "resourceBySearchUrl": { "properties": { "extraParameters": { "index": 1, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "preferReturn": { "index": 3, "kind": "parameter", "displayName": "Prefer Return", "group": "common", "label": "", "required": false, "type": "object", "javaType": "ca.uhn.fhir.rest.api.PreferReturnEnum", "enum": [ "REPRESENTATION", "MINIMAL", "OPERATION_OUTCOME" ], "deprecated": false, "autowired": false, "secret": false, "description": "Whether the server include or suppress the resource body as a part of the result", "optional": true }, "resource": { "index": 4, "kind": "parameter", "displayName": "Resource", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IBaseResource", "deprecated": false, "autowired": false, "secret": false, "description": "The resource to update (e.g. Patient)", "optional": false }, "resourceAsString": { "index": 5, "kind": "parameter", "displayName": "Resource As String", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The resource body to update", "optional": false }, "url": { "index": 6, "kind": "parameter", "displayName": "Url", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Specifies that the update should be performed as a conditional create against a given search URL", "optional": false } } } } }, "validate": { "methods": { "resource": { "properties": { "extraParameters": { "index": 1, "kind": "parameter", "displayName": "Extra Parameters", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map", "deprecated": false, "autowired": false, "secret": false, "description": "See ExtraParameters for a full list of parameters that can be passed, may be NULL", "optional": true }, "resource": { "index": 2, "kind": "parameter", "displayName": "Resource", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.hl7.fhir.instance.model.api.IBaseResource", "deprecated": false, "autowired": false, "secret": false, "description": "The IBaseResource to validate", "optional": false }, "resourceAsString": { "index": 3, "kind": "parameter", "displayName": "Resource As String", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Raw resource to validate", "optional": false } } } } } diff --git a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/FhirSearchIT.java b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/FhirSearchIT.java index bc9315b4a3b30..907c1744ee759 100644 --- a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/FhirSearchIT.java +++ b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/FhirSearchIT.java @@ -16,6 +16,10 @@ */ package org.apache.camel.component.fhir; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.fhir.internal.FhirApiCollection; import org.apache.camel.component.fhir.internal.FhirSearchApiMethod; @@ -27,6 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Test class for {@link org.apache.camel.component.fhir.api.FhirSearch} APIs. The class source won't be generated again @@ -47,6 +52,23 @@ public void testSearchByUrl() { Patient patient = (Patient) result.getEntry().get(0).getResource(); assertNotNull(patient); assertEquals("Freeman", patient.getName().get(0).getFamily()); + assertTrue(result.getLinkFirstRep().getUrl().endsWith("/fhir/Patient?_format=json&family=Freeman&given=Vincent")); + } + + @Test + public void testSearchByResource() { + String resourceName = "Patient"; + + Map headers = new HashMap<>(); + headers.put("CamelFhir.searchParameters", Map.of("given", List.of("Vincent"), "family", List.of("Freeman"))); + Bundle result = requestBodyAndHeaders("direct://SEARCH_BY_RESOURCE", resourceName, headers); + + LOG.debug("searchByResource: {}", result); + assertNotNull(result, "searchByResource result"); + Patient patient = (Patient) result.getEntry().get(0).getResource(); + assertNotNull(patient); + assertEquals("Freeman", patient.getName().get(0).getFamily()); + assertTrue(result.getLinkFirstRep().getUrl().endsWith("/fhir/Patient/_search")); } @Override @@ -57,7 +79,12 @@ public void configure() { from("direct://SEARCH_BY_URL") .to("fhir://" + PATH_PREFIX + "/searchByUrl?inBody=url"); + // test route for searchByResource + from("direct://SEARCH_BY_RESOURCE") + .to("fhir://" + PATH_PREFIX + + "/searchByResource?inBody=resourceName"); } + }; } }