Search in sources :

Example 1 with Handelse

use of se.riv.clinicalprocess.healthcond.certificate.v3.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);
}
Also used : Handelsekod(se.riv.clinicalprocess.healthcond.certificate.types.v3.Handelsekod) Handelse(se.riv.clinicalprocess.healthcond.certificate.v3.Handelse)

Example 2 with Handelse

use of se.riv.clinicalprocess.healthcond.certificate.v3.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;
}
Also used : Handelsekod(se.riv.clinicalprocess.healthcond.certificate.types.v3.Handelsekod) Handelse(se.riv.clinicalprocess.healthcond.certificate.v3.Handelse)

Example 3 with Handelse

use of se.riv.clinicalprocess.healthcond.certificate.v3.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;
}
Also used : UtlatandeId(se.riv.clinicalprocess.healthcond.certificate.types.v1.UtlatandeId) UtlatandeType(se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.UtlatandeType) CertificateStatusUpdateForCareType(se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.CertificateStatusUpdateForCareType) Handelse(se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.Handelse)

Example 4 with Handelse

use of se.riv.clinicalprocess.healthcond.certificate.v3.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);
    }
}
Also used : UtlatandeId(se.riv.clinicalprocess.healthcond.certificate.types.v1.UtlatandeId) UtlatandeType(se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.UtlatandeType) CertificateStatusUpdateForCareType(se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.CertificateStatusUpdateForCareType) Handelse(se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.Handelse)

Example 5 with Handelse

use of se.riv.clinicalprocess.healthcond.certificate.v3.Handelse in project webcert by sklintyg.

the class CertificateStatusUpdateForCareResponderStub method certificateStatusUpdateForCare.

@Override
public CertificateStatusUpdateForCareResponseType certificateStatusUpdateForCare(String logicalAddress, CertificateStatusUpdateForCareType request) {
    Intyg intyg = request.getIntyg();
    String handelseKod = request.getHandelse().getHandelsekod().getCode();
    String intygsId = intyg.getIntygsId().getExtension();
    StringBuilder sb = new StringBuilder();
    if (intyg.getSigneringstidpunkt() != null) {
        sb.append(" Signeringstidpunkt: " + intyg.getSigneringstidpunkt());
        sb.append("\n");
    }
    if (intyg.getPatient() != null) {
        sb.append(" Patient: " + intyg.getPatient().getPersonId().getExtension());
        sb.append("\n");
    }
    Arenden skickadeFragor = request.getSkickadeFragor();
    sb.append(" Skickade fragor totalt: " + skickadeFragor.getTotalt());
    sb.append(" Skickade fragor hanterade: " + skickadeFragor.getHanterade());
    sb.append(" Skickade fragor besvarade: " + skickadeFragor.getBesvarade());
    sb.append(" Skickade fragor ej besvarade: " + skickadeFragor.getEjBesvarade());
    sb.append("\n");
    Arenden mottagnaFragor = request.getMottagnaFragor();
    sb.append(" Mottagna fragor totalt: " + mottagnaFragor.getTotalt());
    sb.append(" Mottagna fragor hanterade: " + mottagnaFragor.getHanterade());
    sb.append(" Mottagna fragor besvarade: " + mottagnaFragor.getBesvarade());
    sb.append(" Mottagna fragor ej besvarade: " + mottagnaFragor.getEjBesvarade());
    sb.append("\n");
    LOG.info("\n*********************************************************************************\n" + " Request to address '{}' recieved for intyg: {} handelse: {}.\n" + "{}" + "*********************************************************************************", logicalAddress, intygsId, handelseKod, sb.toString());
    notificationStoreV3.put(request);
    CertificateStatusUpdateForCareResponseType response = new CertificateStatusUpdateForCareResponseType();
    response.setResult(ResultTypeUtil.okResult());
    LOG.debug("Request set to 'OK'");
    return response;
}
Also used : Arenden(se.riv.clinicalprocess.healthcond.certificate.v3.Arenden) Intyg(se.riv.clinicalprocess.healthcond.certificate.v3.Intyg)

Aggregations

CertificateStatusUpdateForCareType (se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.CertificateStatusUpdateForCareType)2 Handelse (se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.Handelse)2 UtlatandeType (se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v1.UtlatandeType)2 UtlatandeId (se.riv.clinicalprocess.healthcond.certificate.types.v1.UtlatandeId)2 Handelsekod (se.riv.clinicalprocess.healthcond.certificate.types.v3.Handelsekod)2 Handelse (se.riv.clinicalprocess.healthcond.certificate.v3.Handelse)2 Intyg (se.riv.clinicalprocess.healthcond.certificate.v3.Intyg)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 ModuleNotFoundException (se.inera.intyg.common.support.modules.registry.ModuleNotFoundException)1 ModuleApi (se.inera.intyg.common.support.modules.support.api.ModuleApi)1 ModuleException (se.inera.intyg.common.support.modules.support.api.exception.ModuleException)1 ArendeCount (se.inera.intyg.common.support.modules.support.api.notification.ArendeCount)1 Handelse (se.inera.intyg.webcert.persistence.handelse.model.Handelse)1 Utkast (se.inera.intyg.webcert.persistence.utkast.model.Utkast)1 IntygWithNotificationsResponse (se.inera.intyg.webcert.web.service.intyg.dto.IntygWithNotificationsResponse)1 Arenden (se.riv.clinicalprocess.healthcond.certificate.v3.Arenden)1