From b29cdc22f377ab8fc82bf8fb07b864d44e790587 Mon Sep 17 00:00:00 2001 From: Rob Hausam Date: Tue, 29 May 2018 21:34:54 -0500 Subject: [PATCH] Fix client upload-terminology for r4. --- .../uhn/fhir/cli/UploadTerminologyCommand.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/UploadTerminologyCommand.java b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/UploadTerminologyCommand.java index 756567ed7d4..5179a03afbc 100644 --- a/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/UploadTerminologyCommand.java +++ b/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/UploadTerminologyCommand.java @@ -28,9 +28,6 @@ import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; -import org.hl7.fhir.dstu3.model.Parameters; -import org.hl7.fhir.dstu3.model.StringType; -import org.hl7.fhir.dstu3.model.UriType; import org.hl7.fhir.instance.model.api.IBaseParameters; import static org.apache.commons.lang3.StringUtils.isBlank; @@ -82,10 +79,17 @@ public class UploadTerminologyCommand extends BaseCommand { IGenericClient client = super.newClient(theCommandLine); IBaseParameters inputParameters; if (ctx.getVersion().getVersion() == FhirVersionEnum.DSTU3) { - Parameters p = new Parameters(); - p.addParameter().setName("url").setValue(new UriType(termUrl)); + org.hl7.fhir.dstu3.model.Parameters p = new org.hl7.fhir.dstu3.model.Parameters(); + p.addParameter().setName("url").setValue(new org.hl7.fhir.dstu3.model.UriType(termUrl)); for (String next : datafile) { - p.addParameter().setName("localfile").setValue(new StringType(next)); + p.addParameter().setName("localfile").setValue(new org.hl7.fhir.dstu3.model.StringType(next)); + } + inputParameters = p; + } else if (ctx.getVersion().getVersion() == FhirVersionEnum.R4) { + org.hl7.fhir.r4.model.Parameters p = new org.hl7.fhir.r4.model.Parameters(); + p.addParameter().setName("url").setValue(new org.hl7.fhir.r4.model.UriType(termUrl)); + for (String next : datafile) { + p.addParameter().setName("localfile").setValue(new org.hl7.fhir.r4.model.StringType(next)); } inputParameters = p; } else {