Minor cleanup

This commit is contained in:
Tadgh 2021-03-10 12:03:19 -05:00
parent b7398cb6f2
commit 3e249d0261
3 changed files with 6 additions and 10 deletions

View File

@ -77,10 +77,9 @@ public class PatientBulkItemReader extends BaseBulkItemReader implements ItemRea
for (SearchParameterMap map: maps) {
//Ensure users did not monkey with the patient compartment search parameter.
validateSearchParameters(map);
//Skip adding the parameter querying for patient= if we are in fact querying the patient resource type.
if (!myResourceType.equalsIgnoreCase("Patient")) {
//Now that we have our basic built Bulk Export SP map, we inject the condition that the resources returned
//must have a patient= or subject= reference set.
map.add(patientSearchParam, new ReferenceParam().setMissing(false));
}

View File

@ -60,8 +60,6 @@ public class BulkDataExportProvider {
private IBulkDataExportSvc myBulkDataExportSvc;
@Autowired
private FhirContext myFhirContext;
@Autowired
private DaoConfig myDaoConfig;
@VisibleForTesting
public void setFhirContextForUnitTest(FhirContext theFhirContext) {

View File

@ -254,6 +254,10 @@ public class BulkDataExportSvcImpl implements IBulkDataExportSvc {
return theBulkExportJobEntity.getRequest().startsWith("/Patient/");
}
private boolean isGroupBulkJob(BulkExportJobEntity theBulkExportJobEntity) {
return theBulkExportJobEntity.getRequest().startsWith("/Group/");
}
private void enhanceBulkParametersWithGroupParameters(BulkExportJobEntity theBulkExportJobEntity, JobParametersBuilder theParameters) {
String theGroupId = getQueryParameterIfPresent(theBulkExportJobEntity.getRequest(), JpaConstants.PARAM_EXPORT_GROUP_ID);
String expandMdm = getQueryParameterIfPresent(theBulkExportJobEntity.getRequest(), JpaConstants.PARAM_EXPORT_MDM);
@ -261,10 +265,6 @@ public class BulkDataExportSvcImpl implements IBulkDataExportSvc {
theParameters.addString(BulkExportJobConfig.EXPAND_MDM_PARAMETER, expandMdm);
}
private boolean isGroupBulkJob(BulkExportJobEntity theBulkExportJobEntity) {
String queryParameterIfPresent = getQueryParameterIfPresent(theBulkExportJobEntity.getRequest(), JpaConstants.PARAM_EXPORT_GROUP_ID);
return queryParameterIfPresent != null;
}
@SuppressWarnings("unchecked")
private IFhirResourceDao<IBaseBinary> getBinaryDao() {
@ -309,7 +309,6 @@ public class BulkDataExportSvcImpl implements IBulkDataExportSvc {
requestBuilder.append("Patient/");
}
requestBuilder.append(JpaConstants.OPERATION_EXPORT);
requestBuilder.append("?").append(JpaConstants.PARAM_EXPORT_OUTPUT_FORMAT).append("=").append(escapeUrlParam(outputFormat));
Set<String> resourceTypes = theBulkDataExportOptions.getResourceTypes();
@ -474,7 +473,7 @@ public class BulkDataExportSvcImpl implements IBulkDataExportSvc {
} else if (theExportStyle.equals(GROUP) || theExportStyle.equals(PATIENT)) {
return getPatientCompartmentResources();
} else {
return null;
return throw new IllegalArgumentException(String.format("HAPI FHIR does not recognize a Bulk Export request of type: %s", theExportStyle));
}
}