Search in sources :

Example 1 with FrageStallare

use of se.inera.intyg.webcert.web.service.fragasvar.dto.FrageStallare in project webcert by sklintyg.

the class FragestallareConverterUtil method partToFrageStallarKod.

public static String partToFrageStallarKod(String partCode) {
    try {
        PartToFragestallare partToFragestallare = PartToFragestallare.valueOf(partCode);
        FrageStallare ret = FrageStallare.getByKod(partToFragestallare.fragestallarKod);
        return ret.getKod();
    } catch (IllegalArgumentException ie) {
        throw new WebCertServiceException(WebCertServiceErrorCodeEnum.INTERNAL_PROBLEM, "Invalid PartCode found when converting Arende");
    }
}
Also used : FrageStallare(se.inera.intyg.webcert.web.service.fragasvar.dto.FrageStallare) WebCertServiceException(se.inera.intyg.webcert.common.service.exception.WebCertServiceException)

Example 2 with FrageStallare

use of se.inera.intyg.webcert.web.service.fragasvar.dto.FrageStallare in project webcert by sklintyg.

the class ArendeServiceImpl method determineNotificationEvent.

private NotificationEvent determineNotificationEvent(Arende arende, boolean arendeIsAnswered) {
    FrageStallare frageStallare = FrageStallare.getByKod(arende.getSkickatAv());
    Status arendeSvarStatus = arende.getStatus();
    if (FrageStallare.FORSAKRINGSKASSAN.equals(frageStallare)) {
        if (Status.PENDING_INTERNAL_ACTION.equals(arendeSvarStatus)) {
            return NotificationEvent.QUESTION_FROM_RECIPIENT_HANDLED;
        } else if (Status.CLOSED.equals(arendeSvarStatus)) {
            return NotificationEvent.QUESTION_FROM_RECIPIENT_UNHANDLED;
        }
    }
    if (FrageStallare.WEBCERT.equals(frageStallare)) {
        if (Status.ANSWERED.equals(arendeSvarStatus)) {
            return NotificationEvent.QUESTION_FROM_CARE_WITH_ANSWER_HANDLED;
        } else if (Status.CLOSED.equals(arendeSvarStatus) && arendeIsAnswered) {
            return NotificationEvent.QUESTION_FROM_CARE_WITH_ANSWER_UNHANDLED;
        } else if (Status.CLOSED.equals(arendeSvarStatus)) {
            return NotificationEvent.QUESTION_FROM_CARE_UNHANDLED;
        } else {
            return NotificationEvent.QUESTION_FROM_CARE_HANDLED;
        }
    }
    return null;
}
Also used : Status(se.inera.intyg.webcert.persistence.model.Status) SekretessStatus(se.inera.intyg.webcert.common.model.SekretessStatus) FrageStallare(se.inera.intyg.webcert.web.service.fragasvar.dto.FrageStallare)

Example 3 with FrageStallare

use of se.inera.intyg.webcert.web.service.fragasvar.dto.FrageStallare in project webcert by sklintyg.

the class FragaSvarServiceImpl method determineNotificationEvent.

private NotificationEvent determineNotificationEvent(FragaSvar fragaSvar) {
    FrageStallare frageStallare = FrageStallare.getByKod(fragaSvar.getFrageStallare());
    Status fragaSvarStatus = fragaSvar.getStatus();
    if (FrageStallare.FORSAKRINGSKASSAN.equals(frageStallare)) {
        if (Status.PENDING_INTERNAL_ACTION.equals(fragaSvarStatus)) {
            return NotificationEvent.QUESTION_FROM_RECIPIENT_HANDLED;
        } else if (Status.CLOSED.equals(fragaSvarStatus)) {
            return NotificationEvent.QUESTION_FROM_RECIPIENT_UNHANDLED;
        }
    }
    if (FrageStallare.WEBCERT.equals(frageStallare)) {
        if (Status.ANSWERED.equals(fragaSvarStatus)) {
            return NotificationEvent.QUESTION_FROM_CARE_WITH_ANSWER_HANDLED;
        } else if (Status.CLOSED.equals(fragaSvarStatus) && !Strings.isNullOrEmpty(fragaSvar.getSvarsText())) {
            return NotificationEvent.QUESTION_FROM_CARE_WITH_ANSWER_UNHANDLED;
        } else if (Status.CLOSED.equals(fragaSvarStatus)) {
            return NotificationEvent.QUESTION_FROM_CARE_UNHANDLED;
        } else {
            return NotificationEvent.QUESTION_FROM_CARE_HANDLED;
        }
    }
    return null;
}
Also used : Status(se.inera.intyg.webcert.persistence.model.Status) SekretessStatus(se.inera.intyg.webcert.common.model.SekretessStatus) FrageStallare(se.inera.intyg.webcert.web.service.fragasvar.dto.FrageStallare)

Aggregations

FrageStallare (se.inera.intyg.webcert.web.service.fragasvar.dto.FrageStallare)3 SekretessStatus (se.inera.intyg.webcert.common.model.SekretessStatus)2 Status (se.inera.intyg.webcert.persistence.model.Status)2 WebCertServiceException (se.inera.intyg.webcert.common.service.exception.WebCertServiceException)1