Skip to content

Commit

Permalink
Merge branch 'develop' into feature/otel-config
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenzo-ingenito committed Apr 15, 2024
2 parents 0bef454 + 199dc49 commit 7190801
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import it.finanze.sanita.fse2.ms.gtw.dispatcher.config.MicroservicesURLCFG;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.dto.response.ErrorResponseDTO;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.dto.response.TransactionInspectResDTO;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.enums.ErrorInstanceEnum;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.enums.RestExecutionResultEnum;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.exceptions.BusinessException;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.exceptions.NoRecordFoundException;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -89,7 +91,11 @@ private void errorHandler(final HttpStatusCodeException e1) {

// 404 Not found.
if (HttpStatus.NOT_FOUND.equals(e1.getStatusCode())) {
ErrorResponseDTO error = ErrorResponseDTO.builder().detail("No Record Found").build();
ErrorResponseDTO error = ErrorResponseDTO.builder().
type(RestExecutionResultEnum.RECORD_NOT_FOUND.getType()).
title(RestExecutionResultEnum.RECORD_NOT_FOUND.getTitle()).
instance(ErrorInstanceEnum.RECORD_NOT_FOUND.getInstance()).
detail("No Record Found").build();
throw new NoRecordFoundException(error);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ protected ResponseEntity<ErrorResponseDTO> handleServerResponseException(ServerR
protected ResponseEntity<ErrorResponseDTO> handleRecordNotFoundException(NoRecordFoundException ex, final WebRequest request) {
log.error("" , ex);
Integer status = 404;

LogTraceInfoDTO traceInfoDto = getLogTraceInfo();
String detail = ExceptionUtils.getMessage(ex);
if(ex.getError()!=null) {
detail = ex.getError().getDetail();
}
ErrorResponseDTO out = new ErrorResponseDTO(getLogTraceInfo(), RestExecutionResultEnum.RECORD_NOT_FOUND.getType(), RestExecutionResultEnum.RECORD_NOT_FOUND.getTitle(), detail , status, ErrorInstanceEnum.RECORD_NOT_FOUND.getInstance());
ErrorResponseDTO out = new ErrorResponseDTO(traceInfoDto, RestExecutionResultEnum.RECORD_NOT_FOUND.getType(), RestExecutionResultEnum.RECORD_NOT_FOUND.getTitle(), detail , status, ErrorInstanceEnum.RECORD_NOT_FOUND.getInstance());
if(ex.getError()!=null) {
out = ex.getError();
detail = ex.getError().getDetail();
}
out.setSpanID(traceInfoDto.getSpanID());
out.setTraceID(traceInfoDto.getTraceID());

HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_PROBLEM_JSON);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class AccreditamentoSimulationSRV implements IAccreditamentoSimulationSRV
public AccreditamentoSimulationDTO runSimulation(final String idDocumento, final byte[] pdf, final EventTypeEnum eventType) {
AccreditamentoSimulationDTO output = null;

if(EventTypeEnum.REPLACE.equals(eventType)) {
if(EventTypeEnum.REPLACE.equals(eventType) && !idDocumento.equals("TRIAL_ID_SKIP_ACCREDITATIONCHECK")) {
statusCheckClient.callSearchEventByIdDocumento(idDocumento);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ private SubmissionSetEntryDTO createSubmissionSetEntry(final org.jsoup.nodes.Doc
sse.setAuthorInstitution(authorSlotDTO.getAuthorInstitution());
sse.setAuthorRole(authorSlotDTO.getAuthorRole());
sse.setPatientId(buildPatient(docCDA));
sse.setSourceId(SOURCE_ID_PREFIX+organizationId);

String org = organizationId;
if(organizationId.startsWith("0")) {
org = organizationId.substring(1, organizationId.length());
}
sse.setSourceId(SOURCE_ID_PREFIX+org);
sse.setUniqueID(identificativoSottomissione);

sse.setSubmissionTime(new SimpleDateFormat(Constants.Misc.INI_DATE_PATTERN).format(new Date()));
Expand Down Expand Up @@ -275,4 +280,5 @@ private static AuthorSlotDTO buildAuthorSlotDTO(final String authorRole,final or
return author;
}


}

0 comments on commit 7190801

Please sign in to comment.