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");
}
}
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;
}
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;
}
Aggregations