Source:
<code>public void run(CommandLine theCommandLine) throws ParseException { parseFhirContext(theCommandLine); FhirContext ctx = getFhirContext(); String termUrl = theCommandLine.getOptionValue("u"); if (isBlank(termUrl)) { throw new ParseException("No URL provided"); } String[] datafile = theCommandLine.getOptionValues("d"); if (datafile == null || datafile.length == 0) { throw new ParseException("No data file provided"); } IGenericClient client = super.newClient(theCommandLine); IBaseParameters inputParameters = ParametersUtil.newInstance(myFhirCtx); ParametersUtil.addParameterToParametersUri(myFhirCtx, inputParameters, "url", termUrl); for (String next : datafile) { ParametersUtil.addParameterToParametersString(myFhirCtx, inputParameters, "localfile", next); } if (theCommandLine.hasOption("custom")) { ParametersUtil.addParameterToParametersCode(myFhirCtx, inputParameters, "contentMode", "custom"); } if (theCommandLine.hasOption(VERBOSE_LOGGING_PARAM)) { client.registerInterceptor(new LoggingInterceptor(true)); } ourLog.info("Beginning upload - This may take a while..."); IBaseParameters response; <START> switch (myFhirCtx.getVersion().getVersion()) { <END> case DSTU3: response = client .operation() .onType(org.hl7.fhir.dstu3.model.CodeSystem.class) .named(UPLOAD_EXTERNAL_CODE_SYSTEM) .withParameters(inputParameters) .execute(); break; case R4: response = client .operation() .onType(CodeSystem.class) .named(UPLOAD_EXTERNAL_CODE_SYSTEM) .withParameters(inputParameters) .execute(); break; default: throw new UnsupportedOperationException("This command does not currently support " + myFhirCtx.getVersion().getVersion()); } ourLog.info("Upload complete!"); ourLog.info("Response:\n{}", ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(response)); }</code><technical_language>FhirContext variables in this method. I recommend removing of eliminate confusion</technical_language>

Target:
public void run(CommandLine theCommandLine) throws ParseException { parseFhirContext(theCommandLine); String termUrl = theCommandLine.getOptionValue("u"); if (isBlank(termUrl)) { throw new ParseException("No URL provided"); } String[] datafile = theCommandLine.getOptionValues("d"); if (datafile == null || datafile.length == 0) { throw new ParseException("No data file provided"); } IGenericClient client = super.newClient(theCommandLine); IBaseParameters inputParameters = ParametersUtil.newInstance(myFhirCtx); ParametersUtil.addParameterToParametersUri(myFhirCtx, inputParameters, "url", termUrl); for (String next : datafile) { ParametersUtil.addParameterToParametersString(myFhirCtx, inputParameters, "localfile", next); } if (theCommandLine.hasOption("custom")) { ParametersUtil.addParameterToParametersCode(myFhirCtx, inputParameters, "contentMode", "custom"); } if (theCommandLine.hasOption(VERBOSE_LOGGING_PARAM)) { client.registerInterceptor(new LoggingInterceptor(true)); } ourLog.info("Beginning upload - This may take a while..."); IBaseParameters response = client .operation() .onType(myFhirCtx.getResourceDefinition("CodeSystem").getImplementingClass()) .named(UPLOAD_EXTERNAL_CODE_SYSTEM) .withParameters(inputParameters) .execute(); ourLog.info("Upload complete!"); ourLog.info("Response:\n{}", myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(response)); }