use of se.inera.intyg.webcert.common.model.UtkastStatus in project webcert by sklintyg.
the class IntygServiceImpl method buildIntygItemListFromDrafts.
private List<ListIntygEntry> buildIntygItemListFromDrafts(List<String> enhetId, Personnummer personnummer) {
List<UtkastStatus> statuses = new ArrayList<>();
statuses.add(UtkastStatus.SIGNED);
SekretessStatus sekretessmarkering = patientDetailsResolver.getSekretessStatus(personnummer);
Set<String> base = authoritiesHelper.getIntygstyperForPrivilege(webCertUserService.getUser(), AuthoritiesConstants.PRIVILEGE_VISA_INTYG);
// Remove intygstyper that cannot be issued for a sekretessmarkerad patient
Set<String> intygsTyper = (sekretessmarkering == SekretessStatus.TRUE || sekretessmarkering == SekretessStatus.UNDEFINED) ? filterAllowedForSekretessMarkering(base) : base;
List<Utkast> drafts = utkastRepository.findDraftsByPatientAndEnhetAndStatus(DaoUtil.formatPnrForPersistence(personnummer), enhetId, statuses, intygsTyper);
return IntygDraftsConverter.convertUtkastsToListIntygEntries(drafts);
}
Aggregations