Commit ff0f1810 authored by Franck Desaize's avatar Franck Desaize
Browse files

Fix Quality gate

parent dcb0e8b5
Pipeline #268014 failed with stages
in 16 minutes and 43 seconds
......@@ -61,10 +61,9 @@ public class CrossReferenceSearchProcessingService {
if (targetDomains == null) {
if (!CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME.equals(sourceIdentifier.getName())) {
LOGGER.error(String.format("ProcessRequest.inputs shall have the name '%s' and '%s' for a %s operation !",
CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME,
CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_TARGET_NAME,
CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_PATIENT_SEARCH_OPERATION));
LOGGER.error("ProcessRequest.inputs shall have the name " + CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME
+ " and " + CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_TARGET_NAME + " for a "
+ CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_PATIENT_SEARCH_OPERATION + " operation !");
throw new IllegalArgumentException(String.format("ProcessRequest.inputs shall have the name '%s' and '%s' for a %s operation !",
CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME,
......@@ -77,10 +76,9 @@ public class CrossReferenceSearchProcessingService {
} else {
if (!CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME.equals(sourceIdentifier.getName()) ||
!CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_TARGET_NAME.equals(targetDomains.getName())) {
LOGGER.error(String.format("ProcessRequest.inputs shall have the name '%s' and '%s' for a %s operation !",
CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME,
CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_TARGET_NAME,
CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_PATIENT_SEARCH_OPERATION));
LOGGER.error("ProcessRequest.inputs shall have the name " + CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME
+ " and " + CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_TARGET_NAME + " for a "
+ CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_PATIENT_SEARCH_OPERATION + " operation !");
throw new IllegalArgumentException(String.format("ProcessRequest.inputs shall have the name '%s' and '%s' for a %s operation !",
CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME,
CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_TARGET_NAME,
......
......@@ -105,29 +105,29 @@ public class PatientCrossReferenceSearchImpl implements PatientCrossReferenceSea
*/
private PatientAliases processingOnResult(List<CrossReferenceDB> crossReferenceDBS, PatientDB patientDB, boolean usableTargetDomains,
List<String> targetDomains) throws SearchCrossReferenceException {
if (!crossReferenceDBS.isEmpty()) {
PatientAliases patientAliases = new PatientAliases();
List<Patient> patients = new ArrayList<>();
for (CrossReferenceDB crossReference : crossReferenceDBS) {
if (crossReference.getPatients() != null) {
for (PatientDB patientInCrossRef : crossReference.getPatients()) {
if (!patientInCrossRef.getUuid().equals(patientDB.getUuid())) {
patients.add(PatientConverter.toPatient(patientInCrossRef));
}
PatientAliases patientAliases = new PatientAliases();
List<Patient> patients = new ArrayList<>();
for (CrossReferenceDB crossReference : crossReferenceDBS) {
List<PatientDB> patientList = crossReference.getPatients();
if (patientList != null && !patientList.isEmpty()) {
for (PatientDB patientInCrossRef : crossReference.getPatients()) {
if (!patientInCrossRef.getUuid().equals(patientDB.getUuid())) {
patients.add(PatientConverter.toPatient(patientInCrossRef));
}
}
}
patientAliases.setMembers(patients);
patientAliases.setLastModifier("Generated");
patientAliases.setLastModifierDateTime();
if (usableTargetDomains) {
removePatientFromPatientAliasWithNonMatchingTargetDomain(patientAliases, targetDomains);
}
LOGGER.info("Search is done, prepare the response");
return patientAliases;
}
throw new SearchCrossReferenceException("PatientAliases is empty");
patientAliases.setMembers(patients);
patientAliases.setLastModifier("Generated");
patientAliases.setLastModifierDateTime();
if (usableTargetDomains) {
removePatientFromPatientAliasWithNonMatchingTargetDomain(patientAliases, targetDomains);
}
LOGGER.info("Search is done, prepare the response");
return patientAliases;
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment