@Test public void missingBothEnhetAndVardgivareShouldNotThrow() { ListCertificatesForCareWithQAType request = new ListCertificatesForCareWithQAType(); PersonId personId = new PersonId(); personId.setExtension("191212121212"); request.setPersonId(personId); responder.listCertificatesForCareWithQA("logicalAdress", request); }
@Override public ListCertificatesForCareWithQAResponseType listCertificatesForCareWithQA(String s, ListCertificatesForCareWithQAType request) { Objects.requireNonNull(request.getEnhetsId()); if (!validate(request)) { throw new IllegalArgumentException(); } ListCertificatesForCareWithQAResponseType response = new ListCertificatesForCareWithQAResponseType(); List list = new List(); IntygWithNotificationsRequest.Builder builder = new IntygWithNotificationsRequest.Builder() .setPersonnummer(Personnummer.createPersonnummer(request.getPersonId().getExtension()).get()); if (!request.getEnhetsId().isEmpty()) { builder = builder.setEnhetId(request.getEnhetsId().stream().map(HsaId::getExtension).collect(Collectors.toList())); } if (request.getVardgivarId() != null) { builder = builder.setVardgivarId(request.getVardgivarId().getExtension()); } if (request.getFromTidpunkt() != null) { builder = builder.setStartDate(request.getFromTidpunkt()); } if (request.getTomTidpunkt() != null) { builder = builder.setEndDate(request.getTomTidpunkt()); } java.util.List<IntygWithNotificationsResponse> intygWithNotifications = intygService.listCertificatesForCareWithQA(builder.build()); for (IntygWithNotificationsResponse intygHolder : intygWithNotifications) { ListItem item = new ListItem(); item.setIntyg(intygHolder.getIntyg()); HandelseList handelseList = new HandelseList(); handelseList.getHandelse().addAll(intygHolder.getNotifications().stream() .map(ListCertificatesForCareWithQAResponderImpl::toHandelse) .collect(Collectors.toList())); item.setHandelser(handelseList); item.setSkickadeFragor(toArenden(intygHolder.getSentQuestions())); item.setMottagnaFragor(toArenden(intygHolder.getReceivedQuestions())); item.setRef(intygHolder.getRef()); list.getItem().add(item); } response.setList(list); return response; }
ListCertificatesForCareWithQAResponderImpl implements ListCertificatesForCareWithQAResponderInterface { @Override public ListCertificatesForCareWithQAResponseType listCertificatesForCareWithQA(String s, ListCertificatesForCareWithQAType request) { Objects.requireNonNull(request.getEnhetsId()); if (!validate(request)) { throw new IllegalArgumentException(); } ListCertificatesForCareWithQAResponseType response = new ListCertificatesForCareWithQAResponseType(); List list = new List(); IntygWithNotificationsRequest.Builder builder = new IntygWithNotificationsRequest.Builder() .setPersonnummer(Personnummer.createPersonnummer(request.getPersonId().getExtension()).get()); if (!request.getEnhetsId().isEmpty()) { builder = builder.setEnhetId(request.getEnhetsId().stream().map(HsaId::getExtension).collect(Collectors.toList())); } if (request.getVardgivarId() != null) { builder = builder.setVardgivarId(request.getVardgivarId().getExtension()); } if (request.getFromTidpunkt() != null) { builder = builder.setStartDate(request.getFromTidpunkt()); } if (request.getTomTidpunkt() != null) { builder = builder.setEndDate(request.getTomTidpunkt()); } java.util.List<IntygWithNotificationsResponse> intygWithNotifications = intygService.listCertificatesForCareWithQA(builder.build()); for (IntygWithNotificationsResponse intygHolder : intygWithNotifications) { ListItem item = new ListItem(); item.setIntyg(intygHolder.getIntyg()); HandelseList handelseList = new HandelseList(); handelseList.getHandelse().addAll(intygHolder.getNotifications().stream() .map(ListCertificatesForCareWithQAResponderImpl::toHandelse) .collect(Collectors.toList())); item.setHandelser(handelseList); item.setSkickadeFragor(toArenden(intygHolder.getSentQuestions())); item.setMottagnaFragor(toArenden(intygHolder.getReceivedQuestions())); item.setRef(intygHolder.getRef()); list.getItem().add(item); } response.setList(list); return response; } }
ListCertificatesForCareWithQAResponderImpl implements ListCertificatesForCareWithQAResponderInterface { @Override public ListCertificatesForCareWithQAResponseType listCertificatesForCareWithQA(String s, ListCertificatesForCareWithQAType request) { Objects.requireNonNull(request.getEnhetsId()); if (!validate(request)) { throw new IllegalArgumentException(); } ListCertificatesForCareWithQAResponseType response = new ListCertificatesForCareWithQAResponseType(); List list = new List(); IntygWithNotificationsRequest.Builder builder = new IntygWithNotificationsRequest.Builder() .setPersonnummer(Personnummer.createPersonnummer(request.getPersonId().getExtension()).get()); if (!request.getEnhetsId().isEmpty()) { builder = builder.setEnhetId(request.getEnhetsId().stream().map(HsaId::getExtension).collect(Collectors.toList())); } if (request.getVardgivarId() != null) { builder = builder.setVardgivarId(request.getVardgivarId().getExtension()); } if (request.getFromTidpunkt() != null) { builder = builder.setStartDate(request.getFromTidpunkt()); } if (request.getTomTidpunkt() != null) { builder = builder.setEndDate(request.getTomTidpunkt()); } java.util.List<IntygWithNotificationsResponse> intygWithNotifications = intygService.listCertificatesForCareWithQA(builder.build()); for (IntygWithNotificationsResponse intygHolder : intygWithNotifications) { ListItem item = new ListItem(); item.setIntyg(intygHolder.getIntyg()); HandelseList handelseList = new HandelseList(); handelseList.getHandelse().addAll(intygHolder.getNotifications().stream() .map(ListCertificatesForCareWithQAResponderImpl::toHandelse) .collect(Collectors.toList())); item.setHandelser(handelseList); item.setSkickadeFragor(toArenden(intygHolder.getSentQuestions())); item.setMottagnaFragor(toArenden(intygHolder.getReceivedQuestions())); item.setRef(intygHolder.getRef()); list.getItem().add(item); } response.setList(list); return response; }  }
ListCertificatesForCareWithQAResponderImpl implements ListCertificatesForCareWithQAResponderInterface { @Override public ListCertificatesForCareWithQAResponseType listCertificatesForCareWithQA(String s, ListCertificatesForCareWithQAType request) { Objects.requireNonNull(request.getEnhetsId()); if (!validate(request)) { throw new IllegalArgumentException(); } ListCertificatesForCareWithQAResponseType response = new ListCertificatesForCareWithQAResponseType(); List list = new List(); IntygWithNotificationsRequest.Builder builder = new IntygWithNotificationsRequest.Builder() .setPersonnummer(Personnummer.createPersonnummer(request.getPersonId().getExtension()).get()); if (!request.getEnhetsId().isEmpty()) { builder = builder.setEnhetId(request.getEnhetsId().stream().map(HsaId::getExtension).collect(Collectors.toList())); } if (request.getVardgivarId() != null) { builder = builder.setVardgivarId(request.getVardgivarId().getExtension()); } if (request.getFromTidpunkt() != null) { builder = builder.setStartDate(request.getFromTidpunkt()); } if (request.getTomTidpunkt() != null) { builder = builder.setEndDate(request.getTomTidpunkt()); } java.util.List<IntygWithNotificationsResponse> intygWithNotifications = intygService.listCertificatesForCareWithQA(builder.build()); for (IntygWithNotificationsResponse intygHolder : intygWithNotifications) { ListItem item = new ListItem(); item.setIntyg(intygHolder.getIntyg()); HandelseList handelseList = new HandelseList(); handelseList.getHandelse().addAll(intygHolder.getNotifications().stream() .map(ListCertificatesForCareWithQAResponderImpl::toHandelse) .collect(Collectors.toList())); item.setHandelser(handelseList); item.setSkickadeFragor(toArenden(intygHolder.getSentQuestions())); item.setMottagnaFragor(toArenden(intygHolder.getReceivedQuestions())); item.setRef(intygHolder.getRef()); list.getItem().add(item); } response.setList(list); return response; }  @Override ListCertificatesForCareWithQAResponseType listCertificatesForCareWithQA(String s, ListCertificatesForCareWithQAType request); }
ListCertificatesForCareWithQAResponderImpl implements ListCertificatesForCareWithQAResponderInterface { @Override public ListCertificatesForCareWithQAResponseType listCertificatesForCareWithQA(String s, ListCertificatesForCareWithQAType request) { Objects.requireNonNull(request.getEnhetsId()); if (!validate(request)) { throw new IllegalArgumentException(); } ListCertificatesForCareWithQAResponseType response = new ListCertificatesForCareWithQAResponseType(); List list = new List(); IntygWithNotificationsRequest.Builder builder = new IntygWithNotificationsRequest.Builder() .setPersonnummer(Personnummer.createPersonnummer(request.getPersonId().getExtension()).get()); if (!request.getEnhetsId().isEmpty()) { builder = builder.setEnhetId(request.getEnhetsId().stream().map(HsaId::getExtension).collect(Collectors.toList())); } if (request.getVardgivarId() != null) { builder = builder.setVardgivarId(request.getVardgivarId().getExtension()); } if (request.getFromTidpunkt() != null) { builder = builder.setStartDate(request.getFromTidpunkt()); } if (request.getTomTidpunkt() != null) { builder = builder.setEndDate(request.getTomTidpunkt()); } java.util.List<IntygWithNotificationsResponse> intygWithNotifications = intygService.listCertificatesForCareWithQA(builder.build()); for (IntygWithNotificationsResponse intygHolder : intygWithNotifications) { ListItem item = new ListItem(); item.setIntyg(intygHolder.getIntyg()); HandelseList handelseList = new HandelseList(); handelseList.getHandelse().addAll(intygHolder.getNotifications().stream() .map(ListCertificatesForCareWithQAResponderImpl::toHandelse) .collect(Collectors.toList())); item.setHandelser(handelseList); item.setSkickadeFragor(toArenden(intygHolder.getSentQuestions())); item.setMottagnaFragor(toArenden(intygHolder.getReceivedQuestions())); item.setRef(intygHolder.getRef()); list.getItem().add(item); } response.setList(list); return response; }  @Override ListCertificatesForCareWithQAResponseType listCertificatesForCareWithQA(String s, ListCertificatesForCareWithQAType request);  }