@SuppressWarnings("unused") private static void operationNoIn() { // START SNIPPET: operationNoIn // Create a client to talk to the HeathIntersections server FhirContext ctx = FhirContext.forDstu2(); IGenericClient client = ctx.newRestfulGenericClient("http://fhir-dev.healthintersections.com.au/open"); client.registerInterceptor(new LoggingInterceptor(true)); // Invoke $everything on "Patient/1" Parameters outParams = client .operation() .onInstance(new IdDt("Patient", "1")) .named("$everything") .withNoParameters(Parameters.class) // No input parameters .execute(); // END SNIPPET: operationNoIn }
.operation() .onServer() .named(UPLOAD_EXTERNAL_CODE_SYSTEM) .withParameters(inputParameters) .execute();
.operation() .onInstance(new IdDt("Patient", "1")) .named("$everything") .withParameters(inParams) .execute();
@SuppressWarnings("unused") private static void operationHttpGet() { // START SNIPPET: operationHttpGet // Create a client to talk to the HeathIntersections server FhirContext ctx = FhirContext.forDstu2(); IGenericClient client = ctx.newRestfulGenericClient("http://fhir-dev.healthintersections.com.au/open"); client.registerInterceptor(new LoggingInterceptor(true)); // Create the input parameters to pass to the server Parameters inParams = new Parameters(); inParams.addParameter().setName("start").setValue(new DateDt("2001-01-01")); inParams.addParameter().setName("end").setValue(new DateDt("2015-03-01")); // Invoke $everything on "Patient/1" Parameters outParams = client .operation() .onInstance(new IdDt("Patient", "1")) .named("$everything") .withParameters(inParams) .useHttpGet() // Use HTTP GET instead of POST .execute(); // END SNIPPET: operationHttpGet }
private IClientExecutable<IOperationUntypedWithInput<Parameters>, ?> getClientExecutable(IGenericClient client, Parameters requestData) { return client.operation() .onType(Patient.class) .named(Iti83Constants.PIXM_OPERATION_NAME) .withParameters(requestData) .useHttpGet(); } }
private IClientExecutable<IOperationUntypedWithInput<Parameters>, ?> getClientExecutable(IGenericClient client, Parameters requestData) { return client.operation() .onType(Patient.class) .named(Iti83Constants.PIXM_OPERATION_NAME) .withParameters(requestData) .useHttpGet(); } }
private <T extends IBaseParameters> IOperationUntypedWithInput<? extends IBaseResource> processNamedOperationParameters(String name, T parameters, Class<T> outputParameterType, boolean useHttpGet, Class<? extends IBaseResource> returnType, Map<ExtraParameters, Object> extraParameters, IOperationUnnamed operationUnnamed) { IOperationUntyped named = operationUnnamed.named(name); IOperationUntypedWithInput<? extends IBaseResource> operationUntypedWithInput; if (outputParameterType != null) { operationUntypedWithInput = named.withNoParameters(outputParameterType); } else { operationUntypedWithInput = named.withParameters(parameters); } if (useHttpGet) { operationUntypedWithInput.useHttpGet(); } if (returnType != null) { operationUntypedWithInput.returnResourceType(returnType); } ExtraParameters.process(extraParameters, operationUntypedWithInput); return operationUntypedWithInput; } }
protected Parameters sendManuallyOnType(Parameters queryParameters) { Parameters result = client.operation() .onType(Patient.class) .named(Iti83Constants.PIXM_OPERATION_NAME) .withParameters(queryParameters) .useHttpGet() .execute(); return result; }
protected Parameters sendManuallyOnType(Parameters queryParameters) { Parameters result = client.operation() .onType(Patient.class) .named(Iti83Constants.PIXM_OPERATION_NAME) .withParameters(queryParameters) .useHttpGet() .execute(); return result; }
protected Parameters sendManuallyOnInstance(String resourceId, Parameters queryParameters) { Parameters result = client.operation() .onInstance(new IdType("Patient", resourceId)) .named(Iti83Constants.PIXM_OPERATION_NAME) .withParameters(queryParameters) .useHttpGet() .execute(); return result; }
protected Parameters sendManuallyOnInstance(String resourceId, Parameters queryParameters) { Parameters result = client.operation() .onInstance(new IdType("Patient", resourceId)) .named(Iti83Constants.PIXM_OPERATION_NAME) .withParameters(queryParameters) .useHttpGet() .execute(); return result; }