use of se.inera.intyg.webcert.web.service.intyg.config.SendIntygConfiguration in project webcert by sklintyg.
the class IntygServiceImpl method sendIntyg.
@Override
public IntygServiceResult sendIntyg(String intygsId, String typ, String recipient, boolean delay) {
Utlatande intyg = getUtlatandeForIntyg(intygsId, typ);
verifyEnhetsAuth(intyg, true);
if (isRevoked(intygsId, typ, false)) {
LOG.debug("Cannot send certificate with id '{}', the certificate is revoked", intygsId);
throw new WebCertServiceException(WebCertServiceErrorCodeEnum.INVALID_STATE, "Certificate is revoked");
}
verifyNotReplacedBySignedIntyg(intygsId, "send");
// WC-US-SM-001 - vi får ej skicka FK-intyg för sekretessmarkerad patient som innehåller personuppgifter.
verifyNoExposureOfSekretessmarkeradPatient(intyg);
SendIntygConfiguration sendConfig = new SendIntygConfiguration(recipient, webCertUserService.getUser());
monitoringService.logIntygSent(intygsId, recipient);
// send PDL log event
LogRequest logRequest = LogRequestFactory.createLogRequestFromUtlatande(intyg);
logRequest.setAdditionalInfo(sendConfig.getPatientConsentMessage());
logService.logSendIntygToRecipient(logRequest);
markUtkastWithSendDateAndRecipient(intygsId, recipient);
return sendIntygToCertificateSender(sendConfig, intyg, delay);
}
Aggregations