@Test(expectedExceptions = { FHIROperationException.class }) public void testBulkImportUtilFormatBadFormatWrongType() throws IOException, FHIRException { FHIRRequestContext.set(new FHIRRequestContext("default")); BulkDataImportUtil.retrieveInputFormat(loadTestFile("/testdata/import/import-demo-bad-format3.json")); }
public static String retrieveInputFormat(Parameters parameters) throws FHIROperationException { if (parameters != null) { for (Parameters.Parameter parameter : parameters.getParameter()) { if (BulkDataConstants.PARAM_INPUT_FORMAT.equals(parameter.getName().getValue()) && parameter.getValue() != null && parameter.getValue().is(com.ibm.fhir.model.type.String.class)) { String val = parameter.getValue().as(com.ibm.fhir.model.type.String.class).getValue(); if (BulkDataConstants.INPUT_FORMATS.contains(val)) { return val; } } } } throw buildExceptionWithIssue("$import requires 'inputFormat' is not found", IssueType.INVALID); }
BulkDataImportUtil { public static String retrieveInputFormat(Parameters parameters) throws FHIROperationException { if (parameters != null) { for (Parameters.Parameter parameter : parameters.getParameter()) { if (BulkDataConstants.PARAM_INPUT_FORMAT.equals(parameter.getName().getValue()) && parameter.getValue() != null && parameter.getValue().is(com.ibm.fhir.model.type.String.class)) { String val = parameter.getValue().as(com.ibm.fhir.model.type.String.class).getValue(); if (BulkDataConstants.INPUT_FORMATS.contains(val)) { return val; } } } } throw buildExceptionWithIssue("$import requires 'inputFormat' is not found", IssueType.INVALID); } }
BulkDataImportUtil { public static String retrieveInputFormat(Parameters parameters) throws FHIROperationException { if (parameters != null) { for (Parameters.Parameter parameter : parameters.getParameter()) { if (BulkDataConstants.PARAM_INPUT_FORMAT.equals(parameter.getName().getValue()) && parameter.getValue() != null && parameter.getValue().is(com.ibm.fhir.model.type.String.class)) { String val = parameter.getValue().as(com.ibm.fhir.model.type.String.class).getValue(); if (BulkDataConstants.INPUT_FORMATS.contains(val)) { return val; } } } } throw buildExceptionWithIssue("$import requires 'inputFormat' is not found", IssueType.INVALID); } private  BulkDataImportUtil(); }
BulkDataImportUtil { public static String retrieveInputFormat(Parameters parameters) throws FHIROperationException { if (parameters != null) { for (Parameters.Parameter parameter : parameters.getParameter()) { if (BulkDataConstants.PARAM_INPUT_FORMAT.equals(parameter.getName().getValue()) && parameter.getValue() != null && parameter.getValue().is(com.ibm.fhir.model.type.String.class)) { String val = parameter.getValue().as(com.ibm.fhir.model.type.String.class).getValue(); if (BulkDataConstants.INPUT_FORMATS.contains(val)) { return val; } } } } throw buildExceptionWithIssue("$import requires 'inputFormat' is not found", IssueType.INVALID); } private  BulkDataImportUtil(); static FHIROperationException buildExceptionWithIssue(String msg, IssueType issueType); static FHIROperationException buildExceptionWithIssue(String msg, Throwable cause, IssueType issueType); static String retrieveInputFormat(Parameters parameters); static String retrieveInputSource(Parameters parameters); static List<Input> retrieveInputs(Parameters parameters); static void checkAllowedTotalSizeForTenantOrSystem(Integer inputSize); static void verifyUrlAllowed(String url); static StorageDetail retrieveStorageDetails(Parameters parameters); }
BulkDataImportUtil { public static String retrieveInputFormat(Parameters parameters) throws FHIROperationException { if (parameters != null) { for (Parameters.Parameter parameter : parameters.getParameter()) { if (BulkDataConstants.PARAM_INPUT_FORMAT.equals(parameter.getName().getValue()) && parameter.getValue() != null && parameter.getValue().is(com.ibm.fhir.model.type.String.class)) { String val = parameter.getValue().as(com.ibm.fhir.model.type.String.class).getValue(); if (BulkDataConstants.INPUT_FORMATS.contains(val)) { return val; } } } } throw buildExceptionWithIssue("$import requires 'inputFormat' is not found", IssueType.INVALID); } private  BulkDataImportUtil(); static FHIROperationException buildExceptionWithIssue(String msg, IssueType issueType); static FHIROperationException buildExceptionWithIssue(String msg, Throwable cause, IssueType issueType); static String retrieveInputFormat(Parameters parameters); static String retrieveInputSource(Parameters parameters); static List<Input> retrieveInputs(Parameters parameters); static void checkAllowedTotalSizeForTenantOrSystem(Integer inputSize); static void verifyUrlAllowed(String url); static StorageDetail retrieveStorageDetails(Parameters parameters);  }