use of se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.Handelse in project webcert by sklintyg.
the class NotificationTypeConverter method decorateWithHandelse.
private static void decorateWithHandelse(CertificateStatusUpdateForCareType statusUpdateType, NotificationMessage notificationMessage) {
Handelsekod handelseKod = new Handelsekod();
handelseKod.setCodeSystem(KV_HANDELSE_CODE_SYSTEM);
handelseKod.setCode(notificationMessage.getHandelse().value());
handelseKod.setDisplayName(notificationMessage.getHandelse().description());
Handelse handelse = new Handelse();
handelse.setHandelsekod(handelseKod);
handelse.setTidpunkt(notificationMessage.getHandelseTid());
// till om händelsen är av typen NYFRFM (ny fråga från mottagare).
if (HandelsekodEnum.fromValue(handelseKod.getCode()) == HandelsekodEnum.NYFRFM) {
if (notificationMessage.getAmne() == null) {
LOGGER.debug("Vid händelsetypen NYFRFM var ämneskod null");
}
handelse.setAmne(notificationMessage.getAmne());
if (notificationMessage.getSistaSvarsDatum() == null) {
LOGGER.debug("Vid händelsetypen NYFRFM var sista datum för svars null");
}
handelse.setSistaDatumForSvar(notificationMessage.getSistaSvarsDatum());
}
statusUpdateType.setHandelse(handelse);
}
use of se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.Handelse in project webcert by sklintyg.
the class ListCertificatesForCareWithQAResponderImpl method toHandelse.
private static Handelse toHandelse(se.inera.intyg.webcert.persistence.handelse.model.Handelse e) {
Handelse res = new Handelse();
Handelsekod code = new Handelsekod();
code.setCodeSystem(KV_HANDELSE_CODE_SYSTEM);
code.setCode(e.getCode().value());
res.setHandelsekod(code);
if (e.getAmne() != null) {
res.setAmne(buildAmne(e.getAmne()));
}
res.setSistaDatumForSvar(e.getSistaDatumForSvar());
res.setTidpunkt(e.getTimestamp());
return res;
}
use of se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.Handelse in project webcert by sklintyg.
the class IntegrationTest method buildNotificationV1.
private CertificateStatusUpdateForCareType buildNotificationV1() {
Handelse handelse = new Handelse();
handelse.setHandelsetidpunkt(LocalDateTime.now().minusMinutes(1));
UtlatandeType utl = new UtlatandeType();
utl.setHandelse(handelse);
utl.setUtlatandeId(new UtlatandeId());
utl.getUtlatandeId().setExtension(UUID.randomUUID().toString());
CertificateStatusUpdateForCareType type = new CertificateStatusUpdateForCareType();
type.setUtlatande(utl);
return type;
}
use of se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.Handelse in project webcert by sklintyg.
the class NotificationStoreTest method populateNotificationsMap.
private void populateNotificationsMap(int nbr, NotificationStoreImpl notificationStore, LocalDateTime baseTime) {
Iterator<String> intygsIdIter = Iterables.cycle(INTYG_IDS).iterator();
for (int i = 0; i < nbr; i++) {
String intygsId = intygsIdIter.next();
Handelse handelse = new Handelse();
handelse.setHandelsetidpunkt(baseTime.minusMinutes(nbr - i));
UtlatandeType utl = new UtlatandeType();
utl.setHandelse(handelse);
utl.setUtlatandeId(new UtlatandeId());
utl.getUtlatandeId().setExtension(intygsId);
CertificateStatusUpdateForCareType type = new CertificateStatusUpdateForCareType();
type.setUtlatande(utl);
notificationStore.put(type);
}
}
Aggregations