use of se.inera.intyg.webcert.web.service.log.dto.LogRequest in project webcert by sklintyg.
the class LogServiceImplTest method testActivityArgsAreIdenticalToAdditionalInfo.
public void testActivityArgsAreIdenticalToAdditionalInfo() {
LogRequest logRequest = new LogRequest();
logRequest.setIntygId("abc123");
logRequest.setPatientId(createPnr("19121212-1212"));
logRequest.setPatientName("Hans Olof van der Test");
logRequest.setAdditionalInfo("this is additional");
logService.logPrintIntygAsPDF(logRequest);
}
use of se.inera.intyg.webcert.web.service.log.dto.LogRequest in project webcert by sklintyg.
the class LogServiceImplTest method logServiceJmsException.
@Test(expected = JmsException.class)
public void logServiceJmsException() throws Exception {
when(userService.getUser()).thenReturn(createUser());
doThrow(new DestinationResolutionException("")).when(template).send(any(MessageCreator.class));
LogRequest logRequest = new LogRequest();
logRequest.setIntygId("abc123");
logRequest.setPatientId(createPnr("19121212-1212"));
logRequest.setPatientName("Hans Olof van der Test");
try {
logService.logReadIntyg(logRequest);
} finally {
verify(template, times(1)).send(any(MessageCreator.class));
}
}
use of se.inera.intyg.webcert.web.service.log.dto.LogRequest in project webcert by sklintyg.
the class UtkastServiceImpl method getDraft.
@Override
@Transactional(readOnly = true)
public Utkast getDraft(String intygId, String intygType) {
Utkast utkast = getIntygAsDraft(intygId, intygType);
LogRequest logRequest = LogRequestFactory.createLogRequestFromUtkast(utkast);
abortIfUserNotAuthorizedForUnit(utkast.getVardgivarId(), utkast.getEnhetsId());
// Log read to PDL
logService.logReadIntyg(logRequest);
// Log read to monitoring log
monitoringService.logUtkastRead(utkast.getIntygsId(), utkast.getIntygsTyp());
return utkast;
}
use of se.inera.intyg.webcert.web.service.log.dto.LogRequest in project webcert by sklintyg.
the class UtkastServiceImpl method logCreateDraftPDL.
private void logCreateDraftPDL(Utkast utkast, LogUser logUser) {
LogRequest logRequest = LogRequestFactory.createLogRequestFromUtkast(utkast);
logService.logCreateIntyg(logRequest, logUser);
}
use of se.inera.intyg.webcert.web.service.log.dto.LogRequest in project webcert by sklintyg.
the class IntygServiceImpl method fetchIntygData.
/**
* Returns the IntygContentHolder. Used both externally to frontend and internally in the modules.
*
* @param intygsId the identifier of the intyg.
* @param intygsTyp the typ of the intyg. Used to call the correct module.
* @param relations If the relations between intyg should be populated. This can be expensive (several database
* operations). Use sparsely.
*/
private IntygContentHolder fetchIntygData(String intygsId, String intygsTyp, boolean relations, boolean coherentJournaling) {
IntygContentHolder intygsData = getIntygData(intygsId, intygsTyp, relations);
LogRequest logRequest = LogRequestFactory.createLogRequestFromUtlatande(intygsData.getUtlatande(), coherentJournaling);
if (!coherentJournaling) {
verifyEnhetsAuth(intygsData.getUtlatande(), true);
}
Personnummer pnr = intygsData.getUtlatande().getGrundData().getPatient().getPersonId();
String enhetsId = intygsData.getUtlatande().getGrundData().getSkapadAv().getVardenhet().getEnhetsid();
verifySekretessmarkering(intygsTyp, webCertUserService.getUser(), enhetsId, pnr);
// Log read to PDL
logService.logReadIntyg(logRequest);
// Log read to monitoring log
monitoringService.logIntygRead(intygsId, intygsTyp);
return intygsData;
}
Aggregations