View Javadoc
1   package ca.uhn.fhir.rest.gclient;
2   
3   import org.hl7.fhir.instance.model.api.IBase;
4   
5   /*
6    * #%L
7    * HAPI FHIR - Core Library
8    * %%
9    * Copyright (C) 2014 - 2018 University Health Network
10   * %%
11   * Licensed under the Apache License, Version 2.0 (the "License");
12   * you may not use this file except in compliance with the License.
13   * You may obtain a copy of the License at
14   * 
15   *      http://www.apache.org/licenses/LICENSE-2.0
16   * 
17   * Unless required by applicable law or agreed to in writing, software
18   * distributed under the License is distributed on an "AS IS" BASIS,
19   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20   * See the License for the specific language governing permissions and
21   * limitations under the License.
22   * #L%
23   */
24  
25  import org.hl7.fhir.instance.model.api.IBaseParameters;
26  
27  import ca.uhn.fhir.model.api.IQueryParameterType;
28  
29  public interface IOperationUntyped {
30  
31  	/**
32  	 * Use the given parameters resource as the input to the operation
33  	 * 
34  	 * @param theParameters The parameters to use as input. May also be <code>null</code> if the operation
35  	 * does not require any input parameters.
36  	 */
37  	<T extends IBaseParameters> IOperationUntypedWithInput<T> withParameters(T theParameters);
38  
39  	/**
40  	 * The operation does not require any input parameters
41  	 * 
42  	 * @param theOutputParameterType The type to use for the output parameters (this should be set to
43  	 * <code>Parameters.class</code> drawn from the version of the FHIR structures you are using)
44  	 */
45  	<T extends IBaseParameters> IOperationUntypedWithInput<T> withNoParameters(Class<T> theOutputParameterType);
46  
47  	/**
48  	 * Use chained method calls to construct a Parameters input. This form is a convenience
49  	 * in order to allow simple method chaining to be used to build up a parameters
50  	 * resource for the input of an operation without needing to manually construct one.
51  	 * <p>
52  	 * A sample invocation of this class could look like:<br/>
53  	 * <pre>Bundle bundle = client.operation()
54  	 *   .onInstance(new IdType("Patient/A161443"))
55  	 *   .named("everything")
56  	 *   .withParameter(Parameters.class, "_count", new IntegerType(50))
57  	 *   .useHttpGet()
58  	 *   .returnResourceType(Bundle.class)
59  	 *   .execute();
60  	 * </pre>
61  	 * </p>
62  	 * 
63  	 * @param theParameterType The type to use for the output parameters (this should be set to
64  	 * <code>Parameters.class</code> drawn from the version of the FHIR structures you are using)
65  	 * @param theName The first parameter name
66  	 * @param theValue The first parameter value
67  	 */
68  	<T extends IBaseParameters> IOperationUntypedWithInputAndPartialOutput<T> withParameter(Class<T> theParameterType, String theName, IBase theValue);
69  
70  	/**
71  	 * Use chained method calls to construct a Parameters input. This form is a convenience
72  	 * in order to allow simple method chaining to be used to build up a parameters
73  	 * resource for the input of an operation without needing to manually construct one.
74  	 * 
75  	 * @param theParameterType The type to use for the output parameters (this should be set to
76  	 * <code>Parameters.class</code> drawn from the version of the FHIR structures you are using)
77  	 * @param theName The first parameter name
78  	 * @param theValue The first parameter value
79  	 */
80  	<T extends IBaseParameters> IOperationUntypedWithInputAndPartialOutput<T> withSearchParameter(Class<T> theParameterType, String theName, IQueryParameterType theValue);
81  
82  }